diff --git a/node_modules/.package-lock.json b/node_modules/.package-lock.json index bd8a057..e96916e 100644 --- a/node_modules/.package-lock.json +++ b/node_modules/.package-lock.json @@ -4,6 +4,12 @@ "lockfileVersion": 3, "requires": true, "packages": { + "node_modules/@bufbuild/protobuf": { + "version": "2.12.0", + "resolved": "https://registry.npmjs.org/@bufbuild/protobuf/-/protobuf-2.12.0.tgz", + "integrity": "sha512-B/XlCaFIP8LOwzo+bz5uFzATYokcwCKQcghqnlfwSmM5eX/qTkvDBnDPs+gXtX/RyjxJ4DRikECcPJbyALA8FA==", + "license": "(Apache-2.0 AND BSD-3-Clause)" + }, "node_modules/accepts": { "version": "1.3.8", "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", @@ -788,6 +794,15 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/meriyah": { + "version": "6.1.4", + "resolved": "https://registry.npmjs.org/meriyah/-/meriyah-6.1.4.tgz", + "integrity": "sha512-Sz8FzjzI0kN13GK/6MVEsVzMZEPvOhnmmI1lU5+/1cGOiK3QUahntrNNtdVeihrO7t9JpoH75iMNXg6R6uWflQ==", + "license": "ISC", + "engines": { + "node": ">=18.0.0" + } + }, "node_modules/methods": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", @@ -1434,6 +1449,19 @@ "engines": { "node": ">=18.0.0" } + }, + "node_modules/youtubei.js": { + "version": "17.0.1", + "resolved": "https://registry.npmjs.org/youtubei.js/-/youtubei.js-17.0.1.tgz", + "integrity": "sha512-1lO4b8UqMDzE0oh2qEGzbBOd4UYRdxn/4PdpRM7BGTHxM6ddsEsKZTu90jp8V9FHVgC2h1UirQyqoqLiKwl+Zg==", + "funding": [ + "https://github.com/sponsors/LuanRT" + ], + "license": "MIT", + "dependencies": { + "@bufbuild/protobuf": "^2.0.0", + "meriyah": "^6.1.4" + } } } } diff --git a/node_modules/@bufbuild/protobuf/README.md b/node_modules/@bufbuild/protobuf/README.md new file mode 100644 index 0000000..23035ef --- /dev/null +++ b/node_modules/@bufbuild/protobuf/README.md @@ -0,0 +1,44 @@ +# @bufbuild/protobuf + +This package provides the runtime library for the [protoc-gen-es](https://www.npmjs.com/package/@bufbuild/protoc-gen-es) +code generator plugin. + +## Protocol Buffers for ECMAScript + +A complete implementation of [Protocol Buffers](https://protobuf.dev/) in TypeScript, +suitable for web browsers, Node.js, and Deno, created by [Buf](https://buf.build). + +**Protobuf-ES** is a solid, modern alternative to existing Protobuf implementations for the JavaScript ecosystem. It's +the first project in this space to provide a comprehensive plugin framework and decouple the base types from RPC +functionality. + +Some additional features that set it apart from the others: + +- ECMAScript module support +- First-class TypeScript support +- Generation of idiomatic JavaScript and TypeScript code +- Generation of [much smaller bundles](https://github.com/bufbuild/protobuf-es/tree/main/packages/bundle-size/) +- Implementation of all proto3 features, including the [canonical JSON format](https://protobuf.dev/programming-guides/proto3/#json) +- Implementation of all proto2 features, except for extensions and the text format +- Usage of standard JavaScript APIs instead of the [Closure Library](http://googlecode.blogspot.com/2009/11/introducing-closure-tools.html) +- Compatibility is covered by the Protocol Buffers [conformance tests](https://github.com/bufbuild/protobuf-es/tree/main/packages/protobuf-conformance/) +- Descriptor and reflection support + +## Installation + +```bash +npm install @bufbuild/protobuf +``` + +## Documentation + +To learn how to work with `@bufbuild/protobuf`, check out the docs for the [Runtime API](https://github.com/bufbuild/protobuf-es/tree/main/MANUAL.md#working-with-messages) +and the [generated code](https://github.com/bufbuild/protobuf-es/tree/main/MANUAL.md#generated-code). + +Official documentation for the Protobuf-ES project can be found at [github.com/bufbuild/protobuf-es](https://github.com/bufbuild/protobuf-es). + +For more information on Buf, check out the official [Buf documentation](https://buf.build/docs/). + +## Examples + +A complete code example can be found in the **Protobuf-ES** repo [here](https://github.com/bufbuild/protobuf-es/tree/main/packages/protobuf-example). diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/clone.d.ts b/node_modules/@bufbuild/protobuf/dist/cjs/clone.d.ts new file mode 100644 index 0000000..1bb50b6 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/clone.d.ts @@ -0,0 +1,6 @@ +import type { MessageShape } from "./types.js"; +import { type DescMessage } from "./descriptors.js"; +/** + * Create a deep copy of a message, including extensions and unknown fields. + */ +export declare function clone(schema: Desc, message: MessageShape): MessageShape; diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/clone.js b/node_modules/@bufbuild/protobuf/dist/cjs/clone.js new file mode 100644 index 0000000..01d4f07 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/clone.js @@ -0,0 +1,66 @@ +"use strict"; +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.clone = clone; +const descriptors_js_1 = require("./descriptors.js"); +const reflect_js_1 = require("./reflect/reflect.js"); +const guard_js_1 = require("./reflect/guard.js"); +/** + * Create a deep copy of a message, including extensions and unknown fields. + */ +function clone(schema, message) { + return cloneReflect((0, reflect_js_1.reflect)(schema, message)).message; +} +function cloneReflect(i) { + const o = (0, reflect_js_1.reflect)(i.desc); + for (const f of i.fields) { + if (!i.isSet(f)) { + continue; + } + switch (f.fieldKind) { + case "list": + const list = o.get(f); + for (const item of i.get(f)) { + list.add(cloneSingular(f, item)); + } + break; + case "map": + const map = o.get(f); + for (const entry of i.get(f).entries()) { + map.set(entry[0], cloneSingular(f, entry[1])); + } + break; + default: { + o.set(f, cloneSingular(f, i.get(f))); + break; + } + } + } + const unknown = i.getUnknown(); + if (unknown && unknown.length > 0) { + o.setUnknown([...unknown]); + } + return o; +} +function cloneSingular(field, value) { + if (field.message !== undefined && (0, guard_js_1.isReflectMessage)(value)) { + return cloneReflect(value); + } + if (field.scalar == descriptors_js_1.ScalarType.BYTES && value instanceof Uint8Array) { + // @ts-expect-error T cannot extend Uint8Array in practice + return value.slice(); + } + return value; +} diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/codegenv1/enum.d.ts b/node_modules/@bufbuild/protobuf/dist/cjs/codegenv1/enum.d.ts new file mode 100644 index 0000000..8f5c83a --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/codegenv1/enum.d.ts @@ -0,0 +1,10 @@ +import type { DescFile } from "../descriptors.js"; +import type { GenEnum } from "./types.js"; +import type { JsonValue } from "../json-value.js"; +export { tsEnum } from "../codegenv2/enum.js"; +/** + * Hydrate an enum descriptor. + * + * @private + */ +export declare function enumDesc(file: DescFile, path: number, ...paths: number[]): GenEnum; diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/codegenv1/enum.js b/node_modules/@bufbuild/protobuf/dist/cjs/codegenv1/enum.js new file mode 100644 index 0000000..273b8b9 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/codegenv1/enum.js @@ -0,0 +1,31 @@ +"use strict"; +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.tsEnum = void 0; +exports.enumDesc = enumDesc; +var enum_js_1 = require("../codegenv2/enum.js"); +Object.defineProperty(exports, "tsEnum", { enumerable: true, get: function () { return enum_js_1.tsEnum; } }); +/** + * Hydrate an enum descriptor. + * + * @private + */ +function enumDesc(file, path, ...paths) { + if (paths.length == 0) { + return file.enums[path]; + } + const e = paths.pop(); // we checked length above + return paths.reduce((acc, cur) => acc.nestedMessages[cur], file.messages[path]).nestedEnums[e]; +} diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/codegenv1/extension.d.ts b/node_modules/@bufbuild/protobuf/dist/cjs/codegenv1/extension.d.ts new file mode 100644 index 0000000..7d6374b --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/codegenv1/extension.d.ts @@ -0,0 +1,9 @@ +import type { Message } from "../types.js"; +import type { DescFile } from "../descriptors.js"; +import type { GenExtension } from "./types.js"; +/** + * Hydrate an extension descriptor. + * + * @private + */ +export declare function extDesc(file: DescFile, path: number, ...paths: number[]): GenExtension; diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/codegenv1/extension.js b/node_modules/@bufbuild/protobuf/dist/cjs/codegenv1/extension.js new file mode 100644 index 0000000..fb7eb7a --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/codegenv1/extension.js @@ -0,0 +1,28 @@ +"use strict"; +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.extDesc = extDesc; +/** + * Hydrate an extension descriptor. + * + * @private + */ +function extDesc(file, path, ...paths) { + if (paths.length == 0) { + return file.extensions[path]; + } + const e = paths.pop(); // we checked length above + return paths.reduce((acc, cur) => acc.nestedMessages[cur], file.messages[path]).nestedExtensions[e]; +} diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/codegenv1/file.d.ts b/node_modules/@bufbuild/protobuf/dist/cjs/codegenv1/file.d.ts new file mode 100644 index 0000000..5c3a513 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/codegenv1/file.d.ts @@ -0,0 +1 @@ +export { fileDesc } from "../codegenv2/file.js"; diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/codegenv1/file.js b/node_modules/@bufbuild/protobuf/dist/cjs/codegenv1/file.js new file mode 100644 index 0000000..cff4806 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/codegenv1/file.js @@ -0,0 +1,18 @@ +"use strict"; +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.fileDesc = void 0; +var file_js_1 = require("../codegenv2/file.js"); +Object.defineProperty(exports, "fileDesc", { enumerable: true, get: function () { return file_js_1.fileDesc; } }); diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/codegenv1/index.d.ts b/node_modules/@bufbuild/protobuf/dist/cjs/codegenv1/index.d.ts new file mode 100644 index 0000000..a3f2ade --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/codegenv1/index.d.ts @@ -0,0 +1,10 @@ +export * from "../codegenv2/boot.js"; +export * from "../codegenv2/embed.js"; +export * from "./enum.js"; +export * from "./extension.js"; +export * from "./file.js"; +export * from "./message.js"; +export * from "./service.js"; +export * from "./symbols.js"; +export * from "../codegenv2/scalar.js"; +export * from "./types.js"; diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/codegenv1/index.js b/node_modules/@bufbuild/protobuf/dist/cjs/codegenv1/index.js new file mode 100644 index 0000000..7b00378 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/codegenv1/index.js @@ -0,0 +1,39 @@ +"use strict"; +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("../codegenv2/boot.js"), exports); +__exportStar(require("../codegenv2/embed.js"), exports); +__exportStar(require("./enum.js"), exports); +__exportStar(require("./extension.js"), exports); +__exportStar(require("./file.js"), exports); +__exportStar(require("./message.js"), exports); +__exportStar(require("./service.js"), exports); +__exportStar(require("./symbols.js"), exports); +__exportStar(require("../codegenv2/scalar.js"), exports); +__exportStar(require("./types.js"), exports); diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/codegenv1/message.d.ts b/node_modules/@bufbuild/protobuf/dist/cjs/codegenv1/message.d.ts new file mode 100644 index 0000000..46ad4ad --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/codegenv1/message.d.ts @@ -0,0 +1,10 @@ +import type { Message } from "../types.js"; +import type { DescFile } from "../descriptors.js"; +import type { GenMessage } from "./types.js"; +import type { JsonValue } from "../json-value.js"; +/** + * Hydrate a message descriptor. + * + * @private + */ +export declare function messageDesc(file: DescFile, path: number, ...paths: number[]): GenMessage; diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/codegenv1/message.js b/node_modules/@bufbuild/protobuf/dist/cjs/codegenv1/message.js new file mode 100644 index 0000000..0696b27 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/codegenv1/message.js @@ -0,0 +1,24 @@ +"use strict"; +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.messageDesc = messageDesc; +/** + * Hydrate a message descriptor. + * + * @private + */ +function messageDesc(file, path, ...paths) { + return paths.reduce((acc, cur) => acc.nestedMessages[cur], file.messages[path]); +} diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/codegenv1/service.d.ts b/node_modules/@bufbuild/protobuf/dist/cjs/codegenv1/service.d.ts new file mode 100644 index 0000000..5818f75 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/codegenv1/service.d.ts @@ -0,0 +1,8 @@ +import type { GenService, GenServiceMethods } from "./types.js"; +import type { DescFile } from "../descriptors.js"; +/** + * Hydrate a service descriptor. + * + * @private + */ +export declare function serviceDesc(file: DescFile, path: number, ...paths: number[]): GenService; diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/codegenv1/service.js b/node_modules/@bufbuild/protobuf/dist/cjs/codegenv1/service.js new file mode 100644 index 0000000..e936b8a --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/codegenv1/service.js @@ -0,0 +1,27 @@ +"use strict"; +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.serviceDesc = serviceDesc; +/** + * Hydrate a service descriptor. + * + * @private + */ +function serviceDesc(file, path, ...paths) { + if (paths.length > 0) { + throw new Error(); + } + return file.services[path]; +} diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/codegenv1/symbols.d.ts b/node_modules/@bufbuild/protobuf/dist/cjs/codegenv1/symbols.d.ts new file mode 100644 index 0000000..fb9fd70 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/codegenv1/symbols.d.ts @@ -0,0 +1,135 @@ +/** + * @private + */ +export declare const packageName = "@bufbuild/protobuf"; +/** + * @private + */ +export declare const wktPublicImportPaths: Readonly>; +/** + * @private + */ +export declare const symbols: { + readonly codegen: { + readonly boot: { + readonly typeOnly: false; + readonly bootstrapWktFrom: "../../codegenv1/boot.js"; + readonly from: string; + }; + readonly fileDesc: { + readonly typeOnly: false; + readonly bootstrapWktFrom: "../../codegenv1/file.js"; + readonly from: string; + }; + readonly enumDesc: { + readonly typeOnly: false; + readonly bootstrapWktFrom: "../../codegenv1/enum.js"; + readonly from: string; + }; + readonly extDesc: { + readonly typeOnly: false; + readonly bootstrapWktFrom: "../../codegenv1/extension.js"; + readonly from: string; + }; + readonly messageDesc: { + readonly typeOnly: false; + readonly bootstrapWktFrom: "../../codegenv1/message.js"; + readonly from: string; + }; + readonly serviceDesc: { + readonly typeOnly: false; + readonly bootstrapWktFrom: "../../codegenv1/service.js"; + readonly from: string; + }; + readonly tsEnum: { + readonly typeOnly: false; + readonly bootstrapWktFrom: "../../codegenv1/enum.js"; + readonly from: string; + }; + readonly GenFile: { + readonly typeOnly: true; + readonly bootstrapWktFrom: "../../codegenv1/types.js"; + readonly from: string; + }; + readonly GenEnum: { + readonly typeOnly: true; + readonly bootstrapWktFrom: "../../codegenv1/types.js"; + readonly from: string; + }; + readonly GenExtension: { + readonly typeOnly: true; + readonly bootstrapWktFrom: "../../codegenv1/types.js"; + readonly from: string; + }; + readonly GenMessage: { + readonly typeOnly: true; + readonly bootstrapWktFrom: "../../codegenv1/types.js"; + readonly from: string; + }; + readonly GenService: { + readonly typeOnly: true; + readonly bootstrapWktFrom: "../../codegenv1/types.js"; + readonly from: string; + }; + }; + readonly isMessage: { + readonly typeOnly: false; + readonly bootstrapWktFrom: "../../is-message.js"; + readonly from: "@bufbuild/protobuf"; + }; + readonly Message: { + readonly typeOnly: true; + readonly bootstrapWktFrom: "../../types.js"; + readonly from: "@bufbuild/protobuf"; + }; + readonly create: { + readonly typeOnly: false; + readonly bootstrapWktFrom: "../../create.js"; + readonly from: "@bufbuild/protobuf"; + }; + readonly fromJson: { + readonly typeOnly: false; + readonly bootstrapWktFrom: "../../from-json.js"; + readonly from: "@bufbuild/protobuf"; + }; + readonly fromJsonString: { + readonly typeOnly: false; + readonly bootstrapWktFrom: "../../from-json.js"; + readonly from: "@bufbuild/protobuf"; + }; + readonly fromBinary: { + readonly typeOnly: false; + readonly bootstrapWktFrom: "../../from-binary.js"; + readonly from: "@bufbuild/protobuf"; + }; + readonly toBinary: { + readonly typeOnly: false; + readonly bootstrapWktFrom: "../../to-binary.js"; + readonly from: "@bufbuild/protobuf"; + }; + readonly toJson: { + readonly typeOnly: false; + readonly bootstrapWktFrom: "../../to-json.js"; + readonly from: "@bufbuild/protobuf"; + }; + readonly toJsonString: { + readonly typeOnly: false; + readonly bootstrapWktFrom: "../../to-json.js"; + readonly from: "@bufbuild/protobuf"; + }; + readonly protoInt64: { + readonly typeOnly: false; + readonly bootstrapWktFrom: "../../proto-int64.js"; + readonly from: "@bufbuild/protobuf"; + }; + readonly JsonValue: { + readonly typeOnly: true; + readonly bootstrapWktFrom: "../../json-value.js"; + readonly from: "@bufbuild/protobuf"; + }; + readonly JsonObject: { + readonly typeOnly: true; + readonly bootstrapWktFrom: "../../json-value.js"; + readonly from: "@bufbuild/protobuf"; + }; +}; diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/codegenv1/symbols.js b/node_modules/@bufbuild/protobuf/dist/cjs/codegenv1/symbols.js new file mode 100644 index 0000000..c49b608 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/codegenv1/symbols.js @@ -0,0 +1,43 @@ +"use strict"; +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.symbols = exports.wktPublicImportPaths = exports.packageName = void 0; +const symbols_js_1 = require("../codegenv2/symbols.js"); +/** + * @private + */ +exports.packageName = symbols_js_1.packageName; +/** + * @private + */ +exports.wktPublicImportPaths = symbols_js_1.wktPublicImportPaths; +/** + * @private + */ +// biome-ignore format: want this to read well +exports.symbols = Object.assign(Object.assign({}, symbols_js_1.symbols), { codegen: { + boot: { typeOnly: false, bootstrapWktFrom: "../../codegenv1/boot.js", from: exports.packageName + "/codegenv1" }, + fileDesc: { typeOnly: false, bootstrapWktFrom: "../../codegenv1/file.js", from: exports.packageName + "/codegenv1" }, + enumDesc: { typeOnly: false, bootstrapWktFrom: "../../codegenv1/enum.js", from: exports.packageName + "/codegenv1" }, + extDesc: { typeOnly: false, bootstrapWktFrom: "../../codegenv1/extension.js", from: exports.packageName + "/codegenv1" }, + messageDesc: { typeOnly: false, bootstrapWktFrom: "../../codegenv1/message.js", from: exports.packageName + "/codegenv1" }, + serviceDesc: { typeOnly: false, bootstrapWktFrom: "../../codegenv1/service.js", from: exports.packageName + "/codegenv1" }, + tsEnum: { typeOnly: false, bootstrapWktFrom: "../../codegenv1/enum.js", from: exports.packageName + "/codegenv1" }, + GenFile: { typeOnly: true, bootstrapWktFrom: "../../codegenv1/types.js", from: exports.packageName + "/codegenv1" }, + GenEnum: { typeOnly: true, bootstrapWktFrom: "../../codegenv1/types.js", from: exports.packageName + "/codegenv1" }, + GenExtension: { typeOnly: true, bootstrapWktFrom: "../../codegenv1/types.js", from: exports.packageName + "/codegenv1" }, + GenMessage: { typeOnly: true, bootstrapWktFrom: "../../codegenv1/types.js", from: exports.packageName + "/codegenv1" }, + GenService: { typeOnly: true, bootstrapWktFrom: "../../codegenv1/types.js", from: exports.packageName + "/codegenv1" }, + } }); diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/codegenv1/types.d.ts b/node_modules/@bufbuild/protobuf/dist/cjs/codegenv1/types.d.ts new file mode 100644 index 0000000..8060fad --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/codegenv1/types.d.ts @@ -0,0 +1,75 @@ +import type { Message } from "../types.js"; +import type { DescEnum, DescEnumValue, DescExtension, DescField, DescFile, DescMessage, DescMethod, DescService } from "../descriptors.js"; +import type { JsonValue } from "../json-value.js"; +/** + * Describes a protobuf source file. + * + * @private + */ +export type GenFile = DescFile; +/** + * Describes a message declaration in a protobuf source file. + * + * This type is identical to DescMessage, but carries additional type + * information. + * + * @private + */ +export type GenMessage = Omit & { + field: Record, DescField>; + typeName: RuntimeShape["$typeName"]; +} & brandv1; +/** + * Describes an enumeration in a protobuf source file. + * + * This type is identical to DescEnum, but carries additional type + * information. + * + * @private + */ +export type GenEnum = Omit & { + value: Record; +} & brandv1; +/** + * Describes an extension in a protobuf source file. + * + * This type is identical to DescExtension, but carries additional type + * information. + * + * @private + */ +export type GenExtension = DescExtension & brandv1; +/** + * Describes a service declaration in a protobuf source file. + * + * This type is identical to DescService, but carries additional type + * information. + * + * @private + */ +export type GenService = Omit & { + method: { + [K in keyof RuntimeShape]: RuntimeShape[K] & DescMethod; + }; +}; +/** + * @private + */ +export type GenServiceMethods = Record>; +declare class brandv1 { + protected v: "codegenv1"; + protected a: A | boolean; + protected b: B | boolean; +} +/** + * Union of the property names of all fields, including oneof members. + * For an anonymous message (no generated message shape), it's simply a string. + */ +type MessageFieldNames = Message extends T ? string : Exclude ? K : P]-?: true; +}, number | symbol>; +type Oneof = { + case: K | undefined; + value?: unknown; +}; +export {}; diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/codegenv1/types.js b/node_modules/@bufbuild/protobuf/dist/cjs/codegenv1/types.js new file mode 100644 index 0000000..757c414 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/codegenv1/types.js @@ -0,0 +1,22 @@ +"use strict"; +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +Object.defineProperty(exports, "__esModule", { value: true }); +class brandv1 { + constructor() { + this.v = "codegenv1"; + this.a = false; + this.b = false; + } +} diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/codegenv2/boot.d.ts b/node_modules/@bufbuild/protobuf/dist/cjs/codegenv2/boot.d.ts new file mode 100644 index 0000000..3edbb6c --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/codegenv2/boot.d.ts @@ -0,0 +1,63 @@ +import type { DescriptorProto_ExtensionRange, FieldDescriptorProto_Label, FieldDescriptorProto_Type, FieldOptions_OptionRetention, FieldOptions_OptionTargetType, FieldOptions_EditionDefault, EnumValueDescriptorProto, FileDescriptorProto } from "../wkt/gen/google/protobuf/descriptor_pb.js"; +import type { DescFile } from "../descriptors.js"; +/** + * Hydrate a file descriptor for google/protobuf/descriptor.proto from a plain + * object. + * + * See createFileDescriptorProtoBoot() for details. + * + * @private + */ +export declare function boot(boot: FileDescriptorProtoBoot): DescFile; +/** + * An object literal for initializing the message google.protobuf.FileDescriptorProto + * for google/protobuf/descriptor.proto. + * + * See createFileDescriptorProtoBoot() for details. + * + * @private + */ +export type FileDescriptorProtoBoot = { + name: "google/protobuf/descriptor.proto"; + package: "google.protobuf"; + messageType: DescriptorProtoBoot[]; + enumType: EnumDescriptorProtoBoot[]; +}; +export type DescriptorProtoBoot = { + name: string; + field?: FieldDescriptorProtoBoot[]; + nestedType?: DescriptorProtoBoot[]; + enumType?: EnumDescriptorProtoBoot[]; + extensionRange?: Pick[]; +}; +export type FieldDescriptorProtoBoot = { + name: string; + number: number; + label?: FieldDescriptorProto_Label; + type: FieldDescriptorProto_Type; + typeName?: string; + extendee?: string; + defaultValue?: string; + options?: FieldOptionsBoot; +}; +export type FieldOptionsBoot = { + packed?: boolean; + deprecated?: boolean; + retention?: FieldOptions_OptionRetention; + targets?: FieldOptions_OptionTargetType[]; + editionDefaults?: FieldOptions_EditionDefaultBoot[]; +}; +export type FieldOptions_EditionDefaultBoot = Pick; +export type EnumDescriptorProtoBoot = { + name: string; + value: EnumValueDescriptorProtoBoot[]; +}; +export type EnumValueDescriptorProtoBoot = Pick; +/** + * Creates the message google.protobuf.FileDescriptorProto from an object literal. + * + * See createFileDescriptorProtoBoot() for details. + * + * @private + */ +export declare function bootFileDescriptorProto(init: FileDescriptorProtoBoot): FileDescriptorProto; diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/codegenv2/boot.js b/node_modules/@bufbuild/protobuf/dist/cjs/codegenv2/boot.js new file mode 100644 index 0000000..28772b6 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/codegenv2/boot.js @@ -0,0 +1,105 @@ +"use strict"; +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.boot = boot; +exports.bootFileDescriptorProto = bootFileDescriptorProto; +const restore_json_names_js_1 = require("./restore-json-names.js"); +const registry_js_1 = require("../registry.js"); +/** + * Hydrate a file descriptor for google/protobuf/descriptor.proto from a plain + * object. + * + * See createFileDescriptorProtoBoot() for details. + * + * @private + */ +function boot(boot) { + const root = bootFileDescriptorProto(boot); + root.messageType.forEach(restore_json_names_js_1.restoreJsonNames); + const reg = (0, registry_js_1.createFileRegistry)(root, () => undefined); + // biome-ignore lint/style/noNonNullAssertion: non-null assertion because we just created the registry from the file we look up + return reg.getFile(root.name); +} +/** + * Creates the message google.protobuf.FileDescriptorProto from an object literal. + * + * See createFileDescriptorProtoBoot() for details. + * + * @private + */ +function bootFileDescriptorProto(init) { + const proto = Object.create({ + syntax: "", + edition: 0, + }); + return Object.assign(proto, Object.assign(Object.assign({ $typeName: "google.protobuf.FileDescriptorProto", dependency: [], publicDependency: [], weakDependency: [], optionDependency: [], service: [], extension: [] }, init), { messageType: init.messageType.map(bootDescriptorProto), enumType: init.enumType.map(bootEnumDescriptorProto) })); +} +function bootDescriptorProto(init) { + var _a, _b, _c, _d, _e, _f, _g, _h; + const proto = Object.create({ + visibility: 0, + }); + return Object.assign(proto, { + $typeName: "google.protobuf.DescriptorProto", + name: init.name, + field: (_b = (_a = init.field) === null || _a === void 0 ? void 0 : _a.map(bootFieldDescriptorProto)) !== null && _b !== void 0 ? _b : [], + extension: [], + nestedType: (_d = (_c = init.nestedType) === null || _c === void 0 ? void 0 : _c.map(bootDescriptorProto)) !== null && _d !== void 0 ? _d : [], + enumType: (_f = (_e = init.enumType) === null || _e === void 0 ? void 0 : _e.map(bootEnumDescriptorProto)) !== null && _f !== void 0 ? _f : [], + extensionRange: (_h = (_g = init.extensionRange) === null || _g === void 0 ? void 0 : _g.map((e) => (Object.assign({ $typeName: "google.protobuf.DescriptorProto.ExtensionRange" }, e)))) !== null && _h !== void 0 ? _h : [], + oneofDecl: [], + reservedRange: [], + reservedName: [], + }); +} +function bootFieldDescriptorProto(init) { + const proto = Object.create({ + label: 1, + typeName: "", + extendee: "", + defaultValue: "", + oneofIndex: 0, + jsonName: "", + proto3Optional: false, + }); + return Object.assign(proto, Object.assign(Object.assign({ $typeName: "google.protobuf.FieldDescriptorProto" }, init), { options: init.options ? bootFieldOptions(init.options) : undefined })); +} +function bootFieldOptions(init) { + var _a, _b, _c; + const proto = Object.create({ + ctype: 0, + packed: false, + jstype: 0, + lazy: false, + unverifiedLazy: false, + deprecated: false, + weak: false, + debugRedact: false, + retention: 0, + }); + return Object.assign(proto, Object.assign(Object.assign({ $typeName: "google.protobuf.FieldOptions" }, init), { targets: (_a = init.targets) !== null && _a !== void 0 ? _a : [], editionDefaults: (_c = (_b = init.editionDefaults) === null || _b === void 0 ? void 0 : _b.map((e) => (Object.assign({ $typeName: "google.protobuf.FieldOptions.EditionDefault" }, e)))) !== null && _c !== void 0 ? _c : [], uninterpretedOption: [] })); +} +function bootEnumDescriptorProto(init) { + const proto = Object.create({ + visibility: 0, + }); + return Object.assign(proto, { + $typeName: "google.protobuf.EnumDescriptorProto", + name: init.name, + reservedName: [], + reservedRange: [], + value: init.value.map((e) => (Object.assign({ $typeName: "google.protobuf.EnumValueDescriptorProto" }, e))), + }); +} diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/codegenv2/embed.d.ts b/node_modules/@bufbuild/protobuf/dist/cjs/codegenv2/embed.d.ts new file mode 100644 index 0000000..a0feea1 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/codegenv2/embed.d.ts @@ -0,0 +1,43 @@ +import type { DescEnum, DescExtension, DescMessage, DescService } from "../descriptors.js"; +import { type FileDescriptorProto } from "../wkt/gen/google/protobuf/descriptor_pb.js"; +import type { FileDescriptorProtoBoot } from "./boot.js"; +type EmbedUnknown = { + bootable: false; + proto(): FileDescriptorProto; + base64(): string; +}; +type EmbedDescriptorProto = Omit & { + bootable: true; + boot(): FileDescriptorProtoBoot; +}; +/** + * Create necessary information to embed a file descriptor in + * generated code. + * + * @private + */ +export declare function embedFileDesc(file: FileDescriptorProto): EmbedUnknown | EmbedDescriptorProto; +/** + * Compute the path to a message, enumeration, extension, or service in a + * file descriptor. + * + * @private + */ +export declare function pathInFileDesc(desc: DescMessage | DescEnum | DescExtension | DescService): number[]; +/** + * The file descriptor for google/protobuf/descriptor.proto cannot be embedded + * in serialized form, since it is required to parse itself. + * + * This function takes an instance of the message, and returns a plain object + * that can be hydrated to the message again via bootFileDescriptorProto(). + * + * This function only works with a message google.protobuf.FileDescriptorProto + * for google/protobuf/descriptor.proto, and only supports features that are + * relevant for the specific use case. For example, it discards file options, + * reserved ranges and reserved names, and field options that are unused in + * descriptor.proto. + * + * @private + */ +export declare function createFileDescriptorProtoBoot(proto: FileDescriptorProto): FileDescriptorProtoBoot; +export {}; diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/codegenv2/embed.js b/node_modules/@bufbuild/protobuf/dist/cjs/codegenv2/embed.js new file mode 100644 index 0000000..0d62477 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/codegenv2/embed.js @@ -0,0 +1,244 @@ +"use strict"; +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.embedFileDesc = embedFileDesc; +exports.pathInFileDesc = pathInFileDesc; +exports.createFileDescriptorProtoBoot = createFileDescriptorProtoBoot; +const names_js_1 = require("../reflect/names.js"); +const fields_js_1 = require("../fields.js"); +const base64_encoding_js_1 = require("../wire/base64-encoding.js"); +const to_binary_js_1 = require("../to-binary.js"); +const clone_js_1 = require("../clone.js"); +const descriptor_pb_js_1 = require("../wkt/gen/google/protobuf/descriptor_pb.js"); +/** + * Create necessary information to embed a file descriptor in + * generated code. + * + * @private + */ +function embedFileDesc(file) { + const embed = { + bootable: false, + proto() { + const stripped = (0, clone_js_1.clone)(descriptor_pb_js_1.FileDescriptorProtoSchema, file); + (0, fields_js_1.clearField)(stripped, descriptor_pb_js_1.FileDescriptorProtoSchema.field.dependency); + (0, fields_js_1.clearField)(stripped, descriptor_pb_js_1.FileDescriptorProtoSchema.field.sourceCodeInfo); + stripped.messageType.map(stripJsonNames); + return stripped; + }, + base64() { + const bytes = (0, to_binary_js_1.toBinary)(descriptor_pb_js_1.FileDescriptorProtoSchema, this.proto()); + return (0, base64_encoding_js_1.base64Encode)(bytes, "std_raw"); + }, + }; + return file.name == "google/protobuf/descriptor.proto" + ? Object.assign(Object.assign({}, embed), { bootable: true, boot() { + return createFileDescriptorProtoBoot(this.proto()); + } }) : embed; +} +function stripJsonNames(d) { + for (const f of d.field) { + if (f.jsonName === (0, names_js_1.protoCamelCase)(f.name)) { + (0, fields_js_1.clearField)(f, descriptor_pb_js_1.FieldDescriptorProtoSchema.field.jsonName); + } + } + for (const n of d.nestedType) { + stripJsonNames(n); + } +} +/** + * Compute the path to a message, enumeration, extension, or service in a + * file descriptor. + * + * @private + */ +function pathInFileDesc(desc) { + if (desc.kind == "service") { + return [desc.file.services.indexOf(desc)]; + } + const parent = desc.parent; + if (parent == undefined) { + switch (desc.kind) { + case "enum": + return [desc.file.enums.indexOf(desc)]; + case "message": + return [desc.file.messages.indexOf(desc)]; + case "extension": + return [desc.file.extensions.indexOf(desc)]; + } + } + function findPath(cur) { + const nested = []; + for (let parent = cur.parent; parent;) { + const idx = parent.nestedMessages.indexOf(cur); + nested.unshift(idx); + cur = parent; + parent = cur.parent; + } + nested.unshift(cur.file.messages.indexOf(cur)); + return nested; + } + const path = findPath(parent); + switch (desc.kind) { + case "extension": + return [...path, parent.nestedExtensions.indexOf(desc)]; + case "message": + return [...path, parent.nestedMessages.indexOf(desc)]; + case "enum": + return [...path, parent.nestedEnums.indexOf(desc)]; + } +} +/** + * The file descriptor for google/protobuf/descriptor.proto cannot be embedded + * in serialized form, since it is required to parse itself. + * + * This function takes an instance of the message, and returns a plain object + * that can be hydrated to the message again via bootFileDescriptorProto(). + * + * This function only works with a message google.protobuf.FileDescriptorProto + * for google/protobuf/descriptor.proto, and only supports features that are + * relevant for the specific use case. For example, it discards file options, + * reserved ranges and reserved names, and field options that are unused in + * descriptor.proto. + * + * @private + */ +function createFileDescriptorProtoBoot(proto) { + var _a; + assert(proto.name == "google/protobuf/descriptor.proto"); + assert(proto.package == "google.protobuf"); + assert(!proto.dependency.length); + assert(!proto.publicDependency.length); + assert(!proto.weakDependency.length); + assert(!proto.optionDependency.length); + assert(!proto.service.length); + assert(!proto.extension.length); + assert(proto.sourceCodeInfo === undefined); + assert(proto.syntax == "" || proto.syntax == "proto2"); + assert(!((_a = proto.options) === null || _a === void 0 ? void 0 : _a.features)); // we're dropping file options + assert(proto.edition === descriptor_pb_js_1.Edition.EDITION_UNKNOWN); + return { + name: proto.name, + package: proto.package, + messageType: proto.messageType.map(createDescriptorBoot), + enumType: proto.enumType.map(createEnumDescriptorBoot), + }; +} +function createDescriptorBoot(proto) { + assert(proto.extension.length == 0); + assert(!proto.oneofDecl.length); + assert(!proto.options); + assert(!(0, fields_js_1.isFieldSet)(proto, descriptor_pb_js_1.DescriptorProtoSchema.field.visibility)); + const b = { + name: proto.name, + }; + if (proto.field.length) { + b.field = proto.field.map(createFieldDescriptorBoot); + } + if (proto.nestedType.length) { + b.nestedType = proto.nestedType.map(createDescriptorBoot); + } + if (proto.enumType.length) { + b.enumType = proto.enumType.map(createEnumDescriptorBoot); + } + if (proto.extensionRange.length) { + b.extensionRange = proto.extensionRange.map((r) => { + assert(!r.options); + return { start: r.start, end: r.end }; + }); + } + return b; +} +function createFieldDescriptorBoot(proto) { + assert((0, fields_js_1.isFieldSet)(proto, descriptor_pb_js_1.FieldDescriptorProtoSchema.field.name)); + assert((0, fields_js_1.isFieldSet)(proto, descriptor_pb_js_1.FieldDescriptorProtoSchema.field.number)); + assert((0, fields_js_1.isFieldSet)(proto, descriptor_pb_js_1.FieldDescriptorProtoSchema.field.type)); + assert(!(0, fields_js_1.isFieldSet)(proto, descriptor_pb_js_1.FieldDescriptorProtoSchema.field.oneofIndex)); + assert(!(0, fields_js_1.isFieldSet)(proto, descriptor_pb_js_1.FieldDescriptorProtoSchema.field.jsonName) || + proto.jsonName === (0, names_js_1.protoCamelCase)(proto.name)); + const b = { + name: proto.name, + number: proto.number, + type: proto.type, + }; + if ((0, fields_js_1.isFieldSet)(proto, descriptor_pb_js_1.FieldDescriptorProtoSchema.field.label)) { + b.label = proto.label; + } + if ((0, fields_js_1.isFieldSet)(proto, descriptor_pb_js_1.FieldDescriptorProtoSchema.field.typeName)) { + b.typeName = proto.typeName; + } + if ((0, fields_js_1.isFieldSet)(proto, descriptor_pb_js_1.FieldDescriptorProtoSchema.field.extendee)) { + b.extendee = proto.extendee; + } + if ((0, fields_js_1.isFieldSet)(proto, descriptor_pb_js_1.FieldDescriptorProtoSchema.field.defaultValue)) { + b.defaultValue = proto.defaultValue; + } + if (proto.options) { + b.options = createFieldOptionsBoot(proto.options); + } + return b; +} +function createFieldOptionsBoot(proto) { + const b = {}; + assert(!(0, fields_js_1.isFieldSet)(proto, descriptor_pb_js_1.FieldOptionsSchema.field.ctype)); + if ((0, fields_js_1.isFieldSet)(proto, descriptor_pb_js_1.FieldOptionsSchema.field.packed)) { + b.packed = proto.packed; + } + assert(!(0, fields_js_1.isFieldSet)(proto, descriptor_pb_js_1.FieldOptionsSchema.field.jstype)); + assert(!(0, fields_js_1.isFieldSet)(proto, descriptor_pb_js_1.FieldOptionsSchema.field.lazy)); + assert(!(0, fields_js_1.isFieldSet)(proto, descriptor_pb_js_1.FieldOptionsSchema.field.unverifiedLazy)); + if ((0, fields_js_1.isFieldSet)(proto, descriptor_pb_js_1.FieldOptionsSchema.field.deprecated)) { + b.deprecated = proto.deprecated; + } + assert(!(0, fields_js_1.isFieldSet)(proto, descriptor_pb_js_1.FieldOptionsSchema.field.weak)); + assert(!(0, fields_js_1.isFieldSet)(proto, descriptor_pb_js_1.FieldOptionsSchema.field.debugRedact)); + if ((0, fields_js_1.isFieldSet)(proto, descriptor_pb_js_1.FieldOptionsSchema.field.retention)) { + b.retention = proto.retention; + } + if (proto.targets.length) { + b.targets = proto.targets; + } + if (proto.editionDefaults.length) { + b.editionDefaults = proto.editionDefaults.map((d) => ({ + value: d.value, + edition: d.edition, + })); + } + assert(!(0, fields_js_1.isFieldSet)(proto, descriptor_pb_js_1.FieldOptionsSchema.field.features)); + assert(!(0, fields_js_1.isFieldSet)(proto, descriptor_pb_js_1.FieldOptionsSchema.field.uninterpretedOption)); + return b; +} +function createEnumDescriptorBoot(proto) { + assert(!proto.options); + assert(!(0, fields_js_1.isFieldSet)(proto, descriptor_pb_js_1.EnumDescriptorProtoSchema.field.visibility)); + return { + name: proto.name, + value: proto.value.map((v) => { + assert(!v.options); + return { + name: v.name, + number: v.number, + }; + }), + }; +} +/** + * Assert that condition is truthy or throw error. + */ +function assert(condition) { + if (!condition) { + throw new Error(); + } +} diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/codegenv2/enum.d.ts b/node_modules/@bufbuild/protobuf/dist/cjs/codegenv2/enum.d.ts new file mode 100644 index 0000000..e77b8fe --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/codegenv2/enum.d.ts @@ -0,0 +1,18 @@ +import type { DescEnum, DescFile } from "../descriptors.js"; +import type { GenEnum } from "./types.js"; +import type { JsonValue } from "../json-value.js"; +/** + * Hydrate an enum descriptor. + * + * @private + */ +export declare function enumDesc(file: DescFile, path: number, ...paths: number[]): GenEnum; +/** + * Construct a TypeScript enum object at runtime from a descriptor. + */ +export declare function tsEnum(desc: DescEnum): enumObject; +type enumObject = { + [key: number]: string; + [k: string]: number | string; +}; +export {}; diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/codegenv2/enum.js b/node_modules/@bufbuild/protobuf/dist/cjs/codegenv2/enum.js new file mode 100644 index 0000000..ff18006 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/codegenv2/enum.js @@ -0,0 +1,40 @@ +"use strict"; +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.enumDesc = enumDesc; +exports.tsEnum = tsEnum; +/** + * Hydrate an enum descriptor. + * + * @private + */ +function enumDesc(file, path, ...paths) { + if (paths.length == 0) { + return file.enums[path]; + } + const e = paths.pop(); // we checked length above + return paths.reduce((acc, cur) => acc.nestedMessages[cur], file.messages[path]).nestedEnums[e]; +} +/** + * Construct a TypeScript enum object at runtime from a descriptor. + */ +function tsEnum(desc) { + const enumObject = {}; + for (const value of desc.values) { + enumObject[value.localName] = value.number; + enumObject[value.number] = value.localName; + } + return enumObject; +} diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/codegenv2/extension.d.ts b/node_modules/@bufbuild/protobuf/dist/cjs/codegenv2/extension.d.ts new file mode 100644 index 0000000..7d6374b --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/codegenv2/extension.d.ts @@ -0,0 +1,9 @@ +import type { Message } from "../types.js"; +import type { DescFile } from "../descriptors.js"; +import type { GenExtension } from "./types.js"; +/** + * Hydrate an extension descriptor. + * + * @private + */ +export declare function extDesc(file: DescFile, path: number, ...paths: number[]): GenExtension; diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/codegenv2/extension.js b/node_modules/@bufbuild/protobuf/dist/cjs/codegenv2/extension.js new file mode 100644 index 0000000..fb7eb7a --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/codegenv2/extension.js @@ -0,0 +1,28 @@ +"use strict"; +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.extDesc = extDesc; +/** + * Hydrate an extension descriptor. + * + * @private + */ +function extDesc(file, path, ...paths) { + if (paths.length == 0) { + return file.extensions[path]; + } + const e = paths.pop(); // we checked length above + return paths.reduce((acc, cur) => acc.nestedMessages[cur], file.messages[path]).nestedExtensions[e]; +} diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/codegenv2/file.d.ts b/node_modules/@bufbuild/protobuf/dist/cjs/codegenv2/file.d.ts new file mode 100644 index 0000000..4d9853f --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/codegenv2/file.d.ts @@ -0,0 +1,7 @@ +import type { DescFile } from "../descriptors.js"; +/** + * Hydrate a file descriptor. + * + * @private + */ +export declare function fileDesc(b64: string, imports?: DescFile[]): DescFile; diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/codegenv2/file.js b/node_modules/@bufbuild/protobuf/dist/cjs/codegenv2/file.js new file mode 100644 index 0000000..fd106e5 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/codegenv2/file.js @@ -0,0 +1,35 @@ +"use strict"; +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.fileDesc = fileDesc; +const base64_encoding_js_1 = require("../wire/base64-encoding.js"); +const descriptor_pb_js_1 = require("../wkt/gen/google/protobuf/descriptor_pb.js"); +const registry_js_1 = require("../registry.js"); +const restore_json_names_js_1 = require("./restore-json-names.js"); +const from_binary_js_1 = require("../from-binary.js"); +/** + * Hydrate a file descriptor. + * + * @private + */ +function fileDesc(b64, imports) { + var _a; + const root = (0, from_binary_js_1.fromBinary)(descriptor_pb_js_1.FileDescriptorProtoSchema, (0, base64_encoding_js_1.base64Decode)(b64)); + root.messageType.forEach(restore_json_names_js_1.restoreJsonNames); + root.dependency = (_a = imports === null || imports === void 0 ? void 0 : imports.map((f) => f.proto.name)) !== null && _a !== void 0 ? _a : []; + const reg = (0, registry_js_1.createFileRegistry)(root, (protoFileName) => imports === null || imports === void 0 ? void 0 : imports.find((f) => f.proto.name === protoFileName)); + // biome-ignore lint/style/noNonNullAssertion: non-null assertion because we just created the registry from the file we look up + return reg.getFile(root.name); +} diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/codegenv2/index.d.ts b/node_modules/@bufbuild/protobuf/dist/cjs/codegenv2/index.d.ts new file mode 100644 index 0000000..b74cd36 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/codegenv2/index.d.ts @@ -0,0 +1,10 @@ +export * from "./boot.js"; +export * from "./embed.js"; +export * from "./enum.js"; +export * from "./extension.js"; +export * from "./file.js"; +export * from "./message.js"; +export * from "./service.js"; +export * from "./symbols.js"; +export * from "./scalar.js"; +export * from "./types.js"; diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/codegenv2/index.js b/node_modules/@bufbuild/protobuf/dist/cjs/codegenv2/index.js new file mode 100644 index 0000000..ed4602f --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/codegenv2/index.js @@ -0,0 +1,39 @@ +"use strict"; +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./boot.js"), exports); +__exportStar(require("./embed.js"), exports); +__exportStar(require("./enum.js"), exports); +__exportStar(require("./extension.js"), exports); +__exportStar(require("./file.js"), exports); +__exportStar(require("./message.js"), exports); +__exportStar(require("./service.js"), exports); +__exportStar(require("./symbols.js"), exports); +__exportStar(require("./scalar.js"), exports); +__exportStar(require("./types.js"), exports); diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/codegenv2/message.d.ts b/node_modules/@bufbuild/protobuf/dist/cjs/codegenv2/message.d.ts new file mode 100644 index 0000000..f0f3977 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/codegenv2/message.d.ts @@ -0,0 +1,15 @@ +import type { Message } from "../types.js"; +import type { DescFile } from "../descriptors.js"; +import type { GenMessage } from "./types.js"; +/** + * Hydrate a message descriptor. + * + * @private + */ +export declare function messageDesc(file: DescFile, path: number, ...paths: number[]): GenMessage; diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/codegenv2/message.js b/node_modules/@bufbuild/protobuf/dist/cjs/codegenv2/message.js new file mode 100644 index 0000000..0696b27 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/codegenv2/message.js @@ -0,0 +1,24 @@ +"use strict"; +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.messageDesc = messageDesc; +/** + * Hydrate a message descriptor. + * + * @private + */ +function messageDesc(file, path, ...paths) { + return paths.reduce((acc, cur) => acc.nestedMessages[cur], file.messages[path]); +} diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/codegenv2/restore-json-names.d.ts b/node_modules/@bufbuild/protobuf/dist/cjs/codegenv2/restore-json-names.d.ts new file mode 100644 index 0000000..d83d94d --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/codegenv2/restore-json-names.d.ts @@ -0,0 +1,5 @@ +import type { DescriptorProto } from "../wkt/gen/google/protobuf/descriptor_pb.js"; +/** + * @private + */ +export declare function restoreJsonNames(message: DescriptorProto): void; diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/codegenv2/restore-json-names.js b/node_modules/@bufbuild/protobuf/dist/cjs/codegenv2/restore-json-names.js new file mode 100644 index 0000000..781304e --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/codegenv2/restore-json-names.js @@ -0,0 +1,29 @@ +"use strict"; +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.restoreJsonNames = restoreJsonNames; +const names_js_1 = require("../reflect/names.js"); +const unsafe_js_1 = require("../reflect/unsafe.js"); +/** + * @private + */ +function restoreJsonNames(message) { + for (const f of message.field) { + if (!(0, unsafe_js_1.unsafeIsSetExplicit)(f, "jsonName")) { + f.jsonName = (0, names_js_1.protoCamelCase)(f.name); + } + } + message.nestedType.forEach(restoreJsonNames); +} diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/codegenv2/scalar.d.ts b/node_modules/@bufbuild/protobuf/dist/cjs/codegenv2/scalar.d.ts new file mode 100644 index 0000000..5c48fce --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/codegenv2/scalar.d.ts @@ -0,0 +1,9 @@ +import { ScalarType } from "../descriptors.js"; +/** + * Return the TypeScript type (as a string) for the given scalar type. + */ +export declare function scalarTypeScriptType(scalar: ScalarType, longAsString: boolean): "string" | "boolean" | "bigint" | "bigint | string" | "Uint8Array" | "number"; +/** + * Return the JSON type (as a string) for the given scalar type. + */ +export declare function scalarJsonType(scalar: ScalarType): "string" | "boolean" | "number" | `number | "NaN" | "Infinity" | "-Infinity"`; diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/codegenv2/scalar.js b/node_modules/@bufbuild/protobuf/dist/cjs/codegenv2/scalar.js new file mode 100644 index 0000000..ea4eea8 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/codegenv2/scalar.js @@ -0,0 +1,67 @@ +"use strict"; +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.scalarTypeScriptType = scalarTypeScriptType; +exports.scalarJsonType = scalarJsonType; +const descriptors_js_1 = require("../descriptors.js"); +/** + * Return the TypeScript type (as a string) for the given scalar type. + */ +function scalarTypeScriptType(scalar, longAsString) { + switch (scalar) { + case descriptors_js_1.ScalarType.STRING: + return "string"; + case descriptors_js_1.ScalarType.BOOL: + return "boolean"; + case descriptors_js_1.ScalarType.UINT64: + case descriptors_js_1.ScalarType.SFIXED64: + case descriptors_js_1.ScalarType.FIXED64: + case descriptors_js_1.ScalarType.SINT64: + case descriptors_js_1.ScalarType.INT64: + return longAsString ? "string" : "bigint"; + case descriptors_js_1.ScalarType.BYTES: + return "Uint8Array"; + default: + return "number"; + } +} +/** + * Return the JSON type (as a string) for the given scalar type. + */ +function scalarJsonType(scalar) { + switch (scalar) { + case descriptors_js_1.ScalarType.DOUBLE: + case descriptors_js_1.ScalarType.FLOAT: + return `number | "NaN" | "Infinity" | "-Infinity"`; + case descriptors_js_1.ScalarType.UINT64: + case descriptors_js_1.ScalarType.SFIXED64: + case descriptors_js_1.ScalarType.FIXED64: + case descriptors_js_1.ScalarType.SINT64: + case descriptors_js_1.ScalarType.INT64: + return "string"; + case descriptors_js_1.ScalarType.INT32: + case descriptors_js_1.ScalarType.FIXED32: + case descriptors_js_1.ScalarType.UINT32: + case descriptors_js_1.ScalarType.SFIXED32: + case descriptors_js_1.ScalarType.SINT32: + return "number"; + case descriptors_js_1.ScalarType.STRING: + return "string"; + case descriptors_js_1.ScalarType.BOOL: + return "boolean"; + case descriptors_js_1.ScalarType.BYTES: + return "string"; + } +} diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/codegenv2/service.d.ts b/node_modules/@bufbuild/protobuf/dist/cjs/codegenv2/service.d.ts new file mode 100644 index 0000000..5818f75 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/codegenv2/service.d.ts @@ -0,0 +1,8 @@ +import type { GenService, GenServiceMethods } from "./types.js"; +import type { DescFile } from "../descriptors.js"; +/** + * Hydrate a service descriptor. + * + * @private + */ +export declare function serviceDesc(file: DescFile, path: number, ...paths: number[]): GenService; diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/codegenv2/service.js b/node_modules/@bufbuild/protobuf/dist/cjs/codegenv2/service.js new file mode 100644 index 0000000..e936b8a --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/codegenv2/service.js @@ -0,0 +1,27 @@ +"use strict"; +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.serviceDesc = serviceDesc; +/** + * Hydrate a service descriptor. + * + * @private + */ +function serviceDesc(file, path, ...paths) { + if (paths.length > 0) { + throw new Error(); + } + return file.services[path]; +} diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/codegenv2/symbols.d.ts b/node_modules/@bufbuild/protobuf/dist/cjs/codegenv2/symbols.d.ts new file mode 100644 index 0000000..f9d8502 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/codegenv2/symbols.d.ts @@ -0,0 +1,135 @@ +/** + * @private + */ +export declare const packageName = "@bufbuild/protobuf"; +/** + * @private + */ +export declare const wktPublicImportPaths: Readonly>; +/** + * @private + */ +export declare const symbols: { + readonly isMessage: { + readonly typeOnly: false; + readonly bootstrapWktFrom: "../../is-message.js"; + readonly from: "@bufbuild/protobuf"; + }; + readonly Message: { + readonly typeOnly: true; + readonly bootstrapWktFrom: "../../types.js"; + readonly from: "@bufbuild/protobuf"; + }; + readonly create: { + readonly typeOnly: false; + readonly bootstrapWktFrom: "../../create.js"; + readonly from: "@bufbuild/protobuf"; + }; + readonly fromJson: { + readonly typeOnly: false; + readonly bootstrapWktFrom: "../../from-json.js"; + readonly from: "@bufbuild/protobuf"; + }; + readonly fromJsonString: { + readonly typeOnly: false; + readonly bootstrapWktFrom: "../../from-json.js"; + readonly from: "@bufbuild/protobuf"; + }; + readonly fromBinary: { + readonly typeOnly: false; + readonly bootstrapWktFrom: "../../from-binary.js"; + readonly from: "@bufbuild/protobuf"; + }; + readonly toBinary: { + readonly typeOnly: false; + readonly bootstrapWktFrom: "../../to-binary.js"; + readonly from: "@bufbuild/protobuf"; + }; + readonly toJson: { + readonly typeOnly: false; + readonly bootstrapWktFrom: "../../to-json.js"; + readonly from: "@bufbuild/protobuf"; + }; + readonly toJsonString: { + readonly typeOnly: false; + readonly bootstrapWktFrom: "../../to-json.js"; + readonly from: "@bufbuild/protobuf"; + }; + readonly protoInt64: { + readonly typeOnly: false; + readonly bootstrapWktFrom: "../../proto-int64.js"; + readonly from: "@bufbuild/protobuf"; + }; + readonly JsonValue: { + readonly typeOnly: true; + readonly bootstrapWktFrom: "../../json-value.js"; + readonly from: "@bufbuild/protobuf"; + }; + readonly JsonObject: { + readonly typeOnly: true; + readonly bootstrapWktFrom: "../../json-value.js"; + readonly from: "@bufbuild/protobuf"; + }; + readonly codegen: { + readonly boot: { + readonly typeOnly: false; + readonly bootstrapWktFrom: "../../codegenv2/boot.js"; + readonly from: string; + }; + readonly fileDesc: { + readonly typeOnly: false; + readonly bootstrapWktFrom: "../../codegenv2/file.js"; + readonly from: string; + }; + readonly enumDesc: { + readonly typeOnly: false; + readonly bootstrapWktFrom: "../../codegenv2/enum.js"; + readonly from: string; + }; + readonly extDesc: { + readonly typeOnly: false; + readonly bootstrapWktFrom: "../../codegenv2/extension.js"; + readonly from: string; + }; + readonly messageDesc: { + readonly typeOnly: false; + readonly bootstrapWktFrom: "../../codegenv2/message.js"; + readonly from: string; + }; + readonly serviceDesc: { + readonly typeOnly: false; + readonly bootstrapWktFrom: "../../codegenv2/service.js"; + readonly from: string; + }; + readonly tsEnum: { + readonly typeOnly: false; + readonly bootstrapWktFrom: "../../codegenv2/enum.js"; + readonly from: string; + }; + readonly GenFile: { + readonly typeOnly: true; + readonly bootstrapWktFrom: "../../codegenv2/types.js"; + readonly from: string; + }; + readonly GenEnum: { + readonly typeOnly: true; + readonly bootstrapWktFrom: "../../codegenv2/types.js"; + readonly from: string; + }; + readonly GenExtension: { + readonly typeOnly: true; + readonly bootstrapWktFrom: "../../codegenv2/types.js"; + readonly from: string; + }; + readonly GenMessage: { + readonly typeOnly: true; + readonly bootstrapWktFrom: "../../codegenv2/types.js"; + readonly from: string; + }; + readonly GenService: { + readonly typeOnly: true; + readonly bootstrapWktFrom: "../../codegenv2/types.js"; + readonly from: string; + }; + }; +}; diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/codegenv2/symbols.js b/node_modules/@bufbuild/protobuf/dist/cjs/codegenv2/symbols.js new file mode 100644 index 0000000..4e238f8 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/codegenv2/symbols.js @@ -0,0 +1,72 @@ +"use strict"; +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.symbols = exports.wktPublicImportPaths = exports.packageName = void 0; +/** + * @private + */ +exports.packageName = "@bufbuild/protobuf"; +/** + * @private + */ +exports.wktPublicImportPaths = { + "google/protobuf/compiler/plugin.proto": exports.packageName + "/wkt", + "google/protobuf/any.proto": exports.packageName + "/wkt", + "google/protobuf/api.proto": exports.packageName + "/wkt", + "google/protobuf/cpp_features.proto": exports.packageName + "/wkt", + "google/protobuf/descriptor.proto": exports.packageName + "/wkt", + "google/protobuf/duration.proto": exports.packageName + "/wkt", + "google/protobuf/empty.proto": exports.packageName + "/wkt", + "google/protobuf/field_mask.proto": exports.packageName + "/wkt", + "google/protobuf/go_features.proto": exports.packageName + "/wkt", + "google/protobuf/java_features.proto": exports.packageName + "/wkt", + "google/protobuf/source_context.proto": exports.packageName + "/wkt", + "google/protobuf/struct.proto": exports.packageName + "/wkt", + "google/protobuf/timestamp.proto": exports.packageName + "/wkt", + "google/protobuf/type.proto": exports.packageName + "/wkt", + "google/protobuf/wrappers.proto": exports.packageName + "/wkt", +}; +/** + * @private + */ +// biome-ignore format: want this to read well +exports.symbols = { + isMessage: { typeOnly: false, bootstrapWktFrom: "../../is-message.js", from: exports.packageName }, + Message: { typeOnly: true, bootstrapWktFrom: "../../types.js", from: exports.packageName }, + create: { typeOnly: false, bootstrapWktFrom: "../../create.js", from: exports.packageName }, + fromJson: { typeOnly: false, bootstrapWktFrom: "../../from-json.js", from: exports.packageName }, + fromJsonString: { typeOnly: false, bootstrapWktFrom: "../../from-json.js", from: exports.packageName }, + fromBinary: { typeOnly: false, bootstrapWktFrom: "../../from-binary.js", from: exports.packageName }, + toBinary: { typeOnly: false, bootstrapWktFrom: "../../to-binary.js", from: exports.packageName }, + toJson: { typeOnly: false, bootstrapWktFrom: "../../to-json.js", from: exports.packageName }, + toJsonString: { typeOnly: false, bootstrapWktFrom: "../../to-json.js", from: exports.packageName }, + protoInt64: { typeOnly: false, bootstrapWktFrom: "../../proto-int64.js", from: exports.packageName }, + JsonValue: { typeOnly: true, bootstrapWktFrom: "../../json-value.js", from: exports.packageName }, + JsonObject: { typeOnly: true, bootstrapWktFrom: "../../json-value.js", from: exports.packageName }, + codegen: { + boot: { typeOnly: false, bootstrapWktFrom: "../../codegenv2/boot.js", from: exports.packageName + "/codegenv2" }, + fileDesc: { typeOnly: false, bootstrapWktFrom: "../../codegenv2/file.js", from: exports.packageName + "/codegenv2" }, + enumDesc: { typeOnly: false, bootstrapWktFrom: "../../codegenv2/enum.js", from: exports.packageName + "/codegenv2" }, + extDesc: { typeOnly: false, bootstrapWktFrom: "../../codegenv2/extension.js", from: exports.packageName + "/codegenv2" }, + messageDesc: { typeOnly: false, bootstrapWktFrom: "../../codegenv2/message.js", from: exports.packageName + "/codegenv2" }, + serviceDesc: { typeOnly: false, bootstrapWktFrom: "../../codegenv2/service.js", from: exports.packageName + "/codegenv2" }, + tsEnum: { typeOnly: false, bootstrapWktFrom: "../../codegenv2/enum.js", from: exports.packageName + "/codegenv2" }, + GenFile: { typeOnly: true, bootstrapWktFrom: "../../codegenv2/types.js", from: exports.packageName + "/codegenv2" }, + GenEnum: { typeOnly: true, bootstrapWktFrom: "../../codegenv2/types.js", from: exports.packageName + "/codegenv2" }, + GenExtension: { typeOnly: true, bootstrapWktFrom: "../../codegenv2/types.js", from: exports.packageName + "/codegenv2" }, + GenMessage: { typeOnly: true, bootstrapWktFrom: "../../codegenv2/types.js", from: exports.packageName + "/codegenv2" }, + GenService: { typeOnly: true, bootstrapWktFrom: "../../codegenv2/types.js", from: exports.packageName + "/codegenv2" }, + }, +}; diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/codegenv2/types.d.ts b/node_modules/@bufbuild/protobuf/dist/cjs/codegenv2/types.d.ts new file mode 100644 index 0000000..286d368 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/codegenv2/types.d.ts @@ -0,0 +1,81 @@ +import type { Message } from "../types.js"; +import type { DescEnum, DescEnumValue, DescExtension, DescField, DescFile, DescMessage, DescMethod, DescService } from "../descriptors.js"; +import type { JsonValue } from "../json-value.js"; +/** + * Describes a protobuf source file. + * + * @private + */ +export type GenFile = DescFile; +/** + * Describes a message declaration in a protobuf source file. + * + * This type is identical to DescMessage, but carries additional type + * information. + * + * @private + */ +export type GenMessage = Omit & { + field: Record, DescField>; + typeName: RuntimeShape["$typeName"]; +} & brandv2; +/** + * Describes an enumeration in a protobuf source file. + * + * This type is identical to DescEnum, but carries additional type + * information. + * + * @private + */ +export type GenEnum = Omit & { + value: Record; +} & brandv2; +/** + * Describes an extension in a protobuf source file. + * + * This type is identical to DescExtension, but carries additional type + * information. + * + * @private + */ +export type GenExtension = DescExtension & brandv2; +/** + * Describes a service declaration in a protobuf source file. + * + * This type is identical to DescService, but carries additional type + * information. + * + * @private + */ +export type GenService = Omit & { + method: { + [K in keyof RuntimeShape]: RuntimeShape[K] & DescMethod; + }; +}; +/** + * @private + */ +export type GenServiceMethods = Record>; +declare class brandv2 { + protected v: "codegenv2"; + protected a: A | boolean; + protected b: B | boolean; +} +/** + * Union of the property names of all fields, including oneof members. + * For an anonymous message (no generated message shape), it's simply a string. + */ +type MessageFieldNames = Message extends T ? string : Exclude ? K : P]-?: true; +}, number | symbol>; +type Oneof = { + case: K | undefined; + value?: unknown; +}; +export {}; diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/codegenv2/types.js b/node_modules/@bufbuild/protobuf/dist/cjs/codegenv2/types.js new file mode 100644 index 0000000..8c60d3d --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/codegenv2/types.js @@ -0,0 +1,22 @@ +"use strict"; +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +Object.defineProperty(exports, "__esModule", { value: true }); +class brandv2 { + constructor() { + this.v = "codegenv2"; + this.a = false; + this.b = false; + } +} diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/create.d.ts b/node_modules/@bufbuild/protobuf/dist/cjs/create.d.ts new file mode 100644 index 0000000..0f86a36 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/create.d.ts @@ -0,0 +1,9 @@ +import { type DescMessage } from "./descriptors.js"; +import type { MessageInitShape, MessageShape } from "./types.js"; +/** + * Create a new message instance. + * + * The second argument is an optional initializer object, where all fields are + * optional. + */ +export declare function create(schema: Desc, init?: MessageInitShape): MessageShape; diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/create.js b/node_modules/@bufbuild/protobuf/dist/cjs/create.js new file mode 100644 index 0000000..2b7b9c5 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/create.js @@ -0,0 +1,259 @@ +"use strict"; +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.create = create; +const is_message_js_1 = require("./is-message.js"); +const descriptors_js_1 = require("./descriptors.js"); +const scalar_js_1 = require("./reflect/scalar.js"); +const guard_js_1 = require("./reflect/guard.js"); +const unsafe_js_1 = require("./reflect/unsafe.js"); +const wrappers_js_1 = require("./wkt/wrappers.js"); +// bootstrap-inject google.protobuf.Edition.EDITION_PROTO3: const $name: Edition.$localName = $number; +const EDITION_PROTO3 = 999; +// bootstrap-inject google.protobuf.Edition.EDITION_PROTO2: const $name: Edition.$localName = $number; +const EDITION_PROTO2 = 998; +// bootstrap-inject google.protobuf.FeatureSet.FieldPresence.IMPLICIT: const $name: FeatureSet_FieldPresence.$localName = $number; +const IMPLICIT = 2; +/** + * Create a new message instance. + * + * The second argument is an optional initializer object, where all fields are + * optional. + */ +function create(schema, init) { + if ((0, is_message_js_1.isMessage)(init, schema)) { + return init; + } + const message = createZeroMessage(schema); + if (init !== undefined) { + initMessage(schema, message, init); + } + return message; +} +/** + * Sets field values from a MessageInitShape on a zero message. + */ +function initMessage(messageDesc, message, init) { + for (const member of messageDesc.members) { + let value = init[member.localName]; + if (value == null) { + // intentionally ignore undefined and null + continue; + } + let field; + if (member.kind == "oneof") { + const oneofField = (0, unsafe_js_1.unsafeOneofCase)(init, member); + if (!oneofField) { + continue; + } + field = oneofField; + value = (0, unsafe_js_1.unsafeGet)(init, oneofField); + } + else { + field = member; + } + switch (field.fieldKind) { + case "message": + value = toMessage(field, value); + break; + case "scalar": + value = initScalar(field, value); + break; + case "list": + value = initList(field, value); + break; + case "map": + value = initMap(field, value); + break; + } + (0, unsafe_js_1.unsafeSet)(message, field, value); + } + return message; +} +function initScalar(field, value) { + if (field.scalar == descriptors_js_1.ScalarType.BYTES) { + return toU8Arr(value); + } + return value; +} +function initMap(field, value) { + if ((0, guard_js_1.isObject)(value)) { + if (field.scalar == descriptors_js_1.ScalarType.BYTES) { + return convertObjectValues(value, toU8Arr); + } + if (field.mapKind == "message") { + return convertObjectValues(value, (val) => toMessage(field, val)); + } + } + return value; +} +function initList(field, value) { + if (Array.isArray(value)) { + if (field.scalar == descriptors_js_1.ScalarType.BYTES) { + return value.map(toU8Arr); + } + if (field.listKind == "message") { + return value.map((item) => toMessage(field, item)); + } + } + return value; +} +function toMessage(field, value) { + if (field.fieldKind == "message" && + !field.oneof && + (0, wrappers_js_1.isWrapperDesc)(field.message)) { + // Types from google/protobuf/wrappers.proto are unwrapped when used in + // a singular field that is not part of a oneof group. + return initScalar(field.message.fields[0], value); + } + if ((0, guard_js_1.isObject)(value)) { + if (field.message.typeName == "google.protobuf.Struct" && + field.parent.typeName !== "google.protobuf.Value") { + // google.protobuf.Struct is represented with JsonObject when used in a + // field, except when used in google.protobuf.Value. + return value; + } + if (!(0, is_message_js_1.isMessage)(value, field.message)) { + return create(field.message, value); + } + } + return value; +} +// converts any ArrayLike to Uint8Array if necessary. +function toU8Arr(value) { + return Array.isArray(value) ? new Uint8Array(value) : value; +} +function convertObjectValues(obj, fn) { + const ret = {}; + for (const entry of Object.entries(obj)) { + ret[entry[0]] = fn(entry[1]); + } + return ret; +} +const tokenZeroMessageField = Symbol(); +const messagePrototypes = new WeakMap(); +/** + * Create a zero message. + */ +function createZeroMessage(desc) { + let msg; + if (!needsPrototypeChain(desc)) { + msg = { + $typeName: desc.typeName, + }; + for (const member of desc.members) { + if (member.kind == "oneof" || member.presence == IMPLICIT) { + msg[member.localName] = createZeroField(member); + } + } + } + else { + // Support default values and track presence via the prototype chain + const cached = messagePrototypes.get(desc); + let prototype; + let members; + if (cached) { + ({ prototype, members } = cached); + } + else { + prototype = {}; + members = new Set(); + for (const member of desc.members) { + if (member.kind == "oneof") { + // we can only put immutable values on the prototype, + // oneof ADTs are mutable + continue; + } + if (member.fieldKind != "scalar" && member.fieldKind != "enum") { + // only scalar and enum values are immutable, map, list, and message + // are not + continue; + } + if (member.presence == IMPLICIT) { + // implicit presence tracks field presence by zero values - e.g. 0, false, "", are unset, 1, true, "x" are set. + // message, map, list fields are mutable, and also have IMPLICIT presence. + continue; + } + members.add(member); + prototype[member.localName] = createZeroField(member); + } + messagePrototypes.set(desc, { prototype, members }); + } + msg = Object.create(prototype); + msg.$typeName = desc.typeName; + for (const member of desc.members) { + if (members.has(member)) { + continue; + } + if (member.kind == "field") { + if (member.fieldKind == "message") { + continue; + } + if (member.fieldKind == "scalar" || member.fieldKind == "enum") { + if (member.presence != IMPLICIT) { + continue; + } + } + } + msg[member.localName] = createZeroField(member); + } + } + return msg; +} +/** + * Do we need the prototype chain to track field presence? + */ +function needsPrototypeChain(desc) { + switch (desc.file.edition) { + case EDITION_PROTO3: + // proto3 always uses implicit presence, we never need the prototype chain. + return false; + case EDITION_PROTO2: + // proto2 never uses implicit presence, we always need the prototype chain. + return true; + default: + // If a message uses scalar or enum fields with explicit presence, we need + // the prototype chain to track presence. This rule does not apply to fields + // in a oneof group - they use a different mechanism to track presence. + return desc.fields.some((f) => f.presence != IMPLICIT && f.fieldKind != "message" && !f.oneof); + } +} +/** + * Returns a zero value for oneof groups, and for every field kind except + * messages. Scalar and enum fields can have default values. + */ +function createZeroField(field) { + if (field.kind == "oneof") { + return { case: undefined }; + } + if (field.fieldKind == "list") { + return []; + } + if (field.fieldKind == "map") { + return {}; // Object.create(null) would be desirable here, but is unsupported by react https://react.dev/reference/react/use-server#serializable-parameters-and-return-values + } + if (field.fieldKind == "message") { + return tokenZeroMessageField; + } + const defaultValue = field.getDefaultValue(); + if (defaultValue !== undefined) { + return field.fieldKind == "scalar" && field.longAsString + ? defaultValue.toString() + : defaultValue; + } + return field.fieldKind == "scalar" + ? (0, scalar_js_1.scalarZeroValue)(field.scalar, field.longAsString) + : field.enum.values[0].number; +} diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/descriptors.d.ts b/node_modules/@bufbuild/protobuf/dist/cjs/descriptors.d.ts new file mode 100644 index 0000000..239a1f9 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/descriptors.d.ts @@ -0,0 +1,634 @@ +import type { DescriptorProto, Edition, EnumDescriptorProto, EnumValueDescriptorProto, FeatureSet_FieldPresence, FieldDescriptorProto, FileDescriptorProto, MethodDescriptorProto, MethodOptions_IdempotencyLevel, OneofDescriptorProto, ServiceDescriptorProto } from "./wkt/gen/google/protobuf/descriptor_pb.js"; +import type { ScalarValue } from "./reflect/scalar.js"; +export type SupportedEdition = Extract; +type SupportedFieldPresence = Extract; +/** + * Scalar value types. This is a subset of field types declared by protobuf + * enum google.protobuf.FieldDescriptorProto.Type The types GROUP and MESSAGE + * are omitted, but the numerical values are identical. + */ +export declare enum ScalarType { + DOUBLE = 1, + FLOAT = 2, + INT64 = 3, + UINT64 = 4, + INT32 = 5, + FIXED64 = 6, + FIXED32 = 7, + BOOL = 8, + STRING = 9, + BYTES = 12, + UINT32 = 13, + SFIXED32 = 15, + SFIXED64 = 16, + SINT32 = 17,// Uses ZigZag encoding. + SINT64 = 18 +} +/** + * A union of all descriptors, discriminated by a `kind` property. + */ +export type AnyDesc = DescFile | DescEnum | DescEnumValue | DescMessage | DescField | DescExtension | DescOneof | DescService | DescMethod; +/** + * Describes a protobuf source file. + */ +export interface DescFile { + readonly kind: "file"; + /** + * The edition of the protobuf file. Will be EDITION_PROTO2 for syntax="proto2", + * EDITION_PROTO3 for syntax="proto3"; + */ + readonly edition: SupportedEdition; + /** + * The name of the file, excluding the .proto suffix. + * For a protobuf file `foo/bar.proto`, this is `foo/bar`. + */ + readonly name: string; + /** + * Files imported by this file. + */ + readonly dependencies: DescFile[]; + /** + * Top-level enumerations declared in this file. + * Note that more enumerations might be declared within message declarations. + */ + readonly enums: DescEnum[]; + /** + * Top-level messages declared in this file. + * Note that more messages might be declared within message declarations. + */ + readonly messages: DescMessage[]; + /** + * Top-level extensions declared in this file. + * Note that more extensions might be declared within message declarations. + */ + readonly extensions: DescExtension[]; + /** + * Services declared in this file. + */ + readonly services: DescService[]; + /** + * Marked as deprecated in the protobuf source. + */ + readonly deprecated: boolean; + /** + * The compiler-generated descriptor. + */ + readonly proto: FileDescriptorProto; + toString(): string; +} +/** + * Describes an enumeration in a protobuf source file. + */ +export interface DescEnum { + readonly kind: "enum"; + /** + * The fully qualified name of the enumeration. (We omit the leading dot.) + */ + readonly typeName: string; + /** + * The name of the enumeration, as declared in the protobuf source. + */ + readonly name: string; + /** + * The file this enumeration was declared in. + */ + readonly file: DescFile; + /** + * The parent message, if this enumeration was declared inside a message declaration. + */ + readonly parent: DescMessage | undefined; + /** + * Enumerations can be open or closed. + * See https://protobuf.dev/programming-guides/enum/ + */ + readonly open: boolean; + /** + * Values declared for this enumeration. + */ + readonly values: DescEnumValue[]; + /** + * All values of this enum by their number. + */ + readonly value: Record; + /** + * A prefix shared by all enum values. + * For example, `my_enum_` for `enum MyEnum {MY_ENUM_A=0; MY_ENUM_B=1;}` + */ + readonly sharedPrefix?: string | undefined; + /** + * Marked as deprecated in the protobuf source. + */ + readonly deprecated: boolean; + /** + * The compiler-generated descriptor. + */ + readonly proto: EnumDescriptorProto; + toString(): string; +} +/** + * Describes an individual value of an enumeration in a protobuf source file. + */ +export interface DescEnumValue { + readonly kind: "enum_value"; + /** + * The name of the enumeration value, as specified in the protobuf source. + */ + readonly name: string; + /** + * A safe and idiomatic name for the value in a TypeScript enum. + */ + readonly localName: string; + /** + * The enumeration this value belongs to. + */ + readonly parent: DescEnum; + /** + * The numeric enumeration value, as specified in the protobuf source. + */ + readonly number: number; + /** + * Marked as deprecated in the protobuf source. + */ + readonly deprecated: boolean; + /** + * The compiler-generated descriptor. + */ + readonly proto: EnumValueDescriptorProto; + toString(): string; +} +/** + * Describes a message declaration in a protobuf source file. + */ +export interface DescMessage { + readonly kind: "message"; + /** + * The fully qualified name of the message. (We omit the leading dot.) + */ + readonly typeName: string; + /** + * The name of the message, as specified in the protobuf source. + */ + readonly name: string; + /** + * The file this message was declared in. + */ + readonly file: DescFile; + /** + * The parent message, if this message was declared inside a message declaration. + */ + readonly parent: DescMessage | undefined; + /** + * Fields declared for this message, including fields declared in a oneof + * group. + */ + readonly fields: DescField[]; + /** + * All fields of this message by their "localName". + */ + readonly field: Record; + /** + * Oneof groups declared for this message. + * This does not include synthetic oneofs for proto3 optionals. + */ + readonly oneofs: DescOneof[]; + /** + * Standalone fields and oneof groups for this message, ordered by + * their appearance in the protobuf source. + */ + readonly members: (DescField | DescOneof)[]; + /** + * Enumerations declared within the message, if any. + */ + readonly nestedEnums: DescEnum[]; + /** + * Messages declared within the message, if any. + * This does not include synthetic messages like map entries. + */ + readonly nestedMessages: DescMessage[]; + /** + * Extensions declared within the message, if any. + */ + readonly nestedExtensions: DescExtension[]; + /** + * Marked as deprecated in the protobuf source. + */ + readonly deprecated: boolean; + /** + * The compiler-generated descriptor. + */ + readonly proto: DescriptorProto; + toString(): string; +} +/** + * Describes a field declaration in a protobuf source file. + */ +export type DescField = (descFieldScalar & descFieldCommon) | (descFieldList & descFieldCommon) | (descFieldMessage & descFieldCommon) | (descFieldEnum & descFieldCommon) | (descFieldMap & descFieldCommon); +type descFieldCommon = descFieldAndExtensionShared & { + readonly kind: "field"; + /** + * The message this field is declared on. + */ + readonly parent: DescMessage; + /** + * A safe and idiomatic name for the field as a property in ECMAScript. + */ + readonly localName: string; +}; +/** + * Describes an extension in a protobuf source file. + */ +export type DescExtension = (Omit & descExtensionCommon) | (Omit & descExtensionCommon) | (Omit & descExtensionCommon) | (descFieldList & descExtensionCommon); +type descExtensionCommon = descFieldAndExtensionShared & { + readonly kind: "extension"; + /** + * The fully qualified name of the extension. + */ + readonly typeName: string; + /** + * The file this extension was declared in. + */ + readonly file: DescFile; + /** + * The parent message, if this extension was declared inside a message declaration. + */ + readonly parent: DescMessage | undefined; + /** + * The message that this extension extends. + */ + readonly extendee: DescMessage; + /** + * The `oneof` group this field belongs to, if any. + */ + readonly oneof: undefined; +}; +interface descFieldAndExtensionShared { + /** + * The field name, as specified in the protobuf source + */ + readonly name: string; + /** + * The field number, as specified in the protobuf source. + */ + readonly number: number; + /** + * The field name in JSON. + */ + readonly jsonName: string; + /** + * Marked as deprecated in the protobuf source. + */ + readonly deprecated: boolean; + /** + * Presence of the field. + * See https://protobuf.dev/programming-guides/field_presence/ + */ + readonly presence: SupportedFieldPresence; + /** + * Whether to reject invalid UTF-8 when reading this field from the binary + * wire format. Reflects the resolved `utf8_validation` feature: true for + * VERIFY (proto3 and editions 2023+ default), false for NONE (proto2 + * default). + */ + readonly utf8Validation: boolean; + /** + * The compiler-generated descriptor. + */ + readonly proto: FieldDescriptorProto; + /** + * Get the edition features for this protobuf element. + */ + toString(): string; +} +type descFieldSingularCommon = { + /** + * The `oneof` group this field belongs to, if any. + * + * This does not include synthetic oneofs for proto3 optionals. + */ + readonly oneof: DescOneof | undefined; +}; +type descFieldScalar = T extends T ? { + readonly fieldKind: "scalar"; + /** + * Scalar type, if it is a scalar field. + */ + readonly scalar: T; + /** + * By default, 64-bit integral types (int64, uint64, sint64, fixed64, + * sfixed64) are represented with BigInt. + * + * If the field option `jstype = JS_STRING` is set, this property + * is true, and 64-bit integral types are represented with String. + */ + readonly longAsString: boolean; + /** + * The message type, if it is a message field. + */ + readonly message: undefined; + /** + * The enum type, if it is an enum field. + */ + readonly enum: undefined; + /** + * Return the default value specified in the protobuf source. + */ + getDefaultValue(): ScalarValue | undefined; +} & descFieldSingularCommon : never; +type descFieldMessage = { + readonly fieldKind: "message"; + /** + * Scalar type, if it is a scalar field. + */ + readonly scalar: undefined; + /** + * The message type, if it is a message field. + */ + readonly message: DescMessage; + /** + * Encode the message delimited (a.k.a. proto2 group encoding), or + * length-prefixed? + */ + readonly delimitedEncoding: boolean; + /** + * The enum type, if it is an enum field. + */ + readonly enum: undefined; + /** + * Return the default value specified in the protobuf source. + */ + getDefaultValue(): undefined; +} & descFieldSingularCommon; +type descFieldEnum = { + readonly fieldKind: "enum"; + /** + * Scalar type, if it is a scalar field. + */ + readonly scalar: undefined; + /** + * The message type, if it is a message field. + */ + readonly message: undefined; + /** + * The enum type, if it is an enum field. + */ + readonly enum: DescEnum; + /** + * Return the default value specified in the protobuf source. + */ + getDefaultValue(): number | undefined; +} & descFieldSingularCommon; +type descFieldList = (descFieldListScalar & descFieldListCommon) | (descFieldListEnum & descFieldListCommon) | (descFieldListMessage & descFieldListCommon); +type descFieldListCommon = { + readonly fieldKind: "list"; + /** + * Pack this repeated field? Only valid for repeated enum fields, and + * for repeated scalar fields except BYTES and STRING. + */ + readonly packed: boolean; + /** + * The `oneof` group this field belongs to, if any. + */ + readonly oneof: undefined; +}; +type descFieldListScalar = T extends T ? { + readonly listKind: "scalar"; + /** + * The enum list element type. + */ + readonly enum: undefined; + /** + * The message list element type. + */ + readonly message: undefined; + /** + * Scalar list element type. + */ + readonly scalar: T; + /** + * By default, 64-bit integral types (int64, uint64, sint64, fixed64, + * sfixed64) are represented with BigInt. + * + * If the field option `jstype = JS_STRING` is set, this property + * is true, and 64-bit integral types are represented with String. + */ + readonly longAsString: boolean; +} : never; +type descFieldListEnum = { + readonly listKind: "enum"; + /** + * The enum list element type. + */ + readonly enum: DescEnum; + /** + * The message list element type. + */ + readonly message: undefined; + /** + * Scalar list element type. + */ + readonly scalar: undefined; +}; +type descFieldListMessage = { + readonly listKind: "message"; + /** + * The enum list element type. + */ + readonly enum: undefined; + /** + * The message list element type. + */ + readonly message: DescMessage; + /** + * Scalar list element type. + */ + readonly scalar: undefined; + /** + * Encode the message delimited (a.k.a. proto2 group encoding), or + * length-prefixed? + */ + readonly delimitedEncoding: boolean; +}; +type descFieldMap = (descFieldMapScalar & descFieldMapCommon) | (descFieldMapEnum & descFieldMapCommon) | (descFieldMapMessage & descFieldMapCommon); +type descFieldMapCommon = T extends Exclude ? { + readonly fieldKind: "map"; + /** + * The scalar map key type. + */ + readonly mapKey: T; + /** + * The `oneof` group this field belongs to, if any. + */ + readonly oneof: undefined; + /** + * Encode the map entry message delimited (a.k.a. proto2 group encoding), + * or length-prefixed? As of Edition 2023, this is always false for map fields, + * and also applies to map values, if they are messages. + */ + readonly delimitedEncoding: false; +} : never; +type descFieldMapScalar = T extends T ? { + readonly mapKind: "scalar"; + /** + * The enum map value type. + */ + readonly enum: undefined; + /** + * The message map value type. + */ + readonly message: undefined; + /** + * Scalar map value type. + */ + readonly scalar: T; +} : never; +type descFieldMapEnum = { + readonly mapKind: "enum"; + /** + * The enum map value type. + */ + readonly enum: DescEnum; + /** + * The message map value type. + */ + readonly message: undefined; + /** + * Scalar map value type. + */ + readonly scalar: undefined; +}; +type descFieldMapMessage = { + readonly mapKind: "message"; + /** + * The enum map value type. + */ + readonly enum: undefined; + /** + * The message map value type. + */ + readonly message: DescMessage; + /** + * Scalar map value type. + */ + readonly scalar: undefined; +}; +/** + * Describes a oneof group in a protobuf source file. + */ +export interface DescOneof { + readonly kind: "oneof"; + /** + * The name of the oneof group, as specified in the protobuf source. + */ + readonly name: string; + /** + * A safe and idiomatic name for the oneof group as a property in ECMAScript. + */ + readonly localName: string; + /** + * The message this oneof group was declared in. + */ + readonly parent: DescMessage; + /** + * The fields declared in this oneof group. + */ + readonly fields: DescField[]; + /** + * Marked as deprecated in the protobuf source. + * Note that oneof groups cannot be marked as deprecated, this property + * only exists for consistency and will always be false. + */ + readonly deprecated: boolean; + /** + * The compiler-generated descriptor. + */ + readonly proto: OneofDescriptorProto; + toString(): string; +} +/** + * Describes a service declaration in a protobuf source file. + */ +export interface DescService { + readonly kind: "service"; + /** + * The fully qualified name of the service. (We omit the leading dot.) + */ + readonly typeName: string; + /** + * The name of the service, as specified in the protobuf source. + */ + readonly name: string; + /** + * The file this service was declared in. + */ + readonly file: DescFile; + /** + * The RPCs this service declares. + */ + readonly methods: DescMethod[]; + /** + * All methods of this service by their "localName". + */ + readonly method: Record; + /** + * Marked as deprecated in the protobuf source. + */ + readonly deprecated: boolean; + /** + * The compiler-generated descriptor. + */ + readonly proto: ServiceDescriptorProto; + toString(): string; +} +/** + * Describes an RPC declaration in a protobuf source file. + */ +export interface DescMethod { + readonly kind: "rpc"; + /** + * The name of the RPC, as specified in the protobuf source. + */ + readonly name: string; + /** + * A safe and idiomatic name for the RPC as a method in ECMAScript. + */ + readonly localName: string; + /** + * The parent service. + */ + readonly parent: DescService; + /** + * One of the four available method types. + */ + readonly methodKind: "unary" | "server_streaming" | "client_streaming" | "bidi_streaming"; + /** + * The message type for requests. + */ + readonly input: DescMessage; + /** + * The message type for responses. + */ + readonly output: DescMessage; + /** + * The idempotency level declared in the protobuf source, if any. + */ + readonly idempotency: MethodOptions_IdempotencyLevel; + /** + * Marked as deprecated in the protobuf source. + */ + readonly deprecated: boolean; + /** + * The compiler-generated descriptor. + */ + readonly proto: MethodDescriptorProto; + toString(): string; +} +/** + * Comments on an element in a protobuf source file. + */ +export interface DescComments { + readonly leadingDetached: readonly string[]; + readonly leading?: string | undefined; + readonly trailing?: string | undefined; + readonly sourcePath: readonly number[]; +} +export {}; diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/descriptors.js b/node_modules/@bufbuild/protobuf/dist/cjs/descriptors.js new file mode 100644 index 0000000..38bab4e --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/descriptors.js @@ -0,0 +1,53 @@ +"use strict"; +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ScalarType = void 0; +/** + * Scalar value types. This is a subset of field types declared by protobuf + * enum google.protobuf.FieldDescriptorProto.Type The types GROUP and MESSAGE + * are omitted, but the numerical values are identical. + */ +var ScalarType; +(function (ScalarType) { + // 0 is reserved for errors. + // Order is weird for historical reasons. + ScalarType[ScalarType["DOUBLE"] = 1] = "DOUBLE"; + ScalarType[ScalarType["FLOAT"] = 2] = "FLOAT"; + // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if + // negative values are likely. + ScalarType[ScalarType["INT64"] = 3] = "INT64"; + ScalarType[ScalarType["UINT64"] = 4] = "UINT64"; + // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if + // negative values are likely. + ScalarType[ScalarType["INT32"] = 5] = "INT32"; + ScalarType[ScalarType["FIXED64"] = 6] = "FIXED64"; + ScalarType[ScalarType["FIXED32"] = 7] = "FIXED32"; + ScalarType[ScalarType["BOOL"] = 8] = "BOOL"; + ScalarType[ScalarType["STRING"] = 9] = "STRING"; + // Tag-delimited aggregate. + // Group type is deprecated and not supported in proto3. However, Proto3 + // implementations should still be able to parse the group wire format and + // treat group fields as unknown fields. + // TYPE_GROUP = 10, + // TYPE_MESSAGE = 11, // Length-delimited aggregate. + // New in version 2. + ScalarType[ScalarType["BYTES"] = 12] = "BYTES"; + ScalarType[ScalarType["UINT32"] = 13] = "UINT32"; + // TYPE_ENUM = 14, + ScalarType[ScalarType["SFIXED32"] = 15] = "SFIXED32"; + ScalarType[ScalarType["SFIXED64"] = 16] = "SFIXED64"; + ScalarType[ScalarType["SINT32"] = 17] = "SINT32"; + ScalarType[ScalarType["SINT64"] = 18] = "SINT64"; +})(ScalarType || (exports.ScalarType = ScalarType = {})); diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/equals.d.ts b/node_modules/@bufbuild/protobuf/dist/cjs/equals.d.ts new file mode 100644 index 0000000..914048f --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/equals.d.ts @@ -0,0 +1,41 @@ +import type { MessageShape } from "./types.js"; +import { type DescMessage } from "./descriptors.js"; +import type { Registry } from "./registry.js"; +interface EqualsOptions { + /** + * A registry to look up extensions, and messages packed in Any. + * + * @private Experimental API, does not follow semantic versioning. + */ + registry: Registry; + /** + * Unpack google.protobuf.Any before comparing. + * If a type is not in the registry, comparison falls back to comparing the + * fields of Any. + * + * @private Experimental API, does not follow semantic versioning. + */ + unpackAny?: boolean; + /** + * Consider extensions when comparing. + * + * @private Experimental API, does not follow semantic versioning. + */ + extensions?: boolean; + /** + * Consider unknown fields when comparing. + * The registry is used to distinguish between extensions, and unknown fields + * caused by schema changes. + * + * @private Experimental API, does not follow semantic versioning. + */ + unknown?: boolean; +} +/** + * Compare two messages of the same type. + * + * Note that this function disregards extensions and unknown fields, and that + * NaN is not equal NaN, following the IEEE standard. + */ +export declare function equals(schema: Desc, a: MessageShape, b: MessageShape, options?: EqualsOptions): boolean; +export {}; diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/equals.js b/node_modules/@bufbuild/protobuf/dist/cjs/equals.js new file mode 100644 index 0000000..4083b7e --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/equals.js @@ -0,0 +1,204 @@ +"use strict"; +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.equals = equals; +const scalar_js_1 = require("./reflect/scalar.js"); +const reflect_js_1 = require("./reflect/reflect.js"); +const descriptors_js_1 = require("./descriptors.js"); +const index_js_1 = require("./wkt/index.js"); +const extensions_js_1 = require("./extensions.js"); +/** + * Compare two messages of the same type. + * + * Note that this function disregards extensions and unknown fields, and that + * NaN is not equal NaN, following the IEEE standard. + */ +function equals(schema, a, b, options) { + if (a.$typeName != schema.typeName || b.$typeName != schema.typeName) { + return false; + } + if (a === b) { + return true; + } + return reflectEquals((0, reflect_js_1.reflect)(schema, a), (0, reflect_js_1.reflect)(schema, b), options); +} +function reflectEquals(a, b, opts) { + if (a.desc.typeName === "google.protobuf.Any" && (opts === null || opts === void 0 ? void 0 : opts.unpackAny) == true) { + return anyUnpackedEquals(a.message, b.message, opts); + } + for (const f of a.fields) { + if (!fieldEquals(f, a, b, opts)) { + return false; + } + } + if ((opts === null || opts === void 0 ? void 0 : opts.unknown) == true && !unknownEquals(a, b, opts.registry)) { + return false; + } + if ((opts === null || opts === void 0 ? void 0 : opts.extensions) == true && !extensionsEquals(a, b, opts)) { + return false; + } + return true; +} +// TODO(tstamm) add an option to consider NaN equal to NaN? +function fieldEquals(f, a, b, opts) { + if (!a.isSet(f) && !b.isSet(f)) { + return true; + } + if (!a.isSet(f) || !b.isSet(f)) { + return false; + } + switch (f.fieldKind) { + case "scalar": + return (0, scalar_js_1.scalarEquals)(f.scalar, a.get(f), b.get(f)); + case "enum": + return a.get(f) === b.get(f); + case "message": + return reflectEquals(a.get(f), b.get(f), opts); + case "map": { + // TODO(tstamm) can't we compare sizes first? + const mapA = a.get(f); + const mapB = b.get(f); + const keys = []; + for (const k of mapA.keys()) { + if (!mapB.has(k)) { + return false; + } + keys.push(k); + } + for (const k of mapB.keys()) { + if (!mapA.has(k)) { + return false; + } + } + for (const key of keys) { + const va = mapA.get(key); + const vb = mapB.get(key); + if (va === vb) { + continue; + } + switch (f.mapKind) { + case "enum": + return false; + case "message": + if (!reflectEquals(va, vb, opts)) { + return false; + } + break; + case "scalar": + if (!(0, scalar_js_1.scalarEquals)(f.scalar, va, vb)) { + return false; + } + break; + } + } + break; + } + case "list": { + const listA = a.get(f); + const listB = b.get(f); + if (listA.size != listB.size) { + return false; + } + for (let i = 0; i < listA.size; i++) { + const va = listA.get(i); + const vb = listB.get(i); + if (va === vb) { + continue; + } + switch (f.listKind) { + case "enum": + return false; + case "message": + if (!reflectEquals(va, vb, opts)) { + return false; + } + break; + case "scalar": + if (!(0, scalar_js_1.scalarEquals)(f.scalar, va, vb)) { + return false; + } + break; + } + } + break; + } + } + return true; +} +function anyUnpackedEquals(a, b, opts) { + if (a.typeUrl !== b.typeUrl) { + return false; + } + const unpackedA = (0, index_js_1.anyUnpack)(a, opts.registry); + const unpackedB = (0, index_js_1.anyUnpack)(b, opts.registry); + if (unpackedA && unpackedB) { + const schema = opts.registry.getMessage(unpackedA.$typeName); + if (schema) { + return equals(schema, unpackedA, unpackedB, opts); + } + } + return (0, scalar_js_1.scalarEquals)(descriptors_js_1.ScalarType.BYTES, a.value, b.value); +} +function unknownEquals(a, b, registry) { + function getTrulyUnknown(msg, registry) { + var _a; + const u = (_a = msg.getUnknown()) !== null && _a !== void 0 ? _a : []; + return registry + ? u.filter((uf) => !registry.getExtensionFor(msg.desc, uf.no)) + : u; + } + const unknownA = getTrulyUnknown(a, registry); + const unknownB = getTrulyUnknown(b, registry); + if (unknownA.length != unknownB.length) { + return false; + } + for (let i = 0; i < unknownA.length; i++) { + const a = unknownA[i]; + const b = unknownB[i]; + if (a.no != b.no) { + return false; + } + if (a.wireType != b.wireType) { + return false; + } + if (!(0, scalar_js_1.scalarEquals)(descriptors_js_1.ScalarType.BYTES, a.data, b.data)) { + return false; + } + } + return true; +} +function extensionsEquals(a, b, opts) { + function getSetExtensions(msg, registry) { + var _a; + return ((_a = msg.getUnknown()) !== null && _a !== void 0 ? _a : []) + .map((uf) => registry.getExtensionFor(msg.desc, uf.no)) + .filter((e) => e != undefined) + .filter((e, index, arr) => arr.indexOf(e) === index); + } + const extensionsA = getSetExtensions(a, opts.registry); + const extensionsB = getSetExtensions(b, opts.registry); + if (extensionsA.length != extensionsB.length || + extensionsA.some((e) => !extensionsB.includes(e))) { + return false; + } + for (const extension of extensionsA) { + const [containerA, field] = (0, extensions_js_1.createExtensionContainer)(extension, (0, extensions_js_1.getExtension)(a.message, extension)); + const [containerB] = (0, extensions_js_1.createExtensionContainer)(extension, (0, extensions_js_1.getExtension)(b.message, extension)); + if (!fieldEquals(field, containerA, containerB, opts)) { + return false; + } + } + return true; +} diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/extensions.d.ts b/node_modules/@bufbuild/protobuf/dist/cjs/extensions.d.ts new file mode 100644 index 0000000..8336447 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/extensions.d.ts @@ -0,0 +1,59 @@ +import type { AnyDesc, DescEnum, DescEnumValue, DescExtension, DescField, DescFile, DescMessage, DescMethod, DescOneof, DescService } from "./descriptors.js"; +import type { ReflectMessage } from "./reflect/reflect-types.js"; +import type { Extendee, ExtensionValueShape } from "./types.js"; +import type { EnumOptions, EnumValueOptions, FieldOptions, FileOptions, MessageOptions, MethodOptions, OneofOptions, ServiceOptions } from "./wkt/gen/google/protobuf/descriptor_pb.js"; +/** + * Retrieve an extension value from a message. + * + * The function never returns undefined. Use hasExtension() to check whether an + * extension is set. If the extension is not set, this function returns the + * default value (if one was specified in the protobuf source), or the zero value + * (for example `0` for numeric types, `[]` for repeated extension fields, and + * an empty message instance for message fields). + * + * Extensions are stored as unknown fields on a message. To mutate an extension + * value, make sure to store the new value with setExtension() after mutating. + * + * If the extension does not extend the given message, an error is raised. + */ +export declare function getExtension(message: Extendee, extension: Desc): ExtensionValueShape; +/** + * Set an extension value on a message. If the message already has a value for + * this extension, the value is replaced. + * + * If the extension does not extend the given message, an error is raised. + */ +export declare function setExtension(message: Extendee, extension: Desc, value: ExtensionValueShape): void; +/** + * Remove an extension value from a message. + * + * If the extension does not extend the given message, an error is raised. + */ +export declare function clearExtension(message: Extendee, extension: Desc): void; +/** + * Check whether an extension is set on a message. + */ +export declare function hasExtension(message: Extendee, extension: Desc): boolean; +/** + * Check whether an option is set on a descriptor. + * + * Options are extensions to the `google.protobuf.*Options` messages defined in + * google/protobuf/descriptor.proto. This function gets the option message from + * the descriptor, and calls hasExtension(). + */ +export declare function hasOption>(element: Desc, option: Ext): boolean; +/** + * Retrieve an option value from a descriptor. + * + * Options are extensions to the `google.protobuf.*Options` messages defined in + * google/protobuf/descriptor.proto. This function gets the option message from + * the descriptor, and calls getExtension(). Same as getExtension(), this + * function never returns undefined. + */ +export declare function getOption>(element: Desc, option: Ext): ExtensionValueShape; +type DescForOptionExtension = Extendee extends FileOptions ? DescFile : Extendee extends EnumOptions ? DescEnum : Extendee extends EnumValueOptions ? DescEnumValue : Extendee extends MessageOptions ? DescMessage : Extendee extends MessageOptions ? DescEnum : Extendee extends FieldOptions ? DescField | DescExtension : Extendee extends OneofOptions ? DescOneof : Extendee extends ServiceOptions ? DescService : Extendee extends EnumOptions ? DescEnum : Extendee extends MethodOptions ? DescMethod : AnyDesc; +/** + * @private + */ +export declare function createExtensionContainer(extension: Desc, value?: ExtensionValueShape): [ReflectMessage, DescField, () => ExtensionValueShape]; +export {}; diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/extensions.js b/node_modules/@bufbuild/protobuf/dist/cjs/extensions.js new file mode 100644 index 0000000..f529ce5 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/extensions.js @@ -0,0 +1,169 @@ +"use strict"; +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getExtension = getExtension; +exports.setExtension = setExtension; +exports.clearExtension = clearExtension; +exports.hasExtension = hasExtension; +exports.hasOption = hasOption; +exports.getOption = getOption; +exports.createExtensionContainer = createExtensionContainer; +const create_js_1 = require("./create.js"); +const from_binary_js_1 = require("./from-binary.js"); +const reflect_js_1 = require("./reflect/reflect.js"); +const scalar_js_1 = require("./reflect/scalar.js"); +const to_binary_js_1 = require("./to-binary.js"); +const binary_encoding_js_1 = require("./wire/binary-encoding.js"); +const wrappers_js_1 = require("./wkt/wrappers.js"); +/** + * Retrieve an extension value from a message. + * + * The function never returns undefined. Use hasExtension() to check whether an + * extension is set. If the extension is not set, this function returns the + * default value (if one was specified in the protobuf source), or the zero value + * (for example `0` for numeric types, `[]` for repeated extension fields, and + * an empty message instance for message fields). + * + * Extensions are stored as unknown fields on a message. To mutate an extension + * value, make sure to store the new value with setExtension() after mutating. + * + * If the extension does not extend the given message, an error is raised. + */ +function getExtension(message, extension) { + assertExtendee(extension, message); + const ufs = filterUnknownFields(message.$unknown, extension); + const [container, field, get] = createExtensionContainer(extension); + for (const uf of ufs) { + (0, from_binary_js_1.readField)(container, new binary_encoding_js_1.BinaryReader(uf.data), field, uf.wireType, { + readUnknownFields: true, + }); + } + return get(); +} +/** + * Set an extension value on a message. If the message already has a value for + * this extension, the value is replaced. + * + * If the extension does not extend the given message, an error is raised. + */ +function setExtension(message, extension, value) { + var _a; + assertExtendee(extension, message); + const ufs = ((_a = message.$unknown) !== null && _a !== void 0 ? _a : []).filter((uf) => uf.no !== extension.number); + const [container, field] = createExtensionContainer(extension, value); + const writer = new binary_encoding_js_1.BinaryWriter(); + (0, to_binary_js_1.writeField)(writer, { writeUnknownFields: true }, container, field); + const reader = new binary_encoding_js_1.BinaryReader(writer.finish()); + while (reader.pos < reader.len) { + const [no, wireType] = reader.tag(); + const data = reader.skip(wireType, no); + ufs.push({ no, wireType, data }); + } + message.$unknown = ufs; +} +/** + * Remove an extension value from a message. + * + * If the extension does not extend the given message, an error is raised. + */ +function clearExtension(message, extension) { + assertExtendee(extension, message); + if (message.$unknown === undefined) { + return; + } + message.$unknown = message.$unknown.filter((uf) => uf.no !== extension.number); +} +/** + * Check whether an extension is set on a message. + */ +function hasExtension(message, extension) { + var _a; + return (extension.extendee.typeName === message.$typeName && + !!((_a = message.$unknown) === null || _a === void 0 ? void 0 : _a.find((uf) => uf.no === extension.number))); +} +/** + * Check whether an option is set on a descriptor. + * + * Options are extensions to the `google.protobuf.*Options` messages defined in + * google/protobuf/descriptor.proto. This function gets the option message from + * the descriptor, and calls hasExtension(). + */ +function hasOption(element, option) { + const message = element.proto.options; + if (!message) { + return false; + } + return hasExtension(message, option); +} +/** + * Retrieve an option value from a descriptor. + * + * Options are extensions to the `google.protobuf.*Options` messages defined in + * google/protobuf/descriptor.proto. This function gets the option message from + * the descriptor, and calls getExtension(). Same as getExtension(), this + * function never returns undefined. + */ +function getOption(element, option) { + const message = element.proto.options; + if (!message) { + const [, , get] = createExtensionContainer(option); + return get(); + } + return getExtension(message, option); +} +function filterUnknownFields(unknownFields, extension) { + if (unknownFields === undefined) + return []; + if (extension.fieldKind === "enum" || extension.fieldKind === "scalar") { + // singular scalar fields do not merge, we pick the last + for (let i = unknownFields.length - 1; i >= 0; --i) { + if (unknownFields[i].no == extension.number) { + return [unknownFields[i]]; + } + } + return []; + } + return unknownFields.filter((uf) => uf.no === extension.number); +} +/** + * @private + */ +function createExtensionContainer(extension, value) { + const localName = extension.typeName; + const field = Object.assign(Object.assign({}, extension), { kind: "field", parent: extension.extendee, localName }); + const desc = Object.assign(Object.assign({}, extension.extendee), { fields: [field], members: [field], oneofs: [] }); + const container = (0, create_js_1.create)(desc, value !== undefined ? { [localName]: value } : undefined); + return [ + (0, reflect_js_1.reflect)(desc, container), + field, + () => { + const value = container[localName]; + if (value === undefined) { + // biome-ignore lint/style/noNonNullAssertion: Only message fields are undefined, rest will have a zero value. + const desc = extension.message; + if ((0, wrappers_js_1.isWrapperDesc)(desc)) { + return (0, scalar_js_1.scalarZeroValue)(desc.fields[0].scalar, desc.fields[0].longAsString); + } + return (0, create_js_1.create)(desc); + } + return value; + }, + ]; +} +function assertExtendee(extension, message) { + if (extension.extendee.typeName != message.$typeName) { + throw new Error(`extension ${extension.typeName} can only be applied to message ${extension.extendee.typeName}`); + } +} diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/fields.d.ts b/node_modules/@bufbuild/protobuf/dist/cjs/fields.d.ts new file mode 100644 index 0000000..a44a0c8 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/fields.d.ts @@ -0,0 +1,23 @@ +import type { MessageShape } from "./types.js"; +import type { DescField, DescMessage } from "./descriptors.js"; +/** + * Returns true if the field is set. + * + * - Scalar and enum fields with implicit presence (proto3): + * Set if not a zero value. + * + * - Scalar and enum fields with explicit presence (proto2, oneof): + * Set if a value was set when creating or parsing the message, or when a + * value was assigned to the field's property. + * + * - Message fields: + * Set if the property is not undefined. + * + * - List and map fields: + * Set if not empty. + */ +export declare function isFieldSet(message: MessageShape, field: DescField): boolean; +/** + * Resets the field, so that isFieldSet() will return false. + */ +export declare function clearField(message: MessageShape, field: DescField): void; diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/fields.js b/node_modules/@bufbuild/protobuf/dist/cjs/fields.js new file mode 100644 index 0000000..5d0ddeb --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/fields.js @@ -0,0 +1,45 @@ +"use strict"; +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isFieldSet = isFieldSet; +exports.clearField = clearField; +const unsafe_js_1 = require("./reflect/unsafe.js"); +/** + * Returns true if the field is set. + * + * - Scalar and enum fields with implicit presence (proto3): + * Set if not a zero value. + * + * - Scalar and enum fields with explicit presence (proto2, oneof): + * Set if a value was set when creating or parsing the message, or when a + * value was assigned to the field's property. + * + * - Message fields: + * Set if the property is not undefined. + * + * - List and map fields: + * Set if not empty. + */ +function isFieldSet(message, field) { + return (field.parent.typeName == message.$typeName && (0, unsafe_js_1.unsafeIsSet)(message, field)); +} +/** + * Resets the field, so that isFieldSet() will return false. + */ +function clearField(message, field) { + if (field.parent.typeName == message.$typeName) { + (0, unsafe_js_1.unsafeClear)(message, field); + } +} diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/from-binary.d.ts b/node_modules/@bufbuild/protobuf/dist/cjs/from-binary.d.ts new file mode 100644 index 0000000..b04a9d3 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/from-binary.d.ts @@ -0,0 +1,34 @@ +import { type DescField, type DescMessage } from "./descriptors.js"; +import type { MessageShape } from "./types.js"; +import type { ReflectMessage } from "./reflect/index.js"; +import { BinaryReader, WireType } from "./wire/binary-encoding.js"; +/** + * Options for parsing binary data. + */ +export interface BinaryReadOptions { + /** + * Retain unknown fields during parsing? The default behavior is to retain + * unknown fields and include them in the serialized output. + * + * For more details see https://developers.google.com/protocol-buffers/docs/proto3#unknowns + */ + readUnknownFields: boolean; +} +/** + * Parse serialized binary data. + */ +export declare function fromBinary(schema: Desc, bytes: Uint8Array, options?: Partial): MessageShape; +/** + * Parse from binary data, merging fields. + * + * Repeated fields are appended. Map entries are added, overwriting + * existing keys. + * + * If a message field is already present, it will be merged with the + * new data. + */ +export declare function mergeFromBinary(schema: Desc, target: MessageShape, bytes: Uint8Array, options?: Partial): MessageShape; +/** + * @private + */ +export declare function readField(message: ReflectMessage, reader: BinaryReader, field: DescField, wireType: WireType, options: BinaryReadOptions): void; diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/from-binary.js b/node_modules/@bufbuild/protobuf/dist/cjs/from-binary.js new file mode 100644 index 0000000..5d1756f --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/from-binary.js @@ -0,0 +1,241 @@ +"use strict"; +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.fromBinary = fromBinary; +exports.mergeFromBinary = mergeFromBinary; +exports.readField = readField; +const descriptors_js_1 = require("./descriptors.js"); +const scalar_js_1 = require("./reflect/scalar.js"); +const reflect_js_1 = require("./reflect/reflect.js"); +const binary_encoding_js_1 = require("./wire/binary-encoding.js"); +const varint_js_1 = require("./wire/varint.js"); +// Default options for parsing binary data. +const readDefaults = { + readUnknownFields: true, +}; +function makeReadOptions(options) { + return options ? Object.assign(Object.assign({}, readDefaults), options) : readDefaults; +} +/** + * Parse serialized binary data. + */ +function fromBinary(schema, bytes, options) { + const msg = (0, reflect_js_1.reflect)(schema, undefined, false); + readMessage(msg, new binary_encoding_js_1.BinaryReader(bytes), makeReadOptions(options), false, bytes.byteLength); + return msg.message; +} +/** + * Parse from binary data, merging fields. + * + * Repeated fields are appended. Map entries are added, overwriting + * existing keys. + * + * If a message field is already present, it will be merged with the + * new data. + */ +function mergeFromBinary(schema, target, bytes, options) { + readMessage((0, reflect_js_1.reflect)(schema, target, false), new binary_encoding_js_1.BinaryReader(bytes), makeReadOptions(options), false, bytes.byteLength); + return target; +} +/** + * If `delimited` is false, read the length given in `lengthOrDelimitedFieldNo`. + * + * If `delimited` is true, read until an EndGroup tag. `lengthOrDelimitedFieldNo` + * is the expected field number. + * + * @private + */ +function readMessage(message, reader, options, delimited, lengthOrDelimitedFieldNo) { + var _a; + const end = delimited ? reader.len : reader.pos + lengthOrDelimitedFieldNo; + let fieldNo; + let wireType; + const unknownFields = (_a = message.getUnknown()) !== null && _a !== void 0 ? _a : []; + while (reader.pos < end) { + [fieldNo, wireType] = reader.tag(); + if (delimited && wireType == binary_encoding_js_1.WireType.EndGroup) { + break; + } + const field = message.findNumber(fieldNo); + if (!field) { + const data = reader.skip(wireType, fieldNo); + if (options.readUnknownFields) { + unknownFields.push({ no: fieldNo, wireType, data }); + } + continue; + } + readField(message, reader, field, wireType, options); + } + if (delimited) { + if (wireType != binary_encoding_js_1.WireType.EndGroup || fieldNo !== lengthOrDelimitedFieldNo) { + throw new Error("invalid end group tag"); + } + } + if (unknownFields.length > 0) { + message.setUnknown(unknownFields); + } +} +/** + * @private + */ +function readField(message, reader, field, wireType, options) { + var _a; + switch (field.fieldKind) { + case "scalar": + message.set(field, readScalar(reader, field.scalar, field.utf8Validation)); + break; + case "enum": + const val = readScalar(reader, descriptors_js_1.ScalarType.INT32); + if (field.enum.open) { + message.set(field, val); + } + else { + const ok = field.enum.values.some((v) => v.number === val); + if (ok) { + message.set(field, val); + } + else if (options.readUnknownFields) { + const bytes = []; + (0, varint_js_1.varint32write)(val, bytes); + const unknownFields = (_a = message.getUnknown()) !== null && _a !== void 0 ? _a : []; + unknownFields.push({ + no: field.number, + wireType, + data: new Uint8Array(bytes), + }); + message.setUnknown(unknownFields); + } + } + break; + case "message": + message.set(field, readMessageField(reader, options, field, message.get(field))); + break; + case "list": + readListField(reader, wireType, message.get(field), options); + break; + case "map": + readMapEntry(reader, message.get(field), options); + break; + } +} +// Read a map field, expecting key field = 1, value field = 2 +function readMapEntry(reader, map, options) { + const field = map.field(); + let key; + let val; + // Read the length of the map entry, which is a varint. + const len = reader.uint32(); + // WARNING: Calculate end AFTER advancing reader.pos (above), so that + // reader.pos is at the start of the map entry. + const end = reader.pos + len; + while (reader.pos < end) { + const [fieldNo] = reader.tag(); + switch (fieldNo) { + case 1: + key = readScalar(reader, field.mapKey, field.utf8Validation); + break; + case 2: + switch (field.mapKind) { + case "scalar": + val = readScalar(reader, field.scalar, field.utf8Validation); + break; + case "enum": + val = reader.int32(); + break; + case "message": + val = readMessageField(reader, options, field); + break; + } + break; + } + } + if (key === undefined) { + key = (0, scalar_js_1.scalarZeroValue)(field.mapKey, false); + } + if (val === undefined) { + switch (field.mapKind) { + case "scalar": + val = (0, scalar_js_1.scalarZeroValue)(field.scalar, false); + break; + case "enum": + val = field.enum.values[0].number; + break; + case "message": + val = (0, reflect_js_1.reflect)(field.message, undefined, false); + break; + } + } + map.set(key, val); +} +function readListField(reader, wireType, list, options) { + var _a; + const field = list.field(); + if (field.listKind === "message") { + list.add(readMessageField(reader, options, field)); + return; + } + const scalarType = (_a = field.scalar) !== null && _a !== void 0 ? _a : descriptors_js_1.ScalarType.INT32; + const packed = wireType == binary_encoding_js_1.WireType.LengthDelimited && + scalarType != descriptors_js_1.ScalarType.STRING && + scalarType != descriptors_js_1.ScalarType.BYTES; + if (!packed) { + list.add(readScalar(reader, scalarType, field.utf8Validation)); + return; + } + const e = reader.uint32() + reader.pos; + while (reader.pos < e) { + list.add(readScalar(reader, scalarType, field.utf8Validation)); + } +} +function readMessageField(reader, options, field, mergeMessage) { + const delimited = field.delimitedEncoding; + const message = mergeMessage !== null && mergeMessage !== void 0 ? mergeMessage : (0, reflect_js_1.reflect)(field.message, undefined, false); + readMessage(message, reader, options, delimited, delimited ? field.number : reader.uint32()); + return message; +} +function readScalar(reader, type, validateUtf8 = false) { + switch (type) { + case descriptors_js_1.ScalarType.STRING: + return reader.string(validateUtf8); + case descriptors_js_1.ScalarType.BOOL: + return reader.bool(); + case descriptors_js_1.ScalarType.DOUBLE: + return reader.double(); + case descriptors_js_1.ScalarType.FLOAT: + return reader.float(); + case descriptors_js_1.ScalarType.INT32: + return reader.int32(); + case descriptors_js_1.ScalarType.INT64: + return reader.int64(); + case descriptors_js_1.ScalarType.UINT64: + return reader.uint64(); + case descriptors_js_1.ScalarType.FIXED64: + return reader.fixed64(); + case descriptors_js_1.ScalarType.BYTES: + return reader.bytes(); + case descriptors_js_1.ScalarType.FIXED32: + return reader.fixed32(); + case descriptors_js_1.ScalarType.SFIXED32: + return reader.sfixed32(); + case descriptors_js_1.ScalarType.SFIXED64: + return reader.sfixed64(); + case descriptors_js_1.ScalarType.SINT64: + return reader.sint64(); + case descriptors_js_1.ScalarType.UINT32: + return reader.uint32(); + case descriptors_js_1.ScalarType.SINT32: + return reader.sint32(); + } +} diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/from-json.d.ts b/node_modules/@bufbuild/protobuf/dist/cjs/from-json.d.ts new file mode 100644 index 0000000..98942a6 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/from-json.d.ts @@ -0,0 +1,56 @@ +import { type DescEnum, type DescMessage } from "./descriptors.js"; +import type { JsonValue } from "./json-value.js"; +import type { Registry } from "./registry.js"; +import type { EnumJsonType, EnumShape, MessageShape } from "./types.js"; +/** + * Options for parsing JSON data. + */ +export interface JsonReadOptions { + /** + * Ignore unknown fields: Proto3 JSON parser should reject unknown fields + * by default. This option ignores unknown fields in parsing, as well as + * unrecognized enum string representations. + */ + ignoreUnknownFields: boolean; + /** + * This option is required to read `google.protobuf.Any` and extensions + * from JSON format. + */ + registry?: Registry | undefined; +} +/** + * Parse a message from a JSON string. + */ +export declare function fromJsonString(schema: Desc, json: string, options?: Partial): MessageShape; +/** + * Parse a message from a JSON string, merging fields. + * + * Repeated fields are appended. Map entries are added, overwriting + * existing keys. + * + * If a message field is already present, it will be merged with the + * new data. + */ +export declare function mergeFromJsonString(schema: Desc, target: MessageShape, json: string, options?: Partial): MessageShape; +/** + * Parse a message from a JSON value. + */ +export declare function fromJson(schema: Desc, json: JsonValue, options?: Partial): MessageShape; +/** + * Parse a message from a JSON value, merging fields. + * + * Repeated fields are appended. Map entries are added, overwriting + * existing keys. + * + * If a message field is already present, it will be merged with the + * new data. + */ +export declare function mergeFromJson(schema: Desc, target: MessageShape, json: JsonValue, options?: Partial): MessageShape; +/** + * Parses an enum value from JSON. + */ +export declare function enumFromJson(descEnum: Desc, json: EnumJsonType): EnumShape; +/** + * Is the given value a JSON enum value? + */ +export declare function isEnumJson(descEnum: Desc, value: unknown): value is EnumJsonType; diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/from-json.js b/node_modules/@bufbuild/protobuf/dist/cjs/from-json.js new file mode 100644 index 0000000..c87b408 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/from-json.js @@ -0,0 +1,619 @@ +"use strict"; +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.fromJsonString = fromJsonString; +exports.mergeFromJsonString = mergeFromJsonString; +exports.fromJson = fromJson; +exports.mergeFromJson = mergeFromJson; +exports.enumFromJson = enumFromJson; +exports.isEnumJson = isEnumJson; +const descriptors_js_1 = require("./descriptors.js"); +const proto_int64_js_1 = require("./proto-int64.js"); +const create_js_1 = require("./create.js"); +const reflect_js_1 = require("./reflect/reflect.js"); +const error_js_1 = require("./reflect/error.js"); +const reflect_check_js_1 = require("./reflect/reflect-check.js"); +const names_js_1 = require("./reflect/names.js"); +const base64_encoding_js_1 = require("./wire/base64-encoding.js"); +const index_js_1 = require("./wkt/index.js"); +const extensions_js_1 = require("./extensions.js"); +// Default options for parsing JSON. +const jsonReadDefaults = { + ignoreUnknownFields: false, +}; +function makeReadOptions(options) { + return options ? Object.assign(Object.assign({}, jsonReadDefaults), options) : jsonReadDefaults; +} +/** + * Parse a message from a JSON string. + */ +function fromJsonString(schema, json, options) { + return fromJson(schema, parseJsonString(json, schema.typeName), options); +} +/** + * Parse a message from a JSON string, merging fields. + * + * Repeated fields are appended. Map entries are added, overwriting + * existing keys. + * + * If a message field is already present, it will be merged with the + * new data. + */ +function mergeFromJsonString(schema, target, json, options) { + return mergeFromJson(schema, target, parseJsonString(json, schema.typeName), options); +} +/** + * Parse a message from a JSON value. + */ +function fromJson(schema, json, options) { + const msg = (0, reflect_js_1.reflect)(schema); + try { + readMessage(msg, json, makeReadOptions(options)); + } + catch (e) { + if ((0, error_js_1.isFieldError)(e)) { + // @ts-expect-error we use the ES2022 error CTOR option "cause" for better stack traces + throw new Error(`cannot decode ${e.field()} from JSON: ${e.message}`, { + cause: e, + }); + } + throw e; + } + return msg.message; +} +/** + * Parse a message from a JSON value, merging fields. + * + * Repeated fields are appended. Map entries are added, overwriting + * existing keys. + * + * If a message field is already present, it will be merged with the + * new data. + */ +function mergeFromJson(schema, target, json, options) { + try { + readMessage((0, reflect_js_1.reflect)(schema, target), json, makeReadOptions(options)); + } + catch (e) { + if ((0, error_js_1.isFieldError)(e)) { + // @ts-expect-error we use the ES2022 error CTOR option "cause" for better stack traces + throw new Error(`cannot decode ${e.field()} from JSON: ${e.message}`, { + cause: e, + }); + } + throw e; + } + return target; +} +/** + * Parses an enum value from JSON. + */ +function enumFromJson(descEnum, json) { + return readEnum(descEnum, json, false); +} +/** + * Is the given value a JSON enum value? + */ +function isEnumJson(descEnum, value) { + return undefined !== descEnum.values.find((v) => v.name === value); +} +const messageJsonFields = new WeakMap(); +function getJsonField(desc, jsonKey) { + var _a; + if (!messageJsonFields.has(desc)) { + const jsonNames = new Map(); + for (const field of desc.fields) { + jsonNames.set(field.name, field).set(field.jsonName, field); + } + messageJsonFields.set(desc, jsonNames); + } + return (_a = messageJsonFields.get(desc)) === null || _a === void 0 ? void 0 : _a.get(jsonKey); +} +function readMessage(msg, json, opts) { + var _a; + if (tryWktFromJson(msg, json, opts)) { + return; + } + if (json == null || Array.isArray(json) || typeof json != "object") { + throw new Error(`cannot decode ${msg.desc} from JSON: ${(0, reflect_check_js_1.formatVal)(json)}`); + } + const oneofSeen = new Map(); + for (const [jsonKey, jsonValue] of Object.entries(json)) { + const field = getJsonField(msg.desc, jsonKey); + if (field) { + if (field.oneof) { + if (jsonValue === null && field.fieldKind == "scalar") { + // see conformance test Required.Proto3.JsonInput.OneofFieldNull{First,Second} + continue; + } + const seen = oneofSeen.get(field.oneof); + if (seen !== undefined) { + throw new error_js_1.FieldError(field.oneof, `oneof set multiple times by ${seen.name} and ${field.name}`); + } + oneofSeen.set(field.oneof, field); + } + readField(msg, field, jsonValue, opts); + } + else { + let extension = undefined; + if (jsonKey.startsWith("[") && + jsonKey.endsWith("]") && + // biome-ignore lint/suspicious/noAssignInExpressions: no + (extension = (_a = opts.registry) === null || _a === void 0 ? void 0 : _a.getExtension(jsonKey.substring(1, jsonKey.length - 1))) && + extension.extendee.typeName === msg.desc.typeName) { + const [container, field, get] = (0, extensions_js_1.createExtensionContainer)(extension); + readField(container, field, jsonValue, opts); + (0, extensions_js_1.setExtension)(msg.message, extension, get()); + } + if (!extension && !opts.ignoreUnknownFields) { + throw new Error(`cannot decode ${msg.desc} from JSON: key "${jsonKey}" is unknown`); + } + } + } +} +function readField(msg, field, json, opts) { + switch (field.fieldKind) { + case "scalar": + readScalarField(msg, field, json); + break; + case "enum": + readEnumField(msg, field, json, opts); + break; + case "message": + readMessageField(msg, field, json, opts); + break; + case "list": + readListField(msg.get(field), json, opts); + break; + case "map": + readMapField(msg.get(field), json, opts); + break; + } +} +function readListOrMapItem(field, json, opts) { + if (field.scalar && json !== null) { + return scalarFromJson(field, json); + } + if (field.message && !isResetSentinelNullValue(field, json)) { + const msgValue = (0, reflect_js_1.reflect)(field.message); + readMessage(msgValue, json, opts); + return msgValue; + } + if (field.enum && !isResetSentinelNullValue(field, json)) { + return readEnum(field.enum, json, opts.ignoreUnknownFields); + } + throw new error_js_1.FieldError(field, `${field.fieldKind === "list" ? "list item" : "map value"} must not be null`); +} +function readMapField(map, json, opts) { + if (json === null) { + return; + } + const field = map.field(); + if (typeof json != "object" || Array.isArray(json)) { + throw new error_js_1.FieldError(field, "expected object, got " + (0, reflect_check_js_1.formatVal)(json)); + } + for (const [jsonMapKey, jsonMapValue] of Object.entries(json)) { + const key = mapKeyFromJson(field.mapKey, jsonMapKey); + const value = readListOrMapItem(field, jsonMapValue, opts); + if (value !== tokenIgnoredUnknownEnum) { + map.set(key, value); + } + } +} +function readListField(list, json, opts) { + if (json === null) { + return; + } + const field = list.field(); + if (!Array.isArray(json)) { + throw new error_js_1.FieldError(field, "expected Array, got " + (0, reflect_check_js_1.formatVal)(json)); + } + for (const jsonItem of json) { + const value = readListOrMapItem(field, jsonItem, opts); + if (value !== tokenIgnoredUnknownEnum) { + list.add(value); + } + } +} +function readMessageField(msg, field, json, opts) { + if (isResetSentinelNullValue(field, json)) { + msg.clear(field); + return; + } + const msgValue = msg.isSet(field) ? msg.get(field) : (0, reflect_js_1.reflect)(field.message); + readMessage(msgValue, json, opts); + msg.set(field, msgValue); +} +function readEnumField(msg, field, json, opts) { + if (isResetSentinelNullValue(field, json)) { + msg.clear(field); + return; + } + const enumValue = readEnum(field.enum, json, opts.ignoreUnknownFields); + if (enumValue !== tokenIgnoredUnknownEnum) { + msg.set(field, enumValue); + } +} +function readScalarField(msg, field, json) { + if (json === null) { + msg.clear(field); + } + else { + msg.set(field, scalarFromJson(field, json)); + } +} +/** + * Indicates whether a value is a sentinel for reseting a field. + * + * For this to be true, the value must be a JSON null and the field must not + * permit a present, Protobuf-serializable null. + * + * Only message google.protobuf.Value and enum google.protobuf.NullValue fields + * permit Protobuf-serializable nulls. + * + * Note that field-resetting sentinel nulls are not permitted in lists and maps. + */ +function isResetSentinelNullValue(field, json) { + var _a, _b; + return (json === null && + ((_a = field.message) === null || _a === void 0 ? void 0 : _a.typeName) != "google.protobuf.Value" && + ((_b = field.enum) === null || _b === void 0 ? void 0 : _b.typeName) != "google.protobuf.NullValue"); +} +const tokenIgnoredUnknownEnum = Symbol(); +function readEnum(desc, json, ignoreUnknownFields) { + if (json === null) { + return desc.values[0].number; + } + switch (typeof json) { + case "number": + if (Number.isInteger(json)) { + return json; + } + break; + case "string": + const value = desc.values.find((ev) => ev.name === json); + if (value !== undefined) { + return value.number; + } + if (ignoreUnknownFields) { + return tokenIgnoredUnknownEnum; + } + break; + } + throw new Error(`cannot decode ${desc} from JSON: ${(0, reflect_check_js_1.formatVal)(json)}`); +} +/** + * Try to parse a JSON value to a scalar value for the reflect API. + * + * Returns the input if the JSON value cannot be converted. Raises a FieldError + * if conversion would be ambiguous. + */ +function scalarFromJson(field, json) { + // int64, sfixed64, sint64, fixed64, uint64: Reflect supports string and number. + // string, bool: Supported by reflect. + switch (field.scalar) { + // float, double: JSON value will be a number or one of the special string values "NaN", "Infinity", and "-Infinity". + // Either numbers or strings are accepted. Exponent notation is also accepted. + case descriptors_js_1.ScalarType.DOUBLE: + case descriptors_js_1.ScalarType.FLOAT: + if (json === "NaN") + return NaN; + if (json === "Infinity") + return Number.POSITIVE_INFINITY; + if (json === "-Infinity") + return Number.NEGATIVE_INFINITY; + if (typeof json == "number") { + if (Number.isNaN(json)) { + // NaN must be encoded with string constants + throw new error_js_1.FieldError(field, "unexpected NaN number"); + } + if (!Number.isFinite(json)) { + // Infinity must be encoded with string constants + throw new error_js_1.FieldError(field, "unexpected infinite number"); + } + break; + } + if (typeof json == "string") { + if (json === "") { + // empty string is not a number + break; + } + if (json.trim().length !== json.length) { + // extra whitespace + break; + } + const float = Number(json); + if (!Number.isFinite(float)) { + // Infinity and NaN must be encoded with string constants + break; + } + return float; + } + break; + // int32, fixed32, uint32: JSON value will be a decimal number. Either numbers or strings are accepted. + case descriptors_js_1.ScalarType.INT32: + case descriptors_js_1.ScalarType.FIXED32: + case descriptors_js_1.ScalarType.SFIXED32: + case descriptors_js_1.ScalarType.SINT32: + case descriptors_js_1.ScalarType.UINT32: + return int32FromJson(json); + // bytes: JSON value will be the data encoded as a string using standard base64 encoding with paddings. + // Either standard or URL-safe base64 encoding with/without paddings are accepted. + case descriptors_js_1.ScalarType.BYTES: + if (typeof json == "string") { + if (json === "") { + return new Uint8Array(0); + } + try { + return (0, base64_encoding_js_1.base64Decode)(json); + } + catch (e) { + const message = e instanceof Error ? e.message : String(e); + throw new error_js_1.FieldError(field, message); + } + } + break; + } + return json; +} +/** + * Try to parse a JSON value to a map key for the reflect API. + * + * Returns the input if the JSON value cannot be converted. + */ +function mapKeyFromJson(type, jsonString) { + switch (type) { + case descriptors_js_1.ScalarType.BOOL: + switch (jsonString) { + case "true": + return true; + case "false": + return false; + } + return jsonString; + case descriptors_js_1.ScalarType.INT32: + case descriptors_js_1.ScalarType.FIXED32: + case descriptors_js_1.ScalarType.UINT32: + case descriptors_js_1.ScalarType.SFIXED32: + case descriptors_js_1.ScalarType.SINT32: + return int32FromJson(jsonString); + default: + return jsonString; + } +} +/** + * Try to parse a JSON value to a 32-bit integer for the reflect API. + * + * Returns the input if the JSON value cannot be converted. + */ +function int32FromJson(json) { + if (typeof json == "string") { + if (json === "") { + // empty string is not a number + return json; + } + if (json.trim().length !== json.length) { + // extra whitespace + return json; + } + const num = Number(json); + if (Number.isNaN(num)) { + // not a number + return json; + } + return num; + } + return json; +} +function parseJsonString(jsonString, typeName) { + try { + return JSON.parse(jsonString); + } + catch (e) { + const message = e instanceof Error ? e.message : String(e); + throw new Error(`cannot decode message ${typeName} from JSON: ${message}`, + // @ts-expect-error we use the ES2022 error CTOR option "cause" for better stack traces + { cause: e }); + } +} +function tryWktFromJson(msg, jsonValue, opts) { + if (!msg.desc.typeName.startsWith("google.protobuf.")) { + return false; + } + switch (msg.desc.typeName) { + case "google.protobuf.Any": + anyFromJson(msg.message, jsonValue, opts); + return true; + case "google.protobuf.Timestamp": + timestampFromJson(msg.message, jsonValue); + return true; + case "google.protobuf.Duration": + durationFromJson(msg.message, jsonValue); + return true; + case "google.protobuf.FieldMask": + fieldMaskFromJson(msg.message, jsonValue); + return true; + case "google.protobuf.Struct": + structFromJson(msg.message, jsonValue); + return true; + case "google.protobuf.Value": + valueFromJson(msg.message, jsonValue); + return true; + case "google.protobuf.ListValue": + listValueFromJson(msg.message, jsonValue); + return true; + default: + if ((0, index_js_1.isWrapperDesc)(msg.desc)) { + const valueField = msg.desc.fields[0]; + if (jsonValue === null) { + msg.clear(valueField); + } + else { + msg.set(valueField, scalarFromJson(valueField, jsonValue)); + } + return true; + } + return false; + } +} +function anyFromJson(any, json, opts) { + var _a; + if (json === null || Array.isArray(json) || typeof json != "object") { + throw new Error(`cannot decode message ${any.$typeName} from JSON: expected object but got ${(0, reflect_check_js_1.formatVal)(json)}`); + } + if (Object.keys(json).length == 0) { + return; + } + const typeUrl = json["@type"]; + if (typeof typeUrl != "string" || typeUrl == "") { + throw new Error(`cannot decode message ${any.$typeName} from JSON: "@type" is empty`); + } + const typeName = typeUrl.includes("/") + ? typeUrl.substring(typeUrl.lastIndexOf("/") + 1) + : typeUrl; + if (!typeName.length) { + throw new Error(`cannot decode message ${any.$typeName} from JSON: "@type" is invalid`); + } + const desc = (_a = opts.registry) === null || _a === void 0 ? void 0 : _a.getMessage(typeName); + if (!desc) { + throw new Error(`cannot decode message ${any.$typeName} from JSON: ${typeUrl} is not in the type registry`); + } + const msg = (0, reflect_js_1.reflect)(desc); + if ((0, index_js_1.hasCustomJsonRepresentation)(desc) && + Object.prototype.hasOwnProperty.call(json, "value")) { + const value = json.value; + readMessage(msg, value, opts); + } + else { + const copy = Object.assign({}, json); + // biome-ignore lint/performance/noDelete: + delete copy["@type"]; + readMessage(msg, copy, opts); + } + (0, index_js_1.anyPack)(msg.desc, msg.message, any); +} +function timestampFromJson(timestamp, json) { + if (typeof json !== "string") { + throw new Error(`cannot decode message ${timestamp.$typeName} from JSON: ${(0, reflect_check_js_1.formatVal)(json)}`); + } + const matches = json.match(/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(?:\.([0-9]{1,9}))?(?:Z|([+-][0-9][0-9]:[0-9][0-9]))$/); + if (!matches) { + throw new Error(`cannot decode message ${timestamp.$typeName} from JSON: invalid RFC 3339 string`); + } + const ms = Date.parse( + // biome-ignore format: want this to read well + matches[1] + "-" + matches[2] + "-" + matches[3] + "T" + matches[4] + ":" + matches[5] + ":" + matches[6] + (matches[8] ? matches[8] : "Z")); + if (Number.isNaN(ms)) { + throw new Error(`cannot decode message ${timestamp.$typeName} from JSON: invalid RFC 3339 string`); + } + if (ms < Date.parse("0001-01-01T00:00:00Z") || + ms > Date.parse("9999-12-31T23:59:59Z")) { + throw new Error(`cannot decode message ${timestamp.$typeName} from JSON: must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive`); + } + timestamp.seconds = proto_int64_js_1.protoInt64.parse(ms / 1000); + timestamp.nanos = 0; + if (matches[7]) { + timestamp.nanos = + parseInt("1" + matches[7] + "0".repeat(9 - matches[7].length)) - + 1000000000; + } +} +function durationFromJson(duration, json) { + if (typeof json !== "string") { + throw new Error(`cannot decode message ${duration.$typeName} from JSON: ${(0, reflect_check_js_1.formatVal)(json)}`); + } + const match = json.match(/^(-?[0-9]+)(?:\.([0-9]+))?s/); + if (match === null) { + throw new Error(`cannot decode message ${duration.$typeName} from JSON: ${(0, reflect_check_js_1.formatVal)(json)}`); + } + const longSeconds = Number(match[1]); + if (longSeconds > 315576000000 || longSeconds < -315576000000) { + throw new Error(`cannot decode message ${duration.$typeName} from JSON: ${(0, reflect_check_js_1.formatVal)(json)}`); + } + duration.seconds = proto_int64_js_1.protoInt64.parse(longSeconds); + if (typeof match[2] !== "string") { + return; + } + const nanosStr = match[2] + "0".repeat(9 - match[2].length); + duration.nanos = parseInt(nanosStr); + if (longSeconds < 0 || Object.is(longSeconds, -0)) { + duration.nanos = -duration.nanos; + } +} +function fieldMaskFromJson(fieldMask, json) { + if (typeof json !== "string") { + throw new Error(`cannot decode message ${fieldMask.$typeName} from JSON: ${(0, reflect_check_js_1.formatVal)(json)}`); + } + if (json === "") { + return; + } + fieldMask.paths = json.split(",").map((path) => { + if (path.includes("_")) { + throw new Error(`cannot decode message ${fieldMask.$typeName} from JSON: path names must be lowerCamelCase`); + } + return (0, names_js_1.protoSnakeCase)(path); + }); +} +function structFromJson(struct, json) { + if (typeof json != "object" || json == null || Array.isArray(json)) { + throw new Error(`cannot decode message ${struct.$typeName} from JSON ${(0, reflect_check_js_1.formatVal)(json)}`); + } + for (const [k, v] of Object.entries(json)) { + const parsedV = (0, create_js_1.create)(index_js_1.ValueSchema); + valueFromJson(parsedV, v); + struct.fields[k] = parsedV; + } +} +function valueFromJson(value, json) { + switch (typeof json) { + case "number": + value.kind = { case: "numberValue", value: json }; + break; + case "string": + value.kind = { case: "stringValue", value: json }; + break; + case "boolean": + value.kind = { case: "boolValue", value: json }; + break; + case "object": + if (json === null) { + value.kind = { case: "nullValue", value: index_js_1.NullValue.NULL_VALUE }; + } + else if (Array.isArray(json)) { + const listValue = (0, create_js_1.create)(index_js_1.ListValueSchema); + listValueFromJson(listValue, json); + value.kind = { case: "listValue", value: listValue }; + } + else { + const struct = (0, create_js_1.create)(index_js_1.StructSchema); + structFromJson(struct, json); + value.kind = { case: "structValue", value: struct }; + } + break; + default: + throw new Error(`cannot decode message ${value.$typeName} from JSON ${(0, reflect_check_js_1.formatVal)(json)}`); + } + return value; +} +function listValueFromJson(listValue, json) { + if (!Array.isArray(json)) { + throw new Error(`cannot decode message ${listValue.$typeName} from JSON ${(0, reflect_check_js_1.formatVal)(json)}`); + } + for (const e of json) { + const value = (0, create_js_1.create)(index_js_1.ValueSchema); + valueFromJson(value, e); + listValue.values.push(value); + } +} diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/index.d.ts b/node_modules/@bufbuild/protobuf/dist/cjs/index.d.ts new file mode 100644 index 0000000..7a23115 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/index.d.ts @@ -0,0 +1,18 @@ +export * from "./types.js"; +export * from "./is-message.js"; +export * from "./create.js"; +export * from "./clone.js"; +export * from "./descriptors.js"; +export * from "./equals.js"; +export * from "./fields.js"; +export * from "./registry.js"; +export type { JsonValue, JsonObject } from "./json-value.js"; +export { toBinary } from "./to-binary.js"; +export type { BinaryWriteOptions } from "./to-binary.js"; +export { fromBinary, mergeFromBinary } from "./from-binary.js"; +export type { BinaryReadOptions } from "./from-binary.js"; +export * from "./to-json.js"; +export * from "./from-json.js"; +export * from "./merge.js"; +export { hasExtension, getExtension, setExtension, clearExtension, hasOption, getOption, } from "./extensions.js"; +export * from "./proto-int64.js"; diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/index.js b/node_modules/@bufbuild/protobuf/dist/cjs/index.js new file mode 100644 index 0000000..edb5f27 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/index.js @@ -0,0 +1,54 @@ +"use strict"; +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getOption = exports.hasOption = exports.clearExtension = exports.setExtension = exports.getExtension = exports.hasExtension = exports.mergeFromBinary = exports.fromBinary = exports.toBinary = void 0; +__exportStar(require("./types.js"), exports); +__exportStar(require("./is-message.js"), exports); +__exportStar(require("./create.js"), exports); +__exportStar(require("./clone.js"), exports); +__exportStar(require("./descriptors.js"), exports); +__exportStar(require("./equals.js"), exports); +__exportStar(require("./fields.js"), exports); +__exportStar(require("./registry.js"), exports); +var to_binary_js_1 = require("./to-binary.js"); +Object.defineProperty(exports, "toBinary", { enumerable: true, get: function () { return to_binary_js_1.toBinary; } }); +var from_binary_js_1 = require("./from-binary.js"); +Object.defineProperty(exports, "fromBinary", { enumerable: true, get: function () { return from_binary_js_1.fromBinary; } }); +Object.defineProperty(exports, "mergeFromBinary", { enumerable: true, get: function () { return from_binary_js_1.mergeFromBinary; } }); +__exportStar(require("./to-json.js"), exports); +__exportStar(require("./from-json.js"), exports); +__exportStar(require("./merge.js"), exports); +var extensions_js_1 = require("./extensions.js"); +Object.defineProperty(exports, "hasExtension", { enumerable: true, get: function () { return extensions_js_1.hasExtension; } }); +Object.defineProperty(exports, "getExtension", { enumerable: true, get: function () { return extensions_js_1.getExtension; } }); +Object.defineProperty(exports, "setExtension", { enumerable: true, get: function () { return extensions_js_1.setExtension; } }); +Object.defineProperty(exports, "clearExtension", { enumerable: true, get: function () { return extensions_js_1.clearExtension; } }); +Object.defineProperty(exports, "hasOption", { enumerable: true, get: function () { return extensions_js_1.hasOption; } }); +Object.defineProperty(exports, "getOption", { enumerable: true, get: function () { return extensions_js_1.getOption; } }); +__exportStar(require("./proto-int64.js"), exports); diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/is-message.d.ts b/node_modules/@bufbuild/protobuf/dist/cjs/is-message.d.ts new file mode 100644 index 0000000..085782d --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/is-message.d.ts @@ -0,0 +1,7 @@ +import type { MessageShape } from "./types.js"; +import type { DescMessage } from "./descriptors.js"; +/** + * Determine whether the given `arg` is a message. + * If `desc` is set, determine whether `arg` is this specific message. + */ +export declare function isMessage(arg: unknown, schema?: Desc): arg is MessageShape; diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/is-message.js b/node_modules/@bufbuild/protobuf/dist/cjs/is-message.js new file mode 100644 index 0000000..1ae756b --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/is-message.js @@ -0,0 +1,33 @@ +"use strict"; +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isMessage = isMessage; +/** + * Determine whether the given `arg` is a message. + * If `desc` is set, determine whether `arg` is this specific message. + */ +function isMessage(arg, schema) { + const isMessage = arg !== null && + typeof arg == "object" && + "$typeName" in arg && + typeof arg.$typeName == "string"; + if (!isMessage) { + return false; + } + if (schema === undefined) { + return true; + } + return schema.typeName === arg.$typeName; +} diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/json-value.d.ts b/node_modules/@bufbuild/protobuf/dist/cjs/json-value.d.ts new file mode 100644 index 0000000..3857eb8 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/json-value.d.ts @@ -0,0 +1,16 @@ +/** + * Represents any possible JSON value: + * - number + * - string + * - boolean + * - null + * - object (with any JSON value as property) + * - array (with any JSON value as element) + */ +export type JsonValue = number | string | boolean | null | JsonObject | JsonValue[]; +/** + * Represents a JSON object. + */ +export type JsonObject = { + [k: string]: JsonValue; +}; diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/json-value.js b/node_modules/@bufbuild/protobuf/dist/cjs/json-value.js new file mode 100644 index 0000000..05da9e9 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/json-value.js @@ -0,0 +1,15 @@ +"use strict"; +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/merge.d.ts b/node_modules/@bufbuild/protobuf/dist/cjs/merge.d.ts new file mode 100644 index 0000000..aad01ed --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/merge.d.ts @@ -0,0 +1,13 @@ +import type { MessageShape } from "./types.js"; +import type { DescMessage } from "./descriptors.js"; +/** + * Merge message `source` into message `target`, following Protobuf semantics. + * + * This is the same as serializing the source message, then deserializing it + * into the target message via `mergeFromBinary()`, with one difference: + * While serialization will create a copy of all values, `merge()` will copy + * the reference for `bytes` and messages. + * + * Also see https://protobuf.com/docs/language-spec#merging-protobuf-messages + */ +export declare function merge(schema: Desc, target: MessageShape, source: MessageShape): void; diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/merge.js b/node_modules/@bufbuild/protobuf/dist/cjs/merge.js new file mode 100644 index 0000000..a77fa35 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/merge.js @@ -0,0 +1,70 @@ +"use strict"; +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.merge = merge; +const reflect_js_1 = require("./reflect/reflect.js"); +/** + * Merge message `source` into message `target`, following Protobuf semantics. + * + * This is the same as serializing the source message, then deserializing it + * into the target message via `mergeFromBinary()`, with one difference: + * While serialization will create a copy of all values, `merge()` will copy + * the reference for `bytes` and messages. + * + * Also see https://protobuf.com/docs/language-spec#merging-protobuf-messages + */ +function merge(schema, target, source) { + reflectMerge((0, reflect_js_1.reflect)(schema, target), (0, reflect_js_1.reflect)(schema, source)); +} +function reflectMerge(target, source) { + var _a; + var _b; + const sourceUnknown = source.message.$unknown; + if (sourceUnknown !== undefined && sourceUnknown.length > 0) { + (_a = (_b = target.message).$unknown) !== null && _a !== void 0 ? _a : (_b.$unknown = []); + target.message.$unknown.push(...sourceUnknown); + } + for (const f of target.fields) { + if (!source.isSet(f)) { + continue; + } + switch (f.fieldKind) { + case "scalar": + case "enum": + target.set(f, source.get(f)); + break; + case "message": + if (target.isSet(f)) { + reflectMerge(target.get(f), source.get(f)); + } + else { + target.set(f, source.get(f)); + } + break; + case "list": + const list = target.get(f); + for (const e of source.get(f)) { + list.add(e); + } + break; + case "map": + const map = target.get(f); + for (const [k, v] of source.get(f)) { + map.set(k, v); + } + break; + } + } +} diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/package.json b/node_modules/@bufbuild/protobuf/dist/cjs/package.json new file mode 100644 index 0000000..729ac4d --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/package.json @@ -0,0 +1 @@ +{"type":"commonjs"} diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/proto-int64.d.ts b/node_modules/@bufbuild/protobuf/dist/cjs/proto-int64.d.ts new file mode 100644 index 0000000..3eaf231 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/proto-int64.d.ts @@ -0,0 +1,98 @@ +/** + * Int64Support for the current environment. + */ +export declare const protoInt64: Int64Support; +/** + * We use the `bigint` primitive to represent 64-bit integral types. If bigint + * is unavailable, we fall back to a string representation, which means that + * all values typed as `bigint` will actually be strings. + * + * If your code is intended to run in an environment where bigint may be + * unavailable, it must handle both the bigint and the string representation. + * For presenting values, this is straight-forward with implicit or explicit + * conversion to string: + * + * ```ts + * let el = document.createElement("span"); + * el.innerText = message.int64Field; // assuming a protobuf int64 field + * + * console.log(`int64: ${message.int64Field}`); + * + * let str: string = message.int64Field.toString(); + * ``` + * + * If you need to manipulate 64-bit integral values and are sure the values + * can be safely represented as an IEEE-754 double precision number, you can + * convert to a JavaScript Number: + * + * ```ts + * console.log(message.int64Field.toString()) + * let num = Number(message.int64Field); + * num = num + 1; + * message.int64Field = protoInt64.parse(num); + * ``` + * + * If you need to manipulate 64-bit integral values that are outside the + * range of safe representation as a JavaScript Number, we recommend you + * use a third party library, for example the npm package "long": + * + * ```ts + * // convert the field value to a Long + * const bits = protoInt64.enc(message.int64Field); + * const longValue = Long.fromBits(bits.lo, bits.hi); + * + * // perform arithmetic + * const longResult = longValue.subtract(1); + * + * // set the result in the field + * message.int64Field = protoInt64.dec(longResult.low, longResult.high); + * + * // Assuming int64Field contains 9223372036854775807: + * console.log(message.int64Field); // 9223372036854775806 + * ``` + */ +interface Int64Support { + /** + * 0n if bigint is available, "0" if unavailable. + */ + readonly zero: bigint; + /** + * Is bigint available? + */ + readonly supported: boolean; + /** + * Parse a signed 64-bit integer. + * Returns a bigint if available, a string otherwise. + */ + parse(value: string | number | bigint): bigint; + /** + * Parse an unsigned 64-bit integer. + * Returns a bigint if available, a string otherwise. + */ + uParse(value: string | number | bigint): bigint; + /** + * Convert a signed 64-bit integral value to a two's complement. + */ + enc(value: string | number | bigint): { + lo: number; + hi: number; + }; + /** + * Convert an unsigned 64-bit integral value to a two's complement. + */ + uEnc(value: string | number | bigint): { + lo: number; + hi: number; + }; + /** + * Convert a two's complement to a signed 64-bit integral value. + * Returns a bigint if available, a string otherwise. + */ + dec(lo: number, hi: number): bigint; + /** + * Convert a two's complement to an unsigned 64-bit integral value. + * Returns a bigint if available, a string otherwise. + */ + uDec(lo: number, hi: number): bigint; +} +export {}; diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/proto-int64.js b/node_modules/@bufbuild/protobuf/dist/cjs/proto-int64.js new file mode 100644 index 0000000..56bb286 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/proto-int64.js @@ -0,0 +1,130 @@ +"use strict"; +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.protoInt64 = void 0; +const varint_js_1 = require("./wire/varint.js"); +/** + * Int64Support for the current environment. + */ +exports.protoInt64 = makeInt64Support(); +function makeInt64Support() { + const dv = new DataView(new ArrayBuffer(8)); + // note that Safari 14 implements BigInt, but not the DataView methods + const ok = typeof BigInt === "function" && + typeof dv.getBigInt64 === "function" && + typeof dv.getBigUint64 === "function" && + typeof dv.setBigInt64 === "function" && + typeof dv.setBigUint64 === "function" && + (!!globalThis.Deno || + typeof process != "object" || + typeof process.env != "object" || + process.env.BUF_BIGINT_DISABLE !== "1"); + if (ok) { + const MIN = BigInt("-9223372036854775808"); + const MAX = BigInt("9223372036854775807"); + const UMIN = BigInt("0"); + const UMAX = BigInt("18446744073709551615"); + return { + zero: BigInt(0), + supported: true, + parse(value) { + const bi = typeof value == "bigint" ? value : BigInt(value); + if (bi > MAX || bi < MIN) { + throw new Error(`invalid int64: ${value}`); + } + return bi; + }, + uParse(value) { + const bi = typeof value == "bigint" ? value : BigInt(value); + if (bi > UMAX || bi < UMIN) { + throw new Error(`invalid uint64: ${value}`); + } + return bi; + }, + enc(value) { + dv.setBigInt64(0, this.parse(value), true); + return { + lo: dv.getInt32(0, true), + hi: dv.getInt32(4, true), + }; + }, + uEnc(value) { + dv.setBigInt64(0, this.uParse(value), true); + return { + lo: dv.getInt32(0, true), + hi: dv.getInt32(4, true), + }; + }, + dec(lo, hi) { + dv.setInt32(0, lo, true); + dv.setInt32(4, hi, true); + return dv.getBigInt64(0, true); + }, + uDec(lo, hi) { + dv.setInt32(0, lo, true); + dv.setInt32(4, hi, true); + return dv.getBigUint64(0, true); + }, + }; + } + return { + zero: "0", + supported: false, + parse(value) { + if (typeof value != "string") { + value = value.toString(); + } + assertInt64String(value); + return value; + }, + uParse(value) { + if (typeof value != "string") { + value = value.toString(); + } + assertUInt64String(value); + return value; + }, + enc(value) { + if (typeof value != "string") { + value = value.toString(); + } + assertInt64String(value); + return (0, varint_js_1.int64FromString)(value); + }, + uEnc(value) { + if (typeof value != "string") { + value = value.toString(); + } + assertUInt64String(value); + return (0, varint_js_1.int64FromString)(value); + }, + dec(lo, hi) { + return (0, varint_js_1.int64ToString)(lo, hi); + }, + uDec(lo, hi) { + return (0, varint_js_1.uInt64ToString)(lo, hi); + }, + }; +} +function assertInt64String(value) { + if (!/^-?[0-9]+$/.test(value)) { + throw new Error("invalid int64: " + value); + } +} +function assertUInt64String(value) { + if (!/^[0-9]+$/.test(value)) { + throw new Error("invalid uint64: " + value); + } +} diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/reflect/error.d.ts b/node_modules/@bufbuild/protobuf/dist/cjs/reflect/error.d.ts new file mode 100644 index 0000000..c6bf1db --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/reflect/error.d.ts @@ -0,0 +1,9 @@ +import type { DescField, DescOneof } from "../descriptors.js"; +declare const errorNames: string[]; +export declare class FieldError extends Error { + readonly name: (typeof errorNames)[number]; + constructor(fieldOrOneof: DescField | DescOneof, message: string, name?: (typeof errorNames)[number]); + readonly field: () => DescField | DescOneof; +} +export declare function isFieldError(arg: unknown): arg is FieldError; +export {}; diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/reflect/error.js b/node_modules/@bufbuild/protobuf/dist/cjs/reflect/error.js new file mode 100644 index 0000000..ce8a35a --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/reflect/error.js @@ -0,0 +1,36 @@ +"use strict"; +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.FieldError = void 0; +exports.isFieldError = isFieldError; +const errorNames = [ + "FieldValueInvalidError", + "FieldListRangeError", + "ForeignFieldError", +]; +class FieldError extends Error { + constructor(fieldOrOneof, message, name = "FieldValueInvalidError") { + super(message); + this.name = name; + this.field = () => fieldOrOneof; + } +} +exports.FieldError = FieldError; +function isFieldError(arg) { + return (arg instanceof Error && + errorNames.includes(arg.name) && + "field" in arg && + typeof arg.field == "function"); +} diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/reflect/guard.d.ts b/node_modules/@bufbuild/protobuf/dist/cjs/reflect/guard.d.ts new file mode 100644 index 0000000..c53aeb2 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/reflect/guard.d.ts @@ -0,0 +1,20 @@ +import type { Message } from "../types.js"; +import type { ScalarValue } from "./scalar.js"; +import type { ReflectList, ReflectMap, ReflectMessage } from "./reflect-types.js"; +import type { DescField, DescMessage } from "../descriptors.js"; +export declare function isObject(arg: unknown): arg is Record; +export declare function isOneofADT(arg: unknown): arg is OneofADT; +export type OneofADT = { + case: undefined; + value?: undefined; +} | { + case: string; + value: Message | ScalarValue; +}; +export declare function isReflectList(arg: unknown, field?: DescField & { + fieldKind: "list"; +}): arg is ReflectList; +export declare function isReflectMap(arg: unknown, field?: DescField & { + fieldKind: "map"; +}): arg is ReflectMap; +export declare function isReflectMessage(arg: unknown, messageDesc?: DescMessage): arg is ReflectMessage; diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/reflect/guard.js b/node_modules/@bufbuild/protobuf/dist/cjs/reflect/guard.js new file mode 100644 index 0000000..c601704 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/reflect/guard.js @@ -0,0 +1,78 @@ +"use strict"; +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isObject = isObject; +exports.isOneofADT = isOneofADT; +exports.isReflectList = isReflectList; +exports.isReflectMap = isReflectMap; +exports.isReflectMessage = isReflectMessage; +const unsafe_js_1 = require("./unsafe.js"); +function isObject(arg) { + return arg !== null && typeof arg == "object" && !Array.isArray(arg); +} +function isOneofADT(arg) { + return (arg !== null && + typeof arg == "object" && + "case" in arg && + ((typeof arg.case == "string" && "value" in arg && arg.value != null) || + (arg.case === undefined && + (!("value" in arg) || arg.value === undefined)))); +} +function isReflectList(arg, field) { + var _a, _b, _c, _d; + if (isObject(arg) && + unsafe_js_1.unsafeLocal in arg && + "add" in arg && + "field" in arg && + typeof arg.field == "function") { + if (field !== undefined) { + const a = field; + const b = arg.field(); + return (a.listKind == b.listKind && + a.scalar === b.scalar && + ((_a = a.message) === null || _a === void 0 ? void 0 : _a.typeName) === ((_b = b.message) === null || _b === void 0 ? void 0 : _b.typeName) && + ((_c = a.enum) === null || _c === void 0 ? void 0 : _c.typeName) === ((_d = b.enum) === null || _d === void 0 ? void 0 : _d.typeName)); + } + return true; + } + return false; +} +function isReflectMap(arg, field) { + var _a, _b, _c, _d; + if (isObject(arg) && + unsafe_js_1.unsafeLocal in arg && + "has" in arg && + "field" in arg && + typeof arg.field == "function") { + if (field !== undefined) { + const a = field, b = arg.field(); + return (a.mapKey === b.mapKey && + a.mapKind == b.mapKind && + a.scalar === b.scalar && + ((_a = a.message) === null || _a === void 0 ? void 0 : _a.typeName) === ((_b = b.message) === null || _b === void 0 ? void 0 : _b.typeName) && + ((_c = a.enum) === null || _c === void 0 ? void 0 : _c.typeName) === ((_d = b.enum) === null || _d === void 0 ? void 0 : _d.typeName)); + } + return true; + } + return false; +} +function isReflectMessage(arg, messageDesc) { + return (isObject(arg) && + unsafe_js_1.unsafeLocal in arg && + "desc" in arg && + isObject(arg.desc) && + arg.desc.kind === "message" && + (messageDesc === undefined || arg.desc.typeName == messageDesc.typeName)); +} diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/reflect/index.d.ts b/node_modules/@bufbuild/protobuf/dist/cjs/reflect/index.d.ts new file mode 100644 index 0000000..97a7130 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/reflect/index.d.ts @@ -0,0 +1,8 @@ +export * from "./error.js"; +export * from "./names.js"; +export * from "./nested-types.js"; +export * from "./reflect.js"; +export * from "./reflect-types.js"; +export * from "./scalar.js"; +export * from "./path.js"; +export { isReflectList, isReflectMap, isReflectMessage } from "./guard.js"; diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/reflect/index.js b/node_modules/@bufbuild/protobuf/dist/cjs/reflect/index.js new file mode 100644 index 0000000..3108140 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/reflect/index.js @@ -0,0 +1,41 @@ +"use strict"; +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isReflectMessage = exports.isReflectMap = exports.isReflectList = void 0; +__exportStar(require("./error.js"), exports); +__exportStar(require("./names.js"), exports); +__exportStar(require("./nested-types.js"), exports); +__exportStar(require("./reflect.js"), exports); +__exportStar(require("./reflect-types.js"), exports); +__exportStar(require("./scalar.js"), exports); +__exportStar(require("./path.js"), exports); +var guard_js_1 = require("./guard.js"); +Object.defineProperty(exports, "isReflectList", { enumerable: true, get: function () { return guard_js_1.isReflectList; } }); +Object.defineProperty(exports, "isReflectMap", { enumerable: true, get: function () { return guard_js_1.isReflectMap; } }); +Object.defineProperty(exports, "isReflectMessage", { enumerable: true, get: function () { return guard_js_1.isReflectMessage; } }); diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/reflect/names.d.ts b/node_modules/@bufbuild/protobuf/dist/cjs/reflect/names.d.ts new file mode 100644 index 0000000..79810d3 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/reflect/names.d.ts @@ -0,0 +1,30 @@ +import type { AnyDesc } from "../descriptors.js"; +/** + * Return a fully-qualified name for a Protobuf descriptor. + * For a file descriptor, return the original file path. + * + * See https://protobuf.com/docs/language-spec#fully-qualified-names + */ +export declare function qualifiedName(desc: AnyDesc): string; +/** + * Converts snake_case to protoCamelCase according to the convention + * used by protoc to convert a field name to a JSON name. + * + * See https://protobuf.com/docs/language-spec#default-json-names + * + * The function protoSnakeCase provides the reverse. + */ +export declare function protoCamelCase(snakeCase: string): string; +/** + * Converts protoCamelCase to snake_case. + * + * This function is the reverse of function protoCamelCase. Note that some names + * are not reversible - for example, "foo__bar" -> "fooBar" -> "foo_bar". + */ +export declare function protoSnakeCase(lowerCamelCase: string): string; +/** + * Escapes names that are reserved for ECMAScript built-in object properties. + * + * Also see safeIdentifier() from @bufbuild/protoplugin. + */ +export declare function safeObjectProperty(name: string): string; diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/reflect/names.js b/node_modules/@bufbuild/protobuf/dist/cjs/reflect/names.js new file mode 100644 index 0000000..f9af937 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/reflect/names.js @@ -0,0 +1,115 @@ +"use strict"; +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.qualifiedName = qualifiedName; +exports.protoCamelCase = protoCamelCase; +exports.protoSnakeCase = protoSnakeCase; +exports.safeObjectProperty = safeObjectProperty; +/** + * Return a fully-qualified name for a Protobuf descriptor. + * For a file descriptor, return the original file path. + * + * See https://protobuf.com/docs/language-spec#fully-qualified-names + */ +function qualifiedName(desc) { + switch (desc.kind) { + case "field": + case "oneof": + case "rpc": + return desc.parent.typeName + "." + desc.name; + case "enum_value": { + const p = desc.parent.parent + ? desc.parent.parent.typeName + : desc.parent.file.proto.package; + return p + (p.length > 0 ? "." : "") + desc.name; + } + case "service": + case "message": + case "enum": + case "extension": + return desc.typeName; + case "file": + return desc.proto.name; + } +} +/** + * Converts snake_case to protoCamelCase according to the convention + * used by protoc to convert a field name to a JSON name. + * + * See https://protobuf.com/docs/language-spec#default-json-names + * + * The function protoSnakeCase provides the reverse. + */ +function protoCamelCase(snakeCase) { + let capNext = false; + const b = []; + for (let i = 0; i < snakeCase.length; i++) { + let c = snakeCase.charAt(i); + switch (c) { + case "_": + capNext = true; + break; + case "0": + case "1": + case "2": + case "3": + case "4": + case "5": + case "6": + case "7": + case "8": + case "9": + b.push(c); + capNext = false; + break; + default: + if (capNext) { + capNext = false; + c = c.toUpperCase(); + } + b.push(c); + break; + } + } + return b.join(""); +} +/** + * Converts protoCamelCase to snake_case. + * + * This function is the reverse of function protoCamelCase. Note that some names + * are not reversible - for example, "foo__bar" -> "fooBar" -> "foo_bar". + */ +function protoSnakeCase(lowerCamelCase) { + return lowerCamelCase.replace(/[A-Z]/g, (letter) => "_" + letter.toLowerCase()); +} +/** + * Names that cannot be used for object properties because they are reserved + * by built-in JavaScript properties. + */ +const reservedObjectProperties = new Set([ + // names reserved by JavaScript + "constructor", + "toString", + "toJSON", + "valueOf", +]); +/** + * Escapes names that are reserved for ECMAScript built-in object properties. + * + * Also see safeIdentifier() from @bufbuild/protoplugin. + */ +function safeObjectProperty(name) { + return reservedObjectProperties.has(name) ? name + "$" : name; +} diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/reflect/nested-types.d.ts b/node_modules/@bufbuild/protobuf/dist/cjs/reflect/nested-types.d.ts new file mode 100644 index 0000000..3817501 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/reflect/nested-types.d.ts @@ -0,0 +1,35 @@ +import type { AnyDesc, DescEnum, DescExtension, DescFile, DescMessage, DescService } from "../descriptors.js"; +/** + * Iterate over all types - enumerations, extensions, services, messages - + * and enumerations, extensions and messages nested in messages. + */ +export declare function nestedTypes(desc: DescFile | DescMessage): Iterable; +/** + * Iterate over types referenced by fields of the given message. + * + * For example: + * + * ```proto + * syntax="proto3"; + * + * message Example { + * Msg singular = 1; + * repeated Level list = 2; + * } + * + * message Msg {} + * + * enum Level { + * LEVEL_UNSPECIFIED = 0; + * } + * ``` + * + * The message Example references the message Msg, and the enum Level. + */ +export declare function usedTypes(descMessage: DescMessage): Iterable; +/** + * Returns the ancestors of a given Protobuf element, up to the file. + */ +export declare function parentTypes(desc: AnyDesc): Parent[]; +type Parent = DescFile | DescEnum | DescMessage | DescService; +export {}; diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/reflect/nested-types.js b/node_modules/@bufbuild/protobuf/dist/cjs/reflect/nested-types.js new file mode 100644 index 0000000..2a8c9f6 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/reflect/nested-types.js @@ -0,0 +1,110 @@ +"use strict"; +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.nestedTypes = nestedTypes; +exports.usedTypes = usedTypes; +exports.parentTypes = parentTypes; +/** + * Iterate over all types - enumerations, extensions, services, messages - + * and enumerations, extensions and messages nested in messages. + */ +function* nestedTypes(desc) { + switch (desc.kind) { + case "file": + for (const message of desc.messages) { + yield message; + yield* nestedTypes(message); + } + yield* desc.enums; + yield* desc.services; + yield* desc.extensions; + break; + case "message": + for (const message of desc.nestedMessages) { + yield message; + yield* nestedTypes(message); + } + yield* desc.nestedEnums; + yield* desc.nestedExtensions; + break; + } +} +/** + * Iterate over types referenced by fields of the given message. + * + * For example: + * + * ```proto + * syntax="proto3"; + * + * message Example { + * Msg singular = 1; + * repeated Level list = 2; + * } + * + * message Msg {} + * + * enum Level { + * LEVEL_UNSPECIFIED = 0; + * } + * ``` + * + * The message Example references the message Msg, and the enum Level. + */ +function usedTypes(descMessage) { + return usedTypesInternal(descMessage, new Set()); +} +function* usedTypesInternal(descMessage, seen) { + var _a, _b; + for (const field of descMessage.fields) { + const ref = (_b = (_a = field.enum) !== null && _a !== void 0 ? _a : field.message) !== null && _b !== void 0 ? _b : undefined; + if (!ref || seen.has(ref.typeName)) { + continue; + } + seen.add(ref.typeName); + yield ref; + if (ref.kind == "message") { + yield* usedTypesInternal(ref, seen); + } + } +} +/** + * Returns the ancestors of a given Protobuf element, up to the file. + */ +function parentTypes(desc) { + const parents = []; + while (desc.kind !== "file") { + const p = parent(desc); + desc = p; + parents.push(p); + } + return parents; +} +function parent(desc) { + var _a; + switch (desc.kind) { + case "enum_value": + case "field": + case "oneof": + case "rpc": + return desc.parent; + case "service": + return desc.file; + case "extension": + case "enum": + case "message": + return (_a = desc.parent) !== null && _a !== void 0 ? _a : desc.file; + } +} diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/reflect/path.d.ts b/node_modules/@bufbuild/protobuf/dist/cjs/reflect/path.d.ts new file mode 100644 index 0000000..9aa5db2 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/reflect/path.d.ts @@ -0,0 +1,107 @@ +import { type DescExtension, type DescField, type DescMessage, type DescOneof } from "../descriptors.js"; +import type { Registry } from "../registry.js"; +/** + * A path to a (nested) member of a Protobuf message, such as a field, oneof, + * extension, list element, or map entry. + * + * Note that we may add additional types to this union in the future to support + * more use cases. + */ +export type Path = (DescField | DescExtension | DescOneof | { + kind: "list_sub"; + index: number; +} | { + kind: "map_sub"; + key: string | number | bigint | boolean; +})[]; +/** + * Builds a Path. + */ +export type PathBuilder = { + /** + * The root message of the path. + */ + readonly schema: DescMessage; + /** + * Add field access. + * + * Throws an InvalidPathError if the field cannot be added to the path. + */ + field(field: DescField): PathBuilder; + /** + * Access a oneof. + * + * Throws an InvalidPathError if the oneof cannot be added to the path. + * + */ + oneof(oneof: DescOneof): PathBuilder; + /** + * Access an extension. + * + * Throws an InvalidPathError if the extension cannot be added to the path. + */ + extension(extension: DescExtension): PathBuilder; + /** + * Access a list field by index. + * + * Throws an InvalidPathError if the list access cannot be added to the path. + */ + list(index: number): PathBuilder; + /** + * Access a map field by key. + * + * Throws an InvalidPathError if the map access cannot be added to the path. + */ + map(key: string | number | bigint | boolean): PathBuilder; + /** + * Append a path. + * + * Throws an InvalidPathError if the path cannot be added. + */ + add(path: Path | PathBuilder): PathBuilder; + /** + * Return the path. + */ + toPath(): Path; + /** + * Create a copy of this builder. + */ + clone(): PathBuilder; + /** + * Get the current container - a list, map, or message. + */ + getLeft(): DescMessage | (DescField & { + fieldKind: "list"; + }) | (DescField & { + fieldKind: "map"; + }) | undefined; +}; +/** + * Create a PathBuilder. + */ +export declare function buildPath(schema: DescMessage): PathBuilder; +/** + * Parse a Path from a string. + * + * Throws an InvalidPathError if the path is invalid. + * + * Note that a Registry must be provided via the options argument to parse + * paths that refer to an extension. + */ +export declare function parsePath(schema: DescMessage, path: string, options?: { + registry?: Registry | undefined; +}): Path; +/** + * Stringify a path. + */ +export declare function pathToString(path: Path): string; +/** + * InvalidPathError is thrown for invalid Paths, for example during parsing from + * a string, or when a new Path is built. + */ +export declare class InvalidPathError extends Error { + name: string; + readonly schema: DescMessage; + readonly path: Path | string; + constructor(schema: DescMessage, message: string, path: string | Path); +} diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/reflect/path.js b/node_modules/@bufbuild/protobuf/dist/cjs/reflect/path.js new file mode 100644 index 0000000..db610ab --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/reflect/path.js @@ -0,0 +1,376 @@ +"use strict"; +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.InvalidPathError = void 0; +exports.buildPath = buildPath; +exports.parsePath = parsePath; +exports.pathToString = pathToString; +const descriptors_js_1 = require("../descriptors.js"); +/** + * Create a PathBuilder. + */ +function buildPath(schema) { + return new PathBuilderImpl(schema, schema, []); +} +/** + * Parse a Path from a string. + * + * Throws an InvalidPathError if the path is invalid. + * + * Note that a Registry must be provided via the options argument to parse + * paths that refer to an extension. + */ +function parsePath(schema, path, options) { + var _a, _b; + const builder = new PathBuilderImpl(schema, schema, []); + const err = (message, i) => new InvalidPathError(schema, message + " at column " + (i + 1), path); + for (let i = 0; i < path.length;) { + const token = nextToken(i, path); + const left = builder.getLeft(); + let right = undefined; + if ("field" in token) { + right = + (left === null || left === void 0 ? void 0 : left.kind) != "message" + ? undefined + : ((_a = left.fields.find((field) => field.name === token.field)) !== null && _a !== void 0 ? _a : left.oneofs.find((oneof) => oneof.name === token.field)); + if (!right) { + throw err(`Unknown field "${token.field}"`, i); + } + } + else if ("ext" in token) { + right = (_b = options === null || options === void 0 ? void 0 : options.registry) === null || _b === void 0 ? void 0 : _b.getExtension(token.ext); + if (!right) { + throw err(`Unknown extension "${token.ext}"`, i); + } + } + else if ("val" in token) { + // list or map + right = + (left === null || left === void 0 ? void 0 : left.kind) == "field" && + left.fieldKind == "list" && + typeof token.val == "bigint" + ? { kind: "list_sub", index: Number(token.val) } + : { kind: "map_sub", key: token.val }; + } + else if ("err" in token) { + throw err(token.err, token.i); + } + if (right) { + try { + builder.add([right]); + } + catch (e) { + throw err(e instanceof InvalidPathError ? e.message : String(e), i); + } + } + i = token.i; + } + return builder.toPath(); +} +/** + * Stringify a path. + */ +function pathToString(path) { + const str = []; + for (const ele of path) { + switch (ele.kind) { + case "field": + case "oneof": + if (str.length > 0) { + str.push("."); + } + str.push(ele.name); + break; + case "extension": + str.push("[", ele.typeName, "]"); + break; + case "list_sub": + str.push("[", ele.index, "]"); + break; + case "map_sub": + if (typeof ele.key == "string") { + str.push('["', ele.key + .split("\\") + .join("\\\\") + .split('"') + .join('\\"') + .split("\r") + .join("\\r") + .split("\n") + .join("\\n"), '"]'); + } + else { + str.push("[", ele.key, "]"); + } + break; + } + } + return str.join(""); +} +/** + * InvalidPathError is thrown for invalid Paths, for example during parsing from + * a string, or when a new Path is built. + */ +class InvalidPathError extends Error { + constructor(schema, message, path) { + super(message); + this.name = "InvalidPathError"; + this.schema = schema; + this.path = path; + // see https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-2.html#example + Object.setPrototypeOf(this, new.target.prototype); + } +} +exports.InvalidPathError = InvalidPathError; +class PathBuilderImpl { + constructor(schema, left, path) { + this.schema = schema; + this.left = left; + this.path = path; + } + getLeft() { + return this.left; + } + field(field) { + return this.push(field); + } + oneof(oneof) { + return this.push(oneof); + } + extension(extension) { + return this.push(extension); + } + list(index) { + return this.push({ kind: "list_sub", index }); + } + map(key) { + return this.push({ kind: "map_sub", key }); + } + add(pathOrBuilder) { + const path = Array.isArray(pathOrBuilder) + ? pathOrBuilder + : pathOrBuilder.toPath(); + const l = this.path.length; + try { + for (const ele of path) { + this.push(ele); + } + } + catch (e) { + // undo pushes + this.path.splice(l); + throw e; + } + return this; + } + toPath() { + return this.path.concat(); + } + clone() { + return new PathBuilderImpl(this.schema, this.left, this.path.concat()); + } + push(ele) { + switch (ele.kind) { + case "field": + if (!this.left || + this.left.kind != "message" || + this.left.typeName != ele.parent.typeName) { + throw this.err("field access"); + } + this.path.push(ele); + this.left = + ele.fieldKind == "message" + ? ele.message + : ele.fieldKind == "list" || ele.fieldKind == "map" + ? ele + : undefined; + return this; + case "oneof": + if (!this.left || + this.left.kind != "message" || + this.left.typeName != ele.parent.typeName) { + throw this.err("oneof access"); + } + this.path.push(ele); + this.left = undefined; + return this; + case "extension": + if (!this.left || + this.left.kind != "message" || + this.left.typeName != ele.extendee.typeName) { + throw this.err("extension access"); + } + this.path.push(ele); + this.left = ele.fieldKind == "message" ? ele.message : undefined; + return this; + case "list_sub": + if (!this.left || + this.left.kind != "field" || + this.left.fieldKind != "list") { + throw this.err("list access"); + } + if (ele.index < 0 || !Number.isInteger(ele.index)) { + throw this.err("list index"); + } + this.path.push(ele); + this.left = + this.left.listKind == "message" ? this.left.message : undefined; + return this; + case "map_sub": + if (!this.left || + this.left.kind != "field" || + this.left.fieldKind != "map") { + throw this.err("map access"); + } + if (!checkKeyType(ele.key, this.left.mapKey)) { + throw this.err("map key"); + } + this.path.push(ele); + this.left = + this.left.mapKind == "message" ? this.left.message : undefined; + return this; + } + } + err(what) { + return new InvalidPathError(this.schema, "Invalid " + what, this.path); + } +} +function checkKeyType(key, type) { + switch (type) { + case descriptors_js_1.ScalarType.STRING: + return typeof key == "string"; + case descriptors_js_1.ScalarType.INT32: + case descriptors_js_1.ScalarType.UINT32: + case descriptors_js_1.ScalarType.SINT32: + case descriptors_js_1.ScalarType.SFIXED32: + case descriptors_js_1.ScalarType.FIXED32: + return typeof key == "number"; + case descriptors_js_1.ScalarType.UINT64: + case descriptors_js_1.ScalarType.INT64: + case descriptors_js_1.ScalarType.FIXED64: + case descriptors_js_1.ScalarType.SFIXED64: + case descriptors_js_1.ScalarType.SINT64: + return typeof key == "bigint"; + case descriptors_js_1.ScalarType.BOOL: + return typeof key == "boolean"; + } +} +function nextToken(i, path) { + const re_extension = /^[A-Za-z_][A-Za-z_0-9]*(?:\.[A-Za-z_][A-Za-z_0-9]*)*$/; + const re_field = /^[A-Za-z_][A-Za-z_0-9]*$/; + if (path[i] == "[") { + i++; + while (path[i] == " ") { + // skip leading whitespace + i++; + } + if (i >= path.length) { + return { err: "Premature end", i: path.length - 1 }; + } + let token; + if (path[i] == `"`) { + // string literal + i++; + let val = ""; + for (;;) { + if (path[i] == `"`) { + // end of string literal + i++; + break; + } + if (path[i] == "\\") { + switch (path[i + 1]) { + case `"`: + case "\\": + val += path[i + 1]; + break; + case "r": + val += "\r"; + break; + case "n": + val += "\n"; + break; + default: + return { err: "Invalid escape sequence", i }; + } + i++; + } + else { + val += path[i]; + } + if (i >= path.length) { + return { err: "Premature end of string", i: path.length - 1 }; + } + i++; + } + token = { val }; + } + else if (path[i].match(/\d/)) { + // integer literal + const start = i; + while (i < path.length && /\d/.test(path[i])) { + i++; + } + token = { val: BigInt(path.substring(start, i)) }; + } + else if (path[i] == "]") { + return { err: "Premature ]", i }; + } + else { + // extension identifier or bool literal + const start = i; + while (i < path.length && path[i] != " " && path[i] != "]") { + i++; + } + const name = path.substring(start, i); + if (name === "true") { + token = { val: true }; + } + else if (name === "false") { + token = { val: false }; + } + else if (re_extension.test(name)) { + token = { ext: name }; + } + else { + return { err: "Invalid ident", i: start }; + } + } + while (path[i] == " ") { + // skip trailing whitespace + i++; + } + if (path[i] != "]") { + return { err: "Missing ]", i }; + } + i++; + return Object.assign(Object.assign({}, token), { i }); + } + // field identifier + if (i > 0) { + if (path[i] != ".") { + return { err: `Expected "."`, i }; + } + i++; + } + const start = i; + while (i < path.length && path[i] != "." && path[i] != "[") { + i++; + } + const field = path.substring(start, i); + return re_field.test(field) + ? { field, i } + : { err: "Invalid ident", i: start }; +} diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/reflect/reflect-check.d.ts b/node_modules/@bufbuild/protobuf/dist/cjs/reflect/reflect-check.d.ts new file mode 100644 index 0000000..63f27b9 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/reflect/reflect-check.d.ts @@ -0,0 +1,19 @@ +import { type DescField } from "../descriptors.js"; +import { FieldError } from "./error.js"; +/** + * Check whether the given field value is valid for the reflect API. + */ +export declare function checkField(field: DescField, value: unknown): FieldError | undefined; +/** + * Check whether the given list item is valid for the reflect API. + */ +export declare function checkListItem(field: DescField & { + fieldKind: "list"; +}, index: number, value: unknown): FieldError | undefined; +/** + * Check whether the given map key and value are valid for the reflect API. + */ +export declare function checkMapEntry(field: DescField & { + fieldKind: "map"; +}, key: unknown, value: unknown): FieldError | undefined; +export declare function formatVal(val: unknown): string; diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/reflect/reflect-check.js b/node_modules/@bufbuild/protobuf/dist/cjs/reflect/reflect-check.js new file mode 100644 index 0000000..33fde2c --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/reflect/reflect-check.js @@ -0,0 +1,266 @@ +"use strict"; +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.checkField = checkField; +exports.checkListItem = checkListItem; +exports.checkMapEntry = checkMapEntry; +exports.formatVal = formatVal; +const descriptors_js_1 = require("../descriptors.js"); +const is_message_js_1 = require("../is-message.js"); +const error_js_1 = require("./error.js"); +const guard_js_1 = require("./guard.js"); +const binary_encoding_js_1 = require("../wire/binary-encoding.js"); +const text_encoding_js_1 = require("../wire/text-encoding.js"); +const proto_int64_js_1 = require("../proto-int64.js"); +/** + * Check whether the given field value is valid for the reflect API. + */ +function checkField(field, value) { + const check = field.fieldKind == "list" + ? (0, guard_js_1.isReflectList)(value, field) + : field.fieldKind == "map" + ? (0, guard_js_1.isReflectMap)(value, field) + : checkSingular(field, value); + if (check === true) { + return undefined; + } + let reason; + switch (field.fieldKind) { + case "list": + reason = `expected ${formatReflectList(field)}, got ${formatVal(value)}`; + break; + case "map": + reason = `expected ${formatReflectMap(field)}, got ${formatVal(value)}`; + break; + default: { + reason = reasonSingular(field, value, check); + } + } + return new error_js_1.FieldError(field, reason); +} +/** + * Check whether the given list item is valid for the reflect API. + */ +function checkListItem(field, index, value) { + const check = checkSingular(field, value); + if (check !== true) { + return new error_js_1.FieldError(field, `list item #${index + 1}: ${reasonSingular(field, value, check)}`); + } + return undefined; +} +/** + * Check whether the given map key and value are valid for the reflect API. + */ +function checkMapEntry(field, key, value) { + const checkKey = checkScalarValue(key, field.mapKey); + if (checkKey !== true) { + return new error_js_1.FieldError(field, `invalid map key: ${reasonSingular({ scalar: field.mapKey }, key, checkKey)}`); + } + const checkVal = checkSingular(field, value); + if (checkVal !== true) { + return new error_js_1.FieldError(field, `map entry ${formatVal(key)}: ${reasonSingular(field, value, checkVal)}`); + } + return undefined; +} +function checkSingular(field, value) { + if (field.scalar !== undefined) { + return checkScalarValue(value, field.scalar); + } + if (field.enum !== undefined) { + if (field.enum.open) { + return Number.isInteger(value); + } + return field.enum.values.some((v) => v.number === value); + } + return (0, guard_js_1.isReflectMessage)(value, field.message); +} +function checkScalarValue(value, scalar) { + switch (scalar) { + case descriptors_js_1.ScalarType.DOUBLE: + return typeof value == "number"; + case descriptors_js_1.ScalarType.FLOAT: + if (typeof value != "number") { + return false; + } + if (Number.isNaN(value) || !Number.isFinite(value)) { + return true; + } + if (value > binary_encoding_js_1.FLOAT32_MAX || value < binary_encoding_js_1.FLOAT32_MIN) { + return `${value.toFixed()} out of range`; + } + return true; + case descriptors_js_1.ScalarType.INT32: + case descriptors_js_1.ScalarType.SFIXED32: + case descriptors_js_1.ScalarType.SINT32: + // signed + if (typeof value !== "number" || !Number.isInteger(value)) { + return false; + } + if (value > binary_encoding_js_1.INT32_MAX || value < binary_encoding_js_1.INT32_MIN) { + return `${value.toFixed()} out of range`; + } + return true; + case descriptors_js_1.ScalarType.FIXED32: + case descriptors_js_1.ScalarType.UINT32: + // unsigned + if (typeof value !== "number" || !Number.isInteger(value)) { + return false; + } + if (value > binary_encoding_js_1.UINT32_MAX || value < 0) { + return `${value.toFixed()} out of range`; + } + return true; + case descriptors_js_1.ScalarType.BOOL: + return typeof value == "boolean"; + case descriptors_js_1.ScalarType.STRING: + if (typeof value != "string") { + return false; + } + return (0, text_encoding_js_1.getTextEncoding)().checkUtf8(value) || "invalid UTF8"; + case descriptors_js_1.ScalarType.BYTES: + return value instanceof Uint8Array; + case descriptors_js_1.ScalarType.INT64: + case descriptors_js_1.ScalarType.SFIXED64: + case descriptors_js_1.ScalarType.SINT64: + // signed + if (typeof value == "bigint" || + typeof value == "number" || + (typeof value == "string" && value.length > 0)) { + try { + proto_int64_js_1.protoInt64.parse(value); + return true; + } + catch (_) { + return `${value} out of range`; + } + } + return false; + case descriptors_js_1.ScalarType.FIXED64: + case descriptors_js_1.ScalarType.UINT64: + // unsigned + if (typeof value == "bigint" || + typeof value == "number" || + (typeof value == "string" && value.length > 0)) { + try { + proto_int64_js_1.protoInt64.uParse(value); + return true; + } + catch (_) { + return `${value} out of range`; + } + } + return false; + } +} +function reasonSingular(field, val, details) { + details = + typeof details == "string" ? `: ${details}` : `, got ${formatVal(val)}`; + if (field.scalar !== undefined) { + return `expected ${scalarTypeDescription(field.scalar)}` + details; + } + if (field.enum !== undefined) { + return `expected ${field.enum.toString()}` + details; + } + return `expected ${formatReflectMessage(field.message)}` + details; +} +function formatVal(val) { + switch (typeof val) { + case "object": + if (val === null) { + return "null"; + } + if (val instanceof Uint8Array) { + return `Uint8Array(${val.length})`; + } + if (Array.isArray(val)) { + return `Array(${val.length})`; + } + if ((0, guard_js_1.isReflectList)(val)) { + return formatReflectList(val.field()); + } + if ((0, guard_js_1.isReflectMap)(val)) { + return formatReflectMap(val.field()); + } + if ((0, guard_js_1.isReflectMessage)(val)) { + return formatReflectMessage(val.desc); + } + if ((0, is_message_js_1.isMessage)(val)) { + return `message ${val.$typeName}`; + } + return "object"; + case "string": + return val.length > 30 ? "string" : `"${val.split('"').join('\\"')}"`; + case "boolean": + return String(val); + case "number": + return String(val); + case "bigint": + return String(val) + "n"; + default: + // "symbol" | "undefined" | "object" | "function" + return typeof val; + } +} +function formatReflectMessage(desc) { + return `ReflectMessage (${desc.typeName})`; +} +function formatReflectList(field) { + switch (field.listKind) { + case "message": + return `ReflectList (${field.message.toString()})`; + case "enum": + return `ReflectList (${field.enum.toString()})`; + case "scalar": + return `ReflectList (${descriptors_js_1.ScalarType[field.scalar]})`; + } +} +function formatReflectMap(field) { + switch (field.mapKind) { + case "message": + return `ReflectMap (${descriptors_js_1.ScalarType[field.mapKey]}, ${field.message.toString()})`; + case "enum": + return `ReflectMap (${descriptors_js_1.ScalarType[field.mapKey]}, ${field.enum.toString()})`; + case "scalar": + return `ReflectMap (${descriptors_js_1.ScalarType[field.mapKey]}, ${descriptors_js_1.ScalarType[field.scalar]})`; + } +} +function scalarTypeDescription(scalar) { + switch (scalar) { + case descriptors_js_1.ScalarType.STRING: + return "string"; + case descriptors_js_1.ScalarType.BOOL: + return "boolean"; + case descriptors_js_1.ScalarType.INT64: + case descriptors_js_1.ScalarType.SINT64: + case descriptors_js_1.ScalarType.SFIXED64: + return "bigint (int64)"; + case descriptors_js_1.ScalarType.UINT64: + case descriptors_js_1.ScalarType.FIXED64: + return "bigint (uint64)"; + case descriptors_js_1.ScalarType.BYTES: + return "Uint8Array"; + case descriptors_js_1.ScalarType.DOUBLE: + return "number (float64)"; + case descriptors_js_1.ScalarType.FLOAT: + return "number (float32)"; + case descriptors_js_1.ScalarType.FIXED32: + case descriptors_js_1.ScalarType.UINT32: + return "number (uint32)"; + case descriptors_js_1.ScalarType.INT32: + case descriptors_js_1.ScalarType.SFIXED32: + case descriptors_js_1.ScalarType.SINT32: + return "number (int32)"; + } +} diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/reflect/reflect-types.d.ts b/node_modules/@bufbuild/protobuf/dist/cjs/reflect/reflect-types.d.ts new file mode 100644 index 0000000..f300dd9 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/reflect/reflect-types.d.ts @@ -0,0 +1,217 @@ +import type { DescField, DescMessage, DescOneof } from "../descriptors.js"; +import { unsafeLocal } from "./unsafe.js"; +import type { Message, UnknownField } from "../types.js"; +import type { ScalarValue } from "./scalar.js"; +/** + * ReflectMessage provides dynamic access and manipulation of a message. + */ +export interface ReflectMessage { + /** + * The underlying message instance. + */ + readonly message: Message; + /** + * The descriptor for the message. + */ + readonly desc: DescMessage; + /** + * The fields of the message. This is a shortcut to message.fields. + */ + readonly fields: readonly DescField[]; + /** + * The fields of the message, sorted by field number ascending. + */ + readonly sortedFields: readonly DescField[]; + /** + * Oneof groups of the message. This is a shortcut to message.oneofs. + */ + readonly oneofs: readonly DescOneof[]; + /** + * Fields and oneof groups for this message. This is a shortcut to message.members. + */ + readonly members: readonly (DescField | DescOneof)[]; + /** + * Find a field by number. + */ + findNumber(number: number): DescField | undefined; + /** + * Returns true if the field is set. + * + * - Scalar and enum fields with implicit presence (proto3): + * Set if not a zero value. + * + * - Scalar and enum fields with explicit presence (proto2, oneof): + * Set if a value was set when creating or parsing the message, or when a + * value was assigned to the field's property. + * + * - Message fields: + * Set if the property is not undefined. + * + * - List and map fields: + * Set if not empty. + */ + isSet(field: DescField): boolean; + /** + * Resets the field, so that isSet() will return false. + */ + clear(field: DescField): void; + /** + * Return the selected field of a oneof group. + */ + oneofCase(oneof: DescOneof): DescField | undefined; + /** + * Returns the field value. Values are converted or wrapped to make it easier + * to manipulate messages. + * + * - Scalar fields: + * Returns the value, but converts 64-bit integer fields with the option + * `jstype=JS_STRING` to a bigint value. + * If the field is not set, the default value is returned. If no default + * value is set, the zero value is returned. + * + * - Enum fields: + * Returns the numeric value. If the field is not set, the default value is + * returned. If no default value is set, the zero value is returned. + * + * - Message fields: + * Returns a ReflectMessage. If the field is not set, a new message is + * returned, but not set on the field. + * + * - List fields: + * Returns a ReflectList object. + * + * - Map fields: + * Returns a ReflectMap object. + * + * Note that get() never returns `undefined`. To determine whether a field is + * set, use isSet(). + */ + get(field: Field): ReflectMessageGet; + /** + * Set a field value. + * + * Expects values in the same form that get() returns: + * + * - Scalar fields: + * 64-bit integer fields with the option `jstype=JS_STRING` as a bigint value. + * + * - Message fields: + * ReflectMessage. + * + * - List fields: + * ReflectList. + * + * - Map fields: + * ReflectMap. + * + * Throws an error if the value is invalid for the field. `undefined` is not + * a valid value. To reset a field, use clear(). + */ + set(field: Field, value: unknown): void; + /** + * Returns the unknown fields of the message. + */ + getUnknown(): UnknownField[] | undefined; + /** + * Sets the unknown fields of the message, overwriting any previous values. + */ + setUnknown(value: UnknownField[]): void; + [unsafeLocal]: Message; +} +/** + * ReflectList provides dynamic access and manipulation of a list field on a + * message. + * + * ReflectList is iterable - you can loop through all items with a for...of loop. + * + * Values are converted or wrapped to make it easier to manipulate them: + * - Scalar 64-bit integer fields with the option `jstype=JS_STRING` are + * converted to bigint. + * - Messages are wrapped in a ReflectMessage. + */ +export interface ReflectList extends Iterable { + /** + * Returns the list field. + */ + field(): DescField & { + fieldKind: "list"; + }; + /** + * The size of the list. + */ + readonly size: number; + /** + * Retrieves the item at the specified index, or undefined if the index + * is out of range. + */ + get(index: number): V | undefined; + /** + * Adds an item at the end of the list. + * Throws an error if an item is invalid for this list. + */ + add(item: V): void; + /** + * Replaces the item at the specified index with the specified item. + * Throws an error if the index is out of range (index < 0 || index >= size). + * Throws an error if the item is invalid for this list. + */ + set(index: number, item: V): void; + /** + * Removes all items from the list. + */ + clear(): void; + [Symbol.iterator](): IterableIterator; + entries(): IterableIterator<[number, V]>; + keys(): IterableIterator; + values(): IterableIterator; + [unsafeLocal]: unknown[]; +} +/** + * ReflectMap provides dynamic access and manipulation of a map field on a + * message. + * + * ReflectMap is iterable - you can loop through all entries with a for...of loop. + * + * Keys and values are converted or wrapped to make it easier to manipulate them: + * - A map field is a record object on a message, where keys are always strings. + * ReflectMap converts keys to their closest possible type in TypeScript. + * - Messages are wrapped in a ReflectMessage. + */ +export interface ReflectMap extends ReadonlyMap { + /** + * Returns the map field. + */ + field(): DescField & { + fieldKind: "map"; + }; + /** + * Removes the entry for the specified key. + * Returns false if the key is unknown. + */ + delete(key: K): boolean; + /** + * Sets or replaces the item at the specified key with the specified value. + * Throws an error if the key or value is invalid for this map. + */ + set(key: K, value: V): this; + /** + * Removes all entries from the map. + */ + clear(): void; + [unsafeLocal]: Record; +} +/** + * The return type of ReflectMessage.get() + */ +export type ReflectMessageGet = (Field extends { + fieldKind: "map"; +} ? ReflectMap : Field extends { + fieldKind: "list"; +} ? ReflectList : Field extends { + fieldKind: "enum"; +} ? number : Field extends { + fieldKind: "message"; +} ? ReflectMessage : Field extends { + fieldKind: "scalar"; + scalar: infer T; +} ? ScalarValue : never); diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/reflect/reflect-types.js b/node_modules/@bufbuild/protobuf/dist/cjs/reflect/reflect-types.js new file mode 100644 index 0000000..6b1a861 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/reflect/reflect-types.js @@ -0,0 +1,16 @@ +"use strict"; +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +Object.defineProperty(exports, "__esModule", { value: true }); +const unsafe_js_1 = require("./unsafe.js"); diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/reflect/reflect.d.ts b/node_modules/@bufbuild/protobuf/dist/cjs/reflect/reflect.d.ts new file mode 100644 index 0000000..3bfb1ad --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/reflect/reflect.d.ts @@ -0,0 +1,43 @@ +import { type DescField, type DescMessage } from "../descriptors.js"; +import type { MessageShape } from "../types.js"; +import type { ReflectList, ReflectMap, ReflectMessage } from "./reflect-types.js"; +/** + * Create a ReflectMessage. + */ +export declare function reflect(messageDesc: Desc, message?: MessageShape, +/** + * By default, field values are validated when setting them. For example, + * a value for an uint32 field must be a ECMAScript Number >= 0. + * + * When field values are trusted, performance can be improved by disabling + * checks. + */ +check?: boolean): ReflectMessage; +/** + * Create a ReflectList. + */ +export declare function reflectList(field: DescField & { + fieldKind: "list"; +}, unsafeInput?: unknown[], +/** + * By default, field values are validated when setting them. For example, + * a value for an uint32 field must be a ECMAScript Number >= 0. + * + * When field values are trusted, performance can be improved by disabling + * checks. + */ +check?: boolean): ReflectList; +/** + * Create a ReflectMap. + */ +export declare function reflectMap(field: DescField & { + fieldKind: "map"; +}, unsafeInput?: Record, +/** + * By default, field values are validated when setting them. For example, + * a value for an uint32 field must be a ECMAScript Number >= 0. + * + * When field values are trusted, performance can be improved by disabling + * checks. + */ +check?: boolean): ReflectMap; diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/reflect/reflect.js b/node_modules/@bufbuild/protobuf/dist/cjs/reflect/reflect.js new file mode 100644 index 0000000..3ee73b1 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/reflect/reflect.js @@ -0,0 +1,545 @@ +"use strict"; +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.reflect = reflect; +exports.reflectList = reflectList; +exports.reflectMap = reflectMap; +const descriptors_js_1 = require("../descriptors.js"); +const reflect_check_js_1 = require("./reflect-check.js"); +const error_js_1 = require("./error.js"); +const unsafe_js_1 = require("./unsafe.js"); +const create_js_1 = require("../create.js"); +const wrappers_js_1 = require("../wkt/wrappers.js"); +const scalar_js_1 = require("./scalar.js"); +const proto_int64_js_1 = require("../proto-int64.js"); +const guard_js_1 = require("./guard.js"); +/** + * Create a ReflectMessage. + */ +function reflect(messageDesc, message, +/** + * By default, field values are validated when setting them. For example, + * a value for an uint32 field must be a ECMAScript Number >= 0. + * + * When field values are trusted, performance can be improved by disabling + * checks. + */ +check = true) { + return new ReflectMessageImpl(messageDesc, message, check); +} +const messageSortedFields = new WeakMap(); +class ReflectMessageImpl { + get sortedFields() { + const cached = messageSortedFields.get(this.desc); + if (cached) { + return cached; + } + const sortedFields = this.desc.fields + .concat() + .sort((a, b) => a.number - b.number); + messageSortedFields.set(this.desc, sortedFields); + return sortedFields; + } + constructor(messageDesc, message, check = true) { + this.lists = new Map(); + this.maps = new Map(); + this.check = check; + this.desc = messageDesc; + this.message = this[unsafe_js_1.unsafeLocal] = message !== null && message !== void 0 ? message : (0, create_js_1.create)(messageDesc); + this.fields = messageDesc.fields; + this.oneofs = messageDesc.oneofs; + this.members = messageDesc.members; + } + findNumber(number) { + if (!this._fieldsByNumber) { + this._fieldsByNumber = new Map(this.desc.fields.map((f) => [f.number, f])); + } + return this._fieldsByNumber.get(number); + } + oneofCase(oneof) { + assertOwn(this.message, oneof); + return (0, unsafe_js_1.unsafeOneofCase)(this.message, oneof); + } + isSet(field) { + assertOwn(this.message, field); + return (0, unsafe_js_1.unsafeIsSet)(this.message, field); + } + clear(field) { + assertOwn(this.message, field); + (0, unsafe_js_1.unsafeClear)(this.message, field); + } + get(field) { + assertOwn(this.message, field); + const value = (0, unsafe_js_1.unsafeGet)(this.message, field); + switch (field.fieldKind) { + case "list": + // eslint-disable-next-line no-case-declarations + let list = this.lists.get(field); + if (!list || list[unsafe_js_1.unsafeLocal] !== value) { + this.lists.set(field, + // biome-ignore lint/suspicious/noAssignInExpressions: no + (list = new ReflectListImpl(field, value, this.check))); + } + return list; + case "map": + let map = this.maps.get(field); + if (!map || map[unsafe_js_1.unsafeLocal] !== value) { + this.maps.set(field, + // biome-ignore lint/suspicious/noAssignInExpressions: no + (map = new ReflectMapImpl(field, value, this.check))); + } + return map; + case "message": + return messageToReflect(field, value, this.check); + case "scalar": + return (value === undefined + ? (0, scalar_js_1.scalarZeroValue)(field.scalar, false) + : longToReflect(field, value)); + case "enum": + return (value !== null && value !== void 0 ? value : field.enum.values[0].number); + } + } + set(field, value) { + assertOwn(this.message, field); + if (this.check) { + const err = (0, reflect_check_js_1.checkField)(field, value); + if (err) { + throw err; + } + } + let local; + if (field.fieldKind == "message") { + local = messageToLocal(field, value); + } + else if ((0, guard_js_1.isReflectMap)(value) || (0, guard_js_1.isReflectList)(value)) { + local = value[unsafe_js_1.unsafeLocal]; + } + else { + local = longToLocal(field, value); + } + (0, unsafe_js_1.unsafeSet)(this.message, field, local); + } + getUnknown() { + return this.message.$unknown; + } + setUnknown(value) { + this.message.$unknown = value; + } +} +function assertOwn(owner, member) { + if (member.parent.typeName !== owner.$typeName) { + throw new error_js_1.FieldError(member, `cannot use ${member.toString()} with message ${owner.$typeName}`, "ForeignFieldError"); + } +} +/** + * Create a ReflectList. + */ +function reflectList(field, unsafeInput, +/** + * By default, field values are validated when setting them. For example, + * a value for an uint32 field must be a ECMAScript Number >= 0. + * + * When field values are trusted, performance can be improved by disabling + * checks. + */ +check = true) { + return new ReflectListImpl(field, unsafeInput !== null && unsafeInput !== void 0 ? unsafeInput : [], check); +} +class ReflectListImpl { + field() { + return this._field; + } + get size() { + return this._arr.length; + } + constructor(field, unsafeInput, check) { + this._field = field; + this._arr = this[unsafe_js_1.unsafeLocal] = unsafeInput; + this.check = check; + } + get(index) { + const item = this._arr[index]; + return item === undefined + ? undefined + : listItemToReflect(this._field, item, this.check); + } + set(index, item) { + if (index < 0 || index >= this._arr.length) { + throw new error_js_1.FieldError(this._field, `list item #${index + 1}: out of range`); + } + if (this.check) { + const err = (0, reflect_check_js_1.checkListItem)(this._field, index, item); + if (err) { + throw err; + } + } + this._arr[index] = listItemToLocal(this._field, item); + } + add(item) { + if (this.check) { + const err = (0, reflect_check_js_1.checkListItem)(this._field, this._arr.length, item); + if (err) { + throw err; + } + } + this._arr.push(listItemToLocal(this._field, item)); + return undefined; + } + clear() { + this._arr.splice(0, this._arr.length); + } + [Symbol.iterator]() { + return this.values(); + } + keys() { + return this._arr.keys(); + } + *values() { + for (const item of this._arr) { + yield listItemToReflect(this._field, item, this.check); + } + } + *entries() { + for (let i = 0; i < this._arr.length; i++) { + yield [i, listItemToReflect(this._field, this._arr[i], this.check)]; + } + } +} +/** + * Create a ReflectMap. + */ +function reflectMap(field, unsafeInput, +/** + * By default, field values are validated when setting them. For example, + * a value for an uint32 field must be a ECMAScript Number >= 0. + * + * When field values are trusted, performance can be improved by disabling + * checks. + */ +check = true) { + return new ReflectMapImpl(field, unsafeInput, check); +} +class ReflectMapImpl { + constructor(field, unsafeInput, check = true) { + this.obj = this[unsafe_js_1.unsafeLocal] = unsafeInput !== null && unsafeInput !== void 0 ? unsafeInput : {}; + this.check = check; + this._field = field; + } + field() { + return this._field; + } + set(key, value) { + if (this.check) { + const err = (0, reflect_check_js_1.checkMapEntry)(this._field, key, value); + if (err) { + throw err; + } + } + this.obj[mapKeyToLocal(key)] = mapValueToLocal(this._field, value); + return this; + } + delete(key) { + const k = mapKeyToLocal(key); + const has = Object.prototype.hasOwnProperty.call(this.obj, k); + if (has) { + delete this.obj[k]; + } + return has; + } + clear() { + for (const key of Object.keys(this.obj)) { + delete this.obj[key]; + } + } + get(key) { + let val = this.obj[mapKeyToLocal(key)]; + if (val !== undefined) { + val = mapValueToReflect(this._field, val, this.check); + } + return val; + } + has(key) { + return Object.prototype.hasOwnProperty.call(this.obj, mapKeyToLocal(key)); + } + *keys() { + for (const objKey of Object.keys(this.obj)) { + yield mapKeyToReflect(objKey, this._field.mapKey); + } + } + *entries() { + for (const objEntry of Object.entries(this.obj)) { + yield [ + mapKeyToReflect(objEntry[0], this._field.mapKey), + mapValueToReflect(this._field, objEntry[1], this.check), + ]; + } + } + [Symbol.iterator]() { + return this.entries(); + } + get size() { + return Object.keys(this.obj).length; + } + *values() { + for (const val of Object.values(this.obj)) { + yield mapValueToReflect(this._field, val, this.check); + } + } + forEach(callbackfn, thisArg) { + for (const mapEntry of this.entries()) { + callbackfn.call(thisArg, mapEntry[1], mapEntry[0], this); + } + } +} +function messageToLocal(field, value) { + if (!(0, guard_js_1.isReflectMessage)(value)) { + return value; + } + if ((0, wrappers_js_1.isWrapper)(value.message) && + !field.oneof && + field.fieldKind == "message") { + // Types from google/protobuf/wrappers.proto are unwrapped when used in + // a singular field that is not part of a oneof group. + return value.message.value; + } + if (value.desc.typeName == "google.protobuf.Struct" && + field.parent.typeName != "google.protobuf.Value") { + // google.protobuf.Struct is represented with JsonObject when used in a + // field, except when used in google.protobuf.Value. + return wktStructToLocal(value.message); + } + return value.message; +} +function messageToReflect(field, value, check) { + if (value !== undefined) { + if ((0, wrappers_js_1.isWrapperDesc)(field.message) && + !field.oneof && + field.fieldKind == "message") { + // Types from google/protobuf/wrappers.proto are unwrapped when used in + // a singular field that is not part of a oneof group. + value = { + $typeName: field.message.typeName, + value: longToReflect(field.message.fields[0], value), + }; + } + else if (field.message.typeName == "google.protobuf.Struct" && + field.parent.typeName != "google.protobuf.Value" && + (0, guard_js_1.isObject)(value)) { + // google.protobuf.Struct is represented with JsonObject when used in a + // field, except when used in google.protobuf.Value. + value = wktStructToReflect(value); + } + } + return new ReflectMessageImpl(field.message, value, check); +} +function listItemToLocal(field, value) { + if (field.listKind == "message") { + return messageToLocal(field, value); + } + return longToLocal(field, value); +} +function listItemToReflect(field, value, check) { + if (field.listKind == "message") { + return messageToReflect(field, value, check); + } + return longToReflect(field, value); +} +function mapValueToLocal(field, value) { + if (field.mapKind == "message") { + return messageToLocal(field, value); + } + return longToLocal(field, value); +} +function mapValueToReflect(field, value, check) { + if (field.mapKind == "message") { + return messageToReflect(field, value, check); + } + return value; +} +function mapKeyToLocal(key) { + return typeof key == "string" || typeof key == "number" ? key : String(key); +} +/** + * Converts a map key (any scalar value except float, double, or bytes) from its + * representation in a message (string or number, the only possible object key + * types) to the closest possible type in ECMAScript. + */ +function mapKeyToReflect(key, type) { + switch (type) { + case descriptors_js_1.ScalarType.STRING: + return key; + case descriptors_js_1.ScalarType.INT32: + case descriptors_js_1.ScalarType.FIXED32: + case descriptors_js_1.ScalarType.UINT32: + case descriptors_js_1.ScalarType.SFIXED32: + case descriptors_js_1.ScalarType.SINT32: { + const n = Number.parseInt(key); + if (Number.isFinite(n)) { + return n; + } + break; + } + case descriptors_js_1.ScalarType.BOOL: + switch (key) { + case "true": + return true; + case "false": + return false; + } + break; + case descriptors_js_1.ScalarType.UINT64: + case descriptors_js_1.ScalarType.FIXED64: + try { + return proto_int64_js_1.protoInt64.uParse(key); + } + catch (_a) { + // + } + break; + default: + // INT64, SFIXED64, SINT64 + try { + return proto_int64_js_1.protoInt64.parse(key); + } + catch (_b) { + // + } + break; + } + return key; +} +function longToReflect(field, value) { + switch (field.scalar) { + case descriptors_js_1.ScalarType.INT64: + case descriptors_js_1.ScalarType.SFIXED64: + case descriptors_js_1.ScalarType.SINT64: + if ("longAsString" in field && + field.longAsString && + typeof value == "string") { + value = proto_int64_js_1.protoInt64.parse(value); + } + break; + case descriptors_js_1.ScalarType.FIXED64: + case descriptors_js_1.ScalarType.UINT64: + if ("longAsString" in field && + field.longAsString && + typeof value == "string") { + value = proto_int64_js_1.protoInt64.uParse(value); + } + break; + } + return value; +} +function longToLocal(field, value) { + switch (field.scalar) { + case descriptors_js_1.ScalarType.INT64: + case descriptors_js_1.ScalarType.SFIXED64: + case descriptors_js_1.ScalarType.SINT64: + if ("longAsString" in field && field.longAsString) { + value = String(value); + } + else if (typeof value == "string" || typeof value == "number") { + value = proto_int64_js_1.protoInt64.parse(value); + } + break; + case descriptors_js_1.ScalarType.FIXED64: + case descriptors_js_1.ScalarType.UINT64: + if ("longAsString" in field && field.longAsString) { + value = String(value); + } + else if (typeof value == "string" || typeof value == "number") { + value = proto_int64_js_1.protoInt64.uParse(value); + } + break; + } + return value; +} +function wktStructToReflect(json) { + const struct = { + $typeName: "google.protobuf.Struct", + fields: {}, + }; + if ((0, guard_js_1.isObject)(json)) { + for (const [k, v] of Object.entries(json)) { + struct.fields[k] = wktValueToReflect(v); + } + } + return struct; +} +function wktStructToLocal(val) { + const json = {}; + for (const [k, v] of Object.entries(val.fields)) { + json[k] = wktValueToLocal(v); + } + return json; +} +function wktValueToLocal(val) { + switch (val.kind.case) { + case "structValue": + return wktStructToLocal(val.kind.value); + case "listValue": + return val.kind.value.values.map(wktValueToLocal); + case "nullValue": + case undefined: + return null; + default: + return val.kind.value; + } +} +function wktValueToReflect(json) { + const value = { + $typeName: "google.protobuf.Value", + kind: { case: undefined }, + }; + switch (typeof json) { + case "number": + value.kind = { case: "numberValue", value: json }; + break; + case "string": + value.kind = { case: "stringValue", value: json }; + break; + case "boolean": + value.kind = { case: "boolValue", value: json }; + break; + case "object": + if (json === null) { + const nullValue = 0; + value.kind = { case: "nullValue", value: nullValue }; + } + else if (Array.isArray(json)) { + const listValue = { + $typeName: "google.protobuf.ListValue", + values: [], + }; + if (Array.isArray(json)) { + for (const e of json) { + listValue.values.push(wktValueToReflect(e)); + } + } + value.kind = { + case: "listValue", + value: listValue, + }; + } + else { + value.kind = { + case: "structValue", + value: wktStructToReflect(json), + }; + } + break; + } + return value; +} diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/reflect/scalar.d.ts b/node_modules/@bufbuild/protobuf/dist/cjs/reflect/scalar.d.ts new file mode 100644 index 0000000..16ac91f --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/reflect/scalar.d.ts @@ -0,0 +1,21 @@ +import { ScalarType } from "../descriptors.js"; +/** + * ScalarValue maps from a scalar field type to a TypeScript value type. + */ +export type ScalarValue = T extends ScalarType.STRING ? string : T extends ScalarType.INT32 ? number : T extends ScalarType.UINT32 ? number : T extends ScalarType.SINT32 ? number : T extends ScalarType.FIXED32 ? number : T extends ScalarType.SFIXED32 ? number : T extends ScalarType.FLOAT ? number : T extends ScalarType.DOUBLE ? number : T extends ScalarType.INT64 ? LongAsString extends true ? string : bigint : T extends ScalarType.SINT64 ? LongAsString extends true ? string : bigint : T extends ScalarType.SFIXED64 ? LongAsString extends true ? string : bigint : T extends ScalarType.UINT64 ? LongAsString extends true ? string : bigint : T extends ScalarType.FIXED64 ? LongAsString extends true ? string : bigint : T extends ScalarType.BOOL ? boolean : T extends ScalarType.BYTES ? Uint8Array : never; +/** + * Returns true if both scalar values are equal. + */ +export declare function scalarEquals(type: ScalarType, a: ScalarValue | undefined, b: ScalarValue | undefined): boolean; +/** + * Returns the zero value for the given scalar type. + */ +export declare function scalarZeroValue(type: T, longAsString: LongAsString): ScalarValue; +/** + * Returns true for a zero-value. For example, an integer has the zero-value `0`, + * a boolean is `false`, a string is `""`, and bytes is an empty Uint8Array. + * + * In proto3, zero-values are not written to the wire, unless the field is + * optional or repeated. + */ +export declare function isScalarZeroValue(type: ScalarType, value: unknown): boolean; diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/reflect/scalar.js b/node_modules/@bufbuild/protobuf/dist/cjs/reflect/scalar.js new file mode 100644 index 0000000..6e9839a --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/reflect/scalar.js @@ -0,0 +1,102 @@ +"use strict"; +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.scalarEquals = scalarEquals; +exports.scalarZeroValue = scalarZeroValue; +exports.isScalarZeroValue = isScalarZeroValue; +const proto_int64_js_1 = require("../proto-int64.js"); +const descriptors_js_1 = require("../descriptors.js"); +/** + * Returns true if both scalar values are equal. + */ +function scalarEquals(type, a, b) { + if (a === b) { + // This correctly matches equal values except BYTES and (possibly) 64-bit integers. + return true; + } + // Special case BYTES - we need to compare each byte individually + if (type == descriptors_js_1.ScalarType.BYTES) { + if (!(a instanceof Uint8Array) || !(b instanceof Uint8Array)) { + return false; + } + if (a.length !== b.length) { + return false; + } + for (let i = 0; i < a.length; i++) { + if (a[i] !== b[i]) { + return false; + } + } + return true; + } + // Special case 64-bit integers - we support number, string and bigint representation. + switch (type) { + case descriptors_js_1.ScalarType.UINT64: + case descriptors_js_1.ScalarType.FIXED64: + case descriptors_js_1.ScalarType.INT64: + case descriptors_js_1.ScalarType.SFIXED64: + case descriptors_js_1.ScalarType.SINT64: + // Loose comparison will match between 0n, 0 and "0". + return a == b; + } + // Anything that hasn't been caught by strict comparison or special cased + // BYTES and 64-bit integers is not equal. + return false; +} +/** + * Returns the zero value for the given scalar type. + */ +function scalarZeroValue(type, longAsString) { + switch (type) { + case descriptors_js_1.ScalarType.STRING: + return ""; + case descriptors_js_1.ScalarType.BOOL: + return false; + case descriptors_js_1.ScalarType.DOUBLE: + case descriptors_js_1.ScalarType.FLOAT: + return 0.0; + case descriptors_js_1.ScalarType.INT64: + case descriptors_js_1.ScalarType.UINT64: + case descriptors_js_1.ScalarType.SFIXED64: + case descriptors_js_1.ScalarType.FIXED64: + case descriptors_js_1.ScalarType.SINT64: + return (longAsString ? "0" : proto_int64_js_1.protoInt64.zero); + case descriptors_js_1.ScalarType.BYTES: + return new Uint8Array(0); + default: + // Handles INT32, UINT32, SINT32, FIXED32, SFIXED32. + // We do not use individual cases to save a few bytes code size. + return 0; + } +} +/** + * Returns true for a zero-value. For example, an integer has the zero-value `0`, + * a boolean is `false`, a string is `""`, and bytes is an empty Uint8Array. + * + * In proto3, zero-values are not written to the wire, unless the field is + * optional or repeated. + */ +function isScalarZeroValue(type, value) { + switch (type) { + case descriptors_js_1.ScalarType.BOOL: + return value === false; + case descriptors_js_1.ScalarType.STRING: + return value === ""; + case descriptors_js_1.ScalarType.BYTES: + return value instanceof Uint8Array && !value.byteLength; + default: + return value == 0; // Loose comparison matches 0n, 0 and "0" + } +} diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/reflect/unsafe.d.ts b/node_modules/@bufbuild/protobuf/dist/cjs/reflect/unsafe.d.ts new file mode 100644 index 0000000..02fd72f --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/reflect/unsafe.d.ts @@ -0,0 +1,39 @@ +import type { DescField, DescOneof } from "../descriptors.js"; +export declare const unsafeLocal: unique symbol; +/** + * Return the selected field of a oneof group. + * + * @private + */ +export declare function unsafeOneofCase(target: Record, oneof: DescOneof): DescField | undefined; +/** + * Returns true if the field is set. + * + * @private + */ +export declare function unsafeIsSet(target: Record, field: DescField): boolean; +/** + * Returns true if the field is set, but only for singular fields with explicit + * presence (proto2). + * + * @private + */ +export declare function unsafeIsSetExplicit(target: object, localName: string): boolean; +/** + * Return a field value, respecting oneof groups. + * + * @private + */ +export declare function unsafeGet(target: Record, field: DescField): unknown; +/** + * Set a field value, respecting oneof groups. + * + * @private + */ +export declare function unsafeSet(target: Record, field: DescField, value: unknown): void; +/** + * Resets the field, so that unsafeIsSet() will return false. + * + * @private + */ +export declare function unsafeClear(target: Record, field: DescField): void; diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/reflect/unsafe.js b/node_modules/@bufbuild/protobuf/dist/cjs/reflect/unsafe.js new file mode 100644 index 0000000..c7c4e2f --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/reflect/unsafe.js @@ -0,0 +1,149 @@ +"use strict"; +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.unsafeLocal = void 0; +exports.unsafeOneofCase = unsafeOneofCase; +exports.unsafeIsSet = unsafeIsSet; +exports.unsafeIsSetExplicit = unsafeIsSetExplicit; +exports.unsafeGet = unsafeGet; +exports.unsafeSet = unsafeSet; +exports.unsafeClear = unsafeClear; +const scalar_js_1 = require("./scalar.js"); +// bootstrap-inject google.protobuf.FeatureSet.FieldPresence.IMPLICIT: const $name: FeatureSet_FieldPresence.$localName = $number; +const IMPLICIT = 2; +exports.unsafeLocal = Symbol.for("reflect unsafe local"); +/** + * Return the selected field of a oneof group. + * + * @private + */ +function unsafeOneofCase( +// biome-ignore lint/suspicious/noExplicitAny: `any` is the best choice for dynamic access +target, oneof) { + const c = target[oneof.localName].case; + if (c === undefined) { + return c; + } + return oneof.fields.find((f) => f.localName === c); +} +/** + * Returns true if the field is set. + * + * @private + */ +function unsafeIsSet( +// biome-ignore lint/suspicious/noExplicitAny: `any` is the best choice for dynamic access +target, field) { + const name = field.localName; + if (field.oneof) { + return target[field.oneof.localName].case === name; + } + if (field.presence != IMPLICIT) { + // Fields with explicit presence have properties on the prototype chain + // for default / zero values (except for proto3). + return (target[name] !== undefined && + Object.prototype.hasOwnProperty.call(target, name)); + } + switch (field.fieldKind) { + case "list": + return target[name].length > 0; + case "map": + return Object.keys(target[name]).length > 0; + case "scalar": + return !(0, scalar_js_1.isScalarZeroValue)(field.scalar, target[name]); + case "enum": + return target[name] !== field.enum.values[0].number; + } + throw new Error("message field with implicit presence"); +} +/** + * Returns true if the field is set, but only for singular fields with explicit + * presence (proto2). + * + * @private + */ +function unsafeIsSetExplicit(target, localName) { + return (Object.prototype.hasOwnProperty.call(target, localName) && + target[localName] !== undefined); +} +/** + * Return a field value, respecting oneof groups. + * + * @private + */ +function unsafeGet(target, field) { + if (field.oneof) { + const oneof = target[field.oneof.localName]; + if (oneof.case === field.localName) { + return oneof.value; + } + return undefined; + } + return target[field.localName]; +} +/** + * Set a field value, respecting oneof groups. + * + * @private + */ +function unsafeSet(target, field, value) { + if (field.oneof) { + target[field.oneof.localName] = { + case: field.localName, + value: value, + }; + } + else { + target[field.localName] = value; + } +} +/** + * Resets the field, so that unsafeIsSet() will return false. + * + * @private + */ +function unsafeClear( +// biome-ignore lint/suspicious/noExplicitAny: `any` is the best choice for dynamic access +target, field) { + const name = field.localName; + if (field.oneof) { + const oneofLocalName = field.oneof.localName; + if (target[oneofLocalName].case === name) { + target[oneofLocalName] = { case: undefined }; + } + } + else if (field.presence != IMPLICIT) { + // Fields with explicit presence have properties on the prototype chain + // for default / zero values (except for proto3). By deleting their own + // property, the field is reset. + delete target[name]; + } + else { + switch (field.fieldKind) { + case "map": + target[name] = {}; + break; + case "list": + target[name] = []; + break; + case "enum": + target[name] = field.enum.values[0].number; + break; + case "scalar": + target[name] = (0, scalar_js_1.scalarZeroValue)(field.scalar, field.longAsString); + break; + } + } +} diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/registry.d.ts b/node_modules/@bufbuild/protobuf/dist/cjs/registry.d.ts new file mode 100644 index 0000000..4a1b5ae --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/registry.d.ts @@ -0,0 +1,98 @@ +import type { FileDescriptorProto, FileDescriptorSet } from "./wkt/gen/google/protobuf/descriptor_pb.js"; +import { type DescEnum, type DescExtension, type DescFile, type DescMessage, type DescService, type SupportedEdition } from "./descriptors.js"; +/** + * A set of descriptors for messages, enumerations, extensions, + * and services. + */ +export interface Registry { + readonly kind: "registry"; + /** + * All types (message, enumeration, extension, or service) contained + * in this registry. + */ + [Symbol.iterator](): IterableIterator; + /** + * Look up a type (message, enumeration, extension, or service) by + * its fully qualified name. + */ + get(typeName: string): DescMessage | DescEnum | DescExtension | DescService | undefined; + /** + * Look up a message descriptor by its fully qualified name. + */ + getMessage(typeName: string): DescMessage | undefined; + /** + * Look up an enumeration descriptor by its fully qualified name. + */ + getEnum(typeName: string): DescEnum | undefined; + /** + * Look up an extension descriptor by its fully qualified name. + */ + getExtension(typeName: string): DescExtension | undefined; + /** + * Look up an extension by the extendee - the message it extends - and + * the extension number. + */ + getExtensionFor(extendee: DescMessage, no: number): DescExtension | undefined; + /** + * Look up a service descriptor by its fully qualified name. + */ + getService(typeName: string): DescService | undefined; +} +/** + * A registry that allows adding and removing descriptors. + */ +export interface MutableRegistry extends Registry { + /** + * Adds the given descriptor - but not types nested within - to the registry. + */ + add(desc: DescMessage | DescEnum | DescExtension | DescService): void; + /** + * Remove the given descriptor - but not types nested within - from the registry. + */ + remove(desc: DescMessage | DescEnum | DescExtension | DescService): void; +} +/** + * A registry that includes files. + */ +export interface FileRegistry extends Registry { + /** + * All files in this registry. + */ + readonly files: Iterable; + /** + * Look up a file descriptor by file name. + */ + getFile(fileName: string): DescFile | undefined; +} +/** + * Create a registry from the given inputs. + * + * An input can be: + * - Any message, enum, service, or extension descriptor, which adds just the + * descriptor for this type. + * - A file descriptor, which adds all typed defined in this file. + * - A registry, which adds all types from the registry. + * + * For duplicate descriptors (same type name), the one given last wins. + */ +export declare function createRegistry(...input: (Registry | DescFile | DescMessage | DescEnum | DescExtension | DescService)[]): Registry; +/** + * Create a registry that allows adding and removing descriptors. + */ +export declare function createMutableRegistry(...input: (Registry | DescFile | DescMessage | DescEnum | DescExtension | DescService)[]): MutableRegistry; +/** + * Create a registry (including file descriptors) from a google.protobuf.FileDescriptorSet + * message. + */ +export declare function createFileRegistry(fileDescriptorSet: FileDescriptorSet): FileRegistry; +/** + * Create a registry (including file descriptors) from a google.protobuf.FileDescriptorProto + * message. For every import, the given resolver function is called. + */ +export declare function createFileRegistry(fileDescriptorProto: FileDescriptorProto, resolve: (protoFileName: string) => FileDescriptorProto | DescFile | undefined): FileRegistry; +/** + * Create a registry (including file descriptors) from one or more registries, + * merging them. + */ +export declare function createFileRegistry(...registries: FileRegistry[]): FileRegistry; +export declare const minimumEdition: SupportedEdition, maximumEdition: SupportedEdition; diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/registry.js b/node_modules/@bufbuild/protobuf/dist/cjs/registry.js new file mode 100644 index 0000000..d683618 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/registry.js @@ -0,0 +1,945 @@ +"use strict"; +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.maximumEdition = exports.minimumEdition = void 0; +exports.createRegistry = createRegistry; +exports.createMutableRegistry = createMutableRegistry; +exports.createFileRegistry = createFileRegistry; +const descriptors_js_1 = require("./descriptors.js"); +const text_format_js_1 = require("./wire/text-format.js"); +const nested_types_js_1 = require("./reflect/nested-types.js"); +const unsafe_js_1 = require("./reflect/unsafe.js"); +const names_js_1 = require("./reflect/names.js"); +/** + * Create a registry from the given inputs. + * + * An input can be: + * - Any message, enum, service, or extension descriptor, which adds just the + * descriptor for this type. + * - A file descriptor, which adds all typed defined in this file. + * - A registry, which adds all types from the registry. + * + * For duplicate descriptors (same type name), the one given last wins. + */ +function createRegistry(...input) { + return initBaseRegistry(input); +} +/** + * Create a registry that allows adding and removing descriptors. + */ +function createMutableRegistry(...input) { + const reg = initBaseRegistry(input); + return Object.assign(Object.assign({}, reg), { remove(desc) { + var _a; + if (desc.kind == "extension") { + (_a = reg.extendees.get(desc.extendee.typeName)) === null || _a === void 0 ? void 0 : _a.delete(desc.number); + } + reg.types.delete(desc.typeName); + } }); +} +function createFileRegistry(...args) { + const registry = createBaseRegistry(); + if (!args.length) { + return registry; + } + if ("$typeName" in args[0] && + args[0].$typeName == "google.protobuf.FileDescriptorSet") { + for (const file of args[0].file) { + addFile(file, registry); + } + return registry; + } + if ("$typeName" in args[0]) { + const input = args[0]; + const resolve = args[1]; + const seen = new Set(); + function recurseDeps(file) { + const deps = []; + for (const protoFileName of file.dependency) { + if (registry.getFile(protoFileName) != undefined) { + continue; + } + if (seen.has(protoFileName)) { + continue; + } + const dep = resolve(protoFileName); + if (!dep) { + throw new Error(`Unable to resolve ${protoFileName}, imported by ${file.name}`); + } + if ("kind" in dep) { + registry.addFile(dep, false, true); + } + else { + seen.add(dep.name); + deps.push(dep); + } + } + return deps.concat(...deps.map(recurseDeps)); + } + for (const file of [input, ...recurseDeps(input)].reverse()) { + addFile(file, registry); + } + } + else { + for (const fileReg of args) { + for (const file of fileReg.files) { + registry.addFile(file); + } + } + } + return registry; +} +/** + * @private + */ +function createBaseRegistry() { + const types = new Map(); + const extendees = new Map(); + const files = new Map(); + return { + kind: "registry", + types, + extendees, + [Symbol.iterator]() { + return types.values(); + }, + get files() { + return files.values(); + }, + addFile(file, skipTypes, withDeps) { + files.set(file.proto.name, file); + if (!skipTypes) { + for (const type of (0, nested_types_js_1.nestedTypes)(file)) { + this.add(type); + } + } + if (withDeps) { + for (const f of file.dependencies) { + this.addFile(f, skipTypes, withDeps); + } + } + }, + add(desc) { + if (desc.kind == "extension") { + let numberToExt = extendees.get(desc.extendee.typeName); + if (!numberToExt) { + extendees.set(desc.extendee.typeName, + // biome-ignore lint/suspicious/noAssignInExpressions: no + (numberToExt = new Map())); + } + numberToExt.set(desc.number, desc); + } + types.set(desc.typeName, desc); + }, + get(typeName) { + return types.get(typeName); + }, + getFile(fileName) { + return files.get(fileName); + }, + getMessage(typeName) { + const t = types.get(typeName); + return (t === null || t === void 0 ? void 0 : t.kind) == "message" ? t : undefined; + }, + getEnum(typeName) { + const t = types.get(typeName); + return (t === null || t === void 0 ? void 0 : t.kind) == "enum" ? t : undefined; + }, + getExtension(typeName) { + const t = types.get(typeName); + return (t === null || t === void 0 ? void 0 : t.kind) == "extension" ? t : undefined; + }, + getExtensionFor(extendee, no) { + var _a; + return (_a = extendees.get(extendee.typeName)) === null || _a === void 0 ? void 0 : _a.get(no); + }, + getService(typeName) { + const t = types.get(typeName); + return (t === null || t === void 0 ? void 0 : t.kind) == "service" ? t : undefined; + }, + }; +} +/** + * @private + */ +function initBaseRegistry(inputs) { + const registry = createBaseRegistry(); + for (const input of inputs) { + switch (input.kind) { + case "registry": + for (const n of input) { + registry.add(n); + } + break; + case "file": + registry.addFile(input); + break; + default: + registry.add(input); + break; + } + } + return registry; +} +// bootstrap-inject google.protobuf.Edition.EDITION_PROTO2: const $name: Edition.$localName = $number; +const EDITION_PROTO2 = 998; +// bootstrap-inject google.protobuf.Edition.EDITION_PROTO3: const $name: Edition.$localName = $number; +const EDITION_PROTO3 = 999; +// bootstrap-inject google.protobuf.Edition.EDITION_UNSTABLE: const $name: Edition.$localName = $number; +const EDITION_UNSTABLE = 9999; +// bootstrap-inject google.protobuf.FieldDescriptorProto.Type.TYPE_STRING: const $name: FieldDescriptorProto_Type.$localName = $number; +const TYPE_STRING = 9; +// bootstrap-inject google.protobuf.FieldDescriptorProto.Type.TYPE_GROUP: const $name: FieldDescriptorProto_Type.$localName = $number; +const TYPE_GROUP = 10; +// bootstrap-inject google.protobuf.FieldDescriptorProto.Type.TYPE_MESSAGE: const $name: FieldDescriptorProto_Type.$localName = $number; +const TYPE_MESSAGE = 11; +// bootstrap-inject google.protobuf.FieldDescriptorProto.Type.TYPE_BYTES: const $name: FieldDescriptorProto_Type.$localName = $number; +const TYPE_BYTES = 12; +// bootstrap-inject google.protobuf.FieldDescriptorProto.Type.TYPE_ENUM: const $name: FieldDescriptorProto_Type.$localName = $number; +const TYPE_ENUM = 14; +// bootstrap-inject google.protobuf.FieldDescriptorProto.Label.LABEL_REPEATED: const $name: FieldDescriptorProto_Label.$localName = $number; +const LABEL_REPEATED = 3; +// bootstrap-inject google.protobuf.FieldDescriptorProto.Label.LABEL_REQUIRED: const $name: FieldDescriptorProto_Label.$localName = $number; +const LABEL_REQUIRED = 2; +// bootstrap-inject google.protobuf.FieldOptions.JSType.JS_STRING: const $name: FieldOptions_JSType.$localName = $number; +const JS_STRING = 1; +// bootstrap-inject google.protobuf.MethodOptions.IdempotencyLevel.IDEMPOTENCY_UNKNOWN: const $name: MethodOptions_IdempotencyLevel.$localName = $number; +const IDEMPOTENCY_UNKNOWN = 0; +// bootstrap-inject google.protobuf.FeatureSet.FieldPresence.EXPLICIT: const $name: FeatureSet_FieldPresence.$localName = $number; +const EXPLICIT = 1; +// bootstrap-inject google.protobuf.FeatureSet.FieldPresence.IMPLICIT: const $name: FeatureSet_FieldPresence.$localName = $number; +const IMPLICIT = 2; +// bootstrap-inject google.protobuf.FeatureSet.FieldPresence.LEGACY_REQUIRED: const $name: FeatureSet_FieldPresence.$localName = $number; +const LEGACY_REQUIRED = 3; +// bootstrap-inject google.protobuf.FeatureSet.RepeatedFieldEncoding.PACKED: const $name: FeatureSet_RepeatedFieldEncoding.$localName = $number; +const PACKED = 1; +// bootstrap-inject google.protobuf.FeatureSet.MessageEncoding.DELIMITED: const $name: FeatureSet_MessageEncoding.$localName = $number; +const DELIMITED = 2; +// bootstrap-inject google.protobuf.FeatureSet.EnumType.OPEN: const $name: FeatureSet_EnumType.$localName = $number; +const OPEN = 1; +// bootstrap-inject google.protobuf.FeatureSet.Utf8Validation.VERIFY: const $name: FeatureSet_Utf8Validation.$localName = $number; +const VERIFY = 2; +// biome-ignore format: want this to read well +// bootstrap-inject defaults: EDITION_PROTO2 to EDITION_2024: export const minimumEdition: SupportedEdition = $minimumEdition, maximumEdition: SupportedEdition = $maximumEdition; +// generated from protoc v34.0 +exports.minimumEdition = 998, exports.maximumEdition = 1001; +const featureDefaults = { + // EDITION_PROTO2 + 998: { + fieldPresence: 1, // EXPLICIT, + enumType: 2, // CLOSED, + repeatedFieldEncoding: 2, // EXPANDED, + utf8Validation: 3, // NONE, + messageEncoding: 1, // LENGTH_PREFIXED, + jsonFormat: 2, // LEGACY_BEST_EFFORT, + enforceNamingStyle: 2, // STYLE_LEGACY, + defaultSymbolVisibility: 1, // EXPORT_ALL, + }, + // EDITION_PROTO3 + 999: { + fieldPresence: 2, // IMPLICIT, + enumType: 1, // OPEN, + repeatedFieldEncoding: 1, // PACKED, + utf8Validation: 2, // VERIFY, + messageEncoding: 1, // LENGTH_PREFIXED, + jsonFormat: 1, // ALLOW, + enforceNamingStyle: 2, // STYLE_LEGACY, + defaultSymbolVisibility: 1, // EXPORT_ALL, + }, + // EDITION_2023 + 1000: { + fieldPresence: 1, // EXPLICIT, + enumType: 1, // OPEN, + repeatedFieldEncoding: 1, // PACKED, + utf8Validation: 2, // VERIFY, + messageEncoding: 1, // LENGTH_PREFIXED, + jsonFormat: 1, // ALLOW, + enforceNamingStyle: 2, // STYLE_LEGACY, + defaultSymbolVisibility: 1, // EXPORT_ALL, + }, + // EDITION_2024 + 1001: { + fieldPresence: 1, // EXPLICIT, + enumType: 1, // OPEN, + repeatedFieldEncoding: 1, // PACKED, + utf8Validation: 2, // VERIFY, + messageEncoding: 1, // LENGTH_PREFIXED, + jsonFormat: 1, // ALLOW, + enforceNamingStyle: 1, // STYLE2024, + defaultSymbolVisibility: 2, // EXPORT_TOP_LEVEL, + }, +}; +/** + * Create a descriptor for a file, add it to the registry. + */ +function addFile(proto, reg) { + var _a, _b; + const file = { + kind: "file", + proto, + deprecated: (_b = (_a = proto.options) === null || _a === void 0 ? void 0 : _a.deprecated) !== null && _b !== void 0 ? _b : false, + edition: getFileEdition(proto), + name: proto.name.replace(/\.proto$/, ""), + dependencies: findFileDependencies(proto, reg), + enums: [], + messages: [], + extensions: [], + services: [], + toString() { + // eslint-disable-next-line @typescript-eslint/restrict-template-expressions -- we asserted above + return `file ${proto.name}`; + }, + }; + const mapEntriesStore = new Map(); + const mapEntries = { + get(typeName) { + return mapEntriesStore.get(typeName); + }, + add(desc) { + var _a; + assert(((_a = desc.proto.options) === null || _a === void 0 ? void 0 : _a.mapEntry) === true); + mapEntriesStore.set(desc.typeName, desc); + }, + }; + for (const enumProto of proto.enumType) { + addEnum(enumProto, file, undefined, reg); + } + for (const messageProto of proto.messageType) { + addMessage(messageProto, file, undefined, reg, mapEntries); + } + for (const serviceProto of proto.service) { + addService(serviceProto, file, reg); + } + addExtensions(file, reg); + for (const mapEntry of mapEntriesStore.values()) { + // to create a map field, we need access to the map entry's fields + addFields(mapEntry, reg, mapEntries); + } + for (const message of file.messages) { + addFields(message, reg, mapEntries); + addExtensions(message, reg); + } + reg.addFile(file, true); +} +/** + * Create descriptors for extensions, and add them to the message / file, + * and to our cart. + * Recurses into nested types. + */ +function addExtensions(desc, reg) { + switch (desc.kind) { + case "file": + for (const proto of desc.proto.extension) { + const ext = newField(proto, desc, reg); + desc.extensions.push(ext); + reg.add(ext); + } + break; + case "message": + for (const proto of desc.proto.extension) { + const ext = newField(proto, desc, reg); + desc.nestedExtensions.push(ext); + reg.add(ext); + } + for (const message of desc.nestedMessages) { + addExtensions(message, reg); + } + break; + } +} +/** + * Create descriptors for fields and oneof groups, and add them to the message. + * Recurses into nested types. + */ +function addFields(message, reg, mapEntries) { + const allOneofs = message.proto.oneofDecl.map((proto) => newOneof(proto, message)); + const oneofsSeen = new Set(); + for (const proto of message.proto.field) { + const oneof = findOneof(proto, allOneofs); + const field = newField(proto, message, reg, oneof, mapEntries); + message.fields.push(field); + message.field[field.localName] = field; + if (oneof === undefined) { + message.members.push(field); + } + else { + oneof.fields.push(field); + if (!oneofsSeen.has(oneof)) { + oneofsSeen.add(oneof); + message.members.push(oneof); + } + } + } + for (const oneof of allOneofs.filter((o) => oneofsSeen.has(o))) { + message.oneofs.push(oneof); + } + for (const child of message.nestedMessages) { + addFields(child, reg, mapEntries); + } +} +/** + * Create a descriptor for an enumeration, and add it our cart and to the + * parent type, if any. + */ +function addEnum(proto, file, parent, reg) { + var _a, _b, _c, _d, _e; + const sharedPrefix = findEnumSharedPrefix(proto.name, proto.value); + const desc = { + kind: "enum", + proto, + deprecated: (_b = (_a = proto.options) === null || _a === void 0 ? void 0 : _a.deprecated) !== null && _b !== void 0 ? _b : false, + file, + parent, + open: true, + name: proto.name, + typeName: makeTypeName(proto, parent, file), + value: {}, + values: [], + sharedPrefix, + toString() { + return `enum ${this.typeName}`; + }, + }; + desc.open = isEnumOpen(desc); + reg.add(desc); + for (const p of proto.value) { + const name = p.name; + desc.values.push( + // biome-ignore lint/suspicious/noAssignInExpressions: no + (desc.value[p.number] = { + kind: "enum_value", + proto: p, + deprecated: (_d = (_c = p.options) === null || _c === void 0 ? void 0 : _c.deprecated) !== null && _d !== void 0 ? _d : false, + parent: desc, + name, + localName: (0, names_js_1.safeObjectProperty)(sharedPrefix == undefined + ? name + : name.substring(sharedPrefix.length)), + number: p.number, + toString() { + return `enum value ${desc.typeName}.${name}`; + }, + })); + } + ((_e = parent === null || parent === void 0 ? void 0 : parent.nestedEnums) !== null && _e !== void 0 ? _e : file.enums).push(desc); +} +/** + * Create a descriptor for a message, including nested types, and add it to our + * cart. Note that this does not create descriptors fields. + */ +function addMessage(proto, file, parent, reg, mapEntries) { + var _a, _b, _c, _d; + const desc = { + kind: "message", + proto, + deprecated: (_b = (_a = proto.options) === null || _a === void 0 ? void 0 : _a.deprecated) !== null && _b !== void 0 ? _b : false, + file, + parent, + name: proto.name, + typeName: makeTypeName(proto, parent, file), + fields: [], + field: {}, + oneofs: [], + members: [], + nestedEnums: [], + nestedMessages: [], + nestedExtensions: [], + toString() { + return `message ${this.typeName}`; + }, + }; + if (((_c = proto.options) === null || _c === void 0 ? void 0 : _c.mapEntry) === true) { + mapEntries.add(desc); + } + else { + ((_d = parent === null || parent === void 0 ? void 0 : parent.nestedMessages) !== null && _d !== void 0 ? _d : file.messages).push(desc); + reg.add(desc); + } + for (const enumProto of proto.enumType) { + addEnum(enumProto, file, desc, reg); + } + for (const messageProto of proto.nestedType) { + addMessage(messageProto, file, desc, reg, mapEntries); + } +} +/** + * Create a descriptor for a service, including methods, and add it to our + * cart. + */ +function addService(proto, file, reg) { + var _a, _b; + const desc = { + kind: "service", + proto, + deprecated: (_b = (_a = proto.options) === null || _a === void 0 ? void 0 : _a.deprecated) !== null && _b !== void 0 ? _b : false, + file, + name: proto.name, + typeName: makeTypeName(proto, undefined, file), + methods: [], + method: {}, + toString() { + return `service ${this.typeName}`; + }, + }; + file.services.push(desc); + reg.add(desc); + for (const methodProto of proto.method) { + const method = newMethod(methodProto, desc, reg); + desc.methods.push(method); + desc.method[method.localName] = method; + } +} +/** + * Create a descriptor for a method. + */ +function newMethod(proto, parent, reg) { + var _a, _b, _c, _d; + let methodKind; + if (proto.clientStreaming && proto.serverStreaming) { + methodKind = "bidi_streaming"; + } + else if (proto.clientStreaming) { + methodKind = "client_streaming"; + } + else if (proto.serverStreaming) { + methodKind = "server_streaming"; + } + else { + methodKind = "unary"; + } + const input = reg.getMessage(trimLeadingDot(proto.inputType)); + const output = reg.getMessage(trimLeadingDot(proto.outputType)); + assert(input, `invalid MethodDescriptorProto: input_type ${proto.inputType} not found`); + assert(output, `invalid MethodDescriptorProto: output_type ${proto.inputType} not found`); + const name = proto.name; + return { + kind: "rpc", + proto, + deprecated: (_b = (_a = proto.options) === null || _a === void 0 ? void 0 : _a.deprecated) !== null && _b !== void 0 ? _b : false, + parent, + name, + localName: (0, names_js_1.safeObjectProperty)(name.length + ? (0, names_js_1.safeObjectProperty)(name[0].toLowerCase() + name.substring(1)) + : name), + methodKind, + input, + output, + idempotency: (_d = (_c = proto.options) === null || _c === void 0 ? void 0 : _c.idempotencyLevel) !== null && _d !== void 0 ? _d : IDEMPOTENCY_UNKNOWN, + toString() { + return `rpc ${parent.typeName}.${name}`; + }, + }; +} +/** + * Create a descriptor for a oneof group. + */ +function newOneof(proto, parent) { + return { + kind: "oneof", + proto, + deprecated: false, + parent, + fields: [], + name: proto.name, + localName: (0, names_js_1.safeObjectProperty)((0, names_js_1.protoCamelCase)(proto.name)), + toString() { + return `oneof ${parent.typeName}.${this.name}`; + }, + }; +} +function newField(proto, parentOrFile, reg, oneof, mapEntries) { + var _a, _b, _c; + const isExtension = mapEntries === undefined; + const field = { + kind: "field", + proto, + deprecated: (_b = (_a = proto.options) === null || _a === void 0 ? void 0 : _a.deprecated) !== null && _b !== void 0 ? _b : false, + name: proto.name, + number: proto.number, + scalar: undefined, + message: undefined, + enum: undefined, + presence: getFieldPresence(proto, oneof, isExtension, parentOrFile), + utf8Validation: isUtf8Validated(proto, parentOrFile), + listKind: undefined, + mapKind: undefined, + mapKey: undefined, + delimitedEncoding: undefined, + packed: undefined, + longAsString: false, + getDefaultValue: undefined, + }; + if (isExtension) { + // extension field + const file = parentOrFile.kind == "file" ? parentOrFile : parentOrFile.file; + const parent = parentOrFile.kind == "file" ? undefined : parentOrFile; + const typeName = makeTypeName(proto, parent, file); + field.kind = "extension"; + field.file = file; + field.parent = parent; + field.oneof = undefined; + field.typeName = typeName; + field.jsonName = `[${typeName}]`; // option json_name is not allowed on extension fields + field.toString = () => `extension ${typeName}`; + const extendee = reg.getMessage(trimLeadingDot(proto.extendee)); + assert(extendee, `invalid FieldDescriptorProto: extendee ${proto.extendee} not found`); + field.extendee = extendee; + } + else { + // regular field + const parent = parentOrFile; + assert(parent.kind == "message"); + field.parent = parent; + field.oneof = oneof; + field.localName = oneof + ? (0, names_js_1.protoCamelCase)(proto.name) + : (0, names_js_1.safeObjectProperty)((0, names_js_1.protoCamelCase)(proto.name)); + field.jsonName = proto.jsonName; + field.toString = () => `field ${parent.typeName}.${proto.name}`; + } + const label = proto.label; + const type = proto.type; + const jstype = (_c = proto.options) === null || _c === void 0 ? void 0 : _c.jstype; + if (label === LABEL_REPEATED) { + // list or map field + const mapEntry = type == TYPE_MESSAGE + ? mapEntries === null || mapEntries === void 0 ? void 0 : mapEntries.get(trimLeadingDot(proto.typeName)) + : undefined; + if (mapEntry) { + // map field + field.fieldKind = "map"; + const { key, value } = findMapEntryFields(mapEntry); + field.mapKey = key.scalar; + field.mapKind = value.fieldKind; + field.message = value.message; + field.delimitedEncoding = false; // map fields are always LENGTH_PREFIXED + field.enum = value.enum; + field.scalar = value.scalar; + return field; + } + // list field + field.fieldKind = "list"; + switch (type) { + case TYPE_MESSAGE: + case TYPE_GROUP: + field.listKind = "message"; + field.message = reg.getMessage(trimLeadingDot(proto.typeName)); + assert(field.message); + field.delimitedEncoding = isDelimitedEncoding(proto, parentOrFile); + break; + case TYPE_ENUM: + field.listKind = "enum"; + field.enum = reg.getEnum(trimLeadingDot(proto.typeName)); + assert(field.enum); + break; + default: + field.listKind = "scalar"; + field.scalar = type; + field.longAsString = jstype == JS_STRING; + break; + } + field.packed = isPackedField(proto, parentOrFile); + return field; + } + // singular + switch (type) { + case TYPE_MESSAGE: + case TYPE_GROUP: + field.fieldKind = "message"; + field.message = reg.getMessage(trimLeadingDot(proto.typeName)); + assert(field.message, `invalid FieldDescriptorProto: type_name ${proto.typeName} not found`); + field.delimitedEncoding = isDelimitedEncoding(proto, parentOrFile); + field.getDefaultValue = () => undefined; + break; + case TYPE_ENUM: { + const enumeration = reg.getEnum(trimLeadingDot(proto.typeName)); + assert(enumeration !== undefined, `invalid FieldDescriptorProto: type_name ${proto.typeName} not found`); + field.fieldKind = "enum"; + field.enum = reg.getEnum(trimLeadingDot(proto.typeName)); + field.getDefaultValue = () => { + return (0, unsafe_js_1.unsafeIsSetExplicit)(proto, "defaultValue") + ? (0, text_format_js_1.parseTextFormatEnumValue)(enumeration, proto.defaultValue) + : undefined; + }; + break; + } + default: { + field.fieldKind = "scalar"; + field.scalar = type; + field.longAsString = jstype == JS_STRING; + field.getDefaultValue = () => { + return (0, unsafe_js_1.unsafeIsSetExplicit)(proto, "defaultValue") + ? (0, text_format_js_1.parseTextFormatScalarValue)(type, proto.defaultValue) + : undefined; + }; + break; + } + } + return field; +} +/** + * Parse the "syntax" and "edition" fields, returning one of the supported + * editions. + */ +function getFileEdition(proto) { + switch (proto.syntax) { + case "": + case "proto2": + return EDITION_PROTO2; + case "proto3": + return EDITION_PROTO3; + case "editions": + // EDITION_UNSTABLE is a sandbox for in-development features. Collapse + // it to maximumEdition so SupportedEdition and feature resolution do + // not leak the test-only edition to users. + if (proto.edition === EDITION_UNSTABLE) { + return exports.maximumEdition; + } + if (proto.edition in featureDefaults) { + return proto.edition; + } + throw new Error(`${proto.name}: unsupported edition`); + default: + throw new Error(`${proto.name}: unsupported syntax "${proto.syntax}"`); + } +} +/** + * Resolve dependencies of FileDescriptorProto to DescFile. + */ +function findFileDependencies(proto, reg) { + return proto.dependency.map((wantName) => { + const dep = reg.getFile(wantName); + if (!dep) { + throw new Error(`Cannot find ${wantName}, imported by ${proto.name}`); + } + return dep; + }); +} +/** + * Finds a prefix shared by enum values, for example `my_enum_` for + * `enum MyEnum {MY_ENUM_A=0; MY_ENUM_B=1;}`. + */ +function findEnumSharedPrefix(enumName, values) { + const prefix = camelToSnakeCase(enumName) + "_"; + for (const value of values) { + if (!value.name.toLowerCase().startsWith(prefix)) { + return undefined; + } + const shortName = value.name.substring(prefix.length); + if (shortName.length == 0) { + return undefined; + } + if (/^\d/.test(shortName)) { + // identifiers must not start with numbers + return undefined; + } + } + return prefix; +} +/** + * Converts lowerCamelCase or UpperCamelCase into lower_snake_case. + * This is used to find shared prefixes in an enum. + */ +function camelToSnakeCase(camel) { + return (camel.substring(0, 1) + camel.substring(1).replace(/[A-Z]/g, (c) => "_" + c)).toLowerCase(); +} +/** + * Create a fully qualified name for a protobuf type or extension field. + * + * The fully qualified name for messages, enumerations, and services is + * constructed by concatenating the package name (if present), parent + * message names (for nested types), and the type name. We omit the leading + * dot added by protobuf compilers. Examples: + * - mypackage.MyMessage + * - mypackage.MyMessage.NestedMessage + * + * The fully qualified name for extension fields is constructed by + * concatenating the package name (if present), parent message names (for + * extensions declared within a message), and the field name. Examples: + * - mypackage.extfield + * - mypackage.MyMessage.extfield + */ +function makeTypeName(proto, parent, file) { + let typeName; + if (parent) { + typeName = `${parent.typeName}.${proto.name}`; + } + else if (file.proto.package.length > 0) { + typeName = `${file.proto.package}.${proto.name}`; + } + else { + typeName = `${proto.name}`; + } + return typeName; +} +/** + * Remove the leading dot from a fully qualified type name. + */ +function trimLeadingDot(typeName) { + return typeName.startsWith(".") ? typeName.substring(1) : typeName; +} +/** + * Did the user put the field in a oneof group? + * Synthetic oneofs for proto3 optionals are ignored. + */ +function findOneof(proto, allOneofs) { + if (!(0, unsafe_js_1.unsafeIsSetExplicit)(proto, "oneofIndex")) { + return undefined; + } + if (proto.proto3Optional) { + return undefined; + } + const oneof = allOneofs[proto.oneofIndex]; + assert(oneof, `invalid FieldDescriptorProto: oneof #${proto.oneofIndex} for field #${proto.number} not found`); + return oneof; +} +/** + * Presence of the field. + * See https://protobuf.dev/programming-guides/field_presence/ + */ +function getFieldPresence(proto, oneof, isExtension, parent) { + if (proto.label == LABEL_REQUIRED) { + // proto2 required is LEGACY_REQUIRED + return LEGACY_REQUIRED; + } + if (proto.label == LABEL_REPEATED) { + // repeated fields (including maps) do not track presence + return IMPLICIT; + } + if (!!oneof || proto.proto3Optional) { + // oneof is always explicit + return EXPLICIT; + } + if (isExtension) { + // extensions always track presence + return EXPLICIT; + } + const resolved = resolveFeature("fieldPresence", { proto, parent }); + if (resolved == IMPLICIT && + (proto.type == TYPE_MESSAGE || proto.type == TYPE_GROUP)) { + // singular message field cannot be implicit + return EXPLICIT; + } + return resolved; +} +/** + * Pack this repeated field? + */ +function isPackedField(proto, parent) { + if (proto.label != LABEL_REPEATED) { + return false; + } + switch (proto.type) { + case TYPE_STRING: + case TYPE_BYTES: + case TYPE_GROUP: + case TYPE_MESSAGE: + // length-delimited types cannot be packed + return false; + } + const o = proto.options; + if (o && (0, unsafe_js_1.unsafeIsSetExplicit)(o, "packed")) { + // prefer the field option over edition features + return o.packed; + } + return (PACKED == + resolveFeature("repeatedFieldEncoding", { + proto, + parent, + })); +} +/** + * Find the key and value fields of a synthetic map entry message. + */ +function findMapEntryFields(mapEntry) { + const key = mapEntry.fields.find((f) => f.number === 1); + const value = mapEntry.fields.find((f) => f.number === 2); + assert(key && + key.fieldKind == "scalar" && + key.scalar != descriptors_js_1.ScalarType.BYTES && + key.scalar != descriptors_js_1.ScalarType.FLOAT && + key.scalar != descriptors_js_1.ScalarType.DOUBLE && + value && + value.fieldKind != "list" && + value.fieldKind != "map"); + return { key, value }; +} +/** + * Enumerations can be open or closed. + * See https://protobuf.dev/programming-guides/enum/ + */ +function isEnumOpen(desc) { + var _a; + return (OPEN == + resolveFeature("enumType", { + proto: desc.proto, + parent: (_a = desc.parent) !== null && _a !== void 0 ? _a : desc.file, + })); +} +/** + * Encode the message delimited (a.k.a. proto2 group encoding), or + * length-prefixed? + */ +function isDelimitedEncoding(proto, parent) { + if (proto.type == TYPE_GROUP) { + return true; + } + return (DELIMITED == + resolveFeature("messageEncoding", { + proto, + parent, + })); +} +/** + * Reject invalid UTF-8 when reading string fields from the binary wire format? + * Driven by the resolved `utf8_validation` feature: VERIFY (proto3 / editions + * 2023+ default) enforces; NONE (proto2 default) does not. + */ +function isUtf8Validated(proto, parent) { + return (VERIFY == + resolveFeature("utf8Validation", { + proto, + parent, + })); +} +function resolveFeature(name, ref) { + var _a, _b; + const featureSet = (_a = ref.proto.options) === null || _a === void 0 ? void 0 : _a.features; + if (featureSet) { + const val = featureSet[name]; + if (val != 0) { + return val; + } + } + if ("kind" in ref) { + if (ref.kind == "message") { + return resolveFeature(name, (_b = ref.parent) !== null && _b !== void 0 ? _b : ref.file); + } + const editionDefaults = featureDefaults[ref.edition]; + if (!editionDefaults) { + throw new Error(`feature default for edition ${ref.edition} not found`); + } + return editionDefaults[name]; + } + return resolveFeature(name, ref.parent); +} +/** + * Assert that condition is truthy or throw error (with message) + */ +function assert(condition, msg) { + if (!condition) { + throw new Error(msg); + } +} diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/to-binary.d.ts b/node_modules/@bufbuild/protobuf/dist/cjs/to-binary.d.ts new file mode 100644 index 0000000..236ed49 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/to-binary.d.ts @@ -0,0 +1,24 @@ +import type { MessageShape } from "./types.js"; +import { BinaryWriter } from "./wire/binary-encoding.js"; +import { type DescField, type DescMessage } from "./descriptors.js"; +import type { ReflectMessage } from "./reflect/index.js"; +/** + * Options for serializing to binary data. + * + * V1 also had the option `readerFactory` for using a custom implementation to + * encode to binary. + */ +export interface BinaryWriteOptions { + /** + * Include unknown fields in the serialized output? The default behavior + * is to retain unknown fields and include them in the serialized output. + * + * For more details see https://developers.google.com/protocol-buffers/docs/proto3#unknowns + */ + writeUnknownFields: boolean; +} +export declare function toBinary(schema: Desc, message: MessageShape, options?: Partial): Uint8Array; +/** + * @private + */ +export declare function writeField(writer: BinaryWriter, opts: BinaryWriteOptions, msg: ReflectMessage, field: DescField): void; diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/to-binary.js b/node_modules/@bufbuild/protobuf/dist/cjs/to-binary.js new file mode 100644 index 0000000..bd9898a --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/to-binary.js @@ -0,0 +1,199 @@ +"use strict"; +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.toBinary = toBinary; +exports.writeField = writeField; +const reflect_js_1 = require("./reflect/reflect.js"); +const binary_encoding_js_1 = require("./wire/binary-encoding.js"); +const descriptors_js_1 = require("./descriptors.js"); +// bootstrap-inject google.protobuf.FeatureSet.FieldPresence.LEGACY_REQUIRED: const $name: FeatureSet_FieldPresence.$localName = $number; +const LEGACY_REQUIRED = 3; +// Default options for serializing binary data. +const writeDefaults = { + writeUnknownFields: true, +}; +function makeWriteOptions(options) { + return options ? Object.assign(Object.assign({}, writeDefaults), options) : writeDefaults; +} +function toBinary(schema, message, options) { + return writeFields(new binary_encoding_js_1.BinaryWriter(), makeWriteOptions(options), (0, reflect_js_1.reflect)(schema, message)).finish(); +} +function writeFields(writer, opts, msg) { + var _a; + for (const f of msg.sortedFields) { + if (!msg.isSet(f)) { + if (f.presence == LEGACY_REQUIRED) { + throw new Error(`cannot encode ${f} to binary: required field not set`); + } + continue; + } + writeField(writer, opts, msg, f); + } + if (opts.writeUnknownFields) { + for (const { no, wireType, data } of (_a = msg.getUnknown()) !== null && _a !== void 0 ? _a : []) { + writer.tag(no, wireType).raw(data); + } + } + return writer; +} +/** + * @private + */ +function writeField(writer, opts, msg, field) { + var _a; + switch (field.fieldKind) { + case "scalar": + case "enum": + writeScalar(writer, msg.desc.typeName, field.name, (_a = field.scalar) !== null && _a !== void 0 ? _a : descriptors_js_1.ScalarType.INT32, field.number, msg.get(field)); + break; + case "list": + writeListField(writer, opts, field, msg.get(field)); + break; + case "message": + writeMessageField(writer, opts, field, msg.get(field)); + break; + case "map": + for (const [key, val] of msg.get(field)) { + writeMapEntry(writer, opts, field, key, val); + } + break; + } +} +function writeScalar(writer, msgName, fieldName, scalarType, fieldNo, value) { + writeScalarValue(writer.tag(fieldNo, writeTypeOfScalar(scalarType)), msgName, fieldName, scalarType, value); +} +function writeMessageField(writer, opts, field, message) { + if (field.delimitedEncoding) { + writeFields(writer.tag(field.number, binary_encoding_js_1.WireType.StartGroup), opts, message).tag(field.number, binary_encoding_js_1.WireType.EndGroup); + } + else { + writeFields(writer.tag(field.number, binary_encoding_js_1.WireType.LengthDelimited).fork(), opts, message).join(); + } +} +function writeListField(writer, opts, field, list) { + var _a; + if (field.listKind == "message") { + for (const item of list) { + writeMessageField(writer, opts, field, item); + } + return; + } + const scalarType = (_a = field.scalar) !== null && _a !== void 0 ? _a : descriptors_js_1.ScalarType.INT32; + if (field.packed) { + if (!list.size) { + return; + } + writer.tag(field.number, binary_encoding_js_1.WireType.LengthDelimited).fork(); + for (const item of list) { + writeScalarValue(writer, field.parent.typeName, field.name, scalarType, item); + } + writer.join(); + return; + } + for (const item of list) { + writeScalar(writer, field.parent.typeName, field.name, scalarType, field.number, item); + } +} +function writeMapEntry(writer, opts, field, key, value) { + var _a; + writer.tag(field.number, binary_encoding_js_1.WireType.LengthDelimited).fork(); + // write key, expecting key field number = 1 + writeScalar(writer, field.parent.typeName, field.name, field.mapKey, 1, key); + // write value, expecting value field number = 2 + switch (field.mapKind) { + case "scalar": + case "enum": + writeScalar(writer, field.parent.typeName, field.name, (_a = field.scalar) !== null && _a !== void 0 ? _a : descriptors_js_1.ScalarType.INT32, 2, value); + break; + case "message": + writeFields(writer.tag(2, binary_encoding_js_1.WireType.LengthDelimited).fork(), opts, value).join(); + break; + } + writer.join(); +} +function writeScalarValue(writer, msgName, fieldName, type, value) { + try { + switch (type) { + case descriptors_js_1.ScalarType.STRING: + writer.string(value); + break; + case descriptors_js_1.ScalarType.BOOL: + writer.bool(value); + break; + case descriptors_js_1.ScalarType.DOUBLE: + writer.double(value); + break; + case descriptors_js_1.ScalarType.FLOAT: + writer.float(value); + break; + case descriptors_js_1.ScalarType.INT32: + writer.int32(value); + break; + case descriptors_js_1.ScalarType.INT64: + writer.int64(value); + break; + case descriptors_js_1.ScalarType.UINT64: + writer.uint64(value); + break; + case descriptors_js_1.ScalarType.FIXED64: + writer.fixed64(value); + break; + case descriptors_js_1.ScalarType.BYTES: + writer.bytes(value); + break; + case descriptors_js_1.ScalarType.FIXED32: + writer.fixed32(value); + break; + case descriptors_js_1.ScalarType.SFIXED32: + writer.sfixed32(value); + break; + case descriptors_js_1.ScalarType.SFIXED64: + writer.sfixed64(value); + break; + case descriptors_js_1.ScalarType.SINT64: + writer.sint64(value); + break; + case descriptors_js_1.ScalarType.UINT32: + writer.uint32(value); + break; + case descriptors_js_1.ScalarType.SINT32: + writer.sint32(value); + break; + } + } + catch (e) { + if (e instanceof Error) { + throw new Error(`cannot encode field ${msgName}.${fieldName} to binary: ${e.message}`); + } + throw e; + } +} +function writeTypeOfScalar(type) { + switch (type) { + case descriptors_js_1.ScalarType.BYTES: + case descriptors_js_1.ScalarType.STRING: + return binary_encoding_js_1.WireType.LengthDelimited; + case descriptors_js_1.ScalarType.DOUBLE: + case descriptors_js_1.ScalarType.FIXED64: + case descriptors_js_1.ScalarType.SFIXED64: + return binary_encoding_js_1.WireType.Bit64; + case descriptors_js_1.ScalarType.FIXED32: + case descriptors_js_1.ScalarType.SFIXED32: + case descriptors_js_1.ScalarType.FLOAT: + return binary_encoding_js_1.WireType.Bit32; + default: + return binary_encoding_js_1.WireType.Varint; + } +} diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/to-json.d.ts b/node_modules/@bufbuild/protobuf/dist/cjs/to-json.d.ts new file mode 100644 index 0000000..66a4a2c --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/to-json.d.ts @@ -0,0 +1,67 @@ +import { type DescEnum, type DescMessage } from "./descriptors.js"; +import type { JsonValue } from "./json-value.js"; +import type { Registry } from "./registry.js"; +import type { EnumJsonType, EnumShape, MessageJsonType, MessageShape } from "./types.js"; +/** + * Options for serializing to JSON. + */ +export interface JsonWriteOptions { + /** + * By default, fields with implicit presence are not serialized if they are + * unset. For example, an empty list field or a proto3 int32 field with 0 is + * not serialized. With this option enabled, such fields are included in the + * output. + */ + alwaysEmitImplicit: boolean; + /** + * Emit enum values as integers instead of strings: The name of an enum + * value is used by default in JSON output. An option may be provided to + * use the numeric value of the enum value instead. + */ + enumAsInteger: boolean; + /** + * Use proto field name instead of lowerCamelCase name: By default proto3 + * JSON printer should convert the field name to lowerCamelCase and use + * that as the JSON name. An implementation may provide an option to use + * proto field name as the JSON name instead. Proto3 JSON parsers are + * required to accept both the converted lowerCamelCase name and the proto + * field name. + */ + useProtoFieldName: boolean; + /** + * This option is required to write `google.protobuf.Any` and extensions + * to JSON format. + */ + registry?: Registry | undefined; +} +/** + * Options for serializing to JSON. + */ +export interface JsonWriteStringOptions extends JsonWriteOptions { + /** + * Format JSON with indentation. Indicates the number of space characters to + * be used as indentation. + * + * This option is passed to JSON.stringify as `space`. + */ + prettySpaces: number; +} +/** + * Serialize the message to a JSON value, a JavaScript value that can be + * passed to JSON.stringify(). + */ +export declare function toJson | undefined = undefined>(schema: Desc, message: MessageShape, options?: Opts): ToJson; +type ToJson> = Opts extends undefined | { + alwaysEmitImplicit?: false; + enumAsInteger?: false; + useProtoFieldName?: false; +} ? MessageJsonType : JsonValue; +/** + * Serialize the message to a JSON string. + */ +export declare function toJsonString(schema: Desc, message: MessageShape, options?: Partial): string; +/** + * Serialize a single enum value to JSON. + */ +export declare function enumToJson(descEnum: Desc, value: EnumShape): EnumJsonType; +export {}; diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/to-json.js b/node_modules/@bufbuild/protobuf/dist/cjs/to-json.js new file mode 100644 index 0000000..c432d03 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/to-json.js @@ -0,0 +1,391 @@ +"use strict"; +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.toJson = toJson; +exports.toJsonString = toJsonString; +exports.enumToJson = enumToJson; +const descriptors_js_1 = require("./descriptors.js"); +const names_js_1 = require("./reflect/names.js"); +const reflect_js_1 = require("./reflect/reflect.js"); +const index_js_1 = require("./wkt/index.js"); +const wrappers_js_1 = require("./wkt/wrappers.js"); +const index_js_2 = require("./wire/index.js"); +const extensions_js_1 = require("./extensions.js"); +const reflect_check_js_1 = require("./reflect/reflect-check.js"); +// bootstrap-inject google.protobuf.FeatureSet.FieldPresence.LEGACY_REQUIRED: const $name: FeatureSet_FieldPresence.$localName = $number; +const LEGACY_REQUIRED = 3; +// bootstrap-inject google.protobuf.FeatureSet.FieldPresence.IMPLICIT: const $name: FeatureSet_FieldPresence.$localName = $number; +const IMPLICIT = 2; +// Default options for serializing to JSON. +const jsonWriteDefaults = { + alwaysEmitImplicit: false, + enumAsInteger: false, + useProtoFieldName: false, +}; +function makeWriteOptions(options) { + return options ? Object.assign(Object.assign({}, jsonWriteDefaults), options) : jsonWriteDefaults; +} +/** + * Serialize the message to a JSON value, a JavaScript value that can be + * passed to JSON.stringify(). + */ +function toJson(schema, message, options) { + return reflectToJson((0, reflect_js_1.reflect)(schema, message), makeWriteOptions(options)); +} +/** + * Serialize the message to a JSON string. + */ +function toJsonString(schema, message, options) { + var _a; + const jsonValue = toJson(schema, message, options); + return JSON.stringify(jsonValue, null, (_a = options === null || options === void 0 ? void 0 : options.prettySpaces) !== null && _a !== void 0 ? _a : 0); +} +/** + * Serialize a single enum value to JSON. + */ +function enumToJson(descEnum, value) { + var _a; + if (descEnum.typeName == "google.protobuf.NullValue") { + return null; + } + const name = (_a = descEnum.value[value]) === null || _a === void 0 ? void 0 : _a.name; + if (name === undefined) { + throw new Error(`${value} is not a value in ${descEnum}`); + } + return name; +} +function reflectToJson(msg, opts) { + var _a; + const wktJson = tryWktToJson(msg, opts); + if (wktJson !== undefined) + return wktJson; + const json = {}; + for (const f of msg.sortedFields) { + if (!msg.isSet(f)) { + if (f.presence == LEGACY_REQUIRED) { + throw new Error(`cannot encode ${f} to JSON: required field not set`); + } + if (!opts.alwaysEmitImplicit || f.presence !== IMPLICIT) { + // Fields with implicit presence omit zero values (e.g. empty string) by default + continue; + } + } + const jsonValue = fieldToJson(f, msg.get(f), opts); + if (jsonValue !== undefined) { + json[jsonName(f, opts)] = jsonValue; + } + } + if (opts.registry) { + const tagSeen = new Set(); + for (const { no } of (_a = msg.getUnknown()) !== null && _a !== void 0 ? _a : []) { + // Same tag can appear multiple times, so we + // keep track and skip identical ones. + if (!tagSeen.has(no)) { + tagSeen.add(no); + const extension = opts.registry.getExtensionFor(msg.desc, no); + if (!extension) { + continue; + } + const value = (0, extensions_js_1.getExtension)(msg.message, extension); + const [container, field] = (0, extensions_js_1.createExtensionContainer)(extension, value); + const jsonValue = fieldToJson(field, container.get(field), opts); + if (jsonValue !== undefined) { + json[extension.jsonName] = jsonValue; + } + } + } + } + return json; +} +function fieldToJson(f, val, opts) { + switch (f.fieldKind) { + case "scalar": + return scalarToJson(f, val); + case "message": + return reflectToJson(val, opts); + case "enum": + return enumToJsonInternal(f.enum, val, opts.enumAsInteger); + case "list": + return listToJson(val, opts); + case "map": + return mapToJson(val, opts); + } +} +function mapToJson(map, opts) { + const f = map.field(); + const jsonObj = {}; + switch (f.mapKind) { + case "scalar": + for (const [entryKey, entryValue] of map) { + jsonObj[entryKey] = scalarToJson(f, entryValue); + } + break; + case "message": + for (const [entryKey, entryValue] of map) { + jsonObj[entryKey] = reflectToJson(entryValue, opts); + } + break; + case "enum": + for (const [entryKey, entryValue] of map) { + jsonObj[entryKey] = enumToJsonInternal(f.enum, entryValue, opts.enumAsInteger); + } + break; + } + return opts.alwaysEmitImplicit || map.size > 0 ? jsonObj : undefined; +} +function listToJson(list, opts) { + const f = list.field(); + const jsonArr = []; + switch (f.listKind) { + case "scalar": + for (const item of list) { + jsonArr.push(scalarToJson(f, item)); + } + break; + case "enum": + for (const item of list) { + jsonArr.push(enumToJsonInternal(f.enum, item, opts.enumAsInteger)); + } + break; + case "message": + for (const item of list) { + jsonArr.push(reflectToJson(item, opts)); + } + break; + } + return opts.alwaysEmitImplicit || jsonArr.length > 0 ? jsonArr : undefined; +} +function enumToJsonInternal(desc, value, enumAsInteger) { + var _a; + if (typeof value != "number") { + throw new Error(`cannot encode ${desc} to JSON: expected number, got ${(0, reflect_check_js_1.formatVal)(value)}`); + } + if (desc.typeName == "google.protobuf.NullValue") { + return null; + } + if (enumAsInteger) { + return value; + } + const val = desc.value[value]; + return (_a = val === null || val === void 0 ? void 0 : val.name) !== null && _a !== void 0 ? _a : value; // if we don't know the enum value, just return the number +} +function scalarToJson(field, value) { + var _a, _b, _c, _d, _e, _f; + switch (field.scalar) { + // int32, fixed32, uint32: JSON value will be a decimal number. Either numbers or strings are accepted. + case descriptors_js_1.ScalarType.INT32: + case descriptors_js_1.ScalarType.SFIXED32: + case descriptors_js_1.ScalarType.SINT32: + case descriptors_js_1.ScalarType.FIXED32: + case descriptors_js_1.ScalarType.UINT32: + if (typeof value != "number") { + throw new Error(`cannot encode ${field} to JSON: ${(_a = (0, reflect_check_js_1.checkField)(field, value)) === null || _a === void 0 ? void 0 : _a.message}`); + } + return value; + // float, double: JSON value will be a number or one of the special string values "NaN", "Infinity", and "-Infinity". + // Either numbers or strings are accepted. Exponent notation is also accepted. + case descriptors_js_1.ScalarType.FLOAT: + case descriptors_js_1.ScalarType.DOUBLE: // eslint-disable-line no-fallthrough + if (typeof value != "number") { + throw new Error(`cannot encode ${field} to JSON: ${(_b = (0, reflect_check_js_1.checkField)(field, value)) === null || _b === void 0 ? void 0 : _b.message}`); + } + if (Number.isNaN(value)) + return "NaN"; + if (value === Number.POSITIVE_INFINITY) + return "Infinity"; + if (value === Number.NEGATIVE_INFINITY) + return "-Infinity"; + return value; + // string: + case descriptors_js_1.ScalarType.STRING: + if (typeof value != "string") { + throw new Error(`cannot encode ${field} to JSON: ${(_c = (0, reflect_check_js_1.checkField)(field, value)) === null || _c === void 0 ? void 0 : _c.message}`); + } + return value; + // bool: + case descriptors_js_1.ScalarType.BOOL: + if (typeof value != "boolean") { + throw new Error(`cannot encode ${field} to JSON: ${(_d = (0, reflect_check_js_1.checkField)(field, value)) === null || _d === void 0 ? void 0 : _d.message}`); + } + return value; + // JSON value will be a decimal string. Either numbers or strings are accepted. + case descriptors_js_1.ScalarType.UINT64: + case descriptors_js_1.ScalarType.FIXED64: + case descriptors_js_1.ScalarType.INT64: + case descriptors_js_1.ScalarType.SFIXED64: + case descriptors_js_1.ScalarType.SINT64: + if (typeof value == "bigint" || + typeof value == "string" || + (typeof value == "number" && Number.isInteger(value))) { + return value.toString(); + } + throw new Error(`cannot encode ${field} to JSON: ${(_e = (0, reflect_check_js_1.checkField)(field, value)) === null || _e === void 0 ? void 0 : _e.message}`); + // bytes: JSON value will be the data encoded as a string using standard base64 encoding with paddings. + // Either standard or URL-safe base64 encoding with/without paddings are accepted. + case descriptors_js_1.ScalarType.BYTES: + if (value instanceof Uint8Array) { + return (0, index_js_2.base64Encode)(value); + } + throw new Error(`cannot encode ${field} to JSON: ${(_f = (0, reflect_check_js_1.checkField)(field, value)) === null || _f === void 0 ? void 0 : _f.message}`); + } +} +function jsonName(f, opts) { + return opts.useProtoFieldName ? f.name : f.jsonName; +} +// returns a json value if wkt, otherwise returns undefined. +function tryWktToJson(msg, opts) { + if (!msg.desc.typeName.startsWith("google.protobuf.")) { + return undefined; + } + switch (msg.desc.typeName) { + case "google.protobuf.Any": + return anyToJson(msg.message, opts); + case "google.protobuf.Timestamp": + return timestampToJson(msg.message); + case "google.protobuf.Duration": + return durationToJson(msg.message); + case "google.protobuf.FieldMask": + return fieldMaskToJson(msg.message); + case "google.protobuf.Struct": + return structToJson(msg.message); + case "google.protobuf.Value": + return valueToJson(msg.message); + case "google.protobuf.ListValue": + return listValueToJson(msg.message); + default: + if ((0, wrappers_js_1.isWrapperDesc)(msg.desc)) { + const valueField = msg.desc.fields[0]; + return scalarToJson(valueField, msg.get(valueField)); + } + return undefined; + } +} +function anyToJson(val, opts) { + if (val.typeUrl === "") { + return {}; + } + const { registry } = opts; + let message; + let desc; + if (registry) { + message = (0, index_js_1.anyUnpack)(val, registry); + if (message) { + desc = registry.getMessage(message.$typeName); + } + } + if (!desc || !message) { + throw new Error(`cannot encode message ${val.$typeName} to JSON: "${val.typeUrl}" is not in the type registry`); + } + const reflected = (0, reflect_js_1.reflect)(desc, message); + const json = (0, wrappers_js_1.hasCustomJsonRepresentation)(desc) + ? { value: tryWktToJson(reflected, opts) } + : reflectToJson(reflected, opts); + json["@type"] = val.typeUrl; + return json; +} +function durationToJson(val) { + const seconds = Number(val.seconds); + const nanos = val.nanos; + if (seconds > 315576000000 || seconds < -315576000000) { + throw new Error(`cannot encode message ${val.$typeName} to JSON: value out of range`); + } + if ((seconds > 0 && nanos < 0) || (seconds < 0 && nanos > 0)) { + throw new Error(`cannot encode message ${val.$typeName} to JSON: nanos sign must match seconds sign`); + } + let text = val.seconds.toString(); + if (nanos !== 0) { + let nanosStr = Math.abs(nanos).toString(); + nanosStr = "0".repeat(9 - nanosStr.length) + nanosStr; + if (nanosStr.substring(3) === "000000") { + nanosStr = nanosStr.substring(0, 3); + } + else if (nanosStr.substring(6) === "000") { + nanosStr = nanosStr.substring(0, 6); + } + text += "." + nanosStr; + if (nanos < 0 && seconds == 0) { + text = "-" + text; + } + } + return text + "s"; +} +function fieldMaskToJson(val) { + return val.paths + .map((p) => { + if ((0, names_js_1.protoSnakeCase)((0, names_js_1.protoCamelCase)(p)) !== p) { + throw new Error(`cannot encode message ${val.$typeName} to JSON: lowerCamelCase of path name "${p}" is irreversible`); + } + return (0, names_js_1.protoCamelCase)(p); + }) + .join(","); +} +function structToJson(val) { + const json = {}; + for (const [k, v] of Object.entries(val.fields)) { + json[k] = valueToJson(v); + } + return json; +} +function valueToJson(val) { + switch (val.kind.case) { + case "nullValue": + return null; + case "numberValue": + if (!Number.isFinite(val.kind.value)) { + throw new Error(`${val.$typeName} cannot be NaN or Infinity`); + } + return val.kind.value; + case "boolValue": + return val.kind.value; + case "stringValue": + return val.kind.value; + case "structValue": + return structToJson(val.kind.value); + case "listValue": + return listValueToJson(val.kind.value); + default: + throw new Error(`${val.$typeName} must have a value`); + } +} +function listValueToJson(val) { + return val.values.map(valueToJson); +} +function timestampToJson(val) { + const ms = Number(val.seconds) * 1000; + if (ms < Date.parse("0001-01-01T00:00:00Z") || + ms > Date.parse("9999-12-31T23:59:59Z")) { + throw new Error(`cannot encode message ${val.$typeName} to JSON: must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive`); + } + if (val.nanos < 0) { + throw new Error(`cannot encode message ${val.$typeName} to JSON: nanos must not be negative`); + } + if (val.nanos > 999999999) { + throw new Error(`cannot encode message ${val.$typeName} to JSON: nanos must not be greater than 99999999`); + } + let z = "Z"; + if (val.nanos > 0) { + const nanosStr = (val.nanos + 1000000000).toString().substring(1); + if (nanosStr.substring(3) === "000000") { + z = "." + nanosStr.substring(0, 3) + "Z"; + } + else if (nanosStr.substring(6) === "000") { + z = "." + nanosStr.substring(0, 6) + "Z"; + } + else { + z = "." + nanosStr + "Z"; + } + } + return new Date(ms).toISOString().replace(".000Z", z); +} diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/types.d.ts b/node_modules/@bufbuild/protobuf/dist/cjs/types.d.ts new file mode 100644 index 0000000..56fa28d --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/types.d.ts @@ -0,0 +1,128 @@ +import type { GenEnum as GenEnumV1, GenExtension as GenExtensionV1, GenMessage as GenMessageV1 } from "./codegenv1/types.js"; +import type { GenEnum as GenEnumV2, GenExtension as GenExtensionV2, GenMessage as GenMessageV2 } from "./codegenv2/types.js"; +import type { DescEnum, DescExtension, DescMessage, DescMethod } from "./descriptors.js"; +import type { OneofADT } from "./reflect/guard.js"; +import type { WireType } from "./wire/index.js"; +import type { JsonValue } from "./json-value.js"; +/** + * The type `Message` contains the properties shared by all messages. + */ +export type Message = { + /** + * The fully qualified Protobuf type-name of the message. + */ + readonly $typeName: TypeName; + /** + * Unknown fields and extensions stored on the message. + */ + $unknown?: UnknownField[] | undefined; +}; +/** + * Extract the message type from a message descriptor. + */ +export type MessageShape = Desc extends GenMessageV1 ? RuntimeShapeV1 : Desc extends GenMessageV2 ? RuntimeShape : Message; +/** + * Extract the message JSON type from a message descriptor. + * + * JSON types are only available for code generated with the plugin option + * `json_types=true`. If JSON types are unavailable, this type falls back to the + * `JsonValue` type. + */ +export type MessageJsonType = Desc extends GenMessageV1 ? JsonTypeV1 : Desc extends GenMessageV2 ? JsonType : JsonValue; +/** + * Extract the message Valid type from a message descriptor. + * + * Valid types are only available for code generated with the plugin option + * `valid_types`. If Valid types are unavailable, this type falls back to the + * regular message shape. + */ +export type MessageValidType = Desc extends GenMessageV1 ? RuntimeShapeV1 : Desc extends GenMessageV2 ? ValidType : Desc extends GenMessageV2 ? RuntimeShape : Message; +/** + * Extract the init type from a message descriptor. + * The init type is accepted by the function create(). + */ +export type MessageInitShape = Desc extends GenMessageV1 ? MessageInit : Desc extends GenMessageV2 ? MessageInit : Record; +/** + * Extract the enum type of from an enum descriptor. + */ +export type EnumShape = Desc extends GenEnumV1 ? RuntimeShape : Desc extends GenEnumV2 ? RuntimeShape : number; +/** + * Extract the enum JSON type from a enum descriptor. + */ +export type EnumJsonType = Desc extends GenEnumV1 ? JsonType : Desc extends GenEnumV2 ? JsonType : string | null; +/** + * Extract the value type from an extension descriptor. + */ +export type ExtensionValueShape = Desc extends GenExtensionV1 ? RuntimeShape : Desc extends GenExtensionV2 ? RuntimeShape : unknown; +/** + * Extract the type of the extended message from an extension descriptor. + */ +export type Extendee = Desc extends GenExtensionV1 ? Extendee : Desc extends GenExtensionV2 ? Extendee : Message; +/** + * Unknown fields are fields that were not recognized during parsing, or + * extension. + */ +export type UnknownField = { + readonly no: number; + readonly wireType: WireType; + readonly data: Uint8Array; +}; +/** + * Describes a streaming RPC declaration. + */ +export type DescMethodStreaming = DescMethodClientStreaming | DescMethodServerStreaming | DescMethodBiDiStreaming; +/** + * Describes a unary RPC declaration. + */ +export type DescMethodUnary = DescMethodTyped<"unary", I, O>; +/** + * Describes a server streaming RPC declaration. + */ +export type DescMethodServerStreaming = DescMethodTyped<"server_streaming", I, O>; +/** + * Describes a client streaming RPC declaration. + */ +export type DescMethodClientStreaming = DescMethodTyped<"client_streaming", I, O>; +/** + * Describes a bidi streaming RPC declaration. + */ +export type DescMethodBiDiStreaming = DescMethodTyped<"bidi_streaming", I, O>; +/** + * The init type for a message, which makes all fields optional. + * The init type is accepted by the function create(). + */ +type MessageInit = T | { + [P in keyof T as P extends "$unknown" ? never : P]?: P extends "$typeName" ? never : FieldInit; +}; +type FieldInit = F extends (Date | Uint8Array | bigint | boolean | string | number) ? F : F extends Array ? Array> : F extends ReadonlyArray ? ReadonlyArray> : F extends Message ? MessageInit : F extends OneofSelectedMessage ? { + case: C; + value: MessageInit; +} : F extends OneofADT ? F : F extends MapWithMessage ? { + [key: string | number]: MessageInit; +} : F; +type MapWithMessage = { + [key: string | number]: V; +}; +type OneofSelectedMessage = { + case: K; + value: M; +}; +type DescMethodTyped = Omit & { + /** + * One of the four available method types. + */ + readonly methodKind: K; + /** + * The message type for requests. + */ + readonly input: I; + /** + * The message type for responses. + */ + readonly output: O; +}; +export {}; diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/types.js b/node_modules/@bufbuild/protobuf/dist/cjs/types.js new file mode 100644 index 0000000..05da9e9 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/types.js @@ -0,0 +1,15 @@ +"use strict"; +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/wire/base64-encoding.d.ts b/node_modules/@bufbuild/protobuf/dist/cjs/wire/base64-encoding.d.ts new file mode 100644 index 0000000..bbe3d7d --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/wire/base64-encoding.d.ts @@ -0,0 +1,23 @@ +/** + * Decodes a base64 string to a byte array. + * + * - ignores white-space, including line breaks and tabs + * - allows inner padding (can decode concatenated base64 strings) + * - does not require padding + * - understands base64url encoding: + * "-" instead of "+", + * "_" instead of "/", + * no padding + */ +export declare function base64Decode(base64Str: string): Uint8Array; +/** + * Encode a byte array to a base64 string. + * + * By default, this function uses the standard base64 encoding with padding. + * + * To encode without padding, use encoding = "std_raw". + * + * To encode with the URL encoding, use encoding = "url", which replaces the + * characters +/ by their URL-safe counterparts -_, and omits padding. + */ +export declare function base64Encode(bytes: Uint8Array, encoding?: "std" | "std_raw" | "url"): string; diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/wire/base64-encoding.js b/node_modules/@bufbuild/protobuf/dist/cjs/wire/base64-encoding.js new file mode 100644 index 0000000..6297e16 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/wire/base64-encoding.js @@ -0,0 +1,156 @@ +"use strict"; +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.base64Decode = base64Decode; +exports.base64Encode = base64Encode; +/** + * Decodes a base64 string to a byte array. + * + * - ignores white-space, including line breaks and tabs + * - allows inner padding (can decode concatenated base64 strings) + * - does not require padding + * - understands base64url encoding: + * "-" instead of "+", + * "_" instead of "/", + * no padding + */ +function base64Decode(base64Str) { + const table = getDecodeTable(); + // estimate byte size, not accounting for inner padding and whitespace + let es = (base64Str.length * 3) / 4; + if (base64Str[base64Str.length - 2] == "=") + es -= 2; + else if (base64Str[base64Str.length - 1] == "=") + es -= 1; + let bytes = new Uint8Array(es), bytePos = 0, // position in byte array + groupPos = 0, // position in base64 group + b, // current byte + p = 0; // previous byte + for (let i = 0; i < base64Str.length; i++) { + b = table[base64Str.charCodeAt(i)]; + if (b === undefined) { + switch (base64Str[i]) { + // @ts-ignore TS7029: Fallthrough case in switch -- ignore instead of expect-error for compiler settings without noFallthroughCasesInSwitch: true + case "=": + groupPos = 0; // reset state when padding found + case "\n": + case "\r": + case "\t": + case " ": + continue; // skip white-space, and padding + default: + throw Error("invalid base64 string"); + } + } + switch (groupPos) { + case 0: + p = b; + groupPos = 1; + break; + case 1: + bytes[bytePos++] = (p << 2) | ((b & 48) >> 4); + p = b; + groupPos = 2; + break; + case 2: + bytes[bytePos++] = ((p & 15) << 4) | ((b & 60) >> 2); + p = b; + groupPos = 3; + break; + case 3: + bytes[bytePos++] = ((p & 3) << 6) | b; + groupPos = 0; + break; + } + } + if (groupPos == 1) + throw Error("invalid base64 string"); + return bytes.subarray(0, bytePos); +} +/** + * Encode a byte array to a base64 string. + * + * By default, this function uses the standard base64 encoding with padding. + * + * To encode without padding, use encoding = "std_raw". + * + * To encode with the URL encoding, use encoding = "url", which replaces the + * characters +/ by their URL-safe counterparts -_, and omits padding. + */ +function base64Encode(bytes, encoding = "std") { + const table = getEncodeTable(encoding); + const pad = encoding == "std"; + let base64 = "", groupPos = 0, // position in base64 group + b, // current byte + p = 0; // carry over from previous byte + for (let i = 0; i < bytes.length; i++) { + b = bytes[i]; + switch (groupPos) { + case 0: + base64 += table[b >> 2]; + p = (b & 3) << 4; + groupPos = 1; + break; + case 1: + base64 += table[p | (b >> 4)]; + p = (b & 15) << 2; + groupPos = 2; + break; + case 2: + base64 += table[p | (b >> 6)]; + base64 += table[b & 63]; + groupPos = 0; + break; + } + } + // add output padding + if (groupPos) { + base64 += table[p]; + if (pad) { + base64 += "="; + if (groupPos == 1) + base64 += "="; + } + } + return base64; +} +// lookup table from base64 character to byte +let encodeTableStd; +let encodeTableUrl; +// lookup table from base64 character *code* to byte because lookup by number is fast +let decodeTable; +function getEncodeTable(encoding) { + if (!encodeTableStd) { + encodeTableStd = + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""); + encodeTableUrl = encodeTableStd.slice(0, -2).concat("-", "_"); + } + return encoding == "url" + ? // biome-ignore lint/style/noNonNullAssertion: TS fails to narrow down + encodeTableUrl + : encodeTableStd; +} +function getDecodeTable() { + if (!decodeTable) { + decodeTable = []; + const encodeTable = getEncodeTable("std"); + for (let i = 0; i < encodeTable.length; i++) + decodeTable[encodeTable[i].charCodeAt(0)] = i; + // support base64url variants + decodeTable["-".charCodeAt(0)] = encodeTable.indexOf("+"); + decodeTable["_".charCodeAt(0)] = encodeTable.indexOf("/"); + } + return decodeTable; +} diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/wire/binary-encoding.d.ts b/node_modules/@bufbuild/protobuf/dist/cjs/wire/binary-encoding.d.ts new file mode 100644 index 0000000..53b6573 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/wire/binary-encoding.d.ts @@ -0,0 +1,266 @@ +/** + * Protobuf binary format wire types. + * + * A wire type provides just enough information to find the length of the + * following value. + * + * See https://developers.google.com/protocol-buffers/docs/encoding#structure + */ +export declare enum WireType { + /** + * Used for int32, int64, uint32, uint64, sint32, sint64, bool, enum + */ + Varint = 0, + /** + * Used for fixed64, sfixed64, double. + * Always 8 bytes with little-endian byte order. + */ + Bit64 = 1, + /** + * Used for string, bytes, embedded messages, packed repeated fields + * + * Only repeated numeric types (types which use the varint, 32-bit, + * or 64-bit wire types) can be packed. In proto3, such fields are + * packed by default. + */ + LengthDelimited = 2, + /** + * Start of a tag-delimited aggregate, such as a proto2 group, or a message + * in editions with message_encoding = DELIMITED. + */ + StartGroup = 3, + /** + * End of a tag-delimited aggregate. + */ + EndGroup = 4, + /** + * Used for fixed32, sfixed32, float. + * Always 4 bytes with little-endian byte order. + */ + Bit32 = 5 +} +/** + * Maximum value for a 32-bit floating point value (Protobuf FLOAT). + */ +export declare const FLOAT32_MAX = 3.4028234663852886e+38; +/** + * Minimum value for a 32-bit floating point value (Protobuf FLOAT). + */ +export declare const FLOAT32_MIN = -3.4028234663852886e+38; +/** + * Maximum value for an unsigned 32-bit integer (Protobuf UINT32, FIXED32). + */ +export declare const UINT32_MAX = 4294967295; +/** + * Maximum value for a signed 32-bit integer (Protobuf INT32, SFIXED32, SINT32). + */ +export declare const INT32_MAX = 2147483647; +/** + * Minimum value for a signed 32-bit integer (Protobuf INT32, SFIXED32, SINT32). + */ +export declare const INT32_MIN = -2147483648; +export declare class BinaryWriter { + private readonly encodeUtf8; + /** + * We cannot allocate a buffer for the entire output + * because we don't know its size. + * + * So we collect smaller chunks of known size and + * concat them later. + * + * Use `raw()` to push data to this array. It will flush + * `buf` first. + */ + private chunks; + /** + * A growing buffer for byte values. If you don't know + * the size of the data you are writing, push to this + * array. + */ + protected buf: number[]; + /** + * Previous fork states. + */ + private stack; + constructor(encodeUtf8?: (text: string) => Uint8Array); + /** + * Return all bytes written and reset this writer. + */ + finish(): Uint8Array; + /** + * Start a new fork for length-delimited data like a message + * or a packed repeated field. + * + * Must be joined later with `join()`. + */ + fork(): this; + /** + * Join the last fork. Write its length and bytes, then + * return to the previous state. + */ + join(): this; + /** + * Writes a tag (field number and wire type). + * + * Equivalent to `uint32( (fieldNo << 3 | type) >>> 0 )`. + * + * Generated code should compute the tag ahead of time and call `uint32()`. + */ + tag(fieldNo: number, type: WireType): this; + /** + * Write a chunk of raw bytes. + */ + raw(chunk: Uint8Array): this; + /** + * Write a `uint32` value, an unsigned 32 bit varint. + */ + uint32(value: number): this; + /** + * Write a `int32` value, a signed 32 bit varint. + */ + int32(value: number): this; + /** + * Write a `bool` value, a varint. + */ + bool(value: boolean): this; + /** + * Write a `bytes` value, length-delimited arbitrary data. + */ + bytes(value: Uint8Array): this; + /** + * Write a `string` value, length-delimited data converted to UTF-8 text. + */ + string(value: string): this; + /** + * Write a `float` value, 32-bit floating point number. + */ + float(value: number): this; + /** + * Write a `double` value, a 64-bit floating point number. + */ + double(value: number): this; + /** + * Write a `fixed32` value, an unsigned, fixed-length 32-bit integer. + */ + fixed32(value: number): this; + /** + * Write a `sfixed32` value, a signed, fixed-length 32-bit integer. + */ + sfixed32(value: number): this; + /** + * Write a `sint32` value, a signed, zigzag-encoded 32-bit varint. + */ + sint32(value: number): this; + /** + * Write a `sfixed64` value, a signed, fixed-length 64-bit integer. + */ + sfixed64(value: string | number | bigint): this; + /** + * Write a `fixed64` value, an unsigned, fixed-length 64 bit integer. + */ + fixed64(value: string | number | bigint): this; + /** + * Write a `int64` value, a signed 64-bit varint. + */ + int64(value: string | number | bigint): this; + /** + * Write a `sint64` value, a signed, zig-zag-encoded 64-bit varint. + */ + sint64(value: string | number | bigint): this; + /** + * Write a `uint64` value, an unsigned 64-bit varint. + */ + uint64(value: string | number | bigint): this; +} +export declare class BinaryReader { + private readonly decodeUtf8; + /** + * Current position. + */ + pos: number; + /** + * Number of bytes available in this reader. + */ + readonly len: number; + protected readonly buf: Uint8Array; + private readonly view; + constructor(buf: Uint8Array, decodeUtf8?: (bytes: Uint8Array, strict?: boolean) => string); + /** + * Reads a tag - field number and wire type. Tags are uint32 varints; values + * that do not fit in uint32 are rejected. + */ + tag(): [number, WireType]; + /** + * Skip one element and return the skipped data. + * + * When skipping StartGroup, provide the tags field number to check for + * matching field number in the EndGroup tag. + */ + skip(wireType: WireType, fieldNo?: number): Uint8Array; + protected varint64: () => [number, number]; + /** + * Throws error if position in byte array is out of range. + */ + protected assertBounds(): void; + /** + * Read a `uint32` field, an unsigned 32 bit varint. + */ + uint32: () => number; + /** + * Read a `int32` field, a signed 32 bit varint. + */ + int32(): number; + /** + * Read a `sint32` field, a signed, zigzag-encoded 32-bit varint. + */ + sint32(): number; + /** + * Read a `int64` field, a signed 64-bit varint. + */ + int64(): bigint | string; + /** + * Read a `uint64` field, an unsigned 64-bit varint. + */ + uint64(): bigint | string; + /** + * Read a `sint64` field, a signed, zig-zag-encoded 64-bit varint. + */ + sint64(): bigint | string; + /** + * Read a `bool` field, a variant. + */ + bool(): boolean; + /** + * Read a `fixed32` field, an unsigned, fixed-length 32-bit integer. + */ + fixed32(): number; + /** + * Read a `sfixed32` field, a signed, fixed-length 32-bit integer. + */ + sfixed32(): number; + /** + * Read a `fixed64` field, an unsigned, fixed-length 64 bit integer. + */ + fixed64(): bigint | string; + /** + * Read a `fixed64` field, a signed, fixed-length 64-bit integer. + */ + sfixed64(): bigint | string; + /** + * Read a `float` field, 32-bit floating point number. + */ + float(): number; + /** + * Read a `double` field, a 64-bit floating point number. + */ + double(): number; + /** + * Read a `bytes` field, length-delimited arbitrary data. + */ + bytes(): Uint8Array; + /** + * Read a `string` field, length-delimited data converted to UTF-8 text. If + * `strict` is true, throw on invalid UTF-8 instead of substituting U+FFFD. + */ + string(strict?: boolean): string; +} diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/wire/binary-encoding.js b/node_modules/@bufbuild/protobuf/dist/cjs/wire/binary-encoding.js new file mode 100644 index 0000000..8e62ca8 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/wire/binary-encoding.js @@ -0,0 +1,525 @@ +"use strict"; +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.BinaryReader = exports.BinaryWriter = exports.INT32_MIN = exports.INT32_MAX = exports.UINT32_MAX = exports.FLOAT32_MIN = exports.FLOAT32_MAX = exports.WireType = void 0; +const varint_js_1 = require("./varint.js"); +const proto_int64_js_1 = require("../proto-int64.js"); +const text_encoding_js_1 = require("./text-encoding.js"); +/** + * Protobuf binary format wire types. + * + * A wire type provides just enough information to find the length of the + * following value. + * + * See https://developers.google.com/protocol-buffers/docs/encoding#structure + */ +var WireType; +(function (WireType) { + /** + * Used for int32, int64, uint32, uint64, sint32, sint64, bool, enum + */ + WireType[WireType["Varint"] = 0] = "Varint"; + /** + * Used for fixed64, sfixed64, double. + * Always 8 bytes with little-endian byte order. + */ + WireType[WireType["Bit64"] = 1] = "Bit64"; + /** + * Used for string, bytes, embedded messages, packed repeated fields + * + * Only repeated numeric types (types which use the varint, 32-bit, + * or 64-bit wire types) can be packed. In proto3, such fields are + * packed by default. + */ + WireType[WireType["LengthDelimited"] = 2] = "LengthDelimited"; + /** + * Start of a tag-delimited aggregate, such as a proto2 group, or a message + * in editions with message_encoding = DELIMITED. + */ + WireType[WireType["StartGroup"] = 3] = "StartGroup"; + /** + * End of a tag-delimited aggregate. + */ + WireType[WireType["EndGroup"] = 4] = "EndGroup"; + /** + * Used for fixed32, sfixed32, float. + * Always 4 bytes with little-endian byte order. + */ + WireType[WireType["Bit32"] = 5] = "Bit32"; +})(WireType || (exports.WireType = WireType = {})); +/** + * Maximum value for a 32-bit floating point value (Protobuf FLOAT). + */ +exports.FLOAT32_MAX = 3.4028234663852886e38; +/** + * Minimum value for a 32-bit floating point value (Protobuf FLOAT). + */ +exports.FLOAT32_MIN = -3.4028234663852886e38; +/** + * Maximum value for an unsigned 32-bit integer (Protobuf UINT32, FIXED32). + */ +exports.UINT32_MAX = 0xffffffff; +/** + * Maximum value for a signed 32-bit integer (Protobuf INT32, SFIXED32, SINT32). + */ +exports.INT32_MAX = 0x7fffffff; +/** + * Minimum value for a signed 32-bit integer (Protobuf INT32, SFIXED32, SINT32). + */ +exports.INT32_MIN = -0x80000000; +class BinaryWriter { + constructor(encodeUtf8 = (0, text_encoding_js_1.getTextEncoding)().encodeUtf8) { + this.encodeUtf8 = encodeUtf8; + /** + * Previous fork states. + */ + this.stack = []; + this.chunks = []; + this.buf = []; + } + /** + * Return all bytes written and reset this writer. + */ + finish() { + if (this.buf.length) { + this.chunks.push(new Uint8Array(this.buf)); // flush the buffer + this.buf = []; + } + let len = 0; + for (let i = 0; i < this.chunks.length; i++) + len += this.chunks[i].length; + let bytes = new Uint8Array(len); + let offset = 0; + for (let i = 0; i < this.chunks.length; i++) { + bytes.set(this.chunks[i], offset); + offset += this.chunks[i].length; + } + this.chunks = []; + return bytes; + } + /** + * Start a new fork for length-delimited data like a message + * or a packed repeated field. + * + * Must be joined later with `join()`. + */ + fork() { + this.stack.push({ chunks: this.chunks, buf: this.buf }); + this.chunks = []; + this.buf = []; + return this; + } + /** + * Join the last fork. Write its length and bytes, then + * return to the previous state. + */ + join() { + // get chunk of fork + let chunk = this.finish(); + // restore previous state + let prev = this.stack.pop(); + if (!prev) + throw new Error("invalid state, fork stack empty"); + this.chunks = prev.chunks; + this.buf = prev.buf; + // write length of chunk as varint + this.uint32(chunk.byteLength); + return this.raw(chunk); + } + /** + * Writes a tag (field number and wire type). + * + * Equivalent to `uint32( (fieldNo << 3 | type) >>> 0 )`. + * + * Generated code should compute the tag ahead of time and call `uint32()`. + */ + tag(fieldNo, type) { + return this.uint32(((fieldNo << 3) | type) >>> 0); + } + /** + * Write a chunk of raw bytes. + */ + raw(chunk) { + if (this.buf.length) { + this.chunks.push(new Uint8Array(this.buf)); + this.buf = []; + } + this.chunks.push(chunk); + return this; + } + /** + * Write a `uint32` value, an unsigned 32 bit varint. + */ + uint32(value) { + assertUInt32(value); + // write value as varint 32, inlined for speed + while (value > 0x7f) { + this.buf.push((value & 0x7f) | 0x80); + value = value >>> 7; + } + this.buf.push(value); + return this; + } + /** + * Write a `int32` value, a signed 32 bit varint. + */ + int32(value) { + assertInt32(value); + (0, varint_js_1.varint32write)(value, this.buf); + return this; + } + /** + * Write a `bool` value, a varint. + */ + bool(value) { + this.buf.push(value ? 1 : 0); + return this; + } + /** + * Write a `bytes` value, length-delimited arbitrary data. + */ + bytes(value) { + this.uint32(value.byteLength); // write length of chunk as varint + return this.raw(value); + } + /** + * Write a `string` value, length-delimited data converted to UTF-8 text. + */ + string(value) { + let chunk = this.encodeUtf8(value); + this.uint32(chunk.byteLength); // write length of chunk as varint + return this.raw(chunk); + } + /** + * Write a `float` value, 32-bit floating point number. + */ + float(value) { + assertFloat32(value); + let chunk = new Uint8Array(4); + new DataView(chunk.buffer).setFloat32(0, value, true); + return this.raw(chunk); + } + /** + * Write a `double` value, a 64-bit floating point number. + */ + double(value) { + let chunk = new Uint8Array(8); + new DataView(chunk.buffer).setFloat64(0, value, true); + return this.raw(chunk); + } + /** + * Write a `fixed32` value, an unsigned, fixed-length 32-bit integer. + */ + fixed32(value) { + assertUInt32(value); + let chunk = new Uint8Array(4); + new DataView(chunk.buffer).setUint32(0, value, true); + return this.raw(chunk); + } + /** + * Write a `sfixed32` value, a signed, fixed-length 32-bit integer. + */ + sfixed32(value) { + assertInt32(value); + let chunk = new Uint8Array(4); + new DataView(chunk.buffer).setInt32(0, value, true); + return this.raw(chunk); + } + /** + * Write a `sint32` value, a signed, zigzag-encoded 32-bit varint. + */ + sint32(value) { + assertInt32(value); + // zigzag encode + value = ((value << 1) ^ (value >> 31)) >>> 0; + (0, varint_js_1.varint32write)(value, this.buf); + return this; + } + /** + * Write a `sfixed64` value, a signed, fixed-length 64-bit integer. + */ + sfixed64(value) { + let chunk = new Uint8Array(8), view = new DataView(chunk.buffer), tc = proto_int64_js_1.protoInt64.enc(value); + view.setInt32(0, tc.lo, true); + view.setInt32(4, tc.hi, true); + return this.raw(chunk); + } + /** + * Write a `fixed64` value, an unsigned, fixed-length 64 bit integer. + */ + fixed64(value) { + let chunk = new Uint8Array(8), view = new DataView(chunk.buffer), tc = proto_int64_js_1.protoInt64.uEnc(value); + view.setInt32(0, tc.lo, true); + view.setInt32(4, tc.hi, true); + return this.raw(chunk); + } + /** + * Write a `int64` value, a signed 64-bit varint. + */ + int64(value) { + let tc = proto_int64_js_1.protoInt64.enc(value); + (0, varint_js_1.varint64write)(tc.lo, tc.hi, this.buf); + return this; + } + /** + * Write a `sint64` value, a signed, zig-zag-encoded 64-bit varint. + */ + sint64(value) { + const tc = proto_int64_js_1.protoInt64.enc(value), + // zigzag encode + sign = tc.hi >> 31, lo = (tc.lo << 1) ^ sign, hi = ((tc.hi << 1) | (tc.lo >>> 31)) ^ sign; + (0, varint_js_1.varint64write)(lo, hi, this.buf); + return this; + } + /** + * Write a `uint64` value, an unsigned 64-bit varint. + */ + uint64(value) { + const tc = proto_int64_js_1.protoInt64.uEnc(value); + (0, varint_js_1.varint64write)(tc.lo, tc.hi, this.buf); + return this; + } +} +exports.BinaryWriter = BinaryWriter; +class BinaryReader { + constructor(buf, decodeUtf8 = (0, text_encoding_js_1.getTextEncoding)().decodeUtf8) { + this.decodeUtf8 = decodeUtf8; + this.varint64 = varint_js_1.varint64read; // dirty cast for `this` + /** + * Read a `uint32` field, an unsigned 32 bit varint. + */ + this.uint32 = varint_js_1.varint32read; + this.buf = buf; + this.len = buf.length; + this.pos = 0; + this.view = new DataView(buf.buffer, buf.byteOffset, buf.byteLength); + } + /** + * Reads a tag - field number and wire type. Tags are uint32 varints; values + * that do not fit in uint32 are rejected. + */ + tag() { + const start = this.pos; + const tag = this.uint32(); + const bytesRead = this.pos - start; + if (bytesRead > 5 || (bytesRead == 5 && this.buf[this.pos - 1] > 0x0f)) { + throw new Error("illegal tag: varint overflows uint32"); + } + const fieldNo = tag >>> 3; + const wireType = tag & 7; + if (fieldNo <= 0 || wireType > 5) { + throw new Error("illegal tag: field no " + fieldNo + " wire type " + wireType); + } + return [fieldNo, wireType]; + } + /** + * Skip one element and return the skipped data. + * + * When skipping StartGroup, provide the tags field number to check for + * matching field number in the EndGroup tag. + */ + skip(wireType, fieldNo) { + let start = this.pos; + switch (wireType) { + case WireType.Varint: + while (this.buf[this.pos++] & 0x80) { + // ignore + } + break; + // @ts-ignore TS7029: Fallthrough case in switch -- ignore instead of expect-error for compiler settings without noFallthroughCasesInSwitch: true + case WireType.Bit64: + this.pos += 4; + case WireType.Bit32: + this.pos += 4; + break; + case WireType.LengthDelimited: + let len = this.uint32(); + this.pos += len; + break; + case WireType.StartGroup: + for (;;) { + const [fn, wt] = this.tag(); + if (wt === WireType.EndGroup) { + if (fieldNo !== undefined && fn !== fieldNo) { + throw new Error("invalid end group tag"); + } + break; + } + this.skip(wt, fn); + } + break; + default: + throw new Error("cant skip wire type " + wireType); + } + this.assertBounds(); + return this.buf.subarray(start, this.pos); + } + /** + * Throws error if position in byte array is out of range. + */ + assertBounds() { + if (this.pos > this.len) + throw new RangeError("premature EOF"); + } + /** + * Read a `int32` field, a signed 32 bit varint. + */ + int32() { + return this.uint32() | 0; + } + /** + * Read a `sint32` field, a signed, zigzag-encoded 32-bit varint. + */ + sint32() { + let zze = this.uint32(); + // decode zigzag + return (zze >>> 1) ^ -(zze & 1); + } + /** + * Read a `int64` field, a signed 64-bit varint. + */ + int64() { + return proto_int64_js_1.protoInt64.dec(...this.varint64()); + } + /** + * Read a `uint64` field, an unsigned 64-bit varint. + */ + uint64() { + return proto_int64_js_1.protoInt64.uDec(...this.varint64()); + } + /** + * Read a `sint64` field, a signed, zig-zag-encoded 64-bit varint. + */ + sint64() { + let [lo, hi] = this.varint64(); + // decode zig zag + let s = -(lo & 1); + lo = ((lo >>> 1) | ((hi & 1) << 31)) ^ s; + hi = (hi >>> 1) ^ s; + return proto_int64_js_1.protoInt64.dec(lo, hi); + } + /** + * Read a `bool` field, a variant. + */ + bool() { + let [lo, hi] = this.varint64(); + return lo !== 0 || hi !== 0; + } + /** + * Read a `fixed32` field, an unsigned, fixed-length 32-bit integer. + */ + fixed32() { + // biome-ignore lint/suspicious/noAssignInExpressions: no + return this.view.getUint32((this.pos += 4) - 4, true); + } + /** + * Read a `sfixed32` field, a signed, fixed-length 32-bit integer. + */ + sfixed32() { + // biome-ignore lint/suspicious/noAssignInExpressions: no + return this.view.getInt32((this.pos += 4) - 4, true); + } + /** + * Read a `fixed64` field, an unsigned, fixed-length 64 bit integer. + */ + fixed64() { + return proto_int64_js_1.protoInt64.uDec(this.sfixed32(), this.sfixed32()); + } + /** + * Read a `fixed64` field, a signed, fixed-length 64-bit integer. + */ + sfixed64() { + return proto_int64_js_1.protoInt64.dec(this.sfixed32(), this.sfixed32()); + } + /** + * Read a `float` field, 32-bit floating point number. + */ + float() { + // biome-ignore lint/suspicious/noAssignInExpressions: no + return this.view.getFloat32((this.pos += 4) - 4, true); + } + /** + * Read a `double` field, a 64-bit floating point number. + */ + double() { + // biome-ignore lint/suspicious/noAssignInExpressions: no + return this.view.getFloat64((this.pos += 8) - 8, true); + } + /** + * Read a `bytes` field, length-delimited arbitrary data. + */ + bytes() { + let len = this.uint32(), start = this.pos; + this.pos += len; + this.assertBounds(); + return this.buf.subarray(start, start + len); + } + /** + * Read a `string` field, length-delimited data converted to UTF-8 text. If + * `strict` is true, throw on invalid UTF-8 instead of substituting U+FFFD. + */ + string(strict) { + return this.decodeUtf8(this.bytes(), strict); + } +} +exports.BinaryReader = BinaryReader; +/** + * Assert a valid signed protobuf 32-bit integer as a number or string. + */ +function assertInt32(arg) { + if (typeof arg == "string") { + arg = Number(arg); + } + else if (typeof arg != "number") { + throw new Error("invalid int32: " + typeof arg); + } + if (!Number.isInteger(arg) || + arg > exports.INT32_MAX || + arg < exports.INT32_MIN) + throw new Error("invalid int32: " + arg); +} +/** + * Assert a valid unsigned protobuf 32-bit integer as a number or string. + */ +function assertUInt32(arg) { + if (typeof arg == "string") { + arg = Number(arg); + } + else if (typeof arg != "number") { + throw new Error("invalid uint32: " + typeof arg); + } + if (!Number.isInteger(arg) || + arg > exports.UINT32_MAX || + arg < 0) + throw new Error("invalid uint32: " + arg); +} +/** + * Assert a valid protobuf float value as a number or string. + */ +function assertFloat32(arg) { + if (typeof arg == "string") { + const o = arg; + arg = Number(arg); + if (Number.isNaN(arg) && o !== "NaN") { + throw new Error("invalid float32: " + o); + } + } + else if (typeof arg != "number") { + throw new Error("invalid float32: " + typeof arg); + } + if (Number.isFinite(arg) && + (arg > exports.FLOAT32_MAX || arg < exports.FLOAT32_MIN)) + throw new Error("invalid float32: " + arg); +} diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/wire/index.d.ts b/node_modules/@bufbuild/protobuf/dist/cjs/wire/index.d.ts new file mode 100644 index 0000000..8630d1f --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/wire/index.d.ts @@ -0,0 +1,5 @@ +export * from "./binary-encoding.js"; +export * from "./base64-encoding.js"; +export * from "./text-encoding.js"; +export * from "./text-format.js"; +export * from "./size-delimited.js"; diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/wire/index.js b/node_modules/@bufbuild/protobuf/dist/cjs/wire/index.js new file mode 100644 index 0000000..590af6d --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/wire/index.js @@ -0,0 +1,34 @@ +"use strict"; +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./binary-encoding.js"), exports); +__exportStar(require("./base64-encoding.js"), exports); +__exportStar(require("./text-encoding.js"), exports); +__exportStar(require("./text-format.js"), exports); +__exportStar(require("./size-delimited.js"), exports); diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/wire/size-delimited.d.ts b/node_modules/@bufbuild/protobuf/dist/cjs/wire/size-delimited.d.ts new file mode 100644 index 0000000..0294989 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/wire/size-delimited.d.ts @@ -0,0 +1,51 @@ +import type { DescMessage } from "../descriptors.js"; +import type { BinaryWriteOptions } from "../to-binary.js"; +import type { MessageShape } from "../types.js"; +import type { BinaryReadOptions } from "../from-binary.js"; +/** + * Serialize a message, prefixing it with its size. + * + * A size-delimited message is a varint size in bytes, followed by exactly + * that many bytes of a message serialized with the binary format. + * + * This size-delimited format is compatible with other implementations. + * For details, see https://github.com/protocolbuffers/protobuf/issues/10229 + */ +export declare function sizeDelimitedEncode(messageDesc: Desc, message: MessageShape, options?: BinaryWriteOptions): Uint8Array; +/** + * Parse a stream of size-delimited messages. + * + * A size-delimited message is a varint size in bytes, followed by exactly + * that many bytes of a message serialized with the binary format. + * + * This size-delimited format is compatible with other implementations. + * For details, see https://github.com/protocolbuffers/protobuf/issues/10229 + */ +export declare function sizeDelimitedDecodeStream(messageDesc: Desc, iterable: AsyncIterable, options?: BinaryReadOptions): AsyncIterableIterator>; +/** + * Decodes the size from the given size-delimited message, which may be + * incomplete. + * + * Returns an object with the following properties: + * - size: The size of the delimited message in bytes + * - offset: The offset in the given byte array where the message starts + * - eof: true + * + * If the size-delimited data does not include all bytes of the varint size, + * the following object is returned: + * - size: null + * - offset: null + * - eof: false + * + * This function can be used to implement parsing of size-delimited messages + * from a stream. + */ +export declare function sizeDelimitedPeek(data: Uint8Array): { + readonly eof: false; + readonly size: number; + readonly offset: number; +} | { + readonly eof: true; + readonly size: null; + readonly offset: null; +}; diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/wire/size-delimited.js b/node_modules/@bufbuild/protobuf/dist/cjs/wire/size-delimited.js new file mode 100644 index 0000000..966ca8d --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/wire/size-delimited.js @@ -0,0 +1,153 @@ +"use strict"; +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +var __asyncValues = (this && this.__asyncValues) || function (o) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var m = o[Symbol.asyncIterator], i; + return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); + function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } + function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } +}; +var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); } +var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var g = generator.apply(thisArg, _arguments || []), i, q = []; + return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i; + function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; } + function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } + function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.sizeDelimitedEncode = sizeDelimitedEncode; +exports.sizeDelimitedDecodeStream = sizeDelimitedDecodeStream; +exports.sizeDelimitedPeek = sizeDelimitedPeek; +const to_binary_js_1 = require("../to-binary.js"); +const binary_encoding_js_1 = require("./binary-encoding.js"); +const from_binary_js_1 = require("../from-binary.js"); +/** + * Serialize a message, prefixing it with its size. + * + * A size-delimited message is a varint size in bytes, followed by exactly + * that many bytes of a message serialized with the binary format. + * + * This size-delimited format is compatible with other implementations. + * For details, see https://github.com/protocolbuffers/protobuf/issues/10229 + */ +function sizeDelimitedEncode(messageDesc, message, options) { + const writer = new binary_encoding_js_1.BinaryWriter(); + writer.bytes((0, to_binary_js_1.toBinary)(messageDesc, message, options)); + return writer.finish(); +} +/** + * Parse a stream of size-delimited messages. + * + * A size-delimited message is a varint size in bytes, followed by exactly + * that many bytes of a message serialized with the binary format. + * + * This size-delimited format is compatible with other implementations. + * For details, see https://github.com/protocolbuffers/protobuf/issues/10229 + */ +function sizeDelimitedDecodeStream(messageDesc, iterable, options) { + return __asyncGenerator(this, arguments, function* sizeDelimitedDecodeStream_1() { + var _a, e_1, _b, _c; + // append chunk to buffer, returning updated buffer + function append(buffer, chunk) { + const n = new Uint8Array(buffer.byteLength + chunk.byteLength); + n.set(buffer); + n.set(chunk, buffer.length); + return n; + } + let buffer = new Uint8Array(0); + try { + for (var _d = true, iterable_1 = __asyncValues(iterable), iterable_1_1; iterable_1_1 = yield __await(iterable_1.next()), _a = iterable_1_1.done, !_a; _d = true) { + _c = iterable_1_1.value; + _d = false; + const chunk = _c; + buffer = append(buffer, chunk); + for (;;) { + const size = sizeDelimitedPeek(buffer); + if (size.eof) { + // size is incomplete, buffer more data + break; + } + if (size.offset + size.size > buffer.byteLength) { + // message is incomplete, buffer more data + break; + } + yield yield __await((0, from_binary_js_1.fromBinary)(messageDesc, buffer.subarray(size.offset, size.offset + size.size), options)); + buffer = buffer.subarray(size.offset + size.size); + } + } + } + catch (e_1_1) { e_1 = { error: e_1_1 }; } + finally { + try { + if (!_d && !_a && (_b = iterable_1.return)) yield __await(_b.call(iterable_1)); + } + finally { if (e_1) throw e_1.error; } + } + if (buffer.byteLength > 0) { + throw new Error("incomplete data"); + } + }); +} +/** + * Decodes the size from the given size-delimited message, which may be + * incomplete. + * + * Returns an object with the following properties: + * - size: The size of the delimited message in bytes + * - offset: The offset in the given byte array where the message starts + * - eof: true + * + * If the size-delimited data does not include all bytes of the varint size, + * the following object is returned: + * - size: null + * - offset: null + * - eof: false + * + * This function can be used to implement parsing of size-delimited messages + * from a stream. + */ +function sizeDelimitedPeek(data) { + const sizeEof = { eof: true, size: null, offset: null }; + for (let i = 0; i < 10; i++) { + if (i > data.byteLength) { + return sizeEof; + } + if ((data[i] & 0x80) == 0) { + const reader = new binary_encoding_js_1.BinaryReader(data); + let size; + try { + size = reader.uint32(); + } + catch (e) { + if (e instanceof RangeError) { + return sizeEof; + } + throw e; + } + return { + eof: false, + size, + offset: reader.pos, + }; + } + } + throw new Error("invalid varint"); +} diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/wire/text-encoding.d.ts b/node_modules/@bufbuild/protobuf/dist/cjs/wire/text-encoding.d.ts new file mode 100644 index 0000000..947f046 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/wire/text-encoding.d.ts @@ -0,0 +1,28 @@ +interface TextEncoding { + /** + * Verify that the given text is valid UTF-8. + */ + checkUtf8: (text: string) => boolean; + /** + * Encode UTF-8 text to binary. + */ + encodeUtf8: (text: string) => Uint8Array; + /** + * Decode UTF-8 text from binary. If `strict` is true, throw on invalid byte + * sequences instead of silently substituting U+FFFD. Implementations that + * do not support strict decoding may ignore the flag. + */ + decodeUtf8: (bytes: Uint8Array, strict?: boolean) => string; +} +/** + * Protobuf-ES requires the Text Encoding API to convert UTF-8 from and to + * binary. This WHATWG API is widely available, but it is not part of the + * ECMAScript standard. On runtimes where it is not available, use this + * function to provide your own implementation. + * + * Note that the Text Encoding API does not provide a way to validate UTF-8. + * Our implementation falls back to use encodeURIComponent(). + */ +export declare function configureTextEncoding(textEncoding: TextEncoding): void; +export declare function getTextEncoding(): TextEncoding; +export {}; diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/wire/text-encoding.js b/node_modules/@bufbuild/protobuf/dist/cjs/wire/text-encoding.js new file mode 100644 index 0000000..aa1dd96 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/wire/text-encoding.js @@ -0,0 +1,61 @@ +"use strict"; +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.configureTextEncoding = configureTextEncoding; +exports.getTextEncoding = getTextEncoding; +const symbol = Symbol.for("@bufbuild/protobuf/text-encoding"); +/** + * Protobuf-ES requires the Text Encoding API to convert UTF-8 from and to + * binary. This WHATWG API is widely available, but it is not part of the + * ECMAScript standard. On runtimes where it is not available, use this + * function to provide your own implementation. + * + * Note that the Text Encoding API does not provide a way to validate UTF-8. + * Our implementation falls back to use encodeURIComponent(). + */ +function configureTextEncoding(textEncoding) { + globalThis[symbol] = textEncoding; +} +function getTextEncoding() { + if (globalThis[symbol] == undefined) { + const te = new globalThis.TextEncoder(); + const td = new globalThis.TextDecoder(); + let tdStrict; + globalThis[symbol] = { + encodeUtf8(text) { + return te.encode(text); + }, + decodeUtf8(bytes, strict) { + if (strict) { + if (tdStrict === undefined) { + tdStrict = new globalThis.TextDecoder("utf-8", { fatal: true }); + } + return tdStrict.decode(bytes); + } + return td.decode(bytes); + }, + checkUtf8(text) { + try { + encodeURIComponent(text); + return true; + } + catch (_) { + return false; + } + }, + }; + } + return globalThis[symbol]; +} diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/wire/text-format.d.ts b/node_modules/@bufbuild/protobuf/dist/cjs/wire/text-format.d.ts new file mode 100644 index 0000000..06bdbdd --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/wire/text-format.d.ts @@ -0,0 +1,13 @@ +import { type DescEnum, ScalarType } from "../descriptors.js"; +/** + * Parse an enum value from the Protobuf text format. + * + * @private + */ +export declare function parseTextFormatEnumValue(descEnum: DescEnum, value: string): number; +/** + * Parse a scalar value from the Protobuf text format. + * + * @private + */ +export declare function parseTextFormatScalarValue(type: ScalarType, value: string): number | boolean | string | bigint | Uint8Array; diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/wire/text-format.js b/node_modules/@bufbuild/protobuf/dist/cjs/wire/text-format.js new file mode 100644 index 0000000..7af933b --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/wire/text-format.js @@ -0,0 +1,199 @@ +"use strict"; +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.parseTextFormatEnumValue = parseTextFormatEnumValue; +exports.parseTextFormatScalarValue = parseTextFormatScalarValue; +const descriptors_js_1 = require("../descriptors.js"); +const proto_int64_js_1 = require("../proto-int64.js"); +/** + * Parse an enum value from the Protobuf text format. + * + * @private + */ +function parseTextFormatEnumValue(descEnum, value) { + const enumValue = descEnum.values.find((v) => v.name === value); + if (!enumValue) { + throw new Error(`cannot parse ${descEnum} default value: ${value}`); + } + return enumValue.number; +} +/** + * Parse a scalar value from the Protobuf text format. + * + * @private + */ +function parseTextFormatScalarValue(type, value) { + switch (type) { + case descriptors_js_1.ScalarType.STRING: + return value; + case descriptors_js_1.ScalarType.BYTES: { + const u = unescapeBytesDefaultValue(value); + if (u === false) { + throw new Error(`cannot parse ${descriptors_js_1.ScalarType[type]} default value: ${value}`); + } + return u; + } + case descriptors_js_1.ScalarType.INT64: + case descriptors_js_1.ScalarType.SFIXED64: + case descriptors_js_1.ScalarType.SINT64: + return proto_int64_js_1.protoInt64.parse(value); + case descriptors_js_1.ScalarType.UINT64: + case descriptors_js_1.ScalarType.FIXED64: + return proto_int64_js_1.protoInt64.uParse(value); + case descriptors_js_1.ScalarType.DOUBLE: + case descriptors_js_1.ScalarType.FLOAT: + switch (value) { + case "inf": + return Number.POSITIVE_INFINITY; + case "-inf": + return Number.NEGATIVE_INFINITY; + case "nan": + return Number.NaN; + default: + return parseFloat(value); + } + case descriptors_js_1.ScalarType.BOOL: + return value === "true"; + case descriptors_js_1.ScalarType.INT32: + case descriptors_js_1.ScalarType.UINT32: + case descriptors_js_1.ScalarType.SINT32: + case descriptors_js_1.ScalarType.FIXED32: + case descriptors_js_1.ScalarType.SFIXED32: + return parseInt(value, 10); + } +} +/** + * Parses a text-encoded default value (proto2) of a BYTES field. + */ +function unescapeBytesDefaultValue(str) { + const b = []; + const input = { + tail: str, + c: "", + next() { + if (this.tail.length == 0) { + return false; + } + this.c = this.tail[0]; + this.tail = this.tail.substring(1); + return true; + }, + take(n) { + if (this.tail.length >= n) { + const r = this.tail.substring(0, n); + this.tail = this.tail.substring(n); + return r; + } + return false; + }, + }; + while (input.next()) { + switch (input.c) { + case "\\": + if (input.next()) { + switch (input.c) { + case "\\": + b.push(input.c.charCodeAt(0)); + break; + case "b": + b.push(0x08); + break; + case "f": + b.push(0x0c); + break; + case "n": + b.push(0x0a); + break; + case "r": + b.push(0x0d); + break; + case "t": + b.push(0x09); + break; + case "v": + b.push(0x0b); + break; + case "0": + case "1": + case "2": + case "3": + case "4": + case "5": + case "6": + case "7": { + const s = input.c; + const t = input.take(2); + if (t === false) { + return false; + } + const n = parseInt(s + t, 8); + if (Number.isNaN(n)) { + return false; + } + b.push(n); + break; + } + case "x": { + const s = input.c; + const t = input.take(2); + if (t === false) { + return false; + } + const n = parseInt(s + t, 16); + if (Number.isNaN(n)) { + return false; + } + b.push(n); + break; + } + case "u": { + const s = input.c; + const t = input.take(4); + if (t === false) { + return false; + } + const n = parseInt(s + t, 16); + if (Number.isNaN(n)) { + return false; + } + const chunk = new Uint8Array(4); + const view = new DataView(chunk.buffer); + view.setInt32(0, n, true); + b.push(chunk[0], chunk[1], chunk[2], chunk[3]); + break; + } + case "U": { + const s = input.c; + const t = input.take(8); + if (t === false) { + return false; + } + const tc = proto_int64_js_1.protoInt64.uEnc(s + t); + const chunk = new Uint8Array(8); + const view = new DataView(chunk.buffer); + view.setInt32(0, tc.lo, true); + view.setInt32(4, tc.hi, true); + b.push(chunk[0], chunk[1], chunk[2], chunk[3], chunk[4], chunk[5], chunk[6], chunk[7]); + break; + } + } + } + break; + default: + b.push(input.c.charCodeAt(0)); + } + } + return new Uint8Array(b); +} diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/wire/varint.d.ts b/node_modules/@bufbuild/protobuf/dist/cjs/wire/varint.d.ts new file mode 100644 index 0000000..b45ef94 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/wire/varint.d.ts @@ -0,0 +1,70 @@ +/** + * Read a 64 bit varint as two JS numbers. + * + * Returns tuple: + * [0]: low bits + * [1]: high bits + * + * Copyright 2008 Google Inc. All rights reserved. + * + * See https://github.com/protocolbuffers/protobuf/blob/8a71927d74a4ce34efe2d8769fda198f52d20d12/js/experimental/runtime/kernel/buffer_decoder.js#L175 + */ +export declare function varint64read(this: T): [number, number]; +/** + * Write a 64 bit varint, given as two JS numbers, to the given bytes array. + * + * Copyright 2008 Google Inc. All rights reserved. + * + * See https://github.com/protocolbuffers/protobuf/blob/8a71927d74a4ce34efe2d8769fda198f52d20d12/js/experimental/runtime/kernel/writer.js#L344 + */ +export declare function varint64write(lo: number, hi: number, bytes: number[]): void; +/** + * Parse decimal string of 64 bit integer value as two JS numbers. + * + * Copyright 2008 Google Inc. All rights reserved. + * + * See https://github.com/protocolbuffers/protobuf-javascript/blob/a428c58273abad07c66071d9753bc4d1289de426/experimental/runtime/int64.js#L10 + */ +export declare function int64FromString(dec: string): { + lo: number; + hi: number; +}; +/** + * Losslessly converts a 64-bit signed integer in 32:32 split representation + * into a decimal string. + * + * Copyright 2008 Google Inc. All rights reserved. + * + * See https://github.com/protocolbuffers/protobuf-javascript/blob/a428c58273abad07c66071d9753bc4d1289de426/experimental/runtime/int64.js#L10 + */ +export declare function int64ToString(lo: number, hi: number): string; +/** + * Losslessly converts a 64-bit unsigned integer in 32:32 split representation + * into a decimal string. + * + * Copyright 2008 Google Inc. All rights reserved. + * + * See https://github.com/protocolbuffers/protobuf-javascript/blob/a428c58273abad07c66071d9753bc4d1289de426/experimental/runtime/int64.js#L10 + */ +export declare function uInt64ToString(lo: number, hi: number): string; +/** + * Write a 32 bit varint, signed or unsigned. Same as `varint64write(0, value, bytes)` + * + * Copyright 2008 Google Inc. All rights reserved. + * + * See https://github.com/protocolbuffers/protobuf/blob/1b18833f4f2a2f681f4e4a25cdf3b0a43115ec26/js/binary/encoder.js#L144 + */ +export declare function varint32write(value: number, bytes: number[]): void; +/** + * Read an unsigned 32 bit varint. + * + * See https://github.com/protocolbuffers/protobuf/blob/8a71927d74a4ce34efe2d8769fda198f52d20d12/js/experimental/runtime/kernel/buffer_decoder.js#L220 + */ +export declare function varint32read(this: T): number; +type ReaderLike = { + buf: Uint8Array; + pos: number; + len: number; + assertBounds(): void; +}; +export {}; diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/wire/varint.js b/node_modules/@bufbuild/protobuf/dist/cjs/wire/varint.js new file mode 100644 index 0000000..a59369b --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/wire/varint.js @@ -0,0 +1,322 @@ +"use strict"; +// Copyright 2008 Google Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Code generated by the Protocol Buffer compiler is owned by the owner +// of the input file used when generating it. This code is not +// standalone and requires a support library to be linked with it. This +// support library is itself covered by the above license. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.varint64read = varint64read; +exports.varint64write = varint64write; +exports.int64FromString = int64FromString; +exports.int64ToString = int64ToString; +exports.uInt64ToString = uInt64ToString; +exports.varint32write = varint32write; +exports.varint32read = varint32read; +/** + * Read a 64 bit varint as two JS numbers. + * + * Returns tuple: + * [0]: low bits + * [1]: high bits + * + * Copyright 2008 Google Inc. All rights reserved. + * + * See https://github.com/protocolbuffers/protobuf/blob/8a71927d74a4ce34efe2d8769fda198f52d20d12/js/experimental/runtime/kernel/buffer_decoder.js#L175 + */ +function varint64read() { + let lowBits = 0; + let highBits = 0; + for (let shift = 0; shift < 28; shift += 7) { + let b = this.buf[this.pos++]; + lowBits |= (b & 0x7f) << shift; + if ((b & 0x80) == 0) { + this.assertBounds(); + return [lowBits, highBits]; + } + } + let middleByte = this.buf[this.pos++]; + // last four bits of the first 32 bit number + lowBits |= (middleByte & 0x0f) << 28; + // 3 upper bits are part of the next 32 bit number + highBits = (middleByte & 0x70) >> 4; + if ((middleByte & 0x80) == 0) { + this.assertBounds(); + return [lowBits, highBits]; + } + for (let shift = 3; shift <= 31; shift += 7) { + let b = this.buf[this.pos++]; + highBits |= (b & 0x7f) << shift; + if ((b & 0x80) == 0) { + this.assertBounds(); + return [lowBits, highBits]; + } + } + throw new Error("invalid varint"); +} +/** + * Write a 64 bit varint, given as two JS numbers, to the given bytes array. + * + * Copyright 2008 Google Inc. All rights reserved. + * + * See https://github.com/protocolbuffers/protobuf/blob/8a71927d74a4ce34efe2d8769fda198f52d20d12/js/experimental/runtime/kernel/writer.js#L344 + */ +function varint64write(lo, hi, bytes) { + for (let i = 0; i < 28; i = i + 7) { + const shift = lo >>> i; + const hasNext = !(shift >>> 7 == 0 && hi == 0); + const byte = (hasNext ? shift | 0x80 : shift) & 0xff; + bytes.push(byte); + if (!hasNext) { + return; + } + } + const splitBits = ((lo >>> 28) & 0x0f) | ((hi & 0x07) << 4); + const hasMoreBits = !(hi >> 3 == 0); + bytes.push((hasMoreBits ? splitBits | 0x80 : splitBits) & 0xff); + if (!hasMoreBits) { + return; + } + for (let i = 3; i < 31; i = i + 7) { + const shift = hi >>> i; + const hasNext = !(shift >>> 7 == 0); + const byte = (hasNext ? shift | 0x80 : shift) & 0xff; + bytes.push(byte); + if (!hasNext) { + return; + } + } + bytes.push((hi >>> 31) & 0x01); +} +// constants for binary math +const TWO_PWR_32_DBL = 0x100000000; +/** + * Parse decimal string of 64 bit integer value as two JS numbers. + * + * Copyright 2008 Google Inc. All rights reserved. + * + * See https://github.com/protocolbuffers/protobuf-javascript/blob/a428c58273abad07c66071d9753bc4d1289de426/experimental/runtime/int64.js#L10 + */ +function int64FromString(dec) { + // Check for minus sign. + const minus = dec[0] === "-"; + if (minus) { + dec = dec.slice(1); + } + // Work 6 decimal digits at a time, acting like we're converting base 1e6 + // digits to binary. This is safe to do with floating point math because + // Number.isSafeInteger(ALL_32_BITS * 1e6) == true. + const base = 1e6; + let lowBits = 0; + let highBits = 0; + function add1e6digit(begin, end) { + // Note: Number('') is 0. + const digit1e6 = Number(dec.slice(begin, end)); + highBits *= base; + lowBits = lowBits * base + digit1e6; + // Carry bits from lowBits to + if (lowBits >= TWO_PWR_32_DBL) { + highBits = highBits + ((lowBits / TWO_PWR_32_DBL) | 0); + lowBits = lowBits % TWO_PWR_32_DBL; + } + } + add1e6digit(-24, -18); + add1e6digit(-18, -12); + add1e6digit(-12, -6); + add1e6digit(-6); + return minus ? negate(lowBits, highBits) : newBits(lowBits, highBits); +} +/** + * Losslessly converts a 64-bit signed integer in 32:32 split representation + * into a decimal string. + * + * Copyright 2008 Google Inc. All rights reserved. + * + * See https://github.com/protocolbuffers/protobuf-javascript/blob/a428c58273abad07c66071d9753bc4d1289de426/experimental/runtime/int64.js#L10 + */ +function int64ToString(lo, hi) { + let bits = newBits(lo, hi); + // If we're treating the input as a signed value and the high bit is set, do + // a manual two's complement conversion before the decimal conversion. + const negative = bits.hi & 0x80000000; + if (negative) { + bits = negate(bits.lo, bits.hi); + } + const result = uInt64ToString(bits.lo, bits.hi); + return negative ? "-" + result : result; +} +/** + * Losslessly converts a 64-bit unsigned integer in 32:32 split representation + * into a decimal string. + * + * Copyright 2008 Google Inc. All rights reserved. + * + * See https://github.com/protocolbuffers/protobuf-javascript/blob/a428c58273abad07c66071d9753bc4d1289de426/experimental/runtime/int64.js#L10 + */ +function uInt64ToString(lo, hi) { + ({ lo, hi } = toUnsigned(lo, hi)); + // Skip the expensive conversion if the number is small enough to use the + // built-in conversions. + // Number.MAX_SAFE_INTEGER = 0x001FFFFF FFFFFFFF, thus any number with + // highBits <= 0x1FFFFF can be safely expressed with a double and retain + // integer precision. + // Proven by: Number.isSafeInteger(0x1FFFFF * 2**32 + 0xFFFFFFFF) == true. + if (hi <= 0x1fffff) { + return String(TWO_PWR_32_DBL * hi + lo); + } + // What this code is doing is essentially converting the input number from + // base-2 to base-1e7, which allows us to represent the 64-bit range with + // only 3 (very large) digits. Those digits are then trivial to convert to + // a base-10 string. + // The magic numbers used here are - + // 2^24 = 16777216 = (1,6777216) in base-1e7. + // 2^48 = 281474976710656 = (2,8147497,6710656) in base-1e7. + // Split 32:32 representation into 16:24:24 representation so our + // intermediate digits don't overflow. + const low = lo & 0xffffff; + const mid = ((lo >>> 24) | (hi << 8)) & 0xffffff; + const high = (hi >> 16) & 0xffff; + // Assemble our three base-1e7 digits, ignoring carries. The maximum + // value in a digit at this step is representable as a 48-bit integer, which + // can be stored in a 64-bit floating point number. + let digitA = low + mid * 6777216 + high * 6710656; + let digitB = mid + high * 8147497; + let digitC = high * 2; + // Apply carries from A to B and from B to C. + const base = 10000000; + if (digitA >= base) { + digitB += Math.floor(digitA / base); + digitA %= base; + } + if (digitB >= base) { + digitC += Math.floor(digitB / base); + digitB %= base; + } + // If digitC is 0, then we should have returned in the trivial code path + // at the top for non-safe integers. Given this, we can assume both digitB + // and digitA need leading zeros. + return (digitC.toString() + + decimalFrom1e7WithLeadingZeros(digitB) + + decimalFrom1e7WithLeadingZeros(digitA)); +} +function toUnsigned(lo, hi) { + return { lo: lo >>> 0, hi: hi >>> 0 }; +} +function newBits(lo, hi) { + return { lo: lo | 0, hi: hi | 0 }; +} +/** + * Returns two's compliment negation of input. + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Bitwise_Operators#Signed_32-bit_integers + */ +function negate(lowBits, highBits) { + highBits = ~highBits; + if (lowBits) { + lowBits = ~lowBits + 1; + } + else { + // If lowBits is 0, then bitwise-not is 0xFFFFFFFF, + // adding 1 to that, results in 0x100000000, which leaves + // the low bits 0x0 and simply adds one to the high bits. + highBits += 1; + } + return newBits(lowBits, highBits); +} +/** + * Returns decimal representation of digit1e7 with leading zeros. + */ +const decimalFrom1e7WithLeadingZeros = (digit1e7) => { + const partial = String(digit1e7); + return "0000000".slice(partial.length) + partial; +}; +/** + * Write a 32 bit varint, signed or unsigned. Same as `varint64write(0, value, bytes)` + * + * Copyright 2008 Google Inc. All rights reserved. + * + * See https://github.com/protocolbuffers/protobuf/blob/1b18833f4f2a2f681f4e4a25cdf3b0a43115ec26/js/binary/encoder.js#L144 + */ +function varint32write(value, bytes) { + if (value >= 0) { + // write value as varint 32 + while (value > 0x7f) { + bytes.push((value & 0x7f) | 0x80); + value = value >>> 7; + } + bytes.push(value); + } + else { + for (let i = 0; i < 9; i++) { + bytes.push((value & 127) | 128); + value = value >> 7; + } + bytes.push(1); + } +} +/** + * Read an unsigned 32 bit varint. + * + * See https://github.com/protocolbuffers/protobuf/blob/8a71927d74a4ce34efe2d8769fda198f52d20d12/js/experimental/runtime/kernel/buffer_decoder.js#L220 + */ +function varint32read() { + let b = this.buf[this.pos++]; + let result = b & 0x7f; + if ((b & 0x80) == 0) { + this.assertBounds(); + return result; + } + b = this.buf[this.pos++]; + result |= (b & 0x7f) << 7; + if ((b & 0x80) == 0) { + this.assertBounds(); + return result; + } + b = this.buf[this.pos++]; + result |= (b & 0x7f) << 14; + if ((b & 0x80) == 0) { + this.assertBounds(); + return result; + } + b = this.buf[this.pos++]; + result |= (b & 0x7f) << 21; + if ((b & 0x80) == 0) { + this.assertBounds(); + return result; + } + // Extract only last 4 bits + b = this.buf[this.pos++]; + result |= (b & 0x0f) << 28; + for (let readBytes = 5; (b & 0x80) !== 0 && readBytes < 10; readBytes++) + b = this.buf[this.pos++]; + if ((b & 0x80) != 0) + throw new Error("invalid varint"); + this.assertBounds(); + // Result can have 32 bits, convert it to unsigned + return result >>> 0; +} diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/wkt/any.d.ts b/node_modules/@bufbuild/protobuf/dist/cjs/wkt/any.d.ts new file mode 100644 index 0000000..5d41781 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/wkt/any.d.ts @@ -0,0 +1,38 @@ +import type { Message, MessageShape } from "../types.js"; +import type { Any } from "./gen/google/protobuf/any_pb.js"; +import type { DescMessage } from "../descriptors.js"; +import type { Registry } from "../registry.js"; +/** + * Creates a `google.protobuf.Any` from a message. + */ +export declare function anyPack(schema: Desc, message: MessageShape): Any; +/** + * Packs the message into the given any. + */ +export declare function anyPack(schema: Desc, message: MessageShape, into: Any): void; +/** + * Returns true if the Any contains the type given by schema. + */ +export declare function anyIs(any: Any, schema: DescMessage): boolean; +/** + * Returns true if the Any contains a message with the given typeName. + */ +export declare function anyIs(any: Any, typeName: string): boolean; +/** + * Unpacks the message the Any represents. + * + * Returns undefined if the Any is empty, or if packed type is not included + * in the given registry. + */ +export declare function anyUnpack(any: Any, registry: Registry): Message | undefined; +/** + * Unpacks the message the Any represents. + * + * Returns undefined if the Any is empty, or if it does not contain the type + * given by schema. + */ +export declare function anyUnpack(any: Any, schema: Desc): MessageShape | undefined; +/** + * Same as anyUnpack but unpacks into the target message. + */ +export declare function anyUnpackTo(any: Any, schema: Desc, message: MessageShape): MessageShape | undefined; diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/wkt/any.js b/node_modules/@bufbuild/protobuf/dist/cjs/wkt/any.js new file mode 100644 index 0000000..9c9acc5 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/wkt/any.js @@ -0,0 +1,75 @@ +"use strict"; +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.anyPack = anyPack; +exports.anyIs = anyIs; +exports.anyUnpack = anyUnpack; +exports.anyUnpackTo = anyUnpackTo; +const any_pb_js_1 = require("./gen/google/protobuf/any_pb.js"); +const create_js_1 = require("../create.js"); +const to_binary_js_1 = require("../to-binary.js"); +const from_binary_js_1 = require("../from-binary.js"); +function anyPack(schema, message, into) { + let ret = false; + if (!into) { + into = (0, create_js_1.create)(any_pb_js_1.AnySchema); + ret = true; + } + into.value = (0, to_binary_js_1.toBinary)(schema, message); + into.typeUrl = typeNameToUrl(message.$typeName); + return ret ? into : undefined; +} +function anyIs(any, descOrTypeName) { + if (any.typeUrl === "") { + return false; + } + const want = typeof descOrTypeName == "string" + ? descOrTypeName + : descOrTypeName.typeName; + const got = typeUrlToName(any.typeUrl); + return want === got; +} +function anyUnpack(any, registryOrMessageDesc) { + if (any.typeUrl === "") { + return undefined; + } + const desc = registryOrMessageDesc.kind == "message" + ? registryOrMessageDesc + : registryOrMessageDesc.getMessage(typeUrlToName(any.typeUrl)); + if (!desc || !anyIs(any, desc)) { + return undefined; + } + return (0, from_binary_js_1.fromBinary)(desc, any.value); +} +/** + * Same as anyUnpack but unpacks into the target message. + */ +function anyUnpackTo(any, schema, message) { + if (!anyIs(any, schema)) { + return undefined; + } + return (0, from_binary_js_1.mergeFromBinary)(schema, message, any.value); +} +function typeNameToUrl(name) { + return `type.googleapis.com/${name}`; +} +function typeUrlToName(url) { + const slash = url.lastIndexOf("/"); + const name = slash >= 0 ? url.substring(slash + 1) : url; + if (!name.length) { + throw new Error(`invalid type url: ${url}`); + } + return name; +} diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/wkt/duration.d.ts b/node_modules/@bufbuild/protobuf/dist/cjs/wkt/duration.d.ts new file mode 100644 index 0000000..4605342 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/wkt/duration.d.ts @@ -0,0 +1,9 @@ +import type { Duration } from "./gen/google/protobuf/duration_pb.js"; +/** + * Create a google.protobuf.Duration message from a Unix timestamp in milliseconds. + */ +export declare function durationFromMs(durationMs: number): Duration; +/** + * Convert a google.protobuf.Duration to a Unix timestamp in milliseconds. + */ +export declare function durationMs(duration: Duration): number; diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/wkt/duration.js b/node_modules/@bufbuild/protobuf/dist/cjs/wkt/duration.js new file mode 100644 index 0000000..2680ad1 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/wkt/duration.js @@ -0,0 +1,39 @@ +"use strict"; +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.durationFromMs = durationFromMs; +exports.durationMs = durationMs; +const duration_pb_js_1 = require("./gen/google/protobuf/duration_pb.js"); +const create_js_1 = require("../create.js"); +const proto_int64_js_1 = require("../proto-int64.js"); +/** + * Create a google.protobuf.Duration message from a Unix timestamp in milliseconds. + */ +function durationFromMs(durationMs) { + const sign = durationMs < 0 ? -1 : 1; + const absDurationMs = Math.abs(durationMs); + const absSeconds = Math.floor(absDurationMs / 1000); + const absNanos = (absDurationMs - absSeconds * 1000) * 1000000; + return (0, create_js_1.create)(duration_pb_js_1.DurationSchema, { + seconds: proto_int64_js_1.protoInt64.parse(absSeconds * sign), + nanos: absNanos === 0 ? 0 : absNanos * sign, // deliberately avoid signed 0 - it does not serialize + }); +} +/** + * Convert a google.protobuf.Duration to a Unix timestamp in milliseconds. + */ +function durationMs(duration) { + return Number(duration.seconds) * 1000 + Math.round(duration.nanos / 1000000); +} diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/any_pb.d.ts b/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/any_pb.d.ts new file mode 100644 index 0000000..a61678f --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/any_pb.d.ts @@ -0,0 +1,238 @@ +import type { GenFile, GenMessage } from "../../../../codegenv2/types.js"; +import type { Message } from "../../../../types.js"; +/** + * Describes the file google/protobuf/any.proto. + */ +export declare const file_google_protobuf_any: GenFile; +/** + * `Any` contains an arbitrary serialized protocol buffer message along with a + * URL that describes the type of the serialized message. + * + * Protobuf library provides support to pack/unpack Any values in the form + * of utility functions or additional generated methods of the Any type. + * + * Example 1: Pack and unpack a message in C++. + * + * Foo foo = ...; + * Any any; + * any.PackFrom(foo); + * ... + * if (any.UnpackTo(&foo)) { + * ... + * } + * + * Example 2: Pack and unpack a message in Java. + * + * Foo foo = ...; + * Any any = Any.pack(foo); + * ... + * if (any.is(Foo.class)) { + * foo = any.unpack(Foo.class); + * } + * // or ... + * if (any.isSameTypeAs(Foo.getDefaultInstance())) { + * foo = any.unpack(Foo.getDefaultInstance()); + * } + * + * Example 3: Pack and unpack a message in Python. + * + * foo = Foo(...) + * any = Any() + * any.Pack(foo) + * ... + * if any.Is(Foo.DESCRIPTOR): + * any.Unpack(foo) + * ... + * + * Example 4: Pack and unpack a message in Go + * + * foo := &pb.Foo{...} + * any, err := anypb.New(foo) + * if err != nil { + * ... + * } + * ... + * foo := &pb.Foo{} + * if err := any.UnmarshalTo(foo); err != nil { + * ... + * } + * + * The pack methods provided by protobuf library will by default use + * 'type.googleapis.com/full.type.name' as the type URL and the unpack + * methods only use the fully qualified type name after the last '/' + * in the type URL, for example "foo.bar.com/x/y.z" will yield type + * name "y.z". + * + * JSON + * ==== + * The JSON representation of an `Any` value uses the regular + * representation of the deserialized, embedded message, with an + * additional field `@type` which contains the type URL. Example: + * + * package google.profile; + * message Person { + * string first_name = 1; + * string last_name = 2; + * } + * + * { + * "@type": "type.googleapis.com/google.profile.Person", + * "firstName": , + * "lastName": + * } + * + * If the embedded message type is well-known and has a custom JSON + * representation, that representation will be embedded adding a field + * `value` which holds the custom JSON in addition to the `@type` + * field. Example (for message [google.protobuf.Duration][]): + * + * { + * "@type": "type.googleapis.com/google.protobuf.Duration", + * "value": "1.212s" + * } + * + * + * @generated from message google.protobuf.Any + */ +export type Any = Message<"google.protobuf.Any"> & { + /** + * A URL/resource name that uniquely identifies the type of the serialized + * protocol buffer message. This string must contain at least + * one "/" character. The last segment of the URL's path must represent + * the fully qualified name of the type (as in + * `path/google.protobuf.Duration`). The name should be in a canonical form + * (e.g., leading "." is not accepted). + * + * In practice, teams usually precompile into the binary all types that they + * expect it to use in the context of Any. However, for URLs which use the + * scheme `http`, `https`, or no scheme, one can optionally set up a type + * server that maps type URLs to message definitions as follows: + * + * * If no scheme is provided, `https` is assumed. + * * An HTTP GET on the URL must yield a [google.protobuf.Type][] + * value in binary format, or produce an error. + * * Applications are allowed to cache lookup results based on the + * URL, or have them precompiled into a binary to avoid any + * lookup. Therefore, binary compatibility needs to be preserved + * on changes to types. (Use versioned type names to manage + * breaking changes.) + * + * Note: this functionality is not currently available in the official + * protobuf release, and it is not used for type URLs beginning with + * type.googleapis.com. As of May 2023, there are no widely used type server + * implementations and no plans to implement one. + * + * Schemes other than `http`, `https` (or the empty scheme) might be + * used with implementation specific semantics. + * + * + * @generated from field: string type_url = 1; + */ + typeUrl: string; + /** + * Must be a valid serialized protocol buffer of the above specified type. + * + * @generated from field: bytes value = 2; + */ + value: Uint8Array; +}; +/** + * `Any` contains an arbitrary serialized protocol buffer message along with a + * URL that describes the type of the serialized message. + * + * Protobuf library provides support to pack/unpack Any values in the form + * of utility functions or additional generated methods of the Any type. + * + * Example 1: Pack and unpack a message in C++. + * + * Foo foo = ...; + * Any any; + * any.PackFrom(foo); + * ... + * if (any.UnpackTo(&foo)) { + * ... + * } + * + * Example 2: Pack and unpack a message in Java. + * + * Foo foo = ...; + * Any any = Any.pack(foo); + * ... + * if (any.is(Foo.class)) { + * foo = any.unpack(Foo.class); + * } + * // or ... + * if (any.isSameTypeAs(Foo.getDefaultInstance())) { + * foo = any.unpack(Foo.getDefaultInstance()); + * } + * + * Example 3: Pack and unpack a message in Python. + * + * foo = Foo(...) + * any = Any() + * any.Pack(foo) + * ... + * if any.Is(Foo.DESCRIPTOR): + * any.Unpack(foo) + * ... + * + * Example 4: Pack and unpack a message in Go + * + * foo := &pb.Foo{...} + * any, err := anypb.New(foo) + * if err != nil { + * ... + * } + * ... + * foo := &pb.Foo{} + * if err := any.UnmarshalTo(foo); err != nil { + * ... + * } + * + * The pack methods provided by protobuf library will by default use + * 'type.googleapis.com/full.type.name' as the type URL and the unpack + * methods only use the fully qualified type name after the last '/' + * in the type URL, for example "foo.bar.com/x/y.z" will yield type + * name "y.z". + * + * JSON + * ==== + * The JSON representation of an `Any` value uses the regular + * representation of the deserialized, embedded message, with an + * additional field `@type` which contains the type URL. Example: + * + * package google.profile; + * message Person { + * string first_name = 1; + * string last_name = 2; + * } + * + * { + * "@type": "type.googleapis.com/google.profile.Person", + * "firstName": , + * "lastName": + * } + * + * If the embedded message type is well-known and has a custom JSON + * representation, that representation will be embedded adding a field + * `value` which holds the custom JSON in addition to the `@type` + * field. Example (for message [google.protobuf.Duration][]): + * + * { + * "@type": "type.googleapis.com/google.protobuf.Duration", + * "value": "1.212s" + * } + * + * + * @generated from message google.protobuf.Any + */ +export type AnyJson = { + "@type"?: string; +}; +/** + * Describes the message google.protobuf.Any. + * Use `create(AnySchema)` to create a new message. + */ +export declare const AnySchema: GenMessage; diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/any_pb.js b/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/any_pb.js new file mode 100644 index 0000000..61b3486 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/any_pb.js @@ -0,0 +1,27 @@ +"use strict"; +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.AnySchema = exports.file_google_protobuf_any = void 0; +const file_js_1 = require("../../../../codegenv2/file.js"); +const message_js_1 = require("../../../../codegenv2/message.js"); +/** + * Describes the file google/protobuf/any.proto. + */ +exports.file_google_protobuf_any = (0, file_js_1.fileDesc)("Chlnb29nbGUvcHJvdG9idWYvYW55LnByb3RvEg9nb29nbGUucHJvdG9idWYiJgoDQW55EhAKCHR5cGVfdXJsGAEgASgJEg0KBXZhbHVlGAIgASgMQnYKE2NvbS5nb29nbGUucHJvdG9idWZCCEFueVByb3RvUAFaLGdvb2dsZS5nb2xhbmcub3JnL3Byb3RvYnVmL3R5cGVzL2tub3duL2FueXBiogIDR1BCqgIeR29vZ2xlLlByb3RvYnVmLldlbGxLbm93blR5cGVzYgZwcm90bzM"); +/** + * Describes the message google.protobuf.Any. + * Use `create(AnySchema)` to create a new message. + */ +exports.AnySchema = (0, message_js_1.messageDesc)(exports.file_google_protobuf_any, 0); diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/api_pb.d.ts b/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/api_pb.d.ts new file mode 100644 index 0000000..4269e32 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/api_pb.d.ts @@ -0,0 +1,537 @@ +import type { GenFile, GenMessage } from "../../../../codegenv2/types.js"; +import type { SourceContext, SourceContextJson } from "./source_context_pb.js"; +import type { Option, OptionJson, Syntax, SyntaxJson } from "./type_pb.js"; +import type { Message } from "../../../../types.js"; +/** + * Describes the file google/protobuf/api.proto. + */ +export declare const file_google_protobuf_api: GenFile; +/** + * Api is a light-weight descriptor for an API Interface. + * + * Interfaces are also described as "protocol buffer services" in some contexts, + * such as by the "service" keyword in a .proto file, but they are different + * from API Services, which represent a concrete implementation of an interface + * as opposed to simply a description of methods and bindings. They are also + * sometimes simply referred to as "APIs" in other contexts, such as the name of + * this message itself. See https://cloud.google.com/apis/design/glossary for + * detailed terminology. + * + * New usages of this message as an alternative to ServiceDescriptorProto are + * strongly discouraged. This message does not reliability preserve all + * information necessary to model the schema and preserve semantics. Instead + * make use of FileDescriptorSet which preserves the necessary information. + * + * @generated from message google.protobuf.Api + */ +export type Api = Message<"google.protobuf.Api"> & { + /** + * The fully qualified name of this interface, including package name + * followed by the interface's simple name. + * + * @generated from field: string name = 1; + */ + name: string; + /** + * The methods of this interface, in unspecified order. + * + * @generated from field: repeated google.protobuf.Method methods = 2; + */ + methods: Method[]; + /** + * Any metadata attached to the interface. + * + * @generated from field: repeated google.protobuf.Option options = 3; + */ + options: Option[]; + /** + * A version string for this interface. If specified, must have the form + * `major-version.minor-version`, as in `1.10`. If the minor version is + * omitted, it defaults to zero. If the entire version field is empty, the + * major version is derived from the package name, as outlined below. If the + * field is not empty, the version in the package name will be verified to be + * consistent with what is provided here. + * + * The versioning schema uses [semantic + * versioning](http://semver.org) where the major version number + * indicates a breaking change and the minor version an additive, + * non-breaking change. Both version numbers are signals to users + * what to expect from different versions, and should be carefully + * chosen based on the product plan. + * + * The major version is also reflected in the package name of the + * interface, which must end in `v`, as in + * `google.feature.v1`. For major versions 0 and 1, the suffix can + * be omitted. Zero major versions must only be used for + * experimental, non-GA interfaces. + * + * + * @generated from field: string version = 4; + */ + version: string; + /** + * Source context for the protocol buffer service represented by this + * message. + * + * @generated from field: google.protobuf.SourceContext source_context = 5; + */ + sourceContext?: SourceContext | undefined; + /** + * Included interfaces. See [Mixin][]. + * + * @generated from field: repeated google.protobuf.Mixin mixins = 6; + */ + mixins: Mixin[]; + /** + * The source syntax of the service. + * + * @generated from field: google.protobuf.Syntax syntax = 7; + */ + syntax: Syntax; + /** + * The source edition string, only valid when syntax is SYNTAX_EDITIONS. + * + * @generated from field: string edition = 8; + */ + edition: string; +}; +/** + * Api is a light-weight descriptor for an API Interface. + * + * Interfaces are also described as "protocol buffer services" in some contexts, + * such as by the "service" keyword in a .proto file, but they are different + * from API Services, which represent a concrete implementation of an interface + * as opposed to simply a description of methods and bindings. They are also + * sometimes simply referred to as "APIs" in other contexts, such as the name of + * this message itself. See https://cloud.google.com/apis/design/glossary for + * detailed terminology. + * + * New usages of this message as an alternative to ServiceDescriptorProto are + * strongly discouraged. This message does not reliability preserve all + * information necessary to model the schema and preserve semantics. Instead + * make use of FileDescriptorSet which preserves the necessary information. + * + * @generated from message google.protobuf.Api + */ +export type ApiJson = { + /** + * The fully qualified name of this interface, including package name + * followed by the interface's simple name. + * + * @generated from field: string name = 1; + */ + name?: string; + /** + * The methods of this interface, in unspecified order. + * + * @generated from field: repeated google.protobuf.Method methods = 2; + */ + methods?: MethodJson[]; + /** + * Any metadata attached to the interface. + * + * @generated from field: repeated google.protobuf.Option options = 3; + */ + options?: OptionJson[]; + /** + * A version string for this interface. If specified, must have the form + * `major-version.minor-version`, as in `1.10`. If the minor version is + * omitted, it defaults to zero. If the entire version field is empty, the + * major version is derived from the package name, as outlined below. If the + * field is not empty, the version in the package name will be verified to be + * consistent with what is provided here. + * + * The versioning schema uses [semantic + * versioning](http://semver.org) where the major version number + * indicates a breaking change and the minor version an additive, + * non-breaking change. Both version numbers are signals to users + * what to expect from different versions, and should be carefully + * chosen based on the product plan. + * + * The major version is also reflected in the package name of the + * interface, which must end in `v`, as in + * `google.feature.v1`. For major versions 0 and 1, the suffix can + * be omitted. Zero major versions must only be used for + * experimental, non-GA interfaces. + * + * + * @generated from field: string version = 4; + */ + version?: string; + /** + * Source context for the protocol buffer service represented by this + * message. + * + * @generated from field: google.protobuf.SourceContext source_context = 5; + */ + sourceContext?: SourceContextJson; + /** + * Included interfaces. See [Mixin][]. + * + * @generated from field: repeated google.protobuf.Mixin mixins = 6; + */ + mixins?: MixinJson[]; + /** + * The source syntax of the service. + * + * @generated from field: google.protobuf.Syntax syntax = 7; + */ + syntax?: SyntaxJson; + /** + * The source edition string, only valid when syntax is SYNTAX_EDITIONS. + * + * @generated from field: string edition = 8; + */ + edition?: string; +}; +/** + * Describes the message google.protobuf.Api. + * Use `create(ApiSchema)` to create a new message. + */ +export declare const ApiSchema: GenMessage; +/** + * Method represents a method of an API interface. + * + * New usages of this message as an alternative to MethodDescriptorProto are + * strongly discouraged. This message does not reliability preserve all + * information necessary to model the schema and preserve semantics. Instead + * make use of FileDescriptorSet which preserves the necessary information. + * + * @generated from message google.protobuf.Method + */ +export type Method = Message<"google.protobuf.Method"> & { + /** + * The simple name of this method. + * + * @generated from field: string name = 1; + */ + name: string; + /** + * A URL of the input message type. + * + * @generated from field: string request_type_url = 2; + */ + requestTypeUrl: string; + /** + * If true, the request is streamed. + * + * @generated from field: bool request_streaming = 3; + */ + requestStreaming: boolean; + /** + * The URL of the output message type. + * + * @generated from field: string response_type_url = 4; + */ + responseTypeUrl: string; + /** + * If true, the response is streamed. + * + * @generated from field: bool response_streaming = 5; + */ + responseStreaming: boolean; + /** + * Any metadata attached to the method. + * + * @generated from field: repeated google.protobuf.Option options = 6; + */ + options: Option[]; + /** + * The source syntax of this method. + * + * This field should be ignored, instead the syntax should be inherited from + * Api. This is similar to Field and EnumValue. + * + * @generated from field: google.protobuf.Syntax syntax = 7 [deprecated = true]; + * @deprecated + */ + syntax: Syntax; + /** + * The source edition string, only valid when syntax is SYNTAX_EDITIONS. + * + * This field should be ignored, instead the edition should be inherited from + * Api. This is similar to Field and EnumValue. + * + * @generated from field: string edition = 8 [deprecated = true]; + * @deprecated + */ + edition: string; +}; +/** + * Method represents a method of an API interface. + * + * New usages of this message as an alternative to MethodDescriptorProto are + * strongly discouraged. This message does not reliability preserve all + * information necessary to model the schema and preserve semantics. Instead + * make use of FileDescriptorSet which preserves the necessary information. + * + * @generated from message google.protobuf.Method + */ +export type MethodJson = { + /** + * The simple name of this method. + * + * @generated from field: string name = 1; + */ + name?: string; + /** + * A URL of the input message type. + * + * @generated from field: string request_type_url = 2; + */ + requestTypeUrl?: string; + /** + * If true, the request is streamed. + * + * @generated from field: bool request_streaming = 3; + */ + requestStreaming?: boolean; + /** + * The URL of the output message type. + * + * @generated from field: string response_type_url = 4; + */ + responseTypeUrl?: string; + /** + * If true, the response is streamed. + * + * @generated from field: bool response_streaming = 5; + */ + responseStreaming?: boolean; + /** + * Any metadata attached to the method. + * + * @generated from field: repeated google.protobuf.Option options = 6; + */ + options?: OptionJson[]; + /** + * The source syntax of this method. + * + * This field should be ignored, instead the syntax should be inherited from + * Api. This is similar to Field and EnumValue. + * + * @generated from field: google.protobuf.Syntax syntax = 7 [deprecated = true]; + * @deprecated + */ + syntax?: SyntaxJson; + /** + * The source edition string, only valid when syntax is SYNTAX_EDITIONS. + * + * This field should be ignored, instead the edition should be inherited from + * Api. This is similar to Field and EnumValue. + * + * @generated from field: string edition = 8 [deprecated = true]; + * @deprecated + */ + edition?: string; +}; +/** + * Describes the message google.protobuf.Method. + * Use `create(MethodSchema)` to create a new message. + */ +export declare const MethodSchema: GenMessage; +/** + * Declares an API Interface to be included in this interface. The including + * interface must redeclare all the methods from the included interface, but + * documentation and options are inherited as follows: + * + * - If after comment and whitespace stripping, the documentation + * string of the redeclared method is empty, it will be inherited + * from the original method. + * + * - Each annotation belonging to the service config (http, + * visibility) which is not set in the redeclared method will be + * inherited. + * + * - If an http annotation is inherited, the path pattern will be + * modified as follows. Any version prefix will be replaced by the + * version of the including interface plus the [root][] path if + * specified. + * + * Example of a simple mixin: + * + * package google.acl.v1; + * service AccessControl { + * // Get the underlying ACL object. + * rpc GetAcl(GetAclRequest) returns (Acl) { + * option (google.api.http).get = "/v1/{resource=**}:getAcl"; + * } + * } + * + * package google.storage.v2; + * service Storage { + * rpc GetAcl(GetAclRequest) returns (Acl); + * + * // Get a data record. + * rpc GetData(GetDataRequest) returns (Data) { + * option (google.api.http).get = "/v2/{resource=**}"; + * } + * } + * + * Example of a mixin configuration: + * + * apis: + * - name: google.storage.v2.Storage + * mixins: + * - name: google.acl.v1.AccessControl + * + * The mixin construct implies that all methods in `AccessControl` are + * also declared with same name and request/response types in + * `Storage`. A documentation generator or annotation processor will + * see the effective `Storage.GetAcl` method after inheriting + * documentation and annotations as follows: + * + * service Storage { + * // Get the underlying ACL object. + * rpc GetAcl(GetAclRequest) returns (Acl) { + * option (google.api.http).get = "/v2/{resource=**}:getAcl"; + * } + * ... + * } + * + * Note how the version in the path pattern changed from `v1` to `v2`. + * + * If the `root` field in the mixin is specified, it should be a + * relative path under which inherited HTTP paths are placed. Example: + * + * apis: + * - name: google.storage.v2.Storage + * mixins: + * - name: google.acl.v1.AccessControl + * root: acls + * + * This implies the following inherited HTTP annotation: + * + * service Storage { + * // Get the underlying ACL object. + * rpc GetAcl(GetAclRequest) returns (Acl) { + * option (google.api.http).get = "/v2/acls/{resource=**}:getAcl"; + * } + * ... + * } + * + * @generated from message google.protobuf.Mixin + */ +export type Mixin = Message<"google.protobuf.Mixin"> & { + /** + * The fully qualified name of the interface which is included. + * + * @generated from field: string name = 1; + */ + name: string; + /** + * If non-empty specifies a path under which inherited HTTP paths + * are rooted. + * + * @generated from field: string root = 2; + */ + root: string; +}; +/** + * Declares an API Interface to be included in this interface. The including + * interface must redeclare all the methods from the included interface, but + * documentation and options are inherited as follows: + * + * - If after comment and whitespace stripping, the documentation + * string of the redeclared method is empty, it will be inherited + * from the original method. + * + * - Each annotation belonging to the service config (http, + * visibility) which is not set in the redeclared method will be + * inherited. + * + * - If an http annotation is inherited, the path pattern will be + * modified as follows. Any version prefix will be replaced by the + * version of the including interface plus the [root][] path if + * specified. + * + * Example of a simple mixin: + * + * package google.acl.v1; + * service AccessControl { + * // Get the underlying ACL object. + * rpc GetAcl(GetAclRequest) returns (Acl) { + * option (google.api.http).get = "/v1/{resource=**}:getAcl"; + * } + * } + * + * package google.storage.v2; + * service Storage { + * rpc GetAcl(GetAclRequest) returns (Acl); + * + * // Get a data record. + * rpc GetData(GetDataRequest) returns (Data) { + * option (google.api.http).get = "/v2/{resource=**}"; + * } + * } + * + * Example of a mixin configuration: + * + * apis: + * - name: google.storage.v2.Storage + * mixins: + * - name: google.acl.v1.AccessControl + * + * The mixin construct implies that all methods in `AccessControl` are + * also declared with same name and request/response types in + * `Storage`. A documentation generator or annotation processor will + * see the effective `Storage.GetAcl` method after inheriting + * documentation and annotations as follows: + * + * service Storage { + * // Get the underlying ACL object. + * rpc GetAcl(GetAclRequest) returns (Acl) { + * option (google.api.http).get = "/v2/{resource=**}:getAcl"; + * } + * ... + * } + * + * Note how the version in the path pattern changed from `v1` to `v2`. + * + * If the `root` field in the mixin is specified, it should be a + * relative path under which inherited HTTP paths are placed. Example: + * + * apis: + * - name: google.storage.v2.Storage + * mixins: + * - name: google.acl.v1.AccessControl + * root: acls + * + * This implies the following inherited HTTP annotation: + * + * service Storage { + * // Get the underlying ACL object. + * rpc GetAcl(GetAclRequest) returns (Acl) { + * option (google.api.http).get = "/v2/acls/{resource=**}:getAcl"; + * } + * ... + * } + * + * @generated from message google.protobuf.Mixin + */ +export type MixinJson = { + /** + * The fully qualified name of the interface which is included. + * + * @generated from field: string name = 1; + */ + name?: string; + /** + * If non-empty specifies a path under which inherited HTTP paths + * are rooted. + * + * @generated from field: string root = 2; + */ + root?: string; +}; +/** + * Describes the message google.protobuf.Mixin. + * Use `create(MixinSchema)` to create a new message. + */ +export declare const MixinSchema: GenMessage; diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/api_pb.js b/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/api_pb.js new file mode 100644 index 0000000..9984cbc --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/api_pb.js @@ -0,0 +1,39 @@ +"use strict"; +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MixinSchema = exports.MethodSchema = exports.ApiSchema = exports.file_google_protobuf_api = void 0; +const file_js_1 = require("../../../../codegenv2/file.js"); +const source_context_pb_js_1 = require("./source_context_pb.js"); +const type_pb_js_1 = require("./type_pb.js"); +const message_js_1 = require("../../../../codegenv2/message.js"); +/** + * Describes the file google/protobuf/api.proto. + */ +exports.file_google_protobuf_api = (0, file_js_1.fileDesc)("Chlnb29nbGUvcHJvdG9idWYvYXBpLnByb3RvEg9nb29nbGUucHJvdG9idWYikgIKA0FwaRIMCgRuYW1lGAEgASgJEigKB21ldGhvZHMYAiADKAsyFy5nb29nbGUucHJvdG9idWYuTWV0aG9kEigKB29wdGlvbnMYAyADKAsyFy5nb29nbGUucHJvdG9idWYuT3B0aW9uEg8KB3ZlcnNpb24YBCABKAkSNgoOc291cmNlX2NvbnRleHQYBSABKAsyHi5nb29nbGUucHJvdG9idWYuU291cmNlQ29udGV4dBImCgZtaXhpbnMYBiADKAsyFi5nb29nbGUucHJvdG9idWYuTWl4aW4SJwoGc3ludGF4GAcgASgOMhcuZ29vZ2xlLnByb3RvYnVmLlN5bnRheBIPCgdlZGl0aW9uGAggASgJIu4BCgZNZXRob2QSDAoEbmFtZRgBIAEoCRIYChByZXF1ZXN0X3R5cGVfdXJsGAIgASgJEhkKEXJlcXVlc3Rfc3RyZWFtaW5nGAMgASgIEhkKEXJlc3BvbnNlX3R5cGVfdXJsGAQgASgJEhoKEnJlc3BvbnNlX3N0cmVhbWluZxgFIAEoCBIoCgdvcHRpb25zGAYgAygLMhcuZ29vZ2xlLnByb3RvYnVmLk9wdGlvbhIrCgZzeW50YXgYByABKA4yFy5nb29nbGUucHJvdG9idWYuU3ludGF4QgIYARITCgdlZGl0aW9uGAggASgJQgIYASIjCgVNaXhpbhIMCgRuYW1lGAEgASgJEgwKBHJvb3QYAiABKAlCdgoTY29tLmdvb2dsZS5wcm90b2J1ZkIIQXBpUHJvdG9QAVosZ29vZ2xlLmdvbGFuZy5vcmcvcHJvdG9idWYvdHlwZXMva25vd24vYXBpcGKiAgNHUEKqAh5Hb29nbGUuUHJvdG9idWYuV2VsbEtub3duVHlwZXNiBnByb3RvMw", [source_context_pb_js_1.file_google_protobuf_source_context, type_pb_js_1.file_google_protobuf_type]); +/** + * Describes the message google.protobuf.Api. + * Use `create(ApiSchema)` to create a new message. + */ +exports.ApiSchema = (0, message_js_1.messageDesc)(exports.file_google_protobuf_api, 0); +/** + * Describes the message google.protobuf.Method. + * Use `create(MethodSchema)` to create a new message. + */ +exports.MethodSchema = (0, message_js_1.messageDesc)(exports.file_google_protobuf_api, 1); +/** + * Describes the message google.protobuf.Mixin. + * Use `create(MixinSchema)` to create a new message. + */ +exports.MixinSchema = (0, message_js_1.messageDesc)(exports.file_google_protobuf_api, 2); diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/compiler/plugin_pb.d.ts b/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/compiler/plugin_pb.d.ts new file mode 100644 index 0000000..843cde5 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/compiler/plugin_pb.d.ts @@ -0,0 +1,490 @@ +import type { GenEnum, GenFile, GenMessage } from "../../../../../codegenv2/types.js"; +import type { FileDescriptorProto, FileDescriptorProtoJson, GeneratedCodeInfo, GeneratedCodeInfoJson } from "../descriptor_pb.js"; +import type { Message } from "../../../../../types.js"; +/** + * Describes the file google/protobuf/compiler/plugin.proto. + */ +export declare const file_google_protobuf_compiler_plugin: GenFile; +/** + * The version number of protocol compiler. + * + * @generated from message google.protobuf.compiler.Version + */ +export type Version = Message<"google.protobuf.compiler.Version"> & { + /** + * @generated from field: optional int32 major = 1; + */ + major: number; + /** + * @generated from field: optional int32 minor = 2; + */ + minor: number; + /** + * @generated from field: optional int32 patch = 3; + */ + patch: number; + /** + * A suffix for alpha, beta or rc release, e.g., "alpha-1", "rc2". It should + * be empty for mainline stable releases. + * + * @generated from field: optional string suffix = 4; + */ + suffix: string; +}; +/** + * The version number of protocol compiler. + * + * @generated from message google.protobuf.compiler.Version + */ +export type VersionJson = { + /** + * @generated from field: optional int32 major = 1; + */ + major?: number; + /** + * @generated from field: optional int32 minor = 2; + */ + minor?: number; + /** + * @generated from field: optional int32 patch = 3; + */ + patch?: number; + /** + * A suffix for alpha, beta or rc release, e.g., "alpha-1", "rc2". It should + * be empty for mainline stable releases. + * + * @generated from field: optional string suffix = 4; + */ + suffix?: string; +}; +/** + * Describes the message google.protobuf.compiler.Version. + * Use `create(VersionSchema)` to create a new message. + */ +export declare const VersionSchema: GenMessage; +/** + * An encoded CodeGeneratorRequest is written to the plugin's stdin. + * + * @generated from message google.protobuf.compiler.CodeGeneratorRequest + */ +export type CodeGeneratorRequest = Message<"google.protobuf.compiler.CodeGeneratorRequest"> & { + /** + * The .proto files that were explicitly listed on the command-line. The + * code generator should generate code only for these files. Each file's + * descriptor will be included in proto_file, below. + * + * @generated from field: repeated string file_to_generate = 1; + */ + fileToGenerate: string[]; + /** + * The generator parameter passed on the command-line. + * + * @generated from field: optional string parameter = 2; + */ + parameter: string; + /** + * FileDescriptorProtos for all files in files_to_generate and everything + * they import. The files will appear in topological order, so each file + * appears before any file that imports it. + * + * Note: the files listed in files_to_generate will include runtime-retention + * options only, but all other files will include source-retention options. + * The source_file_descriptors field below is available in case you need + * source-retention options for files_to_generate. + * + * protoc guarantees that all proto_files will be written after + * the fields above, even though this is not technically guaranteed by the + * protobuf wire format. This theoretically could allow a plugin to stream + * in the FileDescriptorProtos and handle them one by one rather than read + * the entire set into memory at once. However, as of this writing, this + * is not similarly optimized on protoc's end -- it will store all fields in + * memory at once before sending them to the plugin. + * + * Type names of fields and extensions in the FileDescriptorProto are always + * fully qualified. + * + * @generated from field: repeated google.protobuf.FileDescriptorProto proto_file = 15; + */ + protoFile: FileDescriptorProto[]; + /** + * File descriptors with all options, including source-retention options. + * These descriptors are only provided for the files listed in + * files_to_generate. + * + * @generated from field: repeated google.protobuf.FileDescriptorProto source_file_descriptors = 17; + */ + sourceFileDescriptors: FileDescriptorProto[]; + /** + * The version number of protocol compiler. + * + * @generated from field: optional google.protobuf.compiler.Version compiler_version = 3; + */ + compilerVersion?: Version | undefined; +}; +/** + * An encoded CodeGeneratorRequest is written to the plugin's stdin. + * + * @generated from message google.protobuf.compiler.CodeGeneratorRequest + */ +export type CodeGeneratorRequestJson = { + /** + * The .proto files that were explicitly listed on the command-line. The + * code generator should generate code only for these files. Each file's + * descriptor will be included in proto_file, below. + * + * @generated from field: repeated string file_to_generate = 1; + */ + fileToGenerate?: string[]; + /** + * The generator parameter passed on the command-line. + * + * @generated from field: optional string parameter = 2; + */ + parameter?: string; + /** + * FileDescriptorProtos for all files in files_to_generate and everything + * they import. The files will appear in topological order, so each file + * appears before any file that imports it. + * + * Note: the files listed in files_to_generate will include runtime-retention + * options only, but all other files will include source-retention options. + * The source_file_descriptors field below is available in case you need + * source-retention options for files_to_generate. + * + * protoc guarantees that all proto_files will be written after + * the fields above, even though this is not technically guaranteed by the + * protobuf wire format. This theoretically could allow a plugin to stream + * in the FileDescriptorProtos and handle them one by one rather than read + * the entire set into memory at once. However, as of this writing, this + * is not similarly optimized on protoc's end -- it will store all fields in + * memory at once before sending them to the plugin. + * + * Type names of fields and extensions in the FileDescriptorProto are always + * fully qualified. + * + * @generated from field: repeated google.protobuf.FileDescriptorProto proto_file = 15; + */ + protoFile?: FileDescriptorProtoJson[]; + /** + * File descriptors with all options, including source-retention options. + * These descriptors are only provided for the files listed in + * files_to_generate. + * + * @generated from field: repeated google.protobuf.FileDescriptorProto source_file_descriptors = 17; + */ + sourceFileDescriptors?: FileDescriptorProtoJson[]; + /** + * The version number of protocol compiler. + * + * @generated from field: optional google.protobuf.compiler.Version compiler_version = 3; + */ + compilerVersion?: VersionJson; +}; +/** + * Describes the message google.protobuf.compiler.CodeGeneratorRequest. + * Use `create(CodeGeneratorRequestSchema)` to create a new message. + */ +export declare const CodeGeneratorRequestSchema: GenMessage; +/** + * The plugin writes an encoded CodeGeneratorResponse to stdout. + * + * @generated from message google.protobuf.compiler.CodeGeneratorResponse + */ +export type CodeGeneratorResponse = Message<"google.protobuf.compiler.CodeGeneratorResponse"> & { + /** + * Error message. If non-empty, code generation failed. The plugin process + * should exit with status code zero even if it reports an error in this way. + * + * This should be used to indicate errors in .proto files which prevent the + * code generator from generating correct code. Errors which indicate a + * problem in protoc itself -- such as the input CodeGeneratorRequest being + * unparseable -- should be reported by writing a message to stderr and + * exiting with a non-zero status code. + * + * @generated from field: optional string error = 1; + */ + error: string; + /** + * A bitmask of supported features that the code generator supports. + * This is a bitwise "or" of values from the Feature enum. + * + * @generated from field: optional uint64 supported_features = 2; + */ + supportedFeatures: bigint; + /** + * The minimum edition this plugin supports. This will be treated as an + * Edition enum, but we want to allow unknown values. It should be specified + * according the edition enum value, *not* the edition number. Only takes + * effect for plugins that have FEATURE_SUPPORTS_EDITIONS set. + * + * @generated from field: optional int32 minimum_edition = 3; + */ + minimumEdition: number; + /** + * The maximum edition this plugin supports. This will be treated as an + * Edition enum, but we want to allow unknown values. It should be specified + * according the edition enum value, *not* the edition number. Only takes + * effect for plugins that have FEATURE_SUPPORTS_EDITIONS set. + * + * @generated from field: optional int32 maximum_edition = 4; + */ + maximumEdition: number; + /** + * @generated from field: repeated google.protobuf.compiler.CodeGeneratorResponse.File file = 15; + */ + file: CodeGeneratorResponse_File[]; +}; +/** + * The plugin writes an encoded CodeGeneratorResponse to stdout. + * + * @generated from message google.protobuf.compiler.CodeGeneratorResponse + */ +export type CodeGeneratorResponseJson = { + /** + * Error message. If non-empty, code generation failed. The plugin process + * should exit with status code zero even if it reports an error in this way. + * + * This should be used to indicate errors in .proto files which prevent the + * code generator from generating correct code. Errors which indicate a + * problem in protoc itself -- such as the input CodeGeneratorRequest being + * unparseable -- should be reported by writing a message to stderr and + * exiting with a non-zero status code. + * + * @generated from field: optional string error = 1; + */ + error?: string; + /** + * A bitmask of supported features that the code generator supports. + * This is a bitwise "or" of values from the Feature enum. + * + * @generated from field: optional uint64 supported_features = 2; + */ + supportedFeatures?: string; + /** + * The minimum edition this plugin supports. This will be treated as an + * Edition enum, but we want to allow unknown values. It should be specified + * according the edition enum value, *not* the edition number. Only takes + * effect for plugins that have FEATURE_SUPPORTS_EDITIONS set. + * + * @generated from field: optional int32 minimum_edition = 3; + */ + minimumEdition?: number; + /** + * The maximum edition this plugin supports. This will be treated as an + * Edition enum, but we want to allow unknown values. It should be specified + * according the edition enum value, *not* the edition number. Only takes + * effect for plugins that have FEATURE_SUPPORTS_EDITIONS set. + * + * @generated from field: optional int32 maximum_edition = 4; + */ + maximumEdition?: number; + /** + * @generated from field: repeated google.protobuf.compiler.CodeGeneratorResponse.File file = 15; + */ + file?: CodeGeneratorResponse_FileJson[]; +}; +/** + * Describes the message google.protobuf.compiler.CodeGeneratorResponse. + * Use `create(CodeGeneratorResponseSchema)` to create a new message. + */ +export declare const CodeGeneratorResponseSchema: GenMessage; +/** + * Represents a single generated file. + * + * @generated from message google.protobuf.compiler.CodeGeneratorResponse.File + */ +export type CodeGeneratorResponse_File = Message<"google.protobuf.compiler.CodeGeneratorResponse.File"> & { + /** + * The file name, relative to the output directory. The name must not + * contain "." or ".." components and must be relative, not be absolute (so, + * the file cannot lie outside the output directory). "/" must be used as + * the path separator, not "\". + * + * If the name is omitted, the content will be appended to the previous + * file. This allows the generator to break large files into small chunks, + * and allows the generated text to be streamed back to protoc so that large + * files need not reside completely in memory at one time. Note that as of + * this writing protoc does not optimize for this -- it will read the entire + * CodeGeneratorResponse before writing files to disk. + * + * @generated from field: optional string name = 1; + */ + name: string; + /** + * If non-empty, indicates that the named file should already exist, and the + * content here is to be inserted into that file at a defined insertion + * point. This feature allows a code generator to extend the output + * produced by another code generator. The original generator may provide + * insertion points by placing special annotations in the file that look + * like: + * @@protoc_insertion_point(NAME) + * The annotation can have arbitrary text before and after it on the line, + * which allows it to be placed in a comment. NAME should be replaced with + * an identifier naming the point -- this is what other generators will use + * as the insertion_point. Code inserted at this point will be placed + * immediately above the line containing the insertion point (thus multiple + * insertions to the same point will come out in the order they were added). + * The double-@ is intended to make it unlikely that the generated code + * could contain things that look like insertion points by accident. + * + * For example, the C++ code generator places the following line in the + * .pb.h files that it generates: + * // @@protoc_insertion_point(namespace_scope) + * This line appears within the scope of the file's package namespace, but + * outside of any particular class. Another plugin can then specify the + * insertion_point "namespace_scope" to generate additional classes or + * other declarations that should be placed in this scope. + * + * Note that if the line containing the insertion point begins with + * whitespace, the same whitespace will be added to every line of the + * inserted text. This is useful for languages like Python, where + * indentation matters. In these languages, the insertion point comment + * should be indented the same amount as any inserted code will need to be + * in order to work correctly in that context. + * + * The code generator that generates the initial file and the one which + * inserts into it must both run as part of a single invocation of protoc. + * Code generators are executed in the order in which they appear on the + * command line. + * + * If |insertion_point| is present, |name| must also be present. + * + * @generated from field: optional string insertion_point = 2; + */ + insertionPoint: string; + /** + * The file contents. + * + * @generated from field: optional string content = 15; + */ + content: string; + /** + * Information describing the file content being inserted. If an insertion + * point is used, this information will be appropriately offset and inserted + * into the code generation metadata for the generated files. + * + * @generated from field: optional google.protobuf.GeneratedCodeInfo generated_code_info = 16; + */ + generatedCodeInfo?: GeneratedCodeInfo | undefined; +}; +/** + * Represents a single generated file. + * + * @generated from message google.protobuf.compiler.CodeGeneratorResponse.File + */ +export type CodeGeneratorResponse_FileJson = { + /** + * The file name, relative to the output directory. The name must not + * contain "." or ".." components and must be relative, not be absolute (so, + * the file cannot lie outside the output directory). "/" must be used as + * the path separator, not "\". + * + * If the name is omitted, the content will be appended to the previous + * file. This allows the generator to break large files into small chunks, + * and allows the generated text to be streamed back to protoc so that large + * files need not reside completely in memory at one time. Note that as of + * this writing protoc does not optimize for this -- it will read the entire + * CodeGeneratorResponse before writing files to disk. + * + * @generated from field: optional string name = 1; + */ + name?: string; + /** + * If non-empty, indicates that the named file should already exist, and the + * content here is to be inserted into that file at a defined insertion + * point. This feature allows a code generator to extend the output + * produced by another code generator. The original generator may provide + * insertion points by placing special annotations in the file that look + * like: + * @@protoc_insertion_point(NAME) + * The annotation can have arbitrary text before and after it on the line, + * which allows it to be placed in a comment. NAME should be replaced with + * an identifier naming the point -- this is what other generators will use + * as the insertion_point. Code inserted at this point will be placed + * immediately above the line containing the insertion point (thus multiple + * insertions to the same point will come out in the order they were added). + * The double-@ is intended to make it unlikely that the generated code + * could contain things that look like insertion points by accident. + * + * For example, the C++ code generator places the following line in the + * .pb.h files that it generates: + * // @@protoc_insertion_point(namespace_scope) + * This line appears within the scope of the file's package namespace, but + * outside of any particular class. Another plugin can then specify the + * insertion_point "namespace_scope" to generate additional classes or + * other declarations that should be placed in this scope. + * + * Note that if the line containing the insertion point begins with + * whitespace, the same whitespace will be added to every line of the + * inserted text. This is useful for languages like Python, where + * indentation matters. In these languages, the insertion point comment + * should be indented the same amount as any inserted code will need to be + * in order to work correctly in that context. + * + * The code generator that generates the initial file and the one which + * inserts into it must both run as part of a single invocation of protoc. + * Code generators are executed in the order in which they appear on the + * command line. + * + * If |insertion_point| is present, |name| must also be present. + * + * @generated from field: optional string insertion_point = 2; + */ + insertionPoint?: string; + /** + * The file contents. + * + * @generated from field: optional string content = 15; + */ + content?: string; + /** + * Information describing the file content being inserted. If an insertion + * point is used, this information will be appropriately offset and inserted + * into the code generation metadata for the generated files. + * + * @generated from field: optional google.protobuf.GeneratedCodeInfo generated_code_info = 16; + */ + generatedCodeInfo?: GeneratedCodeInfoJson; +}; +/** + * Describes the message google.protobuf.compiler.CodeGeneratorResponse.File. + * Use `create(CodeGeneratorResponse_FileSchema)` to create a new message. + */ +export declare const CodeGeneratorResponse_FileSchema: GenMessage; +/** + * Sync with code_generator.h. + * + * @generated from enum google.protobuf.compiler.CodeGeneratorResponse.Feature + */ +export declare enum CodeGeneratorResponse_Feature { + /** + * @generated from enum value: FEATURE_NONE = 0; + */ + NONE = 0, + /** + * @generated from enum value: FEATURE_PROTO3_OPTIONAL = 1; + */ + PROTO3_OPTIONAL = 1, + /** + * @generated from enum value: FEATURE_SUPPORTS_EDITIONS = 2; + */ + SUPPORTS_EDITIONS = 2 +} +/** + * Sync with code_generator.h. + * + * @generated from enum google.protobuf.compiler.CodeGeneratorResponse.Feature + */ +export type CodeGeneratorResponse_FeatureJson = "FEATURE_NONE" | "FEATURE_PROTO3_OPTIONAL" | "FEATURE_SUPPORTS_EDITIONS"; +/** + * Describes the enum google.protobuf.compiler.CodeGeneratorResponse.Feature. + */ +export declare const CodeGeneratorResponse_FeatureSchema: GenEnum; diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/compiler/plugin_pb.js b/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/compiler/plugin_pb.js new file mode 100644 index 0000000..20b7a6a --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/compiler/plugin_pb.js @@ -0,0 +1,68 @@ +"use strict"; +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.CodeGeneratorResponse_FeatureSchema = exports.CodeGeneratorResponse_Feature = exports.CodeGeneratorResponse_FileSchema = exports.CodeGeneratorResponseSchema = exports.CodeGeneratorRequestSchema = exports.VersionSchema = exports.file_google_protobuf_compiler_plugin = void 0; +const file_js_1 = require("../../../../../codegenv2/file.js"); +const descriptor_pb_js_1 = require("../descriptor_pb.js"); +const message_js_1 = require("../../../../../codegenv2/message.js"); +const enum_js_1 = require("../../../../../codegenv2/enum.js"); +/** + * Describes the file google/protobuf/compiler/plugin.proto. + */ +exports.file_google_protobuf_compiler_plugin = (0, file_js_1.fileDesc)("CiVnb29nbGUvcHJvdG9idWYvY29tcGlsZXIvcGx1Z2luLnByb3RvEhhnb29nbGUucHJvdG9idWYuY29tcGlsZXIiRgoHVmVyc2lvbhINCgVtYWpvchgBIAEoBRINCgVtaW5vchgCIAEoBRINCgVwYXRjaBgDIAEoBRIOCgZzdWZmaXgYBCABKAkigQIKFENvZGVHZW5lcmF0b3JSZXF1ZXN0EhgKEGZpbGVfdG9fZ2VuZXJhdGUYASADKAkSEQoJcGFyYW1ldGVyGAIgASgJEjgKCnByb3RvX2ZpbGUYDyADKAsyJC5nb29nbGUucHJvdG9idWYuRmlsZURlc2NyaXB0b3JQcm90bxJFChdzb3VyY2VfZmlsZV9kZXNjcmlwdG9ycxgRIAMoCzIkLmdvb2dsZS5wcm90b2J1Zi5GaWxlRGVzY3JpcHRvclByb3RvEjsKEGNvbXBpbGVyX3ZlcnNpb24YAyABKAsyIS5nb29nbGUucHJvdG9idWYuY29tcGlsZXIuVmVyc2lvbiKSAwoVQ29kZUdlbmVyYXRvclJlc3BvbnNlEg0KBWVycm9yGAEgASgJEhoKEnN1cHBvcnRlZF9mZWF0dXJlcxgCIAEoBBIXCg9taW5pbXVtX2VkaXRpb24YAyABKAUSFwoPbWF4aW11bV9lZGl0aW9uGAQgASgFEkIKBGZpbGUYDyADKAsyNC5nb29nbGUucHJvdG9idWYuY29tcGlsZXIuQ29kZUdlbmVyYXRvclJlc3BvbnNlLkZpbGUafwoERmlsZRIMCgRuYW1lGAEgASgJEhcKD2luc2VydGlvbl9wb2ludBgCIAEoCRIPCgdjb250ZW50GA8gASgJEj8KE2dlbmVyYXRlZF9jb2RlX2luZm8YECABKAsyIi5nb29nbGUucHJvdG9idWYuR2VuZXJhdGVkQ29kZUluZm8iVwoHRmVhdHVyZRIQCgxGRUFUVVJFX05PTkUQABIbChdGRUFUVVJFX1BST1RPM19PUFRJT05BTBABEh0KGUZFQVRVUkVfU1VQUE9SVFNfRURJVElPTlMQAkJyChxjb20uZ29vZ2xlLnByb3RvYnVmLmNvbXBpbGVyQgxQbHVnaW5Qcm90b3NaKWdvb2dsZS5nb2xhbmcub3JnL3Byb3RvYnVmL3R5cGVzL3BsdWdpbnBiqgIYR29vZ2xlLlByb3RvYnVmLkNvbXBpbGVy", [descriptor_pb_js_1.file_google_protobuf_descriptor]); +/** + * Describes the message google.protobuf.compiler.Version. + * Use `create(VersionSchema)` to create a new message. + */ +exports.VersionSchema = (0, message_js_1.messageDesc)(exports.file_google_protobuf_compiler_plugin, 0); +/** + * Describes the message google.protobuf.compiler.CodeGeneratorRequest. + * Use `create(CodeGeneratorRequestSchema)` to create a new message. + */ +exports.CodeGeneratorRequestSchema = (0, message_js_1.messageDesc)(exports.file_google_protobuf_compiler_plugin, 1); +/** + * Describes the message google.protobuf.compiler.CodeGeneratorResponse. + * Use `create(CodeGeneratorResponseSchema)` to create a new message. + */ +exports.CodeGeneratorResponseSchema = (0, message_js_1.messageDesc)(exports.file_google_protobuf_compiler_plugin, 2); +/** + * Describes the message google.protobuf.compiler.CodeGeneratorResponse.File. + * Use `create(CodeGeneratorResponse_FileSchema)` to create a new message. + */ +exports.CodeGeneratorResponse_FileSchema = (0, message_js_1.messageDesc)(exports.file_google_protobuf_compiler_plugin, 2, 0); +/** + * Sync with code_generator.h. + * + * @generated from enum google.protobuf.compiler.CodeGeneratorResponse.Feature + */ +var CodeGeneratorResponse_Feature; +(function (CodeGeneratorResponse_Feature) { + /** + * @generated from enum value: FEATURE_NONE = 0; + */ + CodeGeneratorResponse_Feature[CodeGeneratorResponse_Feature["NONE"] = 0] = "NONE"; + /** + * @generated from enum value: FEATURE_PROTO3_OPTIONAL = 1; + */ + CodeGeneratorResponse_Feature[CodeGeneratorResponse_Feature["PROTO3_OPTIONAL"] = 1] = "PROTO3_OPTIONAL"; + /** + * @generated from enum value: FEATURE_SUPPORTS_EDITIONS = 2; + */ + CodeGeneratorResponse_Feature[CodeGeneratorResponse_Feature["SUPPORTS_EDITIONS"] = 2] = "SUPPORTS_EDITIONS"; +})(CodeGeneratorResponse_Feature || (exports.CodeGeneratorResponse_Feature = CodeGeneratorResponse_Feature = {})); +/** + * Describes the enum google.protobuf.compiler.CodeGeneratorResponse.Feature. + */ +exports.CodeGeneratorResponse_FeatureSchema = (0, enum_js_1.enumDesc)(exports.file_google_protobuf_compiler_plugin, 2, 0); diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/cpp_features_pb.d.ts b/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/cpp_features_pb.d.ts new file mode 100644 index 0000000..7da3c6d --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/cpp_features_pb.d.ts @@ -0,0 +1,91 @@ +import type { GenEnum, GenExtension, GenFile, GenMessage } from "../../../../codegenv2/types.js"; +import type { FeatureSet } from "./descriptor_pb.js"; +import type { Message } from "../../../../types.js"; +/** + * Describes the file google/protobuf/cpp_features.proto. + */ +export declare const file_google_protobuf_cpp_features: GenFile; +/** + * @generated from message pb.CppFeatures + */ +export type CppFeatures = Message<"pb.CppFeatures"> & { + /** + * Whether or not to treat an enum field as closed. This option is only + * applicable to enum fields, and will be removed in the future. It is + * consistent with the legacy behavior of using proto3 enum types for proto2 + * fields. + * + * @generated from field: optional bool legacy_closed_enum = 1; + */ + legacyClosedEnum: boolean; + /** + * @generated from field: optional pb.CppFeatures.StringType string_type = 2; + */ + stringType: CppFeatures_StringType; + /** + * @generated from field: optional bool enum_name_uses_string_view = 3; + */ + enumNameUsesStringView: boolean; +}; +/** + * @generated from message pb.CppFeatures + */ +export type CppFeaturesJson = { + /** + * Whether or not to treat an enum field as closed. This option is only + * applicable to enum fields, and will be removed in the future. It is + * consistent with the legacy behavior of using proto3 enum types for proto2 + * fields. + * + * @generated from field: optional bool legacy_closed_enum = 1; + */ + legacyClosedEnum?: boolean; + /** + * @generated from field: optional pb.CppFeatures.StringType string_type = 2; + */ + stringType?: CppFeatures_StringTypeJson; + /** + * @generated from field: optional bool enum_name_uses_string_view = 3; + */ + enumNameUsesStringView?: boolean; +}; +/** + * Describes the message pb.CppFeatures. + * Use `create(CppFeaturesSchema)` to create a new message. + */ +export declare const CppFeaturesSchema: GenMessage; +/** + * @generated from enum pb.CppFeatures.StringType + */ +export declare enum CppFeatures_StringType { + /** + * @generated from enum value: STRING_TYPE_UNKNOWN = 0; + */ + STRING_TYPE_UNKNOWN = 0, + /** + * @generated from enum value: VIEW = 1; + */ + VIEW = 1, + /** + * @generated from enum value: CORD = 2; + */ + CORD = 2, + /** + * @generated from enum value: STRING = 3; + */ + STRING = 3 +} +/** + * @generated from enum pb.CppFeatures.StringType + */ +export type CppFeatures_StringTypeJson = "STRING_TYPE_UNKNOWN" | "VIEW" | "CORD" | "STRING"; +/** + * Describes the enum pb.CppFeatures.StringType. + */ +export declare const CppFeatures_StringTypeSchema: GenEnum; +/** + * @generated from extension: optional pb.CppFeatures cpp = 1000; + */ +export declare const cpp: GenExtension; diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/cpp_features_pb.js b/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/cpp_features_pb.js new file mode 100644 index 0000000..8888a2a --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/cpp_features_pb.js @@ -0,0 +1,60 @@ +"use strict"; +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.cpp = exports.CppFeatures_StringTypeSchema = exports.CppFeatures_StringType = exports.CppFeaturesSchema = exports.file_google_protobuf_cpp_features = void 0; +const file_js_1 = require("../../../../codegenv2/file.js"); +const descriptor_pb_js_1 = require("./descriptor_pb.js"); +const message_js_1 = require("../../../../codegenv2/message.js"); +const enum_js_1 = require("../../../../codegenv2/enum.js"); +const extension_js_1 = require("../../../../codegenv2/extension.js"); +/** + * Describes the file google/protobuf/cpp_features.proto. + */ +exports.file_google_protobuf_cpp_features = (0, file_js_1.fileDesc)("CiJnb29nbGUvcHJvdG9idWYvY3BwX2ZlYXR1cmVzLnByb3RvEgJwYiL8AwoLQ3BwRmVhdHVyZXMS+wEKEmxlZ2FjeV9jbG9zZWRfZW51bRgBIAEoCELeAYgBAZgBBJgBAaIBCRIEdHJ1ZRiEB6IBChIFZmFsc2UY5weyAbgBCOgHEOgHGq8BVGhlIGxlZ2FjeSBjbG9zZWQgZW51bSBiZWhhdmlvciBpbiBDKysgaXMgZGVwcmVjYXRlZCBhbmQgaXMgc2NoZWR1bGVkIHRvIGJlIHJlbW92ZWQgaW4gZWRpdGlvbiAyMDI1LiAgU2VlIGh0dHA6Ly9wcm90b2J1Zi5kZXYvcHJvZ3JhbW1pbmctZ3VpZGVzL2VudW0vI2NwcCBmb3IgbW9yZSBpbmZvcm1hdGlvbhJaCgtzdHJpbmdfdHlwZRgCIAEoDjIaLnBiLkNwcEZlYXR1cmVzLlN0cmluZ1R5cGVCKYgBAZgBBJgBAaIBCxIGU1RSSU5HGIQHogEJEgRWSUVXGOkHsgEDCOgHEkwKGmVudW1fbmFtZV91c2VzX3N0cmluZ192aWV3GAMgASgIQiiIAQGYAQaYAQGiAQoSBWZhbHNlGIQHogEJEgR0cnVlGOkHsgEDCOkHIkUKClN0cmluZ1R5cGUSFwoTU1RSSU5HX1RZUEVfVU5LTk9XThAAEggKBFZJRVcQARIICgRDT1JEEAISCgoGU1RSSU5HEAM6PwoDY3BwEhsuZ29vZ2xlLnByb3RvYnVmLkZlYXR1cmVTZXQY6AcgASgLMg8ucGIuQ3BwRmVhdHVyZXNSA2NwcA", [descriptor_pb_js_1.file_google_protobuf_descriptor]); +/** + * Describes the message pb.CppFeatures. + * Use `create(CppFeaturesSchema)` to create a new message. + */ +exports.CppFeaturesSchema = (0, message_js_1.messageDesc)(exports.file_google_protobuf_cpp_features, 0); +/** + * @generated from enum pb.CppFeatures.StringType + */ +var CppFeatures_StringType; +(function (CppFeatures_StringType) { + /** + * @generated from enum value: STRING_TYPE_UNKNOWN = 0; + */ + CppFeatures_StringType[CppFeatures_StringType["STRING_TYPE_UNKNOWN"] = 0] = "STRING_TYPE_UNKNOWN"; + /** + * @generated from enum value: VIEW = 1; + */ + CppFeatures_StringType[CppFeatures_StringType["VIEW"] = 1] = "VIEW"; + /** + * @generated from enum value: CORD = 2; + */ + CppFeatures_StringType[CppFeatures_StringType["CORD"] = 2] = "CORD"; + /** + * @generated from enum value: STRING = 3; + */ + CppFeatures_StringType[CppFeatures_StringType["STRING"] = 3] = "STRING"; +})(CppFeatures_StringType || (exports.CppFeatures_StringType = CppFeatures_StringType = {})); +/** + * Describes the enum pb.CppFeatures.StringType. + */ +exports.CppFeatures_StringTypeSchema = (0, enum_js_1.enumDesc)(exports.file_google_protobuf_cpp_features, 0, 0); +/** + * @generated from extension: optional pb.CppFeatures cpp = 1000; + */ +exports.cpp = (0, extension_js_1.extDesc)(exports.file_google_protobuf_cpp_features, 0); diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/descriptor_pb.d.ts b/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/descriptor_pb.d.ts new file mode 100644 index 0000000..a45650f --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/descriptor_pb.d.ts @@ -0,0 +1,4143 @@ +import type { GenEnum, GenFile, GenMessage } from "../../../../codegenv2/types.js"; +import type { Message } from "../../../../types.js"; +/** + * Describes the file google/protobuf/descriptor.proto. + */ +export declare const file_google_protobuf_descriptor: GenFile; +/** + * The protocol compiler can output a FileDescriptorSet containing the .proto + * files it parses. + * + * @generated from message google.protobuf.FileDescriptorSet + */ +export type FileDescriptorSet = Message<"google.protobuf.FileDescriptorSet"> & { + /** + * @generated from field: repeated google.protobuf.FileDescriptorProto file = 1; + */ + file: FileDescriptorProto[]; +}; +/** + * The protocol compiler can output a FileDescriptorSet containing the .proto + * files it parses. + * + * @generated from message google.protobuf.FileDescriptorSet + */ +export type FileDescriptorSetJson = { + /** + * @generated from field: repeated google.protobuf.FileDescriptorProto file = 1; + */ + file?: FileDescriptorProtoJson[]; +}; +/** + * Describes the message google.protobuf.FileDescriptorSet. + * Use `create(FileDescriptorSetSchema)` to create a new message. + */ +export declare const FileDescriptorSetSchema: GenMessage; +/** + * Describes a complete .proto file. + * + * @generated from message google.protobuf.FileDescriptorProto + */ +export type FileDescriptorProto = Message<"google.protobuf.FileDescriptorProto"> & { + /** + * file name, relative to root of source tree + * + * @generated from field: optional string name = 1; + */ + name: string; + /** + * e.g. "foo", "foo.bar", etc. + * + * @generated from field: optional string package = 2; + */ + package: string; + /** + * Names of files imported by this file. + * + * @generated from field: repeated string dependency = 3; + */ + dependency: string[]; + /** + * Indexes of the public imported files in the dependency list above. + * + * @generated from field: repeated int32 public_dependency = 10; + */ + publicDependency: number[]; + /** + * Indexes of the weak imported files in the dependency list. + * For Google-internal migration only. Do not use. + * + * @generated from field: repeated int32 weak_dependency = 11; + */ + weakDependency: number[]; + /** + * Names of files imported by this file purely for the purpose of providing + * option extensions. These are excluded from the dependency list above. + * + * @generated from field: repeated string option_dependency = 15; + */ + optionDependency: string[]; + /** + * All top-level definitions in this file. + * + * @generated from field: repeated google.protobuf.DescriptorProto message_type = 4; + */ + messageType: DescriptorProto[]; + /** + * @generated from field: repeated google.protobuf.EnumDescriptorProto enum_type = 5; + */ + enumType: EnumDescriptorProto[]; + /** + * @generated from field: repeated google.protobuf.ServiceDescriptorProto service = 6; + */ + service: ServiceDescriptorProto[]; + /** + * @generated from field: repeated google.protobuf.FieldDescriptorProto extension = 7; + */ + extension: FieldDescriptorProto[]; + /** + * @generated from field: optional google.protobuf.FileOptions options = 8; + */ + options?: FileOptions | undefined; + /** + * This field contains optional information about the original source code. + * You may safely remove this entire field without harming runtime + * functionality of the descriptors -- the information is needed only by + * development tools. + * + * @generated from field: optional google.protobuf.SourceCodeInfo source_code_info = 9; + */ + sourceCodeInfo?: SourceCodeInfo | undefined; + /** + * The syntax of the proto file. + * The supported values are "proto2", "proto3", and "editions". + * + * If `edition` is present, this value must be "editions". + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * @generated from field: optional string syntax = 12; + */ + syntax: string; + /** + * The edition of the proto file. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * @generated from field: optional google.protobuf.Edition edition = 14; + */ + edition: Edition; +}; +/** + * Describes a complete .proto file. + * + * @generated from message google.protobuf.FileDescriptorProto + */ +export type FileDescriptorProtoJson = { + /** + * file name, relative to root of source tree + * + * @generated from field: optional string name = 1; + */ + name?: string; + /** + * e.g. "foo", "foo.bar", etc. + * + * @generated from field: optional string package = 2; + */ + package?: string; + /** + * Names of files imported by this file. + * + * @generated from field: repeated string dependency = 3; + */ + dependency?: string[]; + /** + * Indexes of the public imported files in the dependency list above. + * + * @generated from field: repeated int32 public_dependency = 10; + */ + publicDependency?: number[]; + /** + * Indexes of the weak imported files in the dependency list. + * For Google-internal migration only. Do not use. + * + * @generated from field: repeated int32 weak_dependency = 11; + */ + weakDependency?: number[]; + /** + * Names of files imported by this file purely for the purpose of providing + * option extensions. These are excluded from the dependency list above. + * + * @generated from field: repeated string option_dependency = 15; + */ + optionDependency?: string[]; + /** + * All top-level definitions in this file. + * + * @generated from field: repeated google.protobuf.DescriptorProto message_type = 4; + */ + messageType?: DescriptorProtoJson[]; + /** + * @generated from field: repeated google.protobuf.EnumDescriptorProto enum_type = 5; + */ + enumType?: EnumDescriptorProtoJson[]; + /** + * @generated from field: repeated google.protobuf.ServiceDescriptorProto service = 6; + */ + service?: ServiceDescriptorProtoJson[]; + /** + * @generated from field: repeated google.protobuf.FieldDescriptorProto extension = 7; + */ + extension?: FieldDescriptorProtoJson[]; + /** + * @generated from field: optional google.protobuf.FileOptions options = 8; + */ + options?: FileOptionsJson; + /** + * This field contains optional information about the original source code. + * You may safely remove this entire field without harming runtime + * functionality of the descriptors -- the information is needed only by + * development tools. + * + * @generated from field: optional google.protobuf.SourceCodeInfo source_code_info = 9; + */ + sourceCodeInfo?: SourceCodeInfoJson; + /** + * The syntax of the proto file. + * The supported values are "proto2", "proto3", and "editions". + * + * If `edition` is present, this value must be "editions". + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * @generated from field: optional string syntax = 12; + */ + syntax?: string; + /** + * The edition of the proto file. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * @generated from field: optional google.protobuf.Edition edition = 14; + */ + edition?: EditionJson; +}; +/** + * Describes the message google.protobuf.FileDescriptorProto. + * Use `create(FileDescriptorProtoSchema)` to create a new message. + */ +export declare const FileDescriptorProtoSchema: GenMessage; +/** + * Describes a message type. + * + * @generated from message google.protobuf.DescriptorProto + */ +export type DescriptorProto = Message<"google.protobuf.DescriptorProto"> & { + /** + * @generated from field: optional string name = 1; + */ + name: string; + /** + * @generated from field: repeated google.protobuf.FieldDescriptorProto field = 2; + */ + field: FieldDescriptorProto[]; + /** + * @generated from field: repeated google.protobuf.FieldDescriptorProto extension = 6; + */ + extension: FieldDescriptorProto[]; + /** + * @generated from field: repeated google.protobuf.DescriptorProto nested_type = 3; + */ + nestedType: DescriptorProto[]; + /** + * @generated from field: repeated google.protobuf.EnumDescriptorProto enum_type = 4; + */ + enumType: EnumDescriptorProto[]; + /** + * @generated from field: repeated google.protobuf.DescriptorProto.ExtensionRange extension_range = 5; + */ + extensionRange: DescriptorProto_ExtensionRange[]; + /** + * @generated from field: repeated google.protobuf.OneofDescriptorProto oneof_decl = 8; + */ + oneofDecl: OneofDescriptorProto[]; + /** + * @generated from field: optional google.protobuf.MessageOptions options = 7; + */ + options?: MessageOptions | undefined; + /** + * @generated from field: repeated google.protobuf.DescriptorProto.ReservedRange reserved_range = 9; + */ + reservedRange: DescriptorProto_ReservedRange[]; + /** + * Reserved field names, which may not be used by fields in the same message. + * A given name may only be reserved once. + * + * @generated from field: repeated string reserved_name = 10; + */ + reservedName: string[]; + /** + * Support for `export` and `local` keywords on enums. + * + * @generated from field: optional google.protobuf.SymbolVisibility visibility = 11; + */ + visibility: SymbolVisibility; +}; +/** + * Describes a message type. + * + * @generated from message google.protobuf.DescriptorProto + */ +export type DescriptorProtoJson = { + /** + * @generated from field: optional string name = 1; + */ + name?: string; + /** + * @generated from field: repeated google.protobuf.FieldDescriptorProto field = 2; + */ + field?: FieldDescriptorProtoJson[]; + /** + * @generated from field: repeated google.protobuf.FieldDescriptorProto extension = 6; + */ + extension?: FieldDescriptorProtoJson[]; + /** + * @generated from field: repeated google.protobuf.DescriptorProto nested_type = 3; + */ + nestedType?: DescriptorProtoJson[]; + /** + * @generated from field: repeated google.protobuf.EnumDescriptorProto enum_type = 4; + */ + enumType?: EnumDescriptorProtoJson[]; + /** + * @generated from field: repeated google.protobuf.DescriptorProto.ExtensionRange extension_range = 5; + */ + extensionRange?: DescriptorProto_ExtensionRangeJson[]; + /** + * @generated from field: repeated google.protobuf.OneofDescriptorProto oneof_decl = 8; + */ + oneofDecl?: OneofDescriptorProtoJson[]; + /** + * @generated from field: optional google.protobuf.MessageOptions options = 7; + */ + options?: MessageOptionsJson; + /** + * @generated from field: repeated google.protobuf.DescriptorProto.ReservedRange reserved_range = 9; + */ + reservedRange?: DescriptorProto_ReservedRangeJson[]; + /** + * Reserved field names, which may not be used by fields in the same message. + * A given name may only be reserved once. + * + * @generated from field: repeated string reserved_name = 10; + */ + reservedName?: string[]; + /** + * Support for `export` and `local` keywords on enums. + * + * @generated from field: optional google.protobuf.SymbolVisibility visibility = 11; + */ + visibility?: SymbolVisibilityJson; +}; +/** + * Describes the message google.protobuf.DescriptorProto. + * Use `create(DescriptorProtoSchema)` to create a new message. + */ +export declare const DescriptorProtoSchema: GenMessage; +/** + * @generated from message google.protobuf.DescriptorProto.ExtensionRange + */ +export type DescriptorProto_ExtensionRange = Message<"google.protobuf.DescriptorProto.ExtensionRange"> & { + /** + * Inclusive. + * + * @generated from field: optional int32 start = 1; + */ + start: number; + /** + * Exclusive. + * + * @generated from field: optional int32 end = 2; + */ + end: number; + /** + * @generated from field: optional google.protobuf.ExtensionRangeOptions options = 3; + */ + options?: ExtensionRangeOptions | undefined; +}; +/** + * @generated from message google.protobuf.DescriptorProto.ExtensionRange + */ +export type DescriptorProto_ExtensionRangeJson = { + /** + * Inclusive. + * + * @generated from field: optional int32 start = 1; + */ + start?: number; + /** + * Exclusive. + * + * @generated from field: optional int32 end = 2; + */ + end?: number; + /** + * @generated from field: optional google.protobuf.ExtensionRangeOptions options = 3; + */ + options?: ExtensionRangeOptionsJson; +}; +/** + * Describes the message google.protobuf.DescriptorProto.ExtensionRange. + * Use `create(DescriptorProto_ExtensionRangeSchema)` to create a new message. + */ +export declare const DescriptorProto_ExtensionRangeSchema: GenMessage; +/** + * Range of reserved tag numbers. Reserved tag numbers may not be used by + * fields or extension ranges in the same message. Reserved ranges may + * not overlap. + * + * @generated from message google.protobuf.DescriptorProto.ReservedRange + */ +export type DescriptorProto_ReservedRange = Message<"google.protobuf.DescriptorProto.ReservedRange"> & { + /** + * Inclusive. + * + * @generated from field: optional int32 start = 1; + */ + start: number; + /** + * Exclusive. + * + * @generated from field: optional int32 end = 2; + */ + end: number; +}; +/** + * Range of reserved tag numbers. Reserved tag numbers may not be used by + * fields or extension ranges in the same message. Reserved ranges may + * not overlap. + * + * @generated from message google.protobuf.DescriptorProto.ReservedRange + */ +export type DescriptorProto_ReservedRangeJson = { + /** + * Inclusive. + * + * @generated from field: optional int32 start = 1; + */ + start?: number; + /** + * Exclusive. + * + * @generated from field: optional int32 end = 2; + */ + end?: number; +}; +/** + * Describes the message google.protobuf.DescriptorProto.ReservedRange. + * Use `create(DescriptorProto_ReservedRangeSchema)` to create a new message. + */ +export declare const DescriptorProto_ReservedRangeSchema: GenMessage; +/** + * @generated from message google.protobuf.ExtensionRangeOptions + */ +export type ExtensionRangeOptions = Message<"google.protobuf.ExtensionRangeOptions"> & { + /** + * The parser stores options it doesn't recognize here. See above. + * + * @generated from field: repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; + */ + uninterpretedOption: UninterpretedOption[]; + /** + * For external users: DO NOT USE. We are in the process of open sourcing + * extension declaration and executing internal cleanups before it can be + * used externally. + * + * @generated from field: repeated google.protobuf.ExtensionRangeOptions.Declaration declaration = 2; + */ + declaration: ExtensionRangeOptions_Declaration[]; + /** + * Any features defined in the specific edition. + * + * @generated from field: optional google.protobuf.FeatureSet features = 50; + */ + features?: FeatureSet | undefined; + /** + * The verification state of the range. + * TODO: flip the default to DECLARATION once all empty ranges + * are marked as UNVERIFIED. + * + * @generated from field: optional google.protobuf.ExtensionRangeOptions.VerificationState verification = 3 [default = UNVERIFIED]; + */ + verification: ExtensionRangeOptions_VerificationState; +}; +/** + * @generated from message google.protobuf.ExtensionRangeOptions + */ +export type ExtensionRangeOptionsJson = { + /** + * The parser stores options it doesn't recognize here. See above. + * + * @generated from field: repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; + */ + uninterpretedOption?: UninterpretedOptionJson[]; + /** + * For external users: DO NOT USE. We are in the process of open sourcing + * extension declaration and executing internal cleanups before it can be + * used externally. + * + * @generated from field: repeated google.protobuf.ExtensionRangeOptions.Declaration declaration = 2; + */ + declaration?: ExtensionRangeOptions_DeclarationJson[]; + /** + * Any features defined in the specific edition. + * + * @generated from field: optional google.protobuf.FeatureSet features = 50; + */ + features?: FeatureSetJson; + /** + * The verification state of the range. + * TODO: flip the default to DECLARATION once all empty ranges + * are marked as UNVERIFIED. + * + * @generated from field: optional google.protobuf.ExtensionRangeOptions.VerificationState verification = 3 [default = UNVERIFIED]; + */ + verification?: ExtensionRangeOptions_VerificationStateJson; +}; +/** + * Describes the message google.protobuf.ExtensionRangeOptions. + * Use `create(ExtensionRangeOptionsSchema)` to create a new message. + */ +export declare const ExtensionRangeOptionsSchema: GenMessage; +/** + * @generated from message google.protobuf.ExtensionRangeOptions.Declaration + */ +export type ExtensionRangeOptions_Declaration = Message<"google.protobuf.ExtensionRangeOptions.Declaration"> & { + /** + * The extension number declared within the extension range. + * + * @generated from field: optional int32 number = 1; + */ + number: number; + /** + * The fully-qualified name of the extension field. There must be a leading + * dot in front of the full name. + * + * @generated from field: optional string full_name = 2; + */ + fullName: string; + /** + * The fully-qualified type name of the extension field. Unlike + * Metadata.type, Declaration.type must have a leading dot for messages + * and enums. + * + * @generated from field: optional string type = 3; + */ + type: string; + /** + * If true, indicates that the number is reserved in the extension range, + * and any extension field with the number will fail to compile. Set this + * when a declared extension field is deleted. + * + * @generated from field: optional bool reserved = 5; + */ + reserved: boolean; + /** + * If true, indicates that the extension must be defined as repeated. + * Otherwise the extension must be defined as optional. + * + * @generated from field: optional bool repeated = 6; + */ + repeated: boolean; +}; +/** + * @generated from message google.protobuf.ExtensionRangeOptions.Declaration + */ +export type ExtensionRangeOptions_DeclarationJson = { + /** + * The extension number declared within the extension range. + * + * @generated from field: optional int32 number = 1; + */ + number?: number; + /** + * The fully-qualified name of the extension field. There must be a leading + * dot in front of the full name. + * + * @generated from field: optional string full_name = 2; + */ + fullName?: string; + /** + * The fully-qualified type name of the extension field. Unlike + * Metadata.type, Declaration.type must have a leading dot for messages + * and enums. + * + * @generated from field: optional string type = 3; + */ + type?: string; + /** + * If true, indicates that the number is reserved in the extension range, + * and any extension field with the number will fail to compile. Set this + * when a declared extension field is deleted. + * + * @generated from field: optional bool reserved = 5; + */ + reserved?: boolean; + /** + * If true, indicates that the extension must be defined as repeated. + * Otherwise the extension must be defined as optional. + * + * @generated from field: optional bool repeated = 6; + */ + repeated?: boolean; +}; +/** + * Describes the message google.protobuf.ExtensionRangeOptions.Declaration. + * Use `create(ExtensionRangeOptions_DeclarationSchema)` to create a new message. + */ +export declare const ExtensionRangeOptions_DeclarationSchema: GenMessage; +/** + * The verification state of the extension range. + * + * @generated from enum google.protobuf.ExtensionRangeOptions.VerificationState + */ +export declare enum ExtensionRangeOptions_VerificationState { + /** + * All the extensions of the range must be declared. + * + * @generated from enum value: DECLARATION = 0; + */ + DECLARATION = 0, + /** + * @generated from enum value: UNVERIFIED = 1; + */ + UNVERIFIED = 1 +} +/** + * The verification state of the extension range. + * + * @generated from enum google.protobuf.ExtensionRangeOptions.VerificationState + */ +export type ExtensionRangeOptions_VerificationStateJson = "DECLARATION" | "UNVERIFIED"; +/** + * Describes the enum google.protobuf.ExtensionRangeOptions.VerificationState. + */ +export declare const ExtensionRangeOptions_VerificationStateSchema: GenEnum; +/** + * Describes a field within a message. + * + * @generated from message google.protobuf.FieldDescriptorProto + */ +export type FieldDescriptorProto = Message<"google.protobuf.FieldDescriptorProto"> & { + /** + * @generated from field: optional string name = 1; + */ + name: string; + /** + * @generated from field: optional int32 number = 3; + */ + number: number; + /** + * @generated from field: optional google.protobuf.FieldDescriptorProto.Label label = 4; + */ + label: FieldDescriptorProto_Label; + /** + * If type_name is set, this need not be set. If both this and type_name + * are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP. + * + * @generated from field: optional google.protobuf.FieldDescriptorProto.Type type = 5; + */ + type: FieldDescriptorProto_Type; + /** + * For message and enum types, this is the name of the type. If the name + * starts with a '.', it is fully-qualified. Otherwise, C++-like scoping + * rules are used to find the type (i.e. first the nested types within this + * message are searched, then within the parent, on up to the root + * namespace). + * + * @generated from field: optional string type_name = 6; + */ + typeName: string; + /** + * For extensions, this is the name of the type being extended. It is + * resolved in the same manner as type_name. + * + * @generated from field: optional string extendee = 2; + */ + extendee: string; + /** + * For numeric types, contains the original text representation of the value. + * For booleans, "true" or "false". + * For strings, contains the default text contents (not escaped in any way). + * For bytes, contains the C escaped value. All bytes >= 128 are escaped. + * + * @generated from field: optional string default_value = 7; + */ + defaultValue: string; + /** + * If set, gives the index of a oneof in the containing type's oneof_decl + * list. This field is a member of that oneof. + * + * @generated from field: optional int32 oneof_index = 9; + */ + oneofIndex: number; + /** + * JSON name of this field. The value is set by protocol compiler. If the + * user has set a "json_name" option on this field, that option's value + * will be used. Otherwise, it's deduced from the field's name by converting + * it to camelCase. + * + * @generated from field: optional string json_name = 10; + */ + jsonName: string; + /** + * @generated from field: optional google.protobuf.FieldOptions options = 8; + */ + options?: FieldOptions | undefined; + /** + * If true, this is a proto3 "optional". When a proto3 field is optional, it + * tracks presence regardless of field type. + * + * When proto3_optional is true, this field must belong to a oneof to signal + * to old proto3 clients that presence is tracked for this field. This oneof + * is known as a "synthetic" oneof, and this field must be its sole member + * (each proto3 optional field gets its own synthetic oneof). Synthetic oneofs + * exist in the descriptor only, and do not generate any API. Synthetic oneofs + * must be ordered after all "real" oneofs. + * + * For message fields, proto3_optional doesn't create any semantic change, + * since non-repeated message fields always track presence. However it still + * indicates the semantic detail of whether the user wrote "optional" or not. + * This can be useful for round-tripping the .proto file. For consistency we + * give message fields a synthetic oneof also, even though it is not required + * to track presence. This is especially important because the parser can't + * tell if a field is a message or an enum, so it must always create a + * synthetic oneof. + * + * Proto2 optional fields do not set this flag, because they already indicate + * optional with `LABEL_OPTIONAL`. + * + * @generated from field: optional bool proto3_optional = 17; + */ + proto3Optional: boolean; +}; +/** + * Describes a field within a message. + * + * @generated from message google.protobuf.FieldDescriptorProto + */ +export type FieldDescriptorProtoJson = { + /** + * @generated from field: optional string name = 1; + */ + name?: string; + /** + * @generated from field: optional int32 number = 3; + */ + number?: number; + /** + * @generated from field: optional google.protobuf.FieldDescriptorProto.Label label = 4; + */ + label?: FieldDescriptorProto_LabelJson; + /** + * If type_name is set, this need not be set. If both this and type_name + * are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP. + * + * @generated from field: optional google.protobuf.FieldDescriptorProto.Type type = 5; + */ + type?: FieldDescriptorProto_TypeJson; + /** + * For message and enum types, this is the name of the type. If the name + * starts with a '.', it is fully-qualified. Otherwise, C++-like scoping + * rules are used to find the type (i.e. first the nested types within this + * message are searched, then within the parent, on up to the root + * namespace). + * + * @generated from field: optional string type_name = 6; + */ + typeName?: string; + /** + * For extensions, this is the name of the type being extended. It is + * resolved in the same manner as type_name. + * + * @generated from field: optional string extendee = 2; + */ + extendee?: string; + /** + * For numeric types, contains the original text representation of the value. + * For booleans, "true" or "false". + * For strings, contains the default text contents (not escaped in any way). + * For bytes, contains the C escaped value. All bytes >= 128 are escaped. + * + * @generated from field: optional string default_value = 7; + */ + defaultValue?: string; + /** + * If set, gives the index of a oneof in the containing type's oneof_decl + * list. This field is a member of that oneof. + * + * @generated from field: optional int32 oneof_index = 9; + */ + oneofIndex?: number; + /** + * JSON name of this field. The value is set by protocol compiler. If the + * user has set a "json_name" option on this field, that option's value + * will be used. Otherwise, it's deduced from the field's name by converting + * it to camelCase. + * + * @generated from field: optional string json_name = 10; + */ + jsonName?: string; + /** + * @generated from field: optional google.protobuf.FieldOptions options = 8; + */ + options?: FieldOptionsJson; + /** + * If true, this is a proto3 "optional". When a proto3 field is optional, it + * tracks presence regardless of field type. + * + * When proto3_optional is true, this field must belong to a oneof to signal + * to old proto3 clients that presence is tracked for this field. This oneof + * is known as a "synthetic" oneof, and this field must be its sole member + * (each proto3 optional field gets its own synthetic oneof). Synthetic oneofs + * exist in the descriptor only, and do not generate any API. Synthetic oneofs + * must be ordered after all "real" oneofs. + * + * For message fields, proto3_optional doesn't create any semantic change, + * since non-repeated message fields always track presence. However it still + * indicates the semantic detail of whether the user wrote "optional" or not. + * This can be useful for round-tripping the .proto file. For consistency we + * give message fields a synthetic oneof also, even though it is not required + * to track presence. This is especially important because the parser can't + * tell if a field is a message or an enum, so it must always create a + * synthetic oneof. + * + * Proto2 optional fields do not set this flag, because they already indicate + * optional with `LABEL_OPTIONAL`. + * + * @generated from field: optional bool proto3_optional = 17; + */ + proto3Optional?: boolean; +}; +/** + * Describes the message google.protobuf.FieldDescriptorProto. + * Use `create(FieldDescriptorProtoSchema)` to create a new message. + */ +export declare const FieldDescriptorProtoSchema: GenMessage; +/** + * @generated from enum google.protobuf.FieldDescriptorProto.Type + */ +export declare enum FieldDescriptorProto_Type { + /** + * 0 is reserved for errors. + * Order is weird for historical reasons. + * + * @generated from enum value: TYPE_DOUBLE = 1; + */ + DOUBLE = 1, + /** + * @generated from enum value: TYPE_FLOAT = 2; + */ + FLOAT = 2, + /** + * Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if + * negative values are likely. + * + * @generated from enum value: TYPE_INT64 = 3; + */ + INT64 = 3, + /** + * @generated from enum value: TYPE_UINT64 = 4; + */ + UINT64 = 4, + /** + * Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if + * negative values are likely. + * + * @generated from enum value: TYPE_INT32 = 5; + */ + INT32 = 5, + /** + * @generated from enum value: TYPE_FIXED64 = 6; + */ + FIXED64 = 6, + /** + * @generated from enum value: TYPE_FIXED32 = 7; + */ + FIXED32 = 7, + /** + * @generated from enum value: TYPE_BOOL = 8; + */ + BOOL = 8, + /** + * @generated from enum value: TYPE_STRING = 9; + */ + STRING = 9, + /** + * Tag-delimited aggregate. + * Group type is deprecated and not supported after google.protobuf. However, Proto3 + * implementations should still be able to parse the group wire format and + * treat group fields as unknown fields. In Editions, the group wire format + * can be enabled via the `message_encoding` feature. + * + * @generated from enum value: TYPE_GROUP = 10; + */ + GROUP = 10, + /** + * Length-delimited aggregate. + * + * @generated from enum value: TYPE_MESSAGE = 11; + */ + MESSAGE = 11, + /** + * New in version 2. + * + * @generated from enum value: TYPE_BYTES = 12; + */ + BYTES = 12, + /** + * @generated from enum value: TYPE_UINT32 = 13; + */ + UINT32 = 13, + /** + * @generated from enum value: TYPE_ENUM = 14; + */ + ENUM = 14, + /** + * @generated from enum value: TYPE_SFIXED32 = 15; + */ + SFIXED32 = 15, + /** + * @generated from enum value: TYPE_SFIXED64 = 16; + */ + SFIXED64 = 16, + /** + * Uses ZigZag encoding. + * + * @generated from enum value: TYPE_SINT32 = 17; + */ + SINT32 = 17, + /** + * Uses ZigZag encoding. + * + * @generated from enum value: TYPE_SINT64 = 18; + */ + SINT64 = 18 +} +/** + * @generated from enum google.protobuf.FieldDescriptorProto.Type + */ +export type FieldDescriptorProto_TypeJson = "TYPE_DOUBLE" | "TYPE_FLOAT" | "TYPE_INT64" | "TYPE_UINT64" | "TYPE_INT32" | "TYPE_FIXED64" | "TYPE_FIXED32" | "TYPE_BOOL" | "TYPE_STRING" | "TYPE_GROUP" | "TYPE_MESSAGE" | "TYPE_BYTES" | "TYPE_UINT32" | "TYPE_ENUM" | "TYPE_SFIXED32" | "TYPE_SFIXED64" | "TYPE_SINT32" | "TYPE_SINT64"; +/** + * Describes the enum google.protobuf.FieldDescriptorProto.Type. + */ +export declare const FieldDescriptorProto_TypeSchema: GenEnum; +/** + * @generated from enum google.protobuf.FieldDescriptorProto.Label + */ +export declare enum FieldDescriptorProto_Label { + /** + * 0 is reserved for errors + * + * @generated from enum value: LABEL_OPTIONAL = 1; + */ + OPTIONAL = 1, + /** + * @generated from enum value: LABEL_REPEATED = 3; + */ + REPEATED = 3, + /** + * The required label is only allowed in google.protobuf. In proto3 and Editions + * it's explicitly prohibited. In Editions, the `field_presence` feature + * can be used to get this behavior. + * + * @generated from enum value: LABEL_REQUIRED = 2; + */ + REQUIRED = 2 +} +/** + * @generated from enum google.protobuf.FieldDescriptorProto.Label + */ +export type FieldDescriptorProto_LabelJson = "LABEL_OPTIONAL" | "LABEL_REPEATED" | "LABEL_REQUIRED"; +/** + * Describes the enum google.protobuf.FieldDescriptorProto.Label. + */ +export declare const FieldDescriptorProto_LabelSchema: GenEnum; +/** + * Describes a oneof. + * + * @generated from message google.protobuf.OneofDescriptorProto + */ +export type OneofDescriptorProto = Message<"google.protobuf.OneofDescriptorProto"> & { + /** + * @generated from field: optional string name = 1; + */ + name: string; + /** + * @generated from field: optional google.protobuf.OneofOptions options = 2; + */ + options?: OneofOptions | undefined; +}; +/** + * Describes a oneof. + * + * @generated from message google.protobuf.OneofDescriptorProto + */ +export type OneofDescriptorProtoJson = { + /** + * @generated from field: optional string name = 1; + */ + name?: string; + /** + * @generated from field: optional google.protobuf.OneofOptions options = 2; + */ + options?: OneofOptionsJson; +}; +/** + * Describes the message google.protobuf.OneofDescriptorProto. + * Use `create(OneofDescriptorProtoSchema)` to create a new message. + */ +export declare const OneofDescriptorProtoSchema: GenMessage; +/** + * Describes an enum type. + * + * @generated from message google.protobuf.EnumDescriptorProto + */ +export type EnumDescriptorProto = Message<"google.protobuf.EnumDescriptorProto"> & { + /** + * @generated from field: optional string name = 1; + */ + name: string; + /** + * @generated from field: repeated google.protobuf.EnumValueDescriptorProto value = 2; + */ + value: EnumValueDescriptorProto[]; + /** + * @generated from field: optional google.protobuf.EnumOptions options = 3; + */ + options?: EnumOptions | undefined; + /** + * Range of reserved numeric values. Reserved numeric values may not be used + * by enum values in the same enum declaration. Reserved ranges may not + * overlap. + * + * @generated from field: repeated google.protobuf.EnumDescriptorProto.EnumReservedRange reserved_range = 4; + */ + reservedRange: EnumDescriptorProto_EnumReservedRange[]; + /** + * Reserved enum value names, which may not be reused. A given name may only + * be reserved once. + * + * @generated from field: repeated string reserved_name = 5; + */ + reservedName: string[]; + /** + * Support for `export` and `local` keywords on enums. + * + * @generated from field: optional google.protobuf.SymbolVisibility visibility = 6; + */ + visibility: SymbolVisibility; +}; +/** + * Describes an enum type. + * + * @generated from message google.protobuf.EnumDescriptorProto + */ +export type EnumDescriptorProtoJson = { + /** + * @generated from field: optional string name = 1; + */ + name?: string; + /** + * @generated from field: repeated google.protobuf.EnumValueDescriptorProto value = 2; + */ + value?: EnumValueDescriptorProtoJson[]; + /** + * @generated from field: optional google.protobuf.EnumOptions options = 3; + */ + options?: EnumOptionsJson; + /** + * Range of reserved numeric values. Reserved numeric values may not be used + * by enum values in the same enum declaration. Reserved ranges may not + * overlap. + * + * @generated from field: repeated google.protobuf.EnumDescriptorProto.EnumReservedRange reserved_range = 4; + */ + reservedRange?: EnumDescriptorProto_EnumReservedRangeJson[]; + /** + * Reserved enum value names, which may not be reused. A given name may only + * be reserved once. + * + * @generated from field: repeated string reserved_name = 5; + */ + reservedName?: string[]; + /** + * Support for `export` and `local` keywords on enums. + * + * @generated from field: optional google.protobuf.SymbolVisibility visibility = 6; + */ + visibility?: SymbolVisibilityJson; +}; +/** + * Describes the message google.protobuf.EnumDescriptorProto. + * Use `create(EnumDescriptorProtoSchema)` to create a new message. + */ +export declare const EnumDescriptorProtoSchema: GenMessage; +/** + * Range of reserved numeric values. Reserved values may not be used by + * entries in the same enum. Reserved ranges may not overlap. + * + * Note that this is distinct from DescriptorProto.ReservedRange in that it + * is inclusive such that it can appropriately represent the entire int32 + * domain. + * + * @generated from message google.protobuf.EnumDescriptorProto.EnumReservedRange + */ +export type EnumDescriptorProto_EnumReservedRange = Message<"google.protobuf.EnumDescriptorProto.EnumReservedRange"> & { + /** + * Inclusive. + * + * @generated from field: optional int32 start = 1; + */ + start: number; + /** + * Inclusive. + * + * @generated from field: optional int32 end = 2; + */ + end: number; +}; +/** + * Range of reserved numeric values. Reserved values may not be used by + * entries in the same enum. Reserved ranges may not overlap. + * + * Note that this is distinct from DescriptorProto.ReservedRange in that it + * is inclusive such that it can appropriately represent the entire int32 + * domain. + * + * @generated from message google.protobuf.EnumDescriptorProto.EnumReservedRange + */ +export type EnumDescriptorProto_EnumReservedRangeJson = { + /** + * Inclusive. + * + * @generated from field: optional int32 start = 1; + */ + start?: number; + /** + * Inclusive. + * + * @generated from field: optional int32 end = 2; + */ + end?: number; +}; +/** + * Describes the message google.protobuf.EnumDescriptorProto.EnumReservedRange. + * Use `create(EnumDescriptorProto_EnumReservedRangeSchema)` to create a new message. + */ +export declare const EnumDescriptorProto_EnumReservedRangeSchema: GenMessage; +/** + * Describes a value within an enum. + * + * @generated from message google.protobuf.EnumValueDescriptorProto + */ +export type EnumValueDescriptorProto = Message<"google.protobuf.EnumValueDescriptorProto"> & { + /** + * @generated from field: optional string name = 1; + */ + name: string; + /** + * @generated from field: optional int32 number = 2; + */ + number: number; + /** + * @generated from field: optional google.protobuf.EnumValueOptions options = 3; + */ + options?: EnumValueOptions | undefined; +}; +/** + * Describes a value within an enum. + * + * @generated from message google.protobuf.EnumValueDescriptorProto + */ +export type EnumValueDescriptorProtoJson = { + /** + * @generated from field: optional string name = 1; + */ + name?: string; + /** + * @generated from field: optional int32 number = 2; + */ + number?: number; + /** + * @generated from field: optional google.protobuf.EnumValueOptions options = 3; + */ + options?: EnumValueOptionsJson; +}; +/** + * Describes the message google.protobuf.EnumValueDescriptorProto. + * Use `create(EnumValueDescriptorProtoSchema)` to create a new message. + */ +export declare const EnumValueDescriptorProtoSchema: GenMessage; +/** + * Describes a service. + * + * @generated from message google.protobuf.ServiceDescriptorProto + */ +export type ServiceDescriptorProto = Message<"google.protobuf.ServiceDescriptorProto"> & { + /** + * @generated from field: optional string name = 1; + */ + name: string; + /** + * @generated from field: repeated google.protobuf.MethodDescriptorProto method = 2; + */ + method: MethodDescriptorProto[]; + /** + * @generated from field: optional google.protobuf.ServiceOptions options = 3; + */ + options?: ServiceOptions | undefined; +}; +/** + * Describes a service. + * + * @generated from message google.protobuf.ServiceDescriptorProto + */ +export type ServiceDescriptorProtoJson = { + /** + * @generated from field: optional string name = 1; + */ + name?: string; + /** + * @generated from field: repeated google.protobuf.MethodDescriptorProto method = 2; + */ + method?: MethodDescriptorProtoJson[]; + /** + * @generated from field: optional google.protobuf.ServiceOptions options = 3; + */ + options?: ServiceOptionsJson; +}; +/** + * Describes the message google.protobuf.ServiceDescriptorProto. + * Use `create(ServiceDescriptorProtoSchema)` to create a new message. + */ +export declare const ServiceDescriptorProtoSchema: GenMessage; +/** + * Describes a method of a service. + * + * @generated from message google.protobuf.MethodDescriptorProto + */ +export type MethodDescriptorProto = Message<"google.protobuf.MethodDescriptorProto"> & { + /** + * @generated from field: optional string name = 1; + */ + name: string; + /** + * Input and output type names. These are resolved in the same way as + * FieldDescriptorProto.type_name, but must refer to a message type. + * + * @generated from field: optional string input_type = 2; + */ + inputType: string; + /** + * @generated from field: optional string output_type = 3; + */ + outputType: string; + /** + * @generated from field: optional google.protobuf.MethodOptions options = 4; + */ + options?: MethodOptions | undefined; + /** + * Identifies if client streams multiple client messages + * + * @generated from field: optional bool client_streaming = 5 [default = false]; + */ + clientStreaming: boolean; + /** + * Identifies if server streams multiple server messages + * + * @generated from field: optional bool server_streaming = 6 [default = false]; + */ + serverStreaming: boolean; +}; +/** + * Describes a method of a service. + * + * @generated from message google.protobuf.MethodDescriptorProto + */ +export type MethodDescriptorProtoJson = { + /** + * @generated from field: optional string name = 1; + */ + name?: string; + /** + * Input and output type names. These are resolved in the same way as + * FieldDescriptorProto.type_name, but must refer to a message type. + * + * @generated from field: optional string input_type = 2; + */ + inputType?: string; + /** + * @generated from field: optional string output_type = 3; + */ + outputType?: string; + /** + * @generated from field: optional google.protobuf.MethodOptions options = 4; + */ + options?: MethodOptionsJson; + /** + * Identifies if client streams multiple client messages + * + * @generated from field: optional bool client_streaming = 5 [default = false]; + */ + clientStreaming?: boolean; + /** + * Identifies if server streams multiple server messages + * + * @generated from field: optional bool server_streaming = 6 [default = false]; + */ + serverStreaming?: boolean; +}; +/** + * Describes the message google.protobuf.MethodDescriptorProto. + * Use `create(MethodDescriptorProtoSchema)` to create a new message. + */ +export declare const MethodDescriptorProtoSchema: GenMessage; +/** + * @generated from message google.protobuf.FileOptions + */ +export type FileOptions = Message<"google.protobuf.FileOptions"> & { + /** + * Sets the Java package where classes generated from this .proto will be + * placed. By default, the proto package is used, but this is often + * inappropriate because proto packages do not normally start with backwards + * domain names. + * + * @generated from field: optional string java_package = 1; + */ + javaPackage: string; + /** + * Controls the name of the wrapper Java class generated for the .proto file. + * That class will always contain the .proto file's getDescriptor() method as + * well as any top-level extensions defined in the .proto file. + * If java_multiple_files is disabled, then all the other classes from the + * .proto file will be nested inside the single wrapper outer class. + * + * @generated from field: optional string java_outer_classname = 8; + */ + javaOuterClassname: string; + /** + * If enabled, then the Java code generator will generate a separate .java + * file for each top-level message, enum, and service defined in the .proto + * file. Thus, these types will *not* be nested inside the wrapper class + * named by java_outer_classname. However, the wrapper class will still be + * generated to contain the file's getDescriptor() method as well as any + * top-level extensions defined in the file. + * + * @generated from field: optional bool java_multiple_files = 10 [default = false]; + */ + javaMultipleFiles: boolean; + /** + * This option does nothing. + * + * @generated from field: optional bool java_generate_equals_and_hash = 20 [deprecated = true]; + * @deprecated + */ + javaGenerateEqualsAndHash: boolean; + /** + * A proto2 file can set this to true to opt in to UTF-8 checking for Java, + * which will throw an exception if invalid UTF-8 is parsed from the wire or + * assigned to a string field. + * + * TODO: clarify exactly what kinds of field types this option + * applies to, and update these docs accordingly. + * + * Proto3 files already perform these checks. Setting the option explicitly to + * false has no effect: it cannot be used to opt proto3 files out of UTF-8 + * checks. + * + * @generated from field: optional bool java_string_check_utf8 = 27 [default = false]; + */ + javaStringCheckUtf8: boolean; + /** + * @generated from field: optional google.protobuf.FileOptions.OptimizeMode optimize_for = 9 [default = SPEED]; + */ + optimizeFor: FileOptions_OptimizeMode; + /** + * Sets the Go package where structs generated from this .proto will be + * placed. If omitted, the Go package will be derived from the following: + * - The basename of the package import path, if provided. + * - Otherwise, the package statement in the .proto file, if present. + * - Otherwise, the basename of the .proto file, without extension. + * + * @generated from field: optional string go_package = 11; + */ + goPackage: string; + /** + * Should generic services be generated in each language? "Generic" services + * are not specific to any particular RPC system. They are generated by the + * main code generators in each language (without additional plugins). + * Generic services were the only kind of service generation supported by + * early versions of google.protobuf. + * + * Generic services are now considered deprecated in favor of using plugins + * that generate code specific to your particular RPC system. Therefore, + * these default to false. Old code which depends on generic services should + * explicitly set them to true. + * + * @generated from field: optional bool cc_generic_services = 16 [default = false]; + */ + ccGenericServices: boolean; + /** + * @generated from field: optional bool java_generic_services = 17 [default = false]; + */ + javaGenericServices: boolean; + /** + * @generated from field: optional bool py_generic_services = 18 [default = false]; + */ + pyGenericServices: boolean; + /** + * Is this file deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for everything in the file, or it will be completely ignored; in the very + * least, this is a formalization for deprecating files. + * + * @generated from field: optional bool deprecated = 23 [default = false]; + */ + deprecated: boolean; + /** + * Enables the use of arenas for the proto messages in this file. This applies + * only to generated classes for C++. + * + * @generated from field: optional bool cc_enable_arenas = 31 [default = true]; + */ + ccEnableArenas: boolean; + /** + * Sets the objective c class prefix which is prepended to all objective c + * generated classes from this .proto. There is no default. + * + * @generated from field: optional string objc_class_prefix = 36; + */ + objcClassPrefix: string; + /** + * Namespace for generated classes; defaults to the package. + * + * @generated from field: optional string csharp_namespace = 37; + */ + csharpNamespace: string; + /** + * By default Swift generators will take the proto package and CamelCase it + * replacing '.' with underscore and use that to prefix the types/symbols + * defined. When this options is provided, they will use this value instead + * to prefix the types/symbols defined. + * + * @generated from field: optional string swift_prefix = 39; + */ + swiftPrefix: string; + /** + * Sets the php class prefix which is prepended to all php generated classes + * from this .proto. Default is empty. + * + * @generated from field: optional string php_class_prefix = 40; + */ + phpClassPrefix: string; + /** + * Use this option to change the namespace of php generated classes. Default + * is empty. When this option is empty, the package name will be used for + * determining the namespace. + * + * @generated from field: optional string php_namespace = 41; + */ + phpNamespace: string; + /** + * Use this option to change the namespace of php generated metadata classes. + * Default is empty. When this option is empty, the proto file name will be + * used for determining the namespace. + * + * @generated from field: optional string php_metadata_namespace = 44; + */ + phpMetadataNamespace: string; + /** + * Use this option to change the package of ruby generated classes. Default + * is empty. When this option is not set, the package name will be used for + * determining the ruby package. + * + * @generated from field: optional string ruby_package = 45; + */ + rubyPackage: string; + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * @generated from field: optional google.protobuf.FeatureSet features = 50; + */ + features?: FeatureSet | undefined; + /** + * The parser stores options it doesn't recognize here. + * See the documentation for the "Options" section above. + * + * @generated from field: repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; + */ + uninterpretedOption: UninterpretedOption[]; +}; +/** + * @generated from message google.protobuf.FileOptions + */ +export type FileOptionsJson = { + /** + * Sets the Java package where classes generated from this .proto will be + * placed. By default, the proto package is used, but this is often + * inappropriate because proto packages do not normally start with backwards + * domain names. + * + * @generated from field: optional string java_package = 1; + */ + javaPackage?: string; + /** + * Controls the name of the wrapper Java class generated for the .proto file. + * That class will always contain the .proto file's getDescriptor() method as + * well as any top-level extensions defined in the .proto file. + * If java_multiple_files is disabled, then all the other classes from the + * .proto file will be nested inside the single wrapper outer class. + * + * @generated from field: optional string java_outer_classname = 8; + */ + javaOuterClassname?: string; + /** + * If enabled, then the Java code generator will generate a separate .java + * file for each top-level message, enum, and service defined in the .proto + * file. Thus, these types will *not* be nested inside the wrapper class + * named by java_outer_classname. However, the wrapper class will still be + * generated to contain the file's getDescriptor() method as well as any + * top-level extensions defined in the file. + * + * @generated from field: optional bool java_multiple_files = 10 [default = false]; + */ + javaMultipleFiles?: boolean; + /** + * This option does nothing. + * + * @generated from field: optional bool java_generate_equals_and_hash = 20 [deprecated = true]; + * @deprecated + */ + javaGenerateEqualsAndHash?: boolean; + /** + * A proto2 file can set this to true to opt in to UTF-8 checking for Java, + * which will throw an exception if invalid UTF-8 is parsed from the wire or + * assigned to a string field. + * + * TODO: clarify exactly what kinds of field types this option + * applies to, and update these docs accordingly. + * + * Proto3 files already perform these checks. Setting the option explicitly to + * false has no effect: it cannot be used to opt proto3 files out of UTF-8 + * checks. + * + * @generated from field: optional bool java_string_check_utf8 = 27 [default = false]; + */ + javaStringCheckUtf8?: boolean; + /** + * @generated from field: optional google.protobuf.FileOptions.OptimizeMode optimize_for = 9 [default = SPEED]; + */ + optimizeFor?: FileOptions_OptimizeModeJson; + /** + * Sets the Go package where structs generated from this .proto will be + * placed. If omitted, the Go package will be derived from the following: + * - The basename of the package import path, if provided. + * - Otherwise, the package statement in the .proto file, if present. + * - Otherwise, the basename of the .proto file, without extension. + * + * @generated from field: optional string go_package = 11; + */ + goPackage?: string; + /** + * Should generic services be generated in each language? "Generic" services + * are not specific to any particular RPC system. They are generated by the + * main code generators in each language (without additional plugins). + * Generic services were the only kind of service generation supported by + * early versions of google.protobuf. + * + * Generic services are now considered deprecated in favor of using plugins + * that generate code specific to your particular RPC system. Therefore, + * these default to false. Old code which depends on generic services should + * explicitly set them to true. + * + * @generated from field: optional bool cc_generic_services = 16 [default = false]; + */ + ccGenericServices?: boolean; + /** + * @generated from field: optional bool java_generic_services = 17 [default = false]; + */ + javaGenericServices?: boolean; + /** + * @generated from field: optional bool py_generic_services = 18 [default = false]; + */ + pyGenericServices?: boolean; + /** + * Is this file deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for everything in the file, or it will be completely ignored; in the very + * least, this is a formalization for deprecating files. + * + * @generated from field: optional bool deprecated = 23 [default = false]; + */ + deprecated?: boolean; + /** + * Enables the use of arenas for the proto messages in this file. This applies + * only to generated classes for C++. + * + * @generated from field: optional bool cc_enable_arenas = 31 [default = true]; + */ + ccEnableArenas?: boolean; + /** + * Sets the objective c class prefix which is prepended to all objective c + * generated classes from this .proto. There is no default. + * + * @generated from field: optional string objc_class_prefix = 36; + */ + objcClassPrefix?: string; + /** + * Namespace for generated classes; defaults to the package. + * + * @generated from field: optional string csharp_namespace = 37; + */ + csharpNamespace?: string; + /** + * By default Swift generators will take the proto package and CamelCase it + * replacing '.' with underscore and use that to prefix the types/symbols + * defined. When this options is provided, they will use this value instead + * to prefix the types/symbols defined. + * + * @generated from field: optional string swift_prefix = 39; + */ + swiftPrefix?: string; + /** + * Sets the php class prefix which is prepended to all php generated classes + * from this .proto. Default is empty. + * + * @generated from field: optional string php_class_prefix = 40; + */ + phpClassPrefix?: string; + /** + * Use this option to change the namespace of php generated classes. Default + * is empty. When this option is empty, the package name will be used for + * determining the namespace. + * + * @generated from field: optional string php_namespace = 41; + */ + phpNamespace?: string; + /** + * Use this option to change the namespace of php generated metadata classes. + * Default is empty. When this option is empty, the proto file name will be + * used for determining the namespace. + * + * @generated from field: optional string php_metadata_namespace = 44; + */ + phpMetadataNamespace?: string; + /** + * Use this option to change the package of ruby generated classes. Default + * is empty. When this option is not set, the package name will be used for + * determining the ruby package. + * + * @generated from field: optional string ruby_package = 45; + */ + rubyPackage?: string; + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * @generated from field: optional google.protobuf.FeatureSet features = 50; + */ + features?: FeatureSetJson; + /** + * The parser stores options it doesn't recognize here. + * See the documentation for the "Options" section above. + * + * @generated from field: repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; + */ + uninterpretedOption?: UninterpretedOptionJson[]; +}; +/** + * Describes the message google.protobuf.FileOptions. + * Use `create(FileOptionsSchema)` to create a new message. + */ +export declare const FileOptionsSchema: GenMessage; +/** + * Generated classes can be optimized for speed or code size. + * + * @generated from enum google.protobuf.FileOptions.OptimizeMode + */ +export declare enum FileOptions_OptimizeMode { + /** + * Generate complete code for parsing, serialization, + * + * @generated from enum value: SPEED = 1; + */ + SPEED = 1, + /** + * etc. + * + * Use ReflectionOps to implement these methods. + * + * @generated from enum value: CODE_SIZE = 2; + */ + CODE_SIZE = 2, + /** + * Generate code using MessageLite and the lite runtime. + * + * @generated from enum value: LITE_RUNTIME = 3; + */ + LITE_RUNTIME = 3 +} +/** + * Generated classes can be optimized for speed or code size. + * + * @generated from enum google.protobuf.FileOptions.OptimizeMode + */ +export type FileOptions_OptimizeModeJson = "SPEED" | "CODE_SIZE" | "LITE_RUNTIME"; +/** + * Describes the enum google.protobuf.FileOptions.OptimizeMode. + */ +export declare const FileOptions_OptimizeModeSchema: GenEnum; +/** + * @generated from message google.protobuf.MessageOptions + */ +export type MessageOptions = Message<"google.protobuf.MessageOptions"> & { + /** + * Set true to use the old proto1 MessageSet wire format for extensions. + * This is provided for backwards-compatibility with the MessageSet wire + * format. You should not use this for any other reason: It's less + * efficient, has fewer features, and is more complicated. + * + * The message must be defined exactly as follows: + * message Foo { + * option message_set_wire_format = true; + * extensions 4 to max; + * } + * Note that the message cannot have any defined fields; MessageSets only + * have extensions. + * + * All extensions of your type must be singular messages; e.g. they cannot + * be int32s, enums, or repeated messages. + * + * Because this is an option, the above two restrictions are not enforced by + * the protocol compiler. + * + * @generated from field: optional bool message_set_wire_format = 1 [default = false]; + */ + messageSetWireFormat: boolean; + /** + * Disables the generation of the standard "descriptor()" accessor, which can + * conflict with a field of the same name. This is meant to make migration + * from proto1 easier; new code should avoid fields named "descriptor". + * + * @generated from field: optional bool no_standard_descriptor_accessor = 2 [default = false]; + */ + noStandardDescriptorAccessor: boolean; + /** + * Is this message deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the message, or it will be completely ignored; in the very least, + * this is a formalization for deprecating messages. + * + * @generated from field: optional bool deprecated = 3 [default = false]; + */ + deprecated: boolean; + /** + * Whether the message is an automatically generated map entry type for the + * maps field. + * + * For maps fields: + * map map_field = 1; + * The parsed descriptor looks like: + * message MapFieldEntry { + * option map_entry = true; + * optional KeyType key = 1; + * optional ValueType value = 2; + * } + * repeated MapFieldEntry map_field = 1; + * + * Implementations may choose not to generate the map_entry=true message, but + * use a native map in the target language to hold the keys and values. + * The reflection APIs in such implementations still need to work as + * if the field is a repeated message field. + * + * NOTE: Do not set the option in .proto files. Always use the maps syntax + * instead. The option should only be implicitly set by the proto compiler + * parser. + * + * @generated from field: optional bool map_entry = 7; + */ + mapEntry: boolean; + /** + * Enable the legacy handling of JSON field name conflicts. This lowercases + * and strips underscored from the fields before comparison in proto3 only. + * The new behavior takes `json_name` into account and applies to proto2 as + * well. + * + * This should only be used as a temporary measure against broken builds due + * to the change in behavior for JSON field name conflicts. + * + * TODO This is legacy behavior we plan to remove once downstream + * teams have had time to migrate. + * + * @generated from field: optional bool deprecated_legacy_json_field_conflicts = 11 [deprecated = true]; + * @deprecated + */ + deprecatedLegacyJsonFieldConflicts: boolean; + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * @generated from field: optional google.protobuf.FeatureSet features = 12; + */ + features?: FeatureSet | undefined; + /** + * The parser stores options it doesn't recognize here. See above. + * + * @generated from field: repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; + */ + uninterpretedOption: UninterpretedOption[]; +}; +/** + * @generated from message google.protobuf.MessageOptions + */ +export type MessageOptionsJson = { + /** + * Set true to use the old proto1 MessageSet wire format for extensions. + * This is provided for backwards-compatibility with the MessageSet wire + * format. You should not use this for any other reason: It's less + * efficient, has fewer features, and is more complicated. + * + * The message must be defined exactly as follows: + * message Foo { + * option message_set_wire_format = true; + * extensions 4 to max; + * } + * Note that the message cannot have any defined fields; MessageSets only + * have extensions. + * + * All extensions of your type must be singular messages; e.g. they cannot + * be int32s, enums, or repeated messages. + * + * Because this is an option, the above two restrictions are not enforced by + * the protocol compiler. + * + * @generated from field: optional bool message_set_wire_format = 1 [default = false]; + */ + messageSetWireFormat?: boolean; + /** + * Disables the generation of the standard "descriptor()" accessor, which can + * conflict with a field of the same name. This is meant to make migration + * from proto1 easier; new code should avoid fields named "descriptor". + * + * @generated from field: optional bool no_standard_descriptor_accessor = 2 [default = false]; + */ + noStandardDescriptorAccessor?: boolean; + /** + * Is this message deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the message, or it will be completely ignored; in the very least, + * this is a formalization for deprecating messages. + * + * @generated from field: optional bool deprecated = 3 [default = false]; + */ + deprecated?: boolean; + /** + * Whether the message is an automatically generated map entry type for the + * maps field. + * + * For maps fields: + * map map_field = 1; + * The parsed descriptor looks like: + * message MapFieldEntry { + * option map_entry = true; + * optional KeyType key = 1; + * optional ValueType value = 2; + * } + * repeated MapFieldEntry map_field = 1; + * + * Implementations may choose not to generate the map_entry=true message, but + * use a native map in the target language to hold the keys and values. + * The reflection APIs in such implementations still need to work as + * if the field is a repeated message field. + * + * NOTE: Do not set the option in .proto files. Always use the maps syntax + * instead. The option should only be implicitly set by the proto compiler + * parser. + * + * @generated from field: optional bool map_entry = 7; + */ + mapEntry?: boolean; + /** + * Enable the legacy handling of JSON field name conflicts. This lowercases + * and strips underscored from the fields before comparison in proto3 only. + * The new behavior takes `json_name` into account and applies to proto2 as + * well. + * + * This should only be used as a temporary measure against broken builds due + * to the change in behavior for JSON field name conflicts. + * + * TODO This is legacy behavior we plan to remove once downstream + * teams have had time to migrate. + * + * @generated from field: optional bool deprecated_legacy_json_field_conflicts = 11 [deprecated = true]; + * @deprecated + */ + deprecatedLegacyJsonFieldConflicts?: boolean; + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * @generated from field: optional google.protobuf.FeatureSet features = 12; + */ + features?: FeatureSetJson; + /** + * The parser stores options it doesn't recognize here. See above. + * + * @generated from field: repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; + */ + uninterpretedOption?: UninterpretedOptionJson[]; +}; +/** + * Describes the message google.protobuf.MessageOptions. + * Use `create(MessageOptionsSchema)` to create a new message. + */ +export declare const MessageOptionsSchema: GenMessage; +/** + * @generated from message google.protobuf.FieldOptions + */ +export type FieldOptions = Message<"google.protobuf.FieldOptions"> & { + /** + * NOTE: ctype is deprecated. Use `features.(pb.cpp).string_type` instead. + * The ctype option instructs the C++ code generator to use a different + * representation of the field than it normally would. See the specific + * options below. This option is only implemented to support use of + * [ctype=CORD] and [ctype=STRING] (the default) on non-repeated fields of + * type "bytes" in the open source release. + * TODO: make ctype actually deprecated. + * + * @generated from field: optional google.protobuf.FieldOptions.CType ctype = 1 [default = STRING]; + */ + ctype: FieldOptions_CType; + /** + * The packed option can be enabled for repeated primitive fields to enable + * a more efficient representation on the wire. Rather than repeatedly + * writing the tag and type for each element, the entire array is encoded as + * a single length-delimited blob. In proto3, only explicit setting it to + * false will avoid using packed encoding. This option is prohibited in + * Editions, but the `repeated_field_encoding` feature can be used to control + * the behavior. + * + * @generated from field: optional bool packed = 2; + */ + packed: boolean; + /** + * The jstype option determines the JavaScript type used for values of the + * field. The option is permitted only for 64 bit integral and fixed types + * (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING + * is represented as JavaScript string, which avoids loss of precision that + * can happen when a large value is converted to a floating point JavaScript. + * Specifying JS_NUMBER for the jstype causes the generated JavaScript code to + * use the JavaScript "number" type. The behavior of the default option + * JS_NORMAL is implementation dependent. + * + * This option is an enum to permit additional types to be added, e.g. + * goog.math.Integer. + * + * @generated from field: optional google.protobuf.FieldOptions.JSType jstype = 6 [default = JS_NORMAL]; + */ + jstype: FieldOptions_JSType; + /** + * Should this field be parsed lazily? Lazy applies only to message-type + * fields. It means that when the outer message is initially parsed, the + * inner message's contents will not be parsed but instead stored in encoded + * form. The inner message will actually be parsed when it is first accessed. + * + * This is only a hint. Implementations are free to choose whether to use + * eager or lazy parsing regardless of the value of this option. However, + * setting this option true suggests that the protocol author believes that + * using lazy parsing on this field is worth the additional bookkeeping + * overhead typically needed to implement it. + * + * This option does not affect the public interface of any generated code; + * all method signatures remain the same. Furthermore, thread-safety of the + * interface is not affected by this option; const methods remain safe to + * call from multiple threads concurrently, while non-const methods continue + * to require exclusive access. + * + * Note that lazy message fields are still eagerly verified to check + * ill-formed wireformat or missing required fields. Calling IsInitialized() + * on the outer message would fail if the inner message has missing required + * fields. Failed verification would result in parsing failure (except when + * uninitialized messages are acceptable). + * + * @generated from field: optional bool lazy = 5 [default = false]; + */ + lazy: boolean; + /** + * unverified_lazy does no correctness checks on the byte stream. This should + * only be used where lazy with verification is prohibitive for performance + * reasons. + * + * @generated from field: optional bool unverified_lazy = 15 [default = false]; + */ + unverifiedLazy: boolean; + /** + * Is this field deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for accessors, or it will be completely ignored; in the very least, this + * is a formalization for deprecating fields. + * + * @generated from field: optional bool deprecated = 3 [default = false]; + */ + deprecated: boolean; + /** + * DEPRECATED. DO NOT USE! + * For Google-internal migration only. Do not use. + * + * @generated from field: optional bool weak = 10 [default = false, deprecated = true]; + * @deprecated + */ + weak: boolean; + /** + * Indicate that the field value should not be printed out when using debug + * formats, e.g. when the field contains sensitive credentials. + * + * @generated from field: optional bool debug_redact = 16 [default = false]; + */ + debugRedact: boolean; + /** + * @generated from field: optional google.protobuf.FieldOptions.OptionRetention retention = 17; + */ + retention: FieldOptions_OptionRetention; + /** + * @generated from field: repeated google.protobuf.FieldOptions.OptionTargetType targets = 19; + */ + targets: FieldOptions_OptionTargetType[]; + /** + * @generated from field: repeated google.protobuf.FieldOptions.EditionDefault edition_defaults = 20; + */ + editionDefaults: FieldOptions_EditionDefault[]; + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * @generated from field: optional google.protobuf.FeatureSet features = 21; + */ + features?: FeatureSet | undefined; + /** + * @generated from field: optional google.protobuf.FieldOptions.FeatureSupport feature_support = 22; + */ + featureSupport?: FieldOptions_FeatureSupport | undefined; + /** + * The parser stores options it doesn't recognize here. See above. + * + * @generated from field: repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; + */ + uninterpretedOption: UninterpretedOption[]; +}; +/** + * @generated from message google.protobuf.FieldOptions + */ +export type FieldOptionsJson = { + /** + * NOTE: ctype is deprecated. Use `features.(pb.cpp).string_type` instead. + * The ctype option instructs the C++ code generator to use a different + * representation of the field than it normally would. See the specific + * options below. This option is only implemented to support use of + * [ctype=CORD] and [ctype=STRING] (the default) on non-repeated fields of + * type "bytes" in the open source release. + * TODO: make ctype actually deprecated. + * + * @generated from field: optional google.protobuf.FieldOptions.CType ctype = 1 [default = STRING]; + */ + ctype?: FieldOptions_CTypeJson; + /** + * The packed option can be enabled for repeated primitive fields to enable + * a more efficient representation on the wire. Rather than repeatedly + * writing the tag and type for each element, the entire array is encoded as + * a single length-delimited blob. In proto3, only explicit setting it to + * false will avoid using packed encoding. This option is prohibited in + * Editions, but the `repeated_field_encoding` feature can be used to control + * the behavior. + * + * @generated from field: optional bool packed = 2; + */ + packed?: boolean; + /** + * The jstype option determines the JavaScript type used for values of the + * field. The option is permitted only for 64 bit integral and fixed types + * (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING + * is represented as JavaScript string, which avoids loss of precision that + * can happen when a large value is converted to a floating point JavaScript. + * Specifying JS_NUMBER for the jstype causes the generated JavaScript code to + * use the JavaScript "number" type. The behavior of the default option + * JS_NORMAL is implementation dependent. + * + * This option is an enum to permit additional types to be added, e.g. + * goog.math.Integer. + * + * @generated from field: optional google.protobuf.FieldOptions.JSType jstype = 6 [default = JS_NORMAL]; + */ + jstype?: FieldOptions_JSTypeJson; + /** + * Should this field be parsed lazily? Lazy applies only to message-type + * fields. It means that when the outer message is initially parsed, the + * inner message's contents will not be parsed but instead stored in encoded + * form. The inner message will actually be parsed when it is first accessed. + * + * This is only a hint. Implementations are free to choose whether to use + * eager or lazy parsing regardless of the value of this option. However, + * setting this option true suggests that the protocol author believes that + * using lazy parsing on this field is worth the additional bookkeeping + * overhead typically needed to implement it. + * + * This option does not affect the public interface of any generated code; + * all method signatures remain the same. Furthermore, thread-safety of the + * interface is not affected by this option; const methods remain safe to + * call from multiple threads concurrently, while non-const methods continue + * to require exclusive access. + * + * Note that lazy message fields are still eagerly verified to check + * ill-formed wireformat or missing required fields. Calling IsInitialized() + * on the outer message would fail if the inner message has missing required + * fields. Failed verification would result in parsing failure (except when + * uninitialized messages are acceptable). + * + * @generated from field: optional bool lazy = 5 [default = false]; + */ + lazy?: boolean; + /** + * unverified_lazy does no correctness checks on the byte stream. This should + * only be used where lazy with verification is prohibitive for performance + * reasons. + * + * @generated from field: optional bool unverified_lazy = 15 [default = false]; + */ + unverifiedLazy?: boolean; + /** + * Is this field deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for accessors, or it will be completely ignored; in the very least, this + * is a formalization for deprecating fields. + * + * @generated from field: optional bool deprecated = 3 [default = false]; + */ + deprecated?: boolean; + /** + * DEPRECATED. DO NOT USE! + * For Google-internal migration only. Do not use. + * + * @generated from field: optional bool weak = 10 [default = false, deprecated = true]; + * @deprecated + */ + weak?: boolean; + /** + * Indicate that the field value should not be printed out when using debug + * formats, e.g. when the field contains sensitive credentials. + * + * @generated from field: optional bool debug_redact = 16 [default = false]; + */ + debugRedact?: boolean; + /** + * @generated from field: optional google.protobuf.FieldOptions.OptionRetention retention = 17; + */ + retention?: FieldOptions_OptionRetentionJson; + /** + * @generated from field: repeated google.protobuf.FieldOptions.OptionTargetType targets = 19; + */ + targets?: FieldOptions_OptionTargetTypeJson[]; + /** + * @generated from field: repeated google.protobuf.FieldOptions.EditionDefault edition_defaults = 20; + */ + editionDefaults?: FieldOptions_EditionDefaultJson[]; + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * @generated from field: optional google.protobuf.FeatureSet features = 21; + */ + features?: FeatureSetJson; + /** + * @generated from field: optional google.protobuf.FieldOptions.FeatureSupport feature_support = 22; + */ + featureSupport?: FieldOptions_FeatureSupportJson; + /** + * The parser stores options it doesn't recognize here. See above. + * + * @generated from field: repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; + */ + uninterpretedOption?: UninterpretedOptionJson[]; +}; +/** + * Describes the message google.protobuf.FieldOptions. + * Use `create(FieldOptionsSchema)` to create a new message. + */ +export declare const FieldOptionsSchema: GenMessage; +/** + * @generated from message google.protobuf.FieldOptions.EditionDefault + */ +export type FieldOptions_EditionDefault = Message<"google.protobuf.FieldOptions.EditionDefault"> & { + /** + * @generated from field: optional google.protobuf.Edition edition = 3; + */ + edition: Edition; + /** + * Textproto value. + * + * @generated from field: optional string value = 2; + */ + value: string; +}; +/** + * @generated from message google.protobuf.FieldOptions.EditionDefault + */ +export type FieldOptions_EditionDefaultJson = { + /** + * @generated from field: optional google.protobuf.Edition edition = 3; + */ + edition?: EditionJson; + /** + * Textproto value. + * + * @generated from field: optional string value = 2; + */ + value?: string; +}; +/** + * Describes the message google.protobuf.FieldOptions.EditionDefault. + * Use `create(FieldOptions_EditionDefaultSchema)` to create a new message. + */ +export declare const FieldOptions_EditionDefaultSchema: GenMessage; +/** + * Information about the support window of a feature. + * + * @generated from message google.protobuf.FieldOptions.FeatureSupport + */ +export type FieldOptions_FeatureSupport = Message<"google.protobuf.FieldOptions.FeatureSupport"> & { + /** + * The edition that this feature was first available in. In editions + * earlier than this one, the default assigned to EDITION_LEGACY will be + * used, and proto files will not be able to override it. + * + * @generated from field: optional google.protobuf.Edition edition_introduced = 1; + */ + editionIntroduced: Edition; + /** + * The edition this feature becomes deprecated in. Using this after this + * edition may trigger warnings. + * + * @generated from field: optional google.protobuf.Edition edition_deprecated = 2; + */ + editionDeprecated: Edition; + /** + * The deprecation warning text if this feature is used after the edition it + * was marked deprecated in. + * + * @generated from field: optional string deprecation_warning = 3; + */ + deprecationWarning: string; + /** + * The edition this feature is no longer available in. In editions after + * this one, the last default assigned will be used, and proto files will + * not be able to override it. + * + * @generated from field: optional google.protobuf.Edition edition_removed = 4; + */ + editionRemoved: Edition; + /** + * The removal error text if this feature is used after the edition it was + * removed in. + * + * @generated from field: optional string removal_error = 5; + */ + removalError: string; +}; +/** + * Information about the support window of a feature. + * + * @generated from message google.protobuf.FieldOptions.FeatureSupport + */ +export type FieldOptions_FeatureSupportJson = { + /** + * The edition that this feature was first available in. In editions + * earlier than this one, the default assigned to EDITION_LEGACY will be + * used, and proto files will not be able to override it. + * + * @generated from field: optional google.protobuf.Edition edition_introduced = 1; + */ + editionIntroduced?: EditionJson; + /** + * The edition this feature becomes deprecated in. Using this after this + * edition may trigger warnings. + * + * @generated from field: optional google.protobuf.Edition edition_deprecated = 2; + */ + editionDeprecated?: EditionJson; + /** + * The deprecation warning text if this feature is used after the edition it + * was marked deprecated in. + * + * @generated from field: optional string deprecation_warning = 3; + */ + deprecationWarning?: string; + /** + * The edition this feature is no longer available in. In editions after + * this one, the last default assigned will be used, and proto files will + * not be able to override it. + * + * @generated from field: optional google.protobuf.Edition edition_removed = 4; + */ + editionRemoved?: EditionJson; + /** + * The removal error text if this feature is used after the edition it was + * removed in. + * + * @generated from field: optional string removal_error = 5; + */ + removalError?: string; +}; +/** + * Describes the message google.protobuf.FieldOptions.FeatureSupport. + * Use `create(FieldOptions_FeatureSupportSchema)` to create a new message. + */ +export declare const FieldOptions_FeatureSupportSchema: GenMessage; +/** + * @generated from enum google.protobuf.FieldOptions.CType + */ +export declare enum FieldOptions_CType { + /** + * Default mode. + * + * @generated from enum value: STRING = 0; + */ + STRING = 0, + /** + * The option [ctype=CORD] may be applied to a non-repeated field of type + * "bytes". It indicates that in C++, the data should be stored in a Cord + * instead of a string. For very large strings, this may reduce memory + * fragmentation. It may also allow better performance when parsing from a + * Cord, or when parsing with aliasing enabled, as the parsed Cord may then + * alias the original buffer. + * + * @generated from enum value: CORD = 1; + */ + CORD = 1, + /** + * @generated from enum value: STRING_PIECE = 2; + */ + STRING_PIECE = 2 +} +/** + * @generated from enum google.protobuf.FieldOptions.CType + */ +export type FieldOptions_CTypeJson = "STRING" | "CORD" | "STRING_PIECE"; +/** + * Describes the enum google.protobuf.FieldOptions.CType. + */ +export declare const FieldOptions_CTypeSchema: GenEnum; +/** + * @generated from enum google.protobuf.FieldOptions.JSType + */ +export declare enum FieldOptions_JSType { + /** + * Use the default type. + * + * @generated from enum value: JS_NORMAL = 0; + */ + JS_NORMAL = 0, + /** + * Use JavaScript strings. + * + * @generated from enum value: JS_STRING = 1; + */ + JS_STRING = 1, + /** + * Use JavaScript numbers. + * + * @generated from enum value: JS_NUMBER = 2; + */ + JS_NUMBER = 2 +} +/** + * @generated from enum google.protobuf.FieldOptions.JSType + */ +export type FieldOptions_JSTypeJson = "JS_NORMAL" | "JS_STRING" | "JS_NUMBER"; +/** + * Describes the enum google.protobuf.FieldOptions.JSType. + */ +export declare const FieldOptions_JSTypeSchema: GenEnum; +/** + * If set to RETENTION_SOURCE, the option will be omitted from the binary. + * + * @generated from enum google.protobuf.FieldOptions.OptionRetention + */ +export declare enum FieldOptions_OptionRetention { + /** + * @generated from enum value: RETENTION_UNKNOWN = 0; + */ + RETENTION_UNKNOWN = 0, + /** + * @generated from enum value: RETENTION_RUNTIME = 1; + */ + RETENTION_RUNTIME = 1, + /** + * @generated from enum value: RETENTION_SOURCE = 2; + */ + RETENTION_SOURCE = 2 +} +/** + * If set to RETENTION_SOURCE, the option will be omitted from the binary. + * + * @generated from enum google.protobuf.FieldOptions.OptionRetention + */ +export type FieldOptions_OptionRetentionJson = "RETENTION_UNKNOWN" | "RETENTION_RUNTIME" | "RETENTION_SOURCE"; +/** + * Describes the enum google.protobuf.FieldOptions.OptionRetention. + */ +export declare const FieldOptions_OptionRetentionSchema: GenEnum; +/** + * This indicates the types of entities that the field may apply to when used + * as an option. If it is unset, then the field may be freely used as an + * option on any kind of entity. + * + * @generated from enum google.protobuf.FieldOptions.OptionTargetType + */ +export declare enum FieldOptions_OptionTargetType { + /** + * @generated from enum value: TARGET_TYPE_UNKNOWN = 0; + */ + TARGET_TYPE_UNKNOWN = 0, + /** + * @generated from enum value: TARGET_TYPE_FILE = 1; + */ + TARGET_TYPE_FILE = 1, + /** + * @generated from enum value: TARGET_TYPE_EXTENSION_RANGE = 2; + */ + TARGET_TYPE_EXTENSION_RANGE = 2, + /** + * @generated from enum value: TARGET_TYPE_MESSAGE = 3; + */ + TARGET_TYPE_MESSAGE = 3, + /** + * @generated from enum value: TARGET_TYPE_FIELD = 4; + */ + TARGET_TYPE_FIELD = 4, + /** + * @generated from enum value: TARGET_TYPE_ONEOF = 5; + */ + TARGET_TYPE_ONEOF = 5, + /** + * @generated from enum value: TARGET_TYPE_ENUM = 6; + */ + TARGET_TYPE_ENUM = 6, + /** + * @generated from enum value: TARGET_TYPE_ENUM_ENTRY = 7; + */ + TARGET_TYPE_ENUM_ENTRY = 7, + /** + * @generated from enum value: TARGET_TYPE_SERVICE = 8; + */ + TARGET_TYPE_SERVICE = 8, + /** + * @generated from enum value: TARGET_TYPE_METHOD = 9; + */ + TARGET_TYPE_METHOD = 9 +} +/** + * This indicates the types of entities that the field may apply to when used + * as an option. If it is unset, then the field may be freely used as an + * option on any kind of entity. + * + * @generated from enum google.protobuf.FieldOptions.OptionTargetType + */ +export type FieldOptions_OptionTargetTypeJson = "TARGET_TYPE_UNKNOWN" | "TARGET_TYPE_FILE" | "TARGET_TYPE_EXTENSION_RANGE" | "TARGET_TYPE_MESSAGE" | "TARGET_TYPE_FIELD" | "TARGET_TYPE_ONEOF" | "TARGET_TYPE_ENUM" | "TARGET_TYPE_ENUM_ENTRY" | "TARGET_TYPE_SERVICE" | "TARGET_TYPE_METHOD"; +/** + * Describes the enum google.protobuf.FieldOptions.OptionTargetType. + */ +export declare const FieldOptions_OptionTargetTypeSchema: GenEnum; +/** + * @generated from message google.protobuf.OneofOptions + */ +export type OneofOptions = Message<"google.protobuf.OneofOptions"> & { + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * @generated from field: optional google.protobuf.FeatureSet features = 1; + */ + features?: FeatureSet | undefined; + /** + * The parser stores options it doesn't recognize here. See above. + * + * @generated from field: repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; + */ + uninterpretedOption: UninterpretedOption[]; +}; +/** + * @generated from message google.protobuf.OneofOptions + */ +export type OneofOptionsJson = { + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * @generated from field: optional google.protobuf.FeatureSet features = 1; + */ + features?: FeatureSetJson; + /** + * The parser stores options it doesn't recognize here. See above. + * + * @generated from field: repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; + */ + uninterpretedOption?: UninterpretedOptionJson[]; +}; +/** + * Describes the message google.protobuf.OneofOptions. + * Use `create(OneofOptionsSchema)` to create a new message. + */ +export declare const OneofOptionsSchema: GenMessage; +/** + * @generated from message google.protobuf.EnumOptions + */ +export type EnumOptions = Message<"google.protobuf.EnumOptions"> & { + /** + * Set this option to true to allow mapping different tag names to the same + * value. + * + * @generated from field: optional bool allow_alias = 2; + */ + allowAlias: boolean; + /** + * Is this enum deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the enum, or it will be completely ignored; in the very least, this + * is a formalization for deprecating enums. + * + * @generated from field: optional bool deprecated = 3 [default = false]; + */ + deprecated: boolean; + /** + * Enable the legacy handling of JSON field name conflicts. This lowercases + * and strips underscored from the fields before comparison in proto3 only. + * The new behavior takes `json_name` into account and applies to proto2 as + * well. + * TODO Remove this legacy behavior once downstream teams have + * had time to migrate. + * + * @generated from field: optional bool deprecated_legacy_json_field_conflicts = 6 [deprecated = true]; + * @deprecated + */ + deprecatedLegacyJsonFieldConflicts: boolean; + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * @generated from field: optional google.protobuf.FeatureSet features = 7; + */ + features?: FeatureSet | undefined; + /** + * The parser stores options it doesn't recognize here. See above. + * + * @generated from field: repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; + */ + uninterpretedOption: UninterpretedOption[]; +}; +/** + * @generated from message google.protobuf.EnumOptions + */ +export type EnumOptionsJson = { + /** + * Set this option to true to allow mapping different tag names to the same + * value. + * + * @generated from field: optional bool allow_alias = 2; + */ + allowAlias?: boolean; + /** + * Is this enum deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the enum, or it will be completely ignored; in the very least, this + * is a formalization for deprecating enums. + * + * @generated from field: optional bool deprecated = 3 [default = false]; + */ + deprecated?: boolean; + /** + * Enable the legacy handling of JSON field name conflicts. This lowercases + * and strips underscored from the fields before comparison in proto3 only. + * The new behavior takes `json_name` into account and applies to proto2 as + * well. + * TODO Remove this legacy behavior once downstream teams have + * had time to migrate. + * + * @generated from field: optional bool deprecated_legacy_json_field_conflicts = 6 [deprecated = true]; + * @deprecated + */ + deprecatedLegacyJsonFieldConflicts?: boolean; + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * @generated from field: optional google.protobuf.FeatureSet features = 7; + */ + features?: FeatureSetJson; + /** + * The parser stores options it doesn't recognize here. See above. + * + * @generated from field: repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; + */ + uninterpretedOption?: UninterpretedOptionJson[]; +}; +/** + * Describes the message google.protobuf.EnumOptions. + * Use `create(EnumOptionsSchema)` to create a new message. + */ +export declare const EnumOptionsSchema: GenMessage; +/** + * @generated from message google.protobuf.EnumValueOptions + */ +export type EnumValueOptions = Message<"google.protobuf.EnumValueOptions"> & { + /** + * Is this enum value deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the enum value, or it will be completely ignored; in the very least, + * this is a formalization for deprecating enum values. + * + * @generated from field: optional bool deprecated = 1 [default = false]; + */ + deprecated: boolean; + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * @generated from field: optional google.protobuf.FeatureSet features = 2; + */ + features?: FeatureSet | undefined; + /** + * Indicate that fields annotated with this enum value should not be printed + * out when using debug formats, e.g. when the field contains sensitive + * credentials. + * + * @generated from field: optional bool debug_redact = 3 [default = false]; + */ + debugRedact: boolean; + /** + * Information about the support window of a feature value. + * + * @generated from field: optional google.protobuf.FieldOptions.FeatureSupport feature_support = 4; + */ + featureSupport?: FieldOptions_FeatureSupport | undefined; + /** + * The parser stores options it doesn't recognize here. See above. + * + * @generated from field: repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; + */ + uninterpretedOption: UninterpretedOption[]; +}; +/** + * @generated from message google.protobuf.EnumValueOptions + */ +export type EnumValueOptionsJson = { + /** + * Is this enum value deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the enum value, or it will be completely ignored; in the very least, + * this is a formalization for deprecating enum values. + * + * @generated from field: optional bool deprecated = 1 [default = false]; + */ + deprecated?: boolean; + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * @generated from field: optional google.protobuf.FeatureSet features = 2; + */ + features?: FeatureSetJson; + /** + * Indicate that fields annotated with this enum value should not be printed + * out when using debug formats, e.g. when the field contains sensitive + * credentials. + * + * @generated from field: optional bool debug_redact = 3 [default = false]; + */ + debugRedact?: boolean; + /** + * Information about the support window of a feature value. + * + * @generated from field: optional google.protobuf.FieldOptions.FeatureSupport feature_support = 4; + */ + featureSupport?: FieldOptions_FeatureSupportJson; + /** + * The parser stores options it doesn't recognize here. See above. + * + * @generated from field: repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; + */ + uninterpretedOption?: UninterpretedOptionJson[]; +}; +/** + * Describes the message google.protobuf.EnumValueOptions. + * Use `create(EnumValueOptionsSchema)` to create a new message. + */ +export declare const EnumValueOptionsSchema: GenMessage; +/** + * @generated from message google.protobuf.ServiceOptions + */ +export type ServiceOptions = Message<"google.protobuf.ServiceOptions"> & { + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * @generated from field: optional google.protobuf.FeatureSet features = 34; + */ + features?: FeatureSet | undefined; + /** + * Is this service deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the service, or it will be completely ignored; in the very least, + * this is a formalization for deprecating services. + * + * @generated from field: optional bool deprecated = 33 [default = false]; + */ + deprecated: boolean; + /** + * The parser stores options it doesn't recognize here. See above. + * + * @generated from field: repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; + */ + uninterpretedOption: UninterpretedOption[]; +}; +/** + * @generated from message google.protobuf.ServiceOptions + */ +export type ServiceOptionsJson = { + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * @generated from field: optional google.protobuf.FeatureSet features = 34; + */ + features?: FeatureSetJson; + /** + * Is this service deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the service, or it will be completely ignored; in the very least, + * this is a formalization for deprecating services. + * + * @generated from field: optional bool deprecated = 33 [default = false]; + */ + deprecated?: boolean; + /** + * The parser stores options it doesn't recognize here. See above. + * + * @generated from field: repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; + */ + uninterpretedOption?: UninterpretedOptionJson[]; +}; +/** + * Describes the message google.protobuf.ServiceOptions. + * Use `create(ServiceOptionsSchema)` to create a new message. + */ +export declare const ServiceOptionsSchema: GenMessage; +/** + * @generated from message google.protobuf.MethodOptions + */ +export type MethodOptions = Message<"google.protobuf.MethodOptions"> & { + /** + * Is this method deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the method, or it will be completely ignored; in the very least, + * this is a formalization for deprecating methods. + * + * @generated from field: optional bool deprecated = 33 [default = false]; + */ + deprecated: boolean; + /** + * @generated from field: optional google.protobuf.MethodOptions.IdempotencyLevel idempotency_level = 34 [default = IDEMPOTENCY_UNKNOWN]; + */ + idempotencyLevel: MethodOptions_IdempotencyLevel; + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * @generated from field: optional google.protobuf.FeatureSet features = 35; + */ + features?: FeatureSet | undefined; + /** + * The parser stores options it doesn't recognize here. See above. + * + * @generated from field: repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; + */ + uninterpretedOption: UninterpretedOption[]; +}; +/** + * @generated from message google.protobuf.MethodOptions + */ +export type MethodOptionsJson = { + /** + * Is this method deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the method, or it will be completely ignored; in the very least, + * this is a formalization for deprecating methods. + * + * @generated from field: optional bool deprecated = 33 [default = false]; + */ + deprecated?: boolean; + /** + * @generated from field: optional google.protobuf.MethodOptions.IdempotencyLevel idempotency_level = 34 [default = IDEMPOTENCY_UNKNOWN]; + */ + idempotencyLevel?: MethodOptions_IdempotencyLevelJson; + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * @generated from field: optional google.protobuf.FeatureSet features = 35; + */ + features?: FeatureSetJson; + /** + * The parser stores options it doesn't recognize here. See above. + * + * @generated from field: repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; + */ + uninterpretedOption?: UninterpretedOptionJson[]; +}; +/** + * Describes the message google.protobuf.MethodOptions. + * Use `create(MethodOptionsSchema)` to create a new message. + */ +export declare const MethodOptionsSchema: GenMessage; +/** + * Is this method side-effect-free (or safe in HTTP parlance), or idempotent, + * or neither? HTTP based RPC implementation may choose GET verb for safe + * methods, and PUT verb for idempotent methods instead of the default POST. + * + * @generated from enum google.protobuf.MethodOptions.IdempotencyLevel + */ +export declare enum MethodOptions_IdempotencyLevel { + /** + * @generated from enum value: IDEMPOTENCY_UNKNOWN = 0; + */ + IDEMPOTENCY_UNKNOWN = 0, + /** + * implies idempotent + * + * @generated from enum value: NO_SIDE_EFFECTS = 1; + */ + NO_SIDE_EFFECTS = 1, + /** + * idempotent, but may have side effects + * + * @generated from enum value: IDEMPOTENT = 2; + */ + IDEMPOTENT = 2 +} +/** + * Is this method side-effect-free (or safe in HTTP parlance), or idempotent, + * or neither? HTTP based RPC implementation may choose GET verb for safe + * methods, and PUT verb for idempotent methods instead of the default POST. + * + * @generated from enum google.protobuf.MethodOptions.IdempotencyLevel + */ +export type MethodOptions_IdempotencyLevelJson = "IDEMPOTENCY_UNKNOWN" | "NO_SIDE_EFFECTS" | "IDEMPOTENT"; +/** + * Describes the enum google.protobuf.MethodOptions.IdempotencyLevel. + */ +export declare const MethodOptions_IdempotencyLevelSchema: GenEnum; +/** + * A message representing a option the parser does not recognize. This only + * appears in options protos created by the compiler::Parser class. + * DescriptorPool resolves these when building Descriptor objects. Therefore, + * options protos in descriptor objects (e.g. returned by Descriptor::options(), + * or produced by Descriptor::CopyTo()) will never have UninterpretedOptions + * in them. + * + * @generated from message google.protobuf.UninterpretedOption + */ +export type UninterpretedOption = Message<"google.protobuf.UninterpretedOption"> & { + /** + * @generated from field: repeated google.protobuf.UninterpretedOption.NamePart name = 2; + */ + name: UninterpretedOption_NamePart[]; + /** + * The value of the uninterpreted option, in whatever type the tokenizer + * identified it as during parsing. Exactly one of these should be set. + * + * @generated from field: optional string identifier_value = 3; + */ + identifierValue: string; + /** + * @generated from field: optional uint64 positive_int_value = 4; + */ + positiveIntValue: bigint; + /** + * @generated from field: optional int64 negative_int_value = 5; + */ + negativeIntValue: bigint; + /** + * @generated from field: optional double double_value = 6; + */ + doubleValue: number; + /** + * @generated from field: optional bytes string_value = 7; + */ + stringValue: Uint8Array; + /** + * @generated from field: optional string aggregate_value = 8; + */ + aggregateValue: string; +}; +/** + * A message representing a option the parser does not recognize. This only + * appears in options protos created by the compiler::Parser class. + * DescriptorPool resolves these when building Descriptor objects. Therefore, + * options protos in descriptor objects (e.g. returned by Descriptor::options(), + * or produced by Descriptor::CopyTo()) will never have UninterpretedOptions + * in them. + * + * @generated from message google.protobuf.UninterpretedOption + */ +export type UninterpretedOptionJson = { + /** + * @generated from field: repeated google.protobuf.UninterpretedOption.NamePart name = 2; + */ + name?: UninterpretedOption_NamePartJson[]; + /** + * The value of the uninterpreted option, in whatever type the tokenizer + * identified it as during parsing. Exactly one of these should be set. + * + * @generated from field: optional string identifier_value = 3; + */ + identifierValue?: string; + /** + * @generated from field: optional uint64 positive_int_value = 4; + */ + positiveIntValue?: string; + /** + * @generated from field: optional int64 negative_int_value = 5; + */ + negativeIntValue?: string; + /** + * @generated from field: optional double double_value = 6; + */ + doubleValue?: number | "NaN" | "Infinity" | "-Infinity"; + /** + * @generated from field: optional bytes string_value = 7; + */ + stringValue?: string; + /** + * @generated from field: optional string aggregate_value = 8; + */ + aggregateValue?: string; +}; +/** + * Describes the message google.protobuf.UninterpretedOption. + * Use `create(UninterpretedOptionSchema)` to create a new message. + */ +export declare const UninterpretedOptionSchema: GenMessage; +/** + * The name of the uninterpreted option. Each string represents a segment in + * a dot-separated name. is_extension is true iff a segment represents an + * extension (denoted with parentheses in options specs in .proto files). + * E.g.,{ ["foo", false], ["bar.baz", true], ["moo", false] } represents + * "foo.(bar.baz).moo". + * + * @generated from message google.protobuf.UninterpretedOption.NamePart + */ +export type UninterpretedOption_NamePart = Message<"google.protobuf.UninterpretedOption.NamePart"> & { + /** + * @generated from field: required string name_part = 1; + */ + namePart: string; + /** + * @generated from field: required bool is_extension = 2; + */ + isExtension: boolean; +}; +/** + * The name of the uninterpreted option. Each string represents a segment in + * a dot-separated name. is_extension is true iff a segment represents an + * extension (denoted with parentheses in options specs in .proto files). + * E.g.,{ ["foo", false], ["bar.baz", true], ["moo", false] } represents + * "foo.(bar.baz).moo". + * + * @generated from message google.protobuf.UninterpretedOption.NamePart + */ +export type UninterpretedOption_NamePartJson = { + /** + * @generated from field: required string name_part = 1; + */ + namePart?: string; + /** + * @generated from field: required bool is_extension = 2; + */ + isExtension?: boolean; +}; +/** + * Describes the message google.protobuf.UninterpretedOption.NamePart. + * Use `create(UninterpretedOption_NamePartSchema)` to create a new message. + */ +export declare const UninterpretedOption_NamePartSchema: GenMessage; +/** + * TODO Enums in C++ gencode (and potentially other languages) are + * not well scoped. This means that each of the feature enums below can clash + * with each other. The short names we've chosen maximize call-site + * readability, but leave us very open to this scenario. A future feature will + * be designed and implemented to handle this, hopefully before we ever hit a + * conflict here. + * + * @generated from message google.protobuf.FeatureSet + */ +export type FeatureSet = Message<"google.protobuf.FeatureSet"> & { + /** + * @generated from field: optional google.protobuf.FeatureSet.FieldPresence field_presence = 1; + */ + fieldPresence: FeatureSet_FieldPresence; + /** + * @generated from field: optional google.protobuf.FeatureSet.EnumType enum_type = 2; + */ + enumType: FeatureSet_EnumType; + /** + * @generated from field: optional google.protobuf.FeatureSet.RepeatedFieldEncoding repeated_field_encoding = 3; + */ + repeatedFieldEncoding: FeatureSet_RepeatedFieldEncoding; + /** + * @generated from field: optional google.protobuf.FeatureSet.Utf8Validation utf8_validation = 4; + */ + utf8Validation: FeatureSet_Utf8Validation; + /** + * @generated from field: optional google.protobuf.FeatureSet.MessageEncoding message_encoding = 5; + */ + messageEncoding: FeatureSet_MessageEncoding; + /** + * @generated from field: optional google.protobuf.FeatureSet.JsonFormat json_format = 6; + */ + jsonFormat: FeatureSet_JsonFormat; + /** + * @generated from field: optional google.protobuf.FeatureSet.EnforceNamingStyle enforce_naming_style = 7; + */ + enforceNamingStyle: FeatureSet_EnforceNamingStyle; + /** + * @generated from field: optional google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility default_symbol_visibility = 8; + */ + defaultSymbolVisibility: FeatureSet_VisibilityFeature_DefaultSymbolVisibility; +}; +/** + * TODO Enums in C++ gencode (and potentially other languages) are + * not well scoped. This means that each of the feature enums below can clash + * with each other. The short names we've chosen maximize call-site + * readability, but leave us very open to this scenario. A future feature will + * be designed and implemented to handle this, hopefully before we ever hit a + * conflict here. + * + * @generated from message google.protobuf.FeatureSet + */ +export type FeatureSetJson = { + /** + * @generated from field: optional google.protobuf.FeatureSet.FieldPresence field_presence = 1; + */ + fieldPresence?: FeatureSet_FieldPresenceJson; + /** + * @generated from field: optional google.protobuf.FeatureSet.EnumType enum_type = 2; + */ + enumType?: FeatureSet_EnumTypeJson; + /** + * @generated from field: optional google.protobuf.FeatureSet.RepeatedFieldEncoding repeated_field_encoding = 3; + */ + repeatedFieldEncoding?: FeatureSet_RepeatedFieldEncodingJson; + /** + * @generated from field: optional google.protobuf.FeatureSet.Utf8Validation utf8_validation = 4; + */ + utf8Validation?: FeatureSet_Utf8ValidationJson; + /** + * @generated from field: optional google.protobuf.FeatureSet.MessageEncoding message_encoding = 5; + */ + messageEncoding?: FeatureSet_MessageEncodingJson; + /** + * @generated from field: optional google.protobuf.FeatureSet.JsonFormat json_format = 6; + */ + jsonFormat?: FeatureSet_JsonFormatJson; + /** + * @generated from field: optional google.protobuf.FeatureSet.EnforceNamingStyle enforce_naming_style = 7; + */ + enforceNamingStyle?: FeatureSet_EnforceNamingStyleJson; + /** + * @generated from field: optional google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility default_symbol_visibility = 8; + */ + defaultSymbolVisibility?: FeatureSet_VisibilityFeature_DefaultSymbolVisibilityJson; +}; +/** + * Describes the message google.protobuf.FeatureSet. + * Use `create(FeatureSetSchema)` to create a new message. + */ +export declare const FeatureSetSchema: GenMessage; +/** + * @generated from message google.protobuf.FeatureSet.VisibilityFeature + */ +export type FeatureSet_VisibilityFeature = Message<"google.protobuf.FeatureSet.VisibilityFeature"> & {}; +/** + * @generated from message google.protobuf.FeatureSet.VisibilityFeature + */ +export type FeatureSet_VisibilityFeatureJson = {}; +/** + * Describes the message google.protobuf.FeatureSet.VisibilityFeature. + * Use `create(FeatureSet_VisibilityFeatureSchema)` to create a new message. + */ +export declare const FeatureSet_VisibilityFeatureSchema: GenMessage; +/** + * @generated from enum google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility + */ +export declare enum FeatureSet_VisibilityFeature_DefaultSymbolVisibility { + /** + * @generated from enum value: DEFAULT_SYMBOL_VISIBILITY_UNKNOWN = 0; + */ + DEFAULT_SYMBOL_VISIBILITY_UNKNOWN = 0, + /** + * Default pre-EDITION_2024, all UNSET visibility are export. + * + * @generated from enum value: EXPORT_ALL = 1; + */ + EXPORT_ALL = 1, + /** + * All top-level symbols default to export, nested default to local. + * + * @generated from enum value: EXPORT_TOP_LEVEL = 2; + */ + EXPORT_TOP_LEVEL = 2, + /** + * All symbols default to local. + * + * @generated from enum value: LOCAL_ALL = 3; + */ + LOCAL_ALL = 3, + /** + * All symbols local by default. Nested types cannot be exported. + * With special case caveat for message { enum {} reserved 1 to max; } + * This is the recommended setting for new protos. + * + * @generated from enum value: STRICT = 4; + */ + STRICT = 4 +} +/** + * @generated from enum google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility + */ +export type FeatureSet_VisibilityFeature_DefaultSymbolVisibilityJson = "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN" | "EXPORT_ALL" | "EXPORT_TOP_LEVEL" | "LOCAL_ALL" | "STRICT"; +/** + * Describes the enum google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility. + */ +export declare const FeatureSet_VisibilityFeature_DefaultSymbolVisibilitySchema: GenEnum; +/** + * @generated from enum google.protobuf.FeatureSet.FieldPresence + */ +export declare enum FeatureSet_FieldPresence { + /** + * @generated from enum value: FIELD_PRESENCE_UNKNOWN = 0; + */ + FIELD_PRESENCE_UNKNOWN = 0, + /** + * @generated from enum value: EXPLICIT = 1; + */ + EXPLICIT = 1, + /** + * @generated from enum value: IMPLICIT = 2; + */ + IMPLICIT = 2, + /** + * @generated from enum value: LEGACY_REQUIRED = 3; + */ + LEGACY_REQUIRED = 3 +} +/** + * @generated from enum google.protobuf.FeatureSet.FieldPresence + */ +export type FeatureSet_FieldPresenceJson = "FIELD_PRESENCE_UNKNOWN" | "EXPLICIT" | "IMPLICIT" | "LEGACY_REQUIRED"; +/** + * Describes the enum google.protobuf.FeatureSet.FieldPresence. + */ +export declare const FeatureSet_FieldPresenceSchema: GenEnum; +/** + * @generated from enum google.protobuf.FeatureSet.EnumType + */ +export declare enum FeatureSet_EnumType { + /** + * @generated from enum value: ENUM_TYPE_UNKNOWN = 0; + */ + ENUM_TYPE_UNKNOWN = 0, + /** + * @generated from enum value: OPEN = 1; + */ + OPEN = 1, + /** + * @generated from enum value: CLOSED = 2; + */ + CLOSED = 2 +} +/** + * @generated from enum google.protobuf.FeatureSet.EnumType + */ +export type FeatureSet_EnumTypeJson = "ENUM_TYPE_UNKNOWN" | "OPEN" | "CLOSED"; +/** + * Describes the enum google.protobuf.FeatureSet.EnumType. + */ +export declare const FeatureSet_EnumTypeSchema: GenEnum; +/** + * @generated from enum google.protobuf.FeatureSet.RepeatedFieldEncoding + */ +export declare enum FeatureSet_RepeatedFieldEncoding { + /** + * @generated from enum value: REPEATED_FIELD_ENCODING_UNKNOWN = 0; + */ + REPEATED_FIELD_ENCODING_UNKNOWN = 0, + /** + * @generated from enum value: PACKED = 1; + */ + PACKED = 1, + /** + * @generated from enum value: EXPANDED = 2; + */ + EXPANDED = 2 +} +/** + * @generated from enum google.protobuf.FeatureSet.RepeatedFieldEncoding + */ +export type FeatureSet_RepeatedFieldEncodingJson = "REPEATED_FIELD_ENCODING_UNKNOWN" | "PACKED" | "EXPANDED"; +/** + * Describes the enum google.protobuf.FeatureSet.RepeatedFieldEncoding. + */ +export declare const FeatureSet_RepeatedFieldEncodingSchema: GenEnum; +/** + * @generated from enum google.protobuf.FeatureSet.Utf8Validation + */ +export declare enum FeatureSet_Utf8Validation { + /** + * @generated from enum value: UTF8_VALIDATION_UNKNOWN = 0; + */ + UTF8_VALIDATION_UNKNOWN = 0, + /** + * @generated from enum value: VERIFY = 2; + */ + VERIFY = 2, + /** + * @generated from enum value: NONE = 3; + */ + NONE = 3 +} +/** + * @generated from enum google.protobuf.FeatureSet.Utf8Validation + */ +export type FeatureSet_Utf8ValidationJson = "UTF8_VALIDATION_UNKNOWN" | "VERIFY" | "NONE"; +/** + * Describes the enum google.protobuf.FeatureSet.Utf8Validation. + */ +export declare const FeatureSet_Utf8ValidationSchema: GenEnum; +/** + * @generated from enum google.protobuf.FeatureSet.MessageEncoding + */ +export declare enum FeatureSet_MessageEncoding { + /** + * @generated from enum value: MESSAGE_ENCODING_UNKNOWN = 0; + */ + MESSAGE_ENCODING_UNKNOWN = 0, + /** + * @generated from enum value: LENGTH_PREFIXED = 1; + */ + LENGTH_PREFIXED = 1, + /** + * @generated from enum value: DELIMITED = 2; + */ + DELIMITED = 2 +} +/** + * @generated from enum google.protobuf.FeatureSet.MessageEncoding + */ +export type FeatureSet_MessageEncodingJson = "MESSAGE_ENCODING_UNKNOWN" | "LENGTH_PREFIXED" | "DELIMITED"; +/** + * Describes the enum google.protobuf.FeatureSet.MessageEncoding. + */ +export declare const FeatureSet_MessageEncodingSchema: GenEnum; +/** + * @generated from enum google.protobuf.FeatureSet.JsonFormat + */ +export declare enum FeatureSet_JsonFormat { + /** + * @generated from enum value: JSON_FORMAT_UNKNOWN = 0; + */ + JSON_FORMAT_UNKNOWN = 0, + /** + * @generated from enum value: ALLOW = 1; + */ + ALLOW = 1, + /** + * @generated from enum value: LEGACY_BEST_EFFORT = 2; + */ + LEGACY_BEST_EFFORT = 2 +} +/** + * @generated from enum google.protobuf.FeatureSet.JsonFormat + */ +export type FeatureSet_JsonFormatJson = "JSON_FORMAT_UNKNOWN" | "ALLOW" | "LEGACY_BEST_EFFORT"; +/** + * Describes the enum google.protobuf.FeatureSet.JsonFormat. + */ +export declare const FeatureSet_JsonFormatSchema: GenEnum; +/** + * @generated from enum google.protobuf.FeatureSet.EnforceNamingStyle + */ +export declare enum FeatureSet_EnforceNamingStyle { + /** + * @generated from enum value: ENFORCE_NAMING_STYLE_UNKNOWN = 0; + */ + ENFORCE_NAMING_STYLE_UNKNOWN = 0, + /** + * @generated from enum value: STYLE2024 = 1; + */ + STYLE2024 = 1, + /** + * @generated from enum value: STYLE_LEGACY = 2; + */ + STYLE_LEGACY = 2 +} +/** + * @generated from enum google.protobuf.FeatureSet.EnforceNamingStyle + */ +export type FeatureSet_EnforceNamingStyleJson = "ENFORCE_NAMING_STYLE_UNKNOWN" | "STYLE2024" | "STYLE_LEGACY"; +/** + * Describes the enum google.protobuf.FeatureSet.EnforceNamingStyle. + */ +export declare const FeatureSet_EnforceNamingStyleSchema: GenEnum; +/** + * A compiled specification for the defaults of a set of features. These + * messages are generated from FeatureSet extensions and can be used to seed + * feature resolution. The resolution with this object becomes a simple search + * for the closest matching edition, followed by proto merges. + * + * @generated from message google.protobuf.FeatureSetDefaults + */ +export type FeatureSetDefaults = Message<"google.protobuf.FeatureSetDefaults"> & { + /** + * @generated from field: repeated google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault defaults = 1; + */ + defaults: FeatureSetDefaults_FeatureSetEditionDefault[]; + /** + * The minimum supported edition (inclusive) when this was constructed. + * Editions before this will not have defaults. + * + * @generated from field: optional google.protobuf.Edition minimum_edition = 4; + */ + minimumEdition: Edition; + /** + * The maximum known edition (inclusive) when this was constructed. Editions + * after this will not have reliable defaults. + * + * @generated from field: optional google.protobuf.Edition maximum_edition = 5; + */ + maximumEdition: Edition; +}; +/** + * A compiled specification for the defaults of a set of features. These + * messages are generated from FeatureSet extensions and can be used to seed + * feature resolution. The resolution with this object becomes a simple search + * for the closest matching edition, followed by proto merges. + * + * @generated from message google.protobuf.FeatureSetDefaults + */ +export type FeatureSetDefaultsJson = { + /** + * @generated from field: repeated google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault defaults = 1; + */ + defaults?: FeatureSetDefaults_FeatureSetEditionDefaultJson[]; + /** + * The minimum supported edition (inclusive) when this was constructed. + * Editions before this will not have defaults. + * + * @generated from field: optional google.protobuf.Edition minimum_edition = 4; + */ + minimumEdition?: EditionJson; + /** + * The maximum known edition (inclusive) when this was constructed. Editions + * after this will not have reliable defaults. + * + * @generated from field: optional google.protobuf.Edition maximum_edition = 5; + */ + maximumEdition?: EditionJson; +}; +/** + * Describes the message google.protobuf.FeatureSetDefaults. + * Use `create(FeatureSetDefaultsSchema)` to create a new message. + */ +export declare const FeatureSetDefaultsSchema: GenMessage; +/** + * A map from every known edition with a unique set of defaults to its + * defaults. Not all editions may be contained here. For a given edition, + * the defaults at the closest matching edition ordered at or before it should + * be used. This field must be in strict ascending order by edition. + * + * @generated from message google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + */ +export type FeatureSetDefaults_FeatureSetEditionDefault = Message<"google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault"> & { + /** + * @generated from field: optional google.protobuf.Edition edition = 3; + */ + edition: Edition; + /** + * Defaults of features that can be overridden in this edition. + * + * @generated from field: optional google.protobuf.FeatureSet overridable_features = 4; + */ + overridableFeatures?: FeatureSet | undefined; + /** + * Defaults of features that can't be overridden in this edition. + * + * @generated from field: optional google.protobuf.FeatureSet fixed_features = 5; + */ + fixedFeatures?: FeatureSet | undefined; +}; +/** + * A map from every known edition with a unique set of defaults to its + * defaults. Not all editions may be contained here. For a given edition, + * the defaults at the closest matching edition ordered at or before it should + * be used. This field must be in strict ascending order by edition. + * + * @generated from message google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + */ +export type FeatureSetDefaults_FeatureSetEditionDefaultJson = { + /** + * @generated from field: optional google.protobuf.Edition edition = 3; + */ + edition?: EditionJson; + /** + * Defaults of features that can be overridden in this edition. + * + * @generated from field: optional google.protobuf.FeatureSet overridable_features = 4; + */ + overridableFeatures?: FeatureSetJson; + /** + * Defaults of features that can't be overridden in this edition. + * + * @generated from field: optional google.protobuf.FeatureSet fixed_features = 5; + */ + fixedFeatures?: FeatureSetJson; +}; +/** + * Describes the message google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault. + * Use `create(FeatureSetDefaults_FeatureSetEditionDefaultSchema)` to create a new message. + */ +export declare const FeatureSetDefaults_FeatureSetEditionDefaultSchema: GenMessage; +/** + * Encapsulates information about the original source file from which a + * FileDescriptorProto was generated. + * + * @generated from message google.protobuf.SourceCodeInfo + */ +export type SourceCodeInfo = Message<"google.protobuf.SourceCodeInfo"> & { + /** + * A Location identifies a piece of source code in a .proto file which + * corresponds to a particular definition. This information is intended + * to be useful to IDEs, code indexers, documentation generators, and similar + * tools. + * + * For example, say we have a file like: + * message Foo { + * optional string foo = 1; + * } + * Let's look at just the field definition: + * optional string foo = 1; + * ^ ^^ ^^ ^ ^^^ + * a bc de f ghi + * We have the following locations: + * span path represents + * [a,i) [ 4, 0, 2, 0 ] The whole field definition. + * [a,b) [ 4, 0, 2, 0, 4 ] The label (optional). + * [c,d) [ 4, 0, 2, 0, 5 ] The type (string). + * [e,f) [ 4, 0, 2, 0, 1 ] The name (foo). + * [g,h) [ 4, 0, 2, 0, 3 ] The number (1). + * + * Notes: + * - A location may refer to a repeated field itself (i.e. not to any + * particular index within it). This is used whenever a set of elements are + * logically enclosed in a single code segment. For example, an entire + * extend block (possibly containing multiple extension definitions) will + * have an outer location whose path refers to the "extensions" repeated + * field without an index. + * - Multiple locations may have the same path. This happens when a single + * logical declaration is spread out across multiple places. The most + * obvious example is the "extend" block again -- there may be multiple + * extend blocks in the same scope, each of which will have the same path. + * - A location's span is not always a subset of its parent's span. For + * example, the "extendee" of an extension declaration appears at the + * beginning of the "extend" block and is shared by all extensions within + * the block. + * - Just because a location's span is a subset of some other location's span + * does not mean that it is a descendant. For example, a "group" defines + * both a type and a field in a single declaration. Thus, the locations + * corresponding to the type and field and their components will overlap. + * - Code which tries to interpret locations should probably be designed to + * ignore those that it doesn't understand, as more types of locations could + * be recorded in the future. + * + * @generated from field: repeated google.protobuf.SourceCodeInfo.Location location = 1; + */ + location: SourceCodeInfo_Location[]; +}; +/** + * Encapsulates information about the original source file from which a + * FileDescriptorProto was generated. + * + * @generated from message google.protobuf.SourceCodeInfo + */ +export type SourceCodeInfoJson = { + /** + * A Location identifies a piece of source code in a .proto file which + * corresponds to a particular definition. This information is intended + * to be useful to IDEs, code indexers, documentation generators, and similar + * tools. + * + * For example, say we have a file like: + * message Foo { + * optional string foo = 1; + * } + * Let's look at just the field definition: + * optional string foo = 1; + * ^ ^^ ^^ ^ ^^^ + * a bc de f ghi + * We have the following locations: + * span path represents + * [a,i) [ 4, 0, 2, 0 ] The whole field definition. + * [a,b) [ 4, 0, 2, 0, 4 ] The label (optional). + * [c,d) [ 4, 0, 2, 0, 5 ] The type (string). + * [e,f) [ 4, 0, 2, 0, 1 ] The name (foo). + * [g,h) [ 4, 0, 2, 0, 3 ] The number (1). + * + * Notes: + * - A location may refer to a repeated field itself (i.e. not to any + * particular index within it). This is used whenever a set of elements are + * logically enclosed in a single code segment. For example, an entire + * extend block (possibly containing multiple extension definitions) will + * have an outer location whose path refers to the "extensions" repeated + * field without an index. + * - Multiple locations may have the same path. This happens when a single + * logical declaration is spread out across multiple places. The most + * obvious example is the "extend" block again -- there may be multiple + * extend blocks in the same scope, each of which will have the same path. + * - A location's span is not always a subset of its parent's span. For + * example, the "extendee" of an extension declaration appears at the + * beginning of the "extend" block and is shared by all extensions within + * the block. + * - Just because a location's span is a subset of some other location's span + * does not mean that it is a descendant. For example, a "group" defines + * both a type and a field in a single declaration. Thus, the locations + * corresponding to the type and field and their components will overlap. + * - Code which tries to interpret locations should probably be designed to + * ignore those that it doesn't understand, as more types of locations could + * be recorded in the future. + * + * @generated from field: repeated google.protobuf.SourceCodeInfo.Location location = 1; + */ + location?: SourceCodeInfo_LocationJson[]; +}; +/** + * Describes the message google.protobuf.SourceCodeInfo. + * Use `create(SourceCodeInfoSchema)` to create a new message. + */ +export declare const SourceCodeInfoSchema: GenMessage; +/** + * @generated from message google.protobuf.SourceCodeInfo.Location + */ +export type SourceCodeInfo_Location = Message<"google.protobuf.SourceCodeInfo.Location"> & { + /** + * Identifies which part of the FileDescriptorProto was defined at this + * location. + * + * Each element is a field number or an index. They form a path from + * the root FileDescriptorProto to the place where the definition appears. + * For example, this path: + * [ 4, 3, 2, 7, 1 ] + * refers to: + * file.message_type(3) // 4, 3 + * .field(7) // 2, 7 + * .name() // 1 + * This is because FileDescriptorProto.message_type has field number 4: + * repeated DescriptorProto message_type = 4; + * and DescriptorProto.field has field number 2: + * repeated FieldDescriptorProto field = 2; + * and FieldDescriptorProto.name has field number 1: + * optional string name = 1; + * + * Thus, the above path gives the location of a field name. If we removed + * the last element: + * [ 4, 3, 2, 7 ] + * this path refers to the whole field declaration (from the beginning + * of the label to the terminating semicolon). + * + * @generated from field: repeated int32 path = 1 [packed = true]; + */ + path: number[]; + /** + * Always has exactly three or four elements: start line, start column, + * end line (optional, otherwise assumed same as start line), end column. + * These are packed into a single field for efficiency. Note that line + * and column numbers are zero-based -- typically you will want to add + * 1 to each before displaying to a user. + * + * @generated from field: repeated int32 span = 2 [packed = true]; + */ + span: number[]; + /** + * If this SourceCodeInfo represents a complete declaration, these are any + * comments appearing before and after the declaration which appear to be + * attached to the declaration. + * + * A series of line comments appearing on consecutive lines, with no other + * tokens appearing on those lines, will be treated as a single comment. + * + * leading_detached_comments will keep paragraphs of comments that appear + * before (but not connected to) the current element. Each paragraph, + * separated by empty lines, will be one comment element in the repeated + * field. + * + * Only the comment content is provided; comment markers (e.g. //) are + * stripped out. For block comments, leading whitespace and an asterisk + * will be stripped from the beginning of each line other than the first. + * Newlines are included in the output. + * + * Examples: + * + * optional int32 foo = 1; // Comment attached to foo. + * // Comment attached to bar. + * optional int32 bar = 2; + * + * optional string baz = 3; + * // Comment attached to baz. + * // Another line attached to baz. + * + * // Comment attached to moo. + * // + * // Another line attached to moo. + * optional double moo = 4; + * + * // Detached comment for corge. This is not leading or trailing comments + * // to moo or corge because there are blank lines separating it from + * // both. + * + * // Detached comment for corge paragraph 2. + * + * optional string corge = 5; + * /* Block comment attached + * * to corge. Leading asterisks + * * will be removed. *\/ + * /* Block comment attached to + * * grault. *\/ + * optional int32 grault = 6; + * + * // ignored detached comments. + * + * @generated from field: optional string leading_comments = 3; + */ + leadingComments: string; + /** + * @generated from field: optional string trailing_comments = 4; + */ + trailingComments: string; + /** + * @generated from field: repeated string leading_detached_comments = 6; + */ + leadingDetachedComments: string[]; +}; +/** + * @generated from message google.protobuf.SourceCodeInfo.Location + */ +export type SourceCodeInfo_LocationJson = { + /** + * Identifies which part of the FileDescriptorProto was defined at this + * location. + * + * Each element is a field number or an index. They form a path from + * the root FileDescriptorProto to the place where the definition appears. + * For example, this path: + * [ 4, 3, 2, 7, 1 ] + * refers to: + * file.message_type(3) // 4, 3 + * .field(7) // 2, 7 + * .name() // 1 + * This is because FileDescriptorProto.message_type has field number 4: + * repeated DescriptorProto message_type = 4; + * and DescriptorProto.field has field number 2: + * repeated FieldDescriptorProto field = 2; + * and FieldDescriptorProto.name has field number 1: + * optional string name = 1; + * + * Thus, the above path gives the location of a field name. If we removed + * the last element: + * [ 4, 3, 2, 7 ] + * this path refers to the whole field declaration (from the beginning + * of the label to the terminating semicolon). + * + * @generated from field: repeated int32 path = 1 [packed = true]; + */ + path?: number[]; + /** + * Always has exactly three or four elements: start line, start column, + * end line (optional, otherwise assumed same as start line), end column. + * These are packed into a single field for efficiency. Note that line + * and column numbers are zero-based -- typically you will want to add + * 1 to each before displaying to a user. + * + * @generated from field: repeated int32 span = 2 [packed = true]; + */ + span?: number[]; + /** + * If this SourceCodeInfo represents a complete declaration, these are any + * comments appearing before and after the declaration which appear to be + * attached to the declaration. + * + * A series of line comments appearing on consecutive lines, with no other + * tokens appearing on those lines, will be treated as a single comment. + * + * leading_detached_comments will keep paragraphs of comments that appear + * before (but not connected to) the current element. Each paragraph, + * separated by empty lines, will be one comment element in the repeated + * field. + * + * Only the comment content is provided; comment markers (e.g. //) are + * stripped out. For block comments, leading whitespace and an asterisk + * will be stripped from the beginning of each line other than the first. + * Newlines are included in the output. + * + * Examples: + * + * optional int32 foo = 1; // Comment attached to foo. + * // Comment attached to bar. + * optional int32 bar = 2; + * + * optional string baz = 3; + * // Comment attached to baz. + * // Another line attached to baz. + * + * // Comment attached to moo. + * // + * // Another line attached to moo. + * optional double moo = 4; + * + * // Detached comment for corge. This is not leading or trailing comments + * // to moo or corge because there are blank lines separating it from + * // both. + * + * // Detached comment for corge paragraph 2. + * + * optional string corge = 5; + * /* Block comment attached + * * to corge. Leading asterisks + * * will be removed. *\/ + * /* Block comment attached to + * * grault. *\/ + * optional int32 grault = 6; + * + * // ignored detached comments. + * + * @generated from field: optional string leading_comments = 3; + */ + leadingComments?: string; + /** + * @generated from field: optional string trailing_comments = 4; + */ + trailingComments?: string; + /** + * @generated from field: repeated string leading_detached_comments = 6; + */ + leadingDetachedComments?: string[]; +}; +/** + * Describes the message google.protobuf.SourceCodeInfo.Location. + * Use `create(SourceCodeInfo_LocationSchema)` to create a new message. + */ +export declare const SourceCodeInfo_LocationSchema: GenMessage; +/** + * Describes the relationship between generated code and its original source + * file. A GeneratedCodeInfo message is associated with only one generated + * source file, but may contain references to different source .proto files. + * + * @generated from message google.protobuf.GeneratedCodeInfo + */ +export type GeneratedCodeInfo = Message<"google.protobuf.GeneratedCodeInfo"> & { + /** + * An Annotation connects some span of text in generated code to an element + * of its generating .proto file. + * + * @generated from field: repeated google.protobuf.GeneratedCodeInfo.Annotation annotation = 1; + */ + annotation: GeneratedCodeInfo_Annotation[]; +}; +/** + * Describes the relationship between generated code and its original source + * file. A GeneratedCodeInfo message is associated with only one generated + * source file, but may contain references to different source .proto files. + * + * @generated from message google.protobuf.GeneratedCodeInfo + */ +export type GeneratedCodeInfoJson = { + /** + * An Annotation connects some span of text in generated code to an element + * of its generating .proto file. + * + * @generated from field: repeated google.protobuf.GeneratedCodeInfo.Annotation annotation = 1; + */ + annotation?: GeneratedCodeInfo_AnnotationJson[]; +}; +/** + * Describes the message google.protobuf.GeneratedCodeInfo. + * Use `create(GeneratedCodeInfoSchema)` to create a new message. + */ +export declare const GeneratedCodeInfoSchema: GenMessage; +/** + * @generated from message google.protobuf.GeneratedCodeInfo.Annotation + */ +export type GeneratedCodeInfo_Annotation = Message<"google.protobuf.GeneratedCodeInfo.Annotation"> & { + /** + * Identifies the element in the original source .proto file. This field + * is formatted the same as SourceCodeInfo.Location.path. + * + * @generated from field: repeated int32 path = 1 [packed = true]; + */ + path: number[]; + /** + * Identifies the filesystem path to the original source .proto. + * + * @generated from field: optional string source_file = 2; + */ + sourceFile: string; + /** + * Identifies the starting offset in bytes in the generated code + * that relates to the identified object. + * + * @generated from field: optional int32 begin = 3; + */ + begin: number; + /** + * Identifies the ending offset in bytes in the generated code that + * relates to the identified object. The end offset should be one past + * the last relevant byte (so the length of the text = end - begin). + * + * @generated from field: optional int32 end = 4; + */ + end: number; + /** + * @generated from field: optional google.protobuf.GeneratedCodeInfo.Annotation.Semantic semantic = 5; + */ + semantic: GeneratedCodeInfo_Annotation_Semantic; +}; +/** + * @generated from message google.protobuf.GeneratedCodeInfo.Annotation + */ +export type GeneratedCodeInfo_AnnotationJson = { + /** + * Identifies the element in the original source .proto file. This field + * is formatted the same as SourceCodeInfo.Location.path. + * + * @generated from field: repeated int32 path = 1 [packed = true]; + */ + path?: number[]; + /** + * Identifies the filesystem path to the original source .proto. + * + * @generated from field: optional string source_file = 2; + */ + sourceFile?: string; + /** + * Identifies the starting offset in bytes in the generated code + * that relates to the identified object. + * + * @generated from field: optional int32 begin = 3; + */ + begin?: number; + /** + * Identifies the ending offset in bytes in the generated code that + * relates to the identified object. The end offset should be one past + * the last relevant byte (so the length of the text = end - begin). + * + * @generated from field: optional int32 end = 4; + */ + end?: number; + /** + * @generated from field: optional google.protobuf.GeneratedCodeInfo.Annotation.Semantic semantic = 5; + */ + semantic?: GeneratedCodeInfo_Annotation_SemanticJson; +}; +/** + * Describes the message google.protobuf.GeneratedCodeInfo.Annotation. + * Use `create(GeneratedCodeInfo_AnnotationSchema)` to create a new message. + */ +export declare const GeneratedCodeInfo_AnnotationSchema: GenMessage; +/** + * Represents the identified object's effect on the element in the original + * .proto file. + * + * @generated from enum google.protobuf.GeneratedCodeInfo.Annotation.Semantic + */ +export declare enum GeneratedCodeInfo_Annotation_Semantic { + /** + * There is no effect or the effect is indescribable. + * + * @generated from enum value: NONE = 0; + */ + NONE = 0, + /** + * The element is set or otherwise mutated. + * + * @generated from enum value: SET = 1; + */ + SET = 1, + /** + * An alias to the element is returned. + * + * @generated from enum value: ALIAS = 2; + */ + ALIAS = 2 +} +/** + * Represents the identified object's effect on the element in the original + * .proto file. + * + * @generated from enum google.protobuf.GeneratedCodeInfo.Annotation.Semantic + */ +export type GeneratedCodeInfo_Annotation_SemanticJson = "NONE" | "SET" | "ALIAS"; +/** + * Describes the enum google.protobuf.GeneratedCodeInfo.Annotation.Semantic. + */ +export declare const GeneratedCodeInfo_Annotation_SemanticSchema: GenEnum; +/** + * The full set of known editions. + * + * @generated from enum google.protobuf.Edition + */ +export declare enum Edition { + /** + * A placeholder for an unknown edition value. + * + * @generated from enum value: EDITION_UNKNOWN = 0; + */ + EDITION_UNKNOWN = 0, + /** + * A placeholder edition for specifying default behaviors *before* a feature + * was first introduced. This is effectively an "infinite past". + * + * @generated from enum value: EDITION_LEGACY = 900; + */ + EDITION_LEGACY = 900, + /** + * Legacy syntax "editions". These pre-date editions, but behave much like + * distinct editions. These can't be used to specify the edition of proto + * files, but feature definitions must supply proto2/proto3 defaults for + * backwards compatibility. + * + * @generated from enum value: EDITION_PROTO2 = 998; + */ + EDITION_PROTO2 = 998, + /** + * @generated from enum value: EDITION_PROTO3 = 999; + */ + EDITION_PROTO3 = 999, + /** + * Editions that have been released. The specific values are arbitrary and + * should not be depended on, but they will always be time-ordered for easy + * comparison. + * + * @generated from enum value: EDITION_2023 = 1000; + */ + EDITION_2023 = 1000, + /** + * @generated from enum value: EDITION_2024 = 1001; + */ + EDITION_2024 = 1001, + /** + * A placeholder edition for developing and testing unscheduled features. + * + * @generated from enum value: EDITION_UNSTABLE = 9999; + */ + EDITION_UNSTABLE = 9999, + /** + * Placeholder editions for testing feature resolution. These should not be + * used or relied on outside of tests. + * + * @generated from enum value: EDITION_1_TEST_ONLY = 1; + */ + EDITION_1_TEST_ONLY = 1, + /** + * @generated from enum value: EDITION_2_TEST_ONLY = 2; + */ + EDITION_2_TEST_ONLY = 2, + /** + * @generated from enum value: EDITION_99997_TEST_ONLY = 99997; + */ + EDITION_99997_TEST_ONLY = 99997, + /** + * @generated from enum value: EDITION_99998_TEST_ONLY = 99998; + */ + EDITION_99998_TEST_ONLY = 99998, + /** + * @generated from enum value: EDITION_99999_TEST_ONLY = 99999; + */ + EDITION_99999_TEST_ONLY = 99999, + /** + * Placeholder for specifying unbounded edition support. This should only + * ever be used by plugins that can expect to never require any changes to + * support a new edition. + * + * @generated from enum value: EDITION_MAX = 2147483647; + */ + EDITION_MAX = 2147483647 +} +/** + * The full set of known editions. + * + * @generated from enum google.protobuf.Edition + */ +export type EditionJson = "EDITION_UNKNOWN" | "EDITION_LEGACY" | "EDITION_PROTO2" | "EDITION_PROTO3" | "EDITION_2023" | "EDITION_2024" | "EDITION_UNSTABLE" | "EDITION_1_TEST_ONLY" | "EDITION_2_TEST_ONLY" | "EDITION_99997_TEST_ONLY" | "EDITION_99998_TEST_ONLY" | "EDITION_99999_TEST_ONLY" | "EDITION_MAX"; +/** + * Describes the enum google.protobuf.Edition. + */ +export declare const EditionSchema: GenEnum; +/** + * Describes the 'visibility' of a symbol with respect to the proto import + * system. Symbols can only be imported when the visibility rules do not prevent + * it (ex: local symbols cannot be imported). Visibility modifiers can only set + * on `message` and `enum` as they are the only types available to be referenced + * from other files. + * + * @generated from enum google.protobuf.SymbolVisibility + */ +export declare enum SymbolVisibility { + /** + * @generated from enum value: VISIBILITY_UNSET = 0; + */ + VISIBILITY_UNSET = 0, + /** + * @generated from enum value: VISIBILITY_LOCAL = 1; + */ + VISIBILITY_LOCAL = 1, + /** + * @generated from enum value: VISIBILITY_EXPORT = 2; + */ + VISIBILITY_EXPORT = 2 +} +/** + * Describes the 'visibility' of a symbol with respect to the proto import + * system. Symbols can only be imported when the visibility rules do not prevent + * it (ex: local symbols cannot be imported). Visibility modifiers can only set + * on `message` and `enum` as they are the only types available to be referenced + * from other files. + * + * @generated from enum google.protobuf.SymbolVisibility + */ +export type SymbolVisibilityJson = "VISIBILITY_UNSET" | "VISIBILITY_LOCAL" | "VISIBILITY_EXPORT"; +/** + * Describes the enum google.protobuf.SymbolVisibility. + */ +export declare const SymbolVisibilitySchema: GenEnum; diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/descriptor_pb.js b/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/descriptor_pb.js new file mode 100644 index 0000000..db49282 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/descriptor_pb.js @@ -0,0 +1,892 @@ +"use strict"; +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.FeatureSet_FieldPresence = exports.FeatureSet_VisibilityFeature_DefaultSymbolVisibilitySchema = exports.FeatureSet_VisibilityFeature_DefaultSymbolVisibility = exports.FeatureSet_VisibilityFeatureSchema = exports.FeatureSetSchema = exports.UninterpretedOption_NamePartSchema = exports.UninterpretedOptionSchema = exports.MethodOptions_IdempotencyLevelSchema = exports.MethodOptions_IdempotencyLevel = exports.MethodOptionsSchema = exports.ServiceOptionsSchema = exports.EnumValueOptionsSchema = exports.EnumOptionsSchema = exports.OneofOptionsSchema = exports.FieldOptions_OptionTargetTypeSchema = exports.FieldOptions_OptionTargetType = exports.FieldOptions_OptionRetentionSchema = exports.FieldOptions_OptionRetention = exports.FieldOptions_JSTypeSchema = exports.FieldOptions_JSType = exports.FieldOptions_CTypeSchema = exports.FieldOptions_CType = exports.FieldOptions_FeatureSupportSchema = exports.FieldOptions_EditionDefaultSchema = exports.FieldOptionsSchema = exports.MessageOptionsSchema = exports.FileOptions_OptimizeModeSchema = exports.FileOptions_OptimizeMode = exports.FileOptionsSchema = exports.MethodDescriptorProtoSchema = exports.ServiceDescriptorProtoSchema = exports.EnumValueDescriptorProtoSchema = exports.EnumDescriptorProto_EnumReservedRangeSchema = exports.EnumDescriptorProtoSchema = exports.OneofDescriptorProtoSchema = exports.FieldDescriptorProto_LabelSchema = exports.FieldDescriptorProto_Label = exports.FieldDescriptorProto_TypeSchema = exports.FieldDescriptorProto_Type = exports.FieldDescriptorProtoSchema = exports.ExtensionRangeOptions_VerificationStateSchema = exports.ExtensionRangeOptions_VerificationState = exports.ExtensionRangeOptions_DeclarationSchema = exports.ExtensionRangeOptionsSchema = exports.DescriptorProto_ReservedRangeSchema = exports.DescriptorProto_ExtensionRangeSchema = exports.DescriptorProtoSchema = exports.FileDescriptorProtoSchema = exports.FileDescriptorSetSchema = exports.file_google_protobuf_descriptor = void 0; +exports.SymbolVisibilitySchema = exports.SymbolVisibility = exports.EditionSchema = exports.Edition = exports.GeneratedCodeInfo_Annotation_SemanticSchema = exports.GeneratedCodeInfo_Annotation_Semantic = exports.GeneratedCodeInfo_AnnotationSchema = exports.GeneratedCodeInfoSchema = exports.SourceCodeInfo_LocationSchema = exports.SourceCodeInfoSchema = exports.FeatureSetDefaults_FeatureSetEditionDefaultSchema = exports.FeatureSetDefaultsSchema = exports.FeatureSet_EnforceNamingStyleSchema = exports.FeatureSet_EnforceNamingStyle = exports.FeatureSet_JsonFormatSchema = exports.FeatureSet_JsonFormat = exports.FeatureSet_MessageEncodingSchema = exports.FeatureSet_MessageEncoding = exports.FeatureSet_Utf8ValidationSchema = exports.FeatureSet_Utf8Validation = exports.FeatureSet_RepeatedFieldEncodingSchema = exports.FeatureSet_RepeatedFieldEncoding = exports.FeatureSet_EnumTypeSchema = exports.FeatureSet_EnumType = exports.FeatureSet_FieldPresenceSchema = void 0; +const boot_js_1 = require("../../../../codegenv2/boot.js"); +const message_js_1 = require("../../../../codegenv2/message.js"); +const enum_js_1 = require("../../../../codegenv2/enum.js"); +/** + * Describes the file google/protobuf/descriptor.proto. + */ +exports.file_google_protobuf_descriptor = (0, boot_js_1.boot)({ "name": "google/protobuf/descriptor.proto", "package": "google.protobuf", "messageType": [{ "name": "FileDescriptorSet", "field": [{ "name": "file", "number": 1, "type": 11, "label": 3, "typeName": ".google.protobuf.FileDescriptorProto" }], "extensionRange": [{ "start": 536000000, "end": 536000001 }] }, { "name": "FileDescriptorProto", "field": [{ "name": "name", "number": 1, "type": 9, "label": 1 }, { "name": "package", "number": 2, "type": 9, "label": 1 }, { "name": "dependency", "number": 3, "type": 9, "label": 3 }, { "name": "public_dependency", "number": 10, "type": 5, "label": 3 }, { "name": "weak_dependency", "number": 11, "type": 5, "label": 3 }, { "name": "option_dependency", "number": 15, "type": 9, "label": 3 }, { "name": "message_type", "number": 4, "type": 11, "label": 3, "typeName": ".google.protobuf.DescriptorProto" }, { "name": "enum_type", "number": 5, "type": 11, "label": 3, "typeName": ".google.protobuf.EnumDescriptorProto" }, { "name": "service", "number": 6, "type": 11, "label": 3, "typeName": ".google.protobuf.ServiceDescriptorProto" }, { "name": "extension", "number": 7, "type": 11, "label": 3, "typeName": ".google.protobuf.FieldDescriptorProto" }, { "name": "options", "number": 8, "type": 11, "label": 1, "typeName": ".google.protobuf.FileOptions" }, { "name": "source_code_info", "number": 9, "type": 11, "label": 1, "typeName": ".google.protobuf.SourceCodeInfo" }, { "name": "syntax", "number": 12, "type": 9, "label": 1 }, { "name": "edition", "number": 14, "type": 14, "label": 1, "typeName": ".google.protobuf.Edition" }] }, { "name": "DescriptorProto", "field": [{ "name": "name", "number": 1, "type": 9, "label": 1 }, { "name": "field", "number": 2, "type": 11, "label": 3, "typeName": ".google.protobuf.FieldDescriptorProto" }, { "name": "extension", "number": 6, "type": 11, "label": 3, "typeName": ".google.protobuf.FieldDescriptorProto" }, { "name": "nested_type", "number": 3, "type": 11, "label": 3, "typeName": ".google.protobuf.DescriptorProto" }, { "name": "enum_type", "number": 4, "type": 11, "label": 3, "typeName": ".google.protobuf.EnumDescriptorProto" }, { "name": "extension_range", "number": 5, "type": 11, "label": 3, "typeName": ".google.protobuf.DescriptorProto.ExtensionRange" }, { "name": "oneof_decl", "number": 8, "type": 11, "label": 3, "typeName": ".google.protobuf.OneofDescriptorProto" }, { "name": "options", "number": 7, "type": 11, "label": 1, "typeName": ".google.protobuf.MessageOptions" }, { "name": "reserved_range", "number": 9, "type": 11, "label": 3, "typeName": ".google.protobuf.DescriptorProto.ReservedRange" }, { "name": "reserved_name", "number": 10, "type": 9, "label": 3 }, { "name": "visibility", "number": 11, "type": 14, "label": 1, "typeName": ".google.protobuf.SymbolVisibility" }], "nestedType": [{ "name": "ExtensionRange", "field": [{ "name": "start", "number": 1, "type": 5, "label": 1 }, { "name": "end", "number": 2, "type": 5, "label": 1 }, { "name": "options", "number": 3, "type": 11, "label": 1, "typeName": ".google.protobuf.ExtensionRangeOptions" }] }, { "name": "ReservedRange", "field": [{ "name": "start", "number": 1, "type": 5, "label": 1 }, { "name": "end", "number": 2, "type": 5, "label": 1 }] }] }, { "name": "ExtensionRangeOptions", "field": [{ "name": "uninterpreted_option", "number": 999, "type": 11, "label": 3, "typeName": ".google.protobuf.UninterpretedOption" }, { "name": "declaration", "number": 2, "type": 11, "label": 3, "typeName": ".google.protobuf.ExtensionRangeOptions.Declaration", "options": { "retention": 2 } }, { "name": "features", "number": 50, "type": 11, "label": 1, "typeName": ".google.protobuf.FeatureSet" }, { "name": "verification", "number": 3, "type": 14, "label": 1, "typeName": ".google.protobuf.ExtensionRangeOptions.VerificationState", "defaultValue": "UNVERIFIED", "options": { "retention": 2 } }], "nestedType": [{ "name": "Declaration", "field": [{ "name": "number", "number": 1, "type": 5, "label": 1 }, { "name": "full_name", "number": 2, "type": 9, "label": 1 }, { "name": "type", "number": 3, "type": 9, "label": 1 }, { "name": "reserved", "number": 5, "type": 8, "label": 1 }, { "name": "repeated", "number": 6, "type": 8, "label": 1 }] }], "enumType": [{ "name": "VerificationState", "value": [{ "name": "DECLARATION", "number": 0 }, { "name": "UNVERIFIED", "number": 1 }] }], "extensionRange": [{ "start": 1000, "end": 536870912 }] }, { "name": "FieldDescriptorProto", "field": [{ "name": "name", "number": 1, "type": 9, "label": 1 }, { "name": "number", "number": 3, "type": 5, "label": 1 }, { "name": "label", "number": 4, "type": 14, "label": 1, "typeName": ".google.protobuf.FieldDescriptorProto.Label" }, { "name": "type", "number": 5, "type": 14, "label": 1, "typeName": ".google.protobuf.FieldDescriptorProto.Type" }, { "name": "type_name", "number": 6, "type": 9, "label": 1 }, { "name": "extendee", "number": 2, "type": 9, "label": 1 }, { "name": "default_value", "number": 7, "type": 9, "label": 1 }, { "name": "oneof_index", "number": 9, "type": 5, "label": 1 }, { "name": "json_name", "number": 10, "type": 9, "label": 1 }, { "name": "options", "number": 8, "type": 11, "label": 1, "typeName": ".google.protobuf.FieldOptions" }, { "name": "proto3_optional", "number": 17, "type": 8, "label": 1 }], "enumType": [{ "name": "Type", "value": [{ "name": "TYPE_DOUBLE", "number": 1 }, { "name": "TYPE_FLOAT", "number": 2 }, { "name": "TYPE_INT64", "number": 3 }, { "name": "TYPE_UINT64", "number": 4 }, { "name": "TYPE_INT32", "number": 5 }, { "name": "TYPE_FIXED64", "number": 6 }, { "name": "TYPE_FIXED32", "number": 7 }, { "name": "TYPE_BOOL", "number": 8 }, { "name": "TYPE_STRING", "number": 9 }, { "name": "TYPE_GROUP", "number": 10 }, { "name": "TYPE_MESSAGE", "number": 11 }, { "name": "TYPE_BYTES", "number": 12 }, { "name": "TYPE_UINT32", "number": 13 }, { "name": "TYPE_ENUM", "number": 14 }, { "name": "TYPE_SFIXED32", "number": 15 }, { "name": "TYPE_SFIXED64", "number": 16 }, { "name": "TYPE_SINT32", "number": 17 }, { "name": "TYPE_SINT64", "number": 18 }] }, { "name": "Label", "value": [{ "name": "LABEL_OPTIONAL", "number": 1 }, { "name": "LABEL_REPEATED", "number": 3 }, { "name": "LABEL_REQUIRED", "number": 2 }] }] }, { "name": "OneofDescriptorProto", "field": [{ "name": "name", "number": 1, "type": 9, "label": 1 }, { "name": "options", "number": 2, "type": 11, "label": 1, "typeName": ".google.protobuf.OneofOptions" }] }, { "name": "EnumDescriptorProto", "field": [{ "name": "name", "number": 1, "type": 9, "label": 1 }, { "name": "value", "number": 2, "type": 11, "label": 3, "typeName": ".google.protobuf.EnumValueDescriptorProto" }, { "name": "options", "number": 3, "type": 11, "label": 1, "typeName": ".google.protobuf.EnumOptions" }, { "name": "reserved_range", "number": 4, "type": 11, "label": 3, "typeName": ".google.protobuf.EnumDescriptorProto.EnumReservedRange" }, { "name": "reserved_name", "number": 5, "type": 9, "label": 3 }, { "name": "visibility", "number": 6, "type": 14, "label": 1, "typeName": ".google.protobuf.SymbolVisibility" }], "nestedType": [{ "name": "EnumReservedRange", "field": [{ "name": "start", "number": 1, "type": 5, "label": 1 }, { "name": "end", "number": 2, "type": 5, "label": 1 }] }] }, { "name": "EnumValueDescriptorProto", "field": [{ "name": "name", "number": 1, "type": 9, "label": 1 }, { "name": "number", "number": 2, "type": 5, "label": 1 }, { "name": "options", "number": 3, "type": 11, "label": 1, "typeName": ".google.protobuf.EnumValueOptions" }] }, { "name": "ServiceDescriptorProto", "field": [{ "name": "name", "number": 1, "type": 9, "label": 1 }, { "name": "method", "number": 2, "type": 11, "label": 3, "typeName": ".google.protobuf.MethodDescriptorProto" }, { "name": "options", "number": 3, "type": 11, "label": 1, "typeName": ".google.protobuf.ServiceOptions" }] }, { "name": "MethodDescriptorProto", "field": [{ "name": "name", "number": 1, "type": 9, "label": 1 }, { "name": "input_type", "number": 2, "type": 9, "label": 1 }, { "name": "output_type", "number": 3, "type": 9, "label": 1 }, { "name": "options", "number": 4, "type": 11, "label": 1, "typeName": ".google.protobuf.MethodOptions" }, { "name": "client_streaming", "number": 5, "type": 8, "label": 1, "defaultValue": "false" }, { "name": "server_streaming", "number": 6, "type": 8, "label": 1, "defaultValue": "false" }] }, { "name": "FileOptions", "field": [{ "name": "java_package", "number": 1, "type": 9, "label": 1 }, { "name": "java_outer_classname", "number": 8, "type": 9, "label": 1 }, { "name": "java_multiple_files", "number": 10, "type": 8, "label": 1, "defaultValue": "false", "options": {} }, { "name": "java_generate_equals_and_hash", "number": 20, "type": 8, "label": 1, "options": { "deprecated": true } }, { "name": "java_string_check_utf8", "number": 27, "type": 8, "label": 1, "defaultValue": "false" }, { "name": "optimize_for", "number": 9, "type": 14, "label": 1, "typeName": ".google.protobuf.FileOptions.OptimizeMode", "defaultValue": "SPEED" }, { "name": "go_package", "number": 11, "type": 9, "label": 1 }, { "name": "cc_generic_services", "number": 16, "type": 8, "label": 1, "defaultValue": "false" }, { "name": "java_generic_services", "number": 17, "type": 8, "label": 1, "defaultValue": "false" }, { "name": "py_generic_services", "number": 18, "type": 8, "label": 1, "defaultValue": "false" }, { "name": "deprecated", "number": 23, "type": 8, "label": 1, "defaultValue": "false" }, { "name": "cc_enable_arenas", "number": 31, "type": 8, "label": 1, "defaultValue": "true" }, { "name": "objc_class_prefix", "number": 36, "type": 9, "label": 1 }, { "name": "csharp_namespace", "number": 37, "type": 9, "label": 1 }, { "name": "swift_prefix", "number": 39, "type": 9, "label": 1 }, { "name": "php_class_prefix", "number": 40, "type": 9, "label": 1 }, { "name": "php_namespace", "number": 41, "type": 9, "label": 1 }, { "name": "php_metadata_namespace", "number": 44, "type": 9, "label": 1 }, { "name": "ruby_package", "number": 45, "type": 9, "label": 1 }, { "name": "features", "number": 50, "type": 11, "label": 1, "typeName": ".google.protobuf.FeatureSet" }, { "name": "uninterpreted_option", "number": 999, "type": 11, "label": 3, "typeName": ".google.protobuf.UninterpretedOption" }], "enumType": [{ "name": "OptimizeMode", "value": [{ "name": "SPEED", "number": 1 }, { "name": "CODE_SIZE", "number": 2 }, { "name": "LITE_RUNTIME", "number": 3 }] }], "extensionRange": [{ "start": 1000, "end": 536870912 }] }, { "name": "MessageOptions", "field": [{ "name": "message_set_wire_format", "number": 1, "type": 8, "label": 1, "defaultValue": "false" }, { "name": "no_standard_descriptor_accessor", "number": 2, "type": 8, "label": 1, "defaultValue": "false" }, { "name": "deprecated", "number": 3, "type": 8, "label": 1, "defaultValue": "false" }, { "name": "map_entry", "number": 7, "type": 8, "label": 1 }, { "name": "deprecated_legacy_json_field_conflicts", "number": 11, "type": 8, "label": 1, "options": { "deprecated": true } }, { "name": "features", "number": 12, "type": 11, "label": 1, "typeName": ".google.protobuf.FeatureSet" }, { "name": "uninterpreted_option", "number": 999, "type": 11, "label": 3, "typeName": ".google.protobuf.UninterpretedOption" }], "extensionRange": [{ "start": 1000, "end": 536870912 }] }, { "name": "FieldOptions", "field": [{ "name": "ctype", "number": 1, "type": 14, "label": 1, "typeName": ".google.protobuf.FieldOptions.CType", "defaultValue": "STRING" }, { "name": "packed", "number": 2, "type": 8, "label": 1 }, { "name": "jstype", "number": 6, "type": 14, "label": 1, "typeName": ".google.protobuf.FieldOptions.JSType", "defaultValue": "JS_NORMAL" }, { "name": "lazy", "number": 5, "type": 8, "label": 1, "defaultValue": "false" }, { "name": "unverified_lazy", "number": 15, "type": 8, "label": 1, "defaultValue": "false" }, { "name": "deprecated", "number": 3, "type": 8, "label": 1, "defaultValue": "false" }, { "name": "weak", "number": 10, "type": 8, "label": 1, "defaultValue": "false", "options": { "deprecated": true } }, { "name": "debug_redact", "number": 16, "type": 8, "label": 1, "defaultValue": "false" }, { "name": "retention", "number": 17, "type": 14, "label": 1, "typeName": ".google.protobuf.FieldOptions.OptionRetention" }, { "name": "targets", "number": 19, "type": 14, "label": 3, "typeName": ".google.protobuf.FieldOptions.OptionTargetType" }, { "name": "edition_defaults", "number": 20, "type": 11, "label": 3, "typeName": ".google.protobuf.FieldOptions.EditionDefault" }, { "name": "features", "number": 21, "type": 11, "label": 1, "typeName": ".google.protobuf.FeatureSet" }, { "name": "feature_support", "number": 22, "type": 11, "label": 1, "typeName": ".google.protobuf.FieldOptions.FeatureSupport" }, { "name": "uninterpreted_option", "number": 999, "type": 11, "label": 3, "typeName": ".google.protobuf.UninterpretedOption" }], "nestedType": [{ "name": "EditionDefault", "field": [{ "name": "edition", "number": 3, "type": 14, "label": 1, "typeName": ".google.protobuf.Edition" }, { "name": "value", "number": 2, "type": 9, "label": 1 }] }, { "name": "FeatureSupport", "field": [{ "name": "edition_introduced", "number": 1, "type": 14, "label": 1, "typeName": ".google.protobuf.Edition" }, { "name": "edition_deprecated", "number": 2, "type": 14, "label": 1, "typeName": ".google.protobuf.Edition" }, { "name": "deprecation_warning", "number": 3, "type": 9, "label": 1 }, { "name": "edition_removed", "number": 4, "type": 14, "label": 1, "typeName": ".google.protobuf.Edition" }, { "name": "removal_error", "number": 5, "type": 9, "label": 1 }] }], "enumType": [{ "name": "CType", "value": [{ "name": "STRING", "number": 0 }, { "name": "CORD", "number": 1 }, { "name": "STRING_PIECE", "number": 2 }] }, { "name": "JSType", "value": [{ "name": "JS_NORMAL", "number": 0 }, { "name": "JS_STRING", "number": 1 }, { "name": "JS_NUMBER", "number": 2 }] }, { "name": "OptionRetention", "value": [{ "name": "RETENTION_UNKNOWN", "number": 0 }, { "name": "RETENTION_RUNTIME", "number": 1 }, { "name": "RETENTION_SOURCE", "number": 2 }] }, { "name": "OptionTargetType", "value": [{ "name": "TARGET_TYPE_UNKNOWN", "number": 0 }, { "name": "TARGET_TYPE_FILE", "number": 1 }, { "name": "TARGET_TYPE_EXTENSION_RANGE", "number": 2 }, { "name": "TARGET_TYPE_MESSAGE", "number": 3 }, { "name": "TARGET_TYPE_FIELD", "number": 4 }, { "name": "TARGET_TYPE_ONEOF", "number": 5 }, { "name": "TARGET_TYPE_ENUM", "number": 6 }, { "name": "TARGET_TYPE_ENUM_ENTRY", "number": 7 }, { "name": "TARGET_TYPE_SERVICE", "number": 8 }, { "name": "TARGET_TYPE_METHOD", "number": 9 }] }], "extensionRange": [{ "start": 1000, "end": 536870912 }] }, { "name": "OneofOptions", "field": [{ "name": "features", "number": 1, "type": 11, "label": 1, "typeName": ".google.protobuf.FeatureSet" }, { "name": "uninterpreted_option", "number": 999, "type": 11, "label": 3, "typeName": ".google.protobuf.UninterpretedOption" }], "extensionRange": [{ "start": 1000, "end": 536870912 }] }, { "name": "EnumOptions", "field": [{ "name": "allow_alias", "number": 2, "type": 8, "label": 1 }, { "name": "deprecated", "number": 3, "type": 8, "label": 1, "defaultValue": "false" }, { "name": "deprecated_legacy_json_field_conflicts", "number": 6, "type": 8, "label": 1, "options": { "deprecated": true } }, { "name": "features", "number": 7, "type": 11, "label": 1, "typeName": ".google.protobuf.FeatureSet" }, { "name": "uninterpreted_option", "number": 999, "type": 11, "label": 3, "typeName": ".google.protobuf.UninterpretedOption" }], "extensionRange": [{ "start": 1000, "end": 536870912 }] }, { "name": "EnumValueOptions", "field": [{ "name": "deprecated", "number": 1, "type": 8, "label": 1, "defaultValue": "false" }, { "name": "features", "number": 2, "type": 11, "label": 1, "typeName": ".google.protobuf.FeatureSet" }, { "name": "debug_redact", "number": 3, "type": 8, "label": 1, "defaultValue": "false" }, { "name": "feature_support", "number": 4, "type": 11, "label": 1, "typeName": ".google.protobuf.FieldOptions.FeatureSupport" }, { "name": "uninterpreted_option", "number": 999, "type": 11, "label": 3, "typeName": ".google.protobuf.UninterpretedOption" }], "extensionRange": [{ "start": 1000, "end": 536870912 }] }, { "name": "ServiceOptions", "field": [{ "name": "features", "number": 34, "type": 11, "label": 1, "typeName": ".google.protobuf.FeatureSet" }, { "name": "deprecated", "number": 33, "type": 8, "label": 1, "defaultValue": "false" }, { "name": "uninterpreted_option", "number": 999, "type": 11, "label": 3, "typeName": ".google.protobuf.UninterpretedOption" }], "extensionRange": [{ "start": 1000, "end": 536870912 }] }, { "name": "MethodOptions", "field": [{ "name": "deprecated", "number": 33, "type": 8, "label": 1, "defaultValue": "false" }, { "name": "idempotency_level", "number": 34, "type": 14, "label": 1, "typeName": ".google.protobuf.MethodOptions.IdempotencyLevel", "defaultValue": "IDEMPOTENCY_UNKNOWN" }, { "name": "features", "number": 35, "type": 11, "label": 1, "typeName": ".google.protobuf.FeatureSet" }, { "name": "uninterpreted_option", "number": 999, "type": 11, "label": 3, "typeName": ".google.protobuf.UninterpretedOption" }], "enumType": [{ "name": "IdempotencyLevel", "value": [{ "name": "IDEMPOTENCY_UNKNOWN", "number": 0 }, { "name": "NO_SIDE_EFFECTS", "number": 1 }, { "name": "IDEMPOTENT", "number": 2 }] }], "extensionRange": [{ "start": 1000, "end": 536870912 }] }, { "name": "UninterpretedOption", "field": [{ "name": "name", "number": 2, "type": 11, "label": 3, "typeName": ".google.protobuf.UninterpretedOption.NamePart" }, { "name": "identifier_value", "number": 3, "type": 9, "label": 1 }, { "name": "positive_int_value", "number": 4, "type": 4, "label": 1 }, { "name": "negative_int_value", "number": 5, "type": 3, "label": 1 }, { "name": "double_value", "number": 6, "type": 1, "label": 1 }, { "name": "string_value", "number": 7, "type": 12, "label": 1 }, { "name": "aggregate_value", "number": 8, "type": 9, "label": 1 }], "nestedType": [{ "name": "NamePart", "field": [{ "name": "name_part", "number": 1, "type": 9, "label": 2 }, { "name": "is_extension", "number": 2, "type": 8, "label": 2 }] }] }, { "name": "FeatureSet", "field": [{ "name": "field_presence", "number": 1, "type": 14, "label": 1, "typeName": ".google.protobuf.FeatureSet.FieldPresence", "options": { "retention": 1, "targets": [4, 1], "editionDefaults": [{ "value": "EXPLICIT", "edition": 900 }, { "value": "IMPLICIT", "edition": 999 }, { "value": "EXPLICIT", "edition": 1000 }] } }, { "name": "enum_type", "number": 2, "type": 14, "label": 1, "typeName": ".google.protobuf.FeatureSet.EnumType", "options": { "retention": 1, "targets": [6, 1], "editionDefaults": [{ "value": "CLOSED", "edition": 900 }, { "value": "OPEN", "edition": 999 }] } }, { "name": "repeated_field_encoding", "number": 3, "type": 14, "label": 1, "typeName": ".google.protobuf.FeatureSet.RepeatedFieldEncoding", "options": { "retention": 1, "targets": [4, 1], "editionDefaults": [{ "value": "EXPANDED", "edition": 900 }, { "value": "PACKED", "edition": 999 }] } }, { "name": "utf8_validation", "number": 4, "type": 14, "label": 1, "typeName": ".google.protobuf.FeatureSet.Utf8Validation", "options": { "retention": 1, "targets": [4, 1], "editionDefaults": [{ "value": "NONE", "edition": 900 }, { "value": "VERIFY", "edition": 999 }] } }, { "name": "message_encoding", "number": 5, "type": 14, "label": 1, "typeName": ".google.protobuf.FeatureSet.MessageEncoding", "options": { "retention": 1, "targets": [4, 1], "editionDefaults": [{ "value": "LENGTH_PREFIXED", "edition": 900 }] } }, { "name": "json_format", "number": 6, "type": 14, "label": 1, "typeName": ".google.protobuf.FeatureSet.JsonFormat", "options": { "retention": 1, "targets": [3, 6, 1], "editionDefaults": [{ "value": "LEGACY_BEST_EFFORT", "edition": 900 }, { "value": "ALLOW", "edition": 999 }] } }, { "name": "enforce_naming_style", "number": 7, "type": 14, "label": 1, "typeName": ".google.protobuf.FeatureSet.EnforceNamingStyle", "options": { "retention": 2, "targets": [1, 2, 3, 4, 5, 6, 7, 8, 9], "editionDefaults": [{ "value": "STYLE_LEGACY", "edition": 900 }, { "value": "STYLE2024", "edition": 1001 }] } }, { "name": "default_symbol_visibility", "number": 8, "type": 14, "label": 1, "typeName": ".google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility", "options": { "retention": 2, "targets": [1], "editionDefaults": [{ "value": "EXPORT_ALL", "edition": 900 }, { "value": "EXPORT_TOP_LEVEL", "edition": 1001 }] } }], "nestedType": [{ "name": "VisibilityFeature", "enumType": [{ "name": "DefaultSymbolVisibility", "value": [{ "name": "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN", "number": 0 }, { "name": "EXPORT_ALL", "number": 1 }, { "name": "EXPORT_TOP_LEVEL", "number": 2 }, { "name": "LOCAL_ALL", "number": 3 }, { "name": "STRICT", "number": 4 }] }] }], "enumType": [{ "name": "FieldPresence", "value": [{ "name": "FIELD_PRESENCE_UNKNOWN", "number": 0 }, { "name": "EXPLICIT", "number": 1 }, { "name": "IMPLICIT", "number": 2 }, { "name": "LEGACY_REQUIRED", "number": 3 }] }, { "name": "EnumType", "value": [{ "name": "ENUM_TYPE_UNKNOWN", "number": 0 }, { "name": "OPEN", "number": 1 }, { "name": "CLOSED", "number": 2 }] }, { "name": "RepeatedFieldEncoding", "value": [{ "name": "REPEATED_FIELD_ENCODING_UNKNOWN", "number": 0 }, { "name": "PACKED", "number": 1 }, { "name": "EXPANDED", "number": 2 }] }, { "name": "Utf8Validation", "value": [{ "name": "UTF8_VALIDATION_UNKNOWN", "number": 0 }, { "name": "VERIFY", "number": 2 }, { "name": "NONE", "number": 3 }] }, { "name": "MessageEncoding", "value": [{ "name": "MESSAGE_ENCODING_UNKNOWN", "number": 0 }, { "name": "LENGTH_PREFIXED", "number": 1 }, { "name": "DELIMITED", "number": 2 }] }, { "name": "JsonFormat", "value": [{ "name": "JSON_FORMAT_UNKNOWN", "number": 0 }, { "name": "ALLOW", "number": 1 }, { "name": "LEGACY_BEST_EFFORT", "number": 2 }] }, { "name": "EnforceNamingStyle", "value": [{ "name": "ENFORCE_NAMING_STYLE_UNKNOWN", "number": 0 }, { "name": "STYLE2024", "number": 1 }, { "name": "STYLE_LEGACY", "number": 2 }] }], "extensionRange": [{ "start": 1000, "end": 9995 }, { "start": 9995, "end": 10000 }, { "start": 10000, "end": 10001 }] }, { "name": "FeatureSetDefaults", "field": [{ "name": "defaults", "number": 1, "type": 11, "label": 3, "typeName": ".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault" }, { "name": "minimum_edition", "number": 4, "type": 14, "label": 1, "typeName": ".google.protobuf.Edition" }, { "name": "maximum_edition", "number": 5, "type": 14, "label": 1, "typeName": ".google.protobuf.Edition" }], "nestedType": [{ "name": "FeatureSetEditionDefault", "field": [{ "name": "edition", "number": 3, "type": 14, "label": 1, "typeName": ".google.protobuf.Edition" }, { "name": "overridable_features", "number": 4, "type": 11, "label": 1, "typeName": ".google.protobuf.FeatureSet" }, { "name": "fixed_features", "number": 5, "type": 11, "label": 1, "typeName": ".google.protobuf.FeatureSet" }] }] }, { "name": "SourceCodeInfo", "field": [{ "name": "location", "number": 1, "type": 11, "label": 3, "typeName": ".google.protobuf.SourceCodeInfo.Location" }], "nestedType": [{ "name": "Location", "field": [{ "name": "path", "number": 1, "type": 5, "label": 3, "options": { "packed": true } }, { "name": "span", "number": 2, "type": 5, "label": 3, "options": { "packed": true } }, { "name": "leading_comments", "number": 3, "type": 9, "label": 1 }, { "name": "trailing_comments", "number": 4, "type": 9, "label": 1 }, { "name": "leading_detached_comments", "number": 6, "type": 9, "label": 3 }] }], "extensionRange": [{ "start": 536000000, "end": 536000001 }] }, { "name": "GeneratedCodeInfo", "field": [{ "name": "annotation", "number": 1, "type": 11, "label": 3, "typeName": ".google.protobuf.GeneratedCodeInfo.Annotation" }], "nestedType": [{ "name": "Annotation", "field": [{ "name": "path", "number": 1, "type": 5, "label": 3, "options": { "packed": true } }, { "name": "source_file", "number": 2, "type": 9, "label": 1 }, { "name": "begin", "number": 3, "type": 5, "label": 1 }, { "name": "end", "number": 4, "type": 5, "label": 1 }, { "name": "semantic", "number": 5, "type": 14, "label": 1, "typeName": ".google.protobuf.GeneratedCodeInfo.Annotation.Semantic" }], "enumType": [{ "name": "Semantic", "value": [{ "name": "NONE", "number": 0 }, { "name": "SET", "number": 1 }, { "name": "ALIAS", "number": 2 }] }] }] }], "enumType": [{ "name": "Edition", "value": [{ "name": "EDITION_UNKNOWN", "number": 0 }, { "name": "EDITION_LEGACY", "number": 900 }, { "name": "EDITION_PROTO2", "number": 998 }, { "name": "EDITION_PROTO3", "number": 999 }, { "name": "EDITION_2023", "number": 1000 }, { "name": "EDITION_2024", "number": 1001 }, { "name": "EDITION_UNSTABLE", "number": 9999 }, { "name": "EDITION_1_TEST_ONLY", "number": 1 }, { "name": "EDITION_2_TEST_ONLY", "number": 2 }, { "name": "EDITION_99997_TEST_ONLY", "number": 99997 }, { "name": "EDITION_99998_TEST_ONLY", "number": 99998 }, { "name": "EDITION_99999_TEST_ONLY", "number": 99999 }, { "name": "EDITION_MAX", "number": 2147483647 }] }, { "name": "SymbolVisibility", "value": [{ "name": "VISIBILITY_UNSET", "number": 0 }, { "name": "VISIBILITY_LOCAL", "number": 1 }, { "name": "VISIBILITY_EXPORT", "number": 2 }] }] }); +/** + * Describes the message google.protobuf.FileDescriptorSet. + * Use `create(FileDescriptorSetSchema)` to create a new message. + */ +exports.FileDescriptorSetSchema = (0, message_js_1.messageDesc)(exports.file_google_protobuf_descriptor, 0); +/** + * Describes the message google.protobuf.FileDescriptorProto. + * Use `create(FileDescriptorProtoSchema)` to create a new message. + */ +exports.FileDescriptorProtoSchema = (0, message_js_1.messageDesc)(exports.file_google_protobuf_descriptor, 1); +/** + * Describes the message google.protobuf.DescriptorProto. + * Use `create(DescriptorProtoSchema)` to create a new message. + */ +exports.DescriptorProtoSchema = (0, message_js_1.messageDesc)(exports.file_google_protobuf_descriptor, 2); +/** + * Describes the message google.protobuf.DescriptorProto.ExtensionRange. + * Use `create(DescriptorProto_ExtensionRangeSchema)` to create a new message. + */ +exports.DescriptorProto_ExtensionRangeSchema = (0, message_js_1.messageDesc)(exports.file_google_protobuf_descriptor, 2, 0); +/** + * Describes the message google.protobuf.DescriptorProto.ReservedRange. + * Use `create(DescriptorProto_ReservedRangeSchema)` to create a new message. + */ +exports.DescriptorProto_ReservedRangeSchema = (0, message_js_1.messageDesc)(exports.file_google_protobuf_descriptor, 2, 1); +/** + * Describes the message google.protobuf.ExtensionRangeOptions. + * Use `create(ExtensionRangeOptionsSchema)` to create a new message. + */ +exports.ExtensionRangeOptionsSchema = (0, message_js_1.messageDesc)(exports.file_google_protobuf_descriptor, 3); +/** + * Describes the message google.protobuf.ExtensionRangeOptions.Declaration. + * Use `create(ExtensionRangeOptions_DeclarationSchema)` to create a new message. + */ +exports.ExtensionRangeOptions_DeclarationSchema = (0, message_js_1.messageDesc)(exports.file_google_protobuf_descriptor, 3, 0); +/** + * The verification state of the extension range. + * + * @generated from enum google.protobuf.ExtensionRangeOptions.VerificationState + */ +var ExtensionRangeOptions_VerificationState; +(function (ExtensionRangeOptions_VerificationState) { + /** + * All the extensions of the range must be declared. + * + * @generated from enum value: DECLARATION = 0; + */ + ExtensionRangeOptions_VerificationState[ExtensionRangeOptions_VerificationState["DECLARATION"] = 0] = "DECLARATION"; + /** + * @generated from enum value: UNVERIFIED = 1; + */ + ExtensionRangeOptions_VerificationState[ExtensionRangeOptions_VerificationState["UNVERIFIED"] = 1] = "UNVERIFIED"; +})(ExtensionRangeOptions_VerificationState || (exports.ExtensionRangeOptions_VerificationState = ExtensionRangeOptions_VerificationState = {})); +/** + * Describes the enum google.protobuf.ExtensionRangeOptions.VerificationState. + */ +exports.ExtensionRangeOptions_VerificationStateSchema = (0, enum_js_1.enumDesc)(exports.file_google_protobuf_descriptor, 3, 0); +/** + * Describes the message google.protobuf.FieldDescriptorProto. + * Use `create(FieldDescriptorProtoSchema)` to create a new message. + */ +exports.FieldDescriptorProtoSchema = (0, message_js_1.messageDesc)(exports.file_google_protobuf_descriptor, 4); +/** + * @generated from enum google.protobuf.FieldDescriptorProto.Type + */ +var FieldDescriptorProto_Type; +(function (FieldDescriptorProto_Type) { + /** + * 0 is reserved for errors. + * Order is weird for historical reasons. + * + * @generated from enum value: TYPE_DOUBLE = 1; + */ + FieldDescriptorProto_Type[FieldDescriptorProto_Type["DOUBLE"] = 1] = "DOUBLE"; + /** + * @generated from enum value: TYPE_FLOAT = 2; + */ + FieldDescriptorProto_Type[FieldDescriptorProto_Type["FLOAT"] = 2] = "FLOAT"; + /** + * Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if + * negative values are likely. + * + * @generated from enum value: TYPE_INT64 = 3; + */ + FieldDescriptorProto_Type[FieldDescriptorProto_Type["INT64"] = 3] = "INT64"; + /** + * @generated from enum value: TYPE_UINT64 = 4; + */ + FieldDescriptorProto_Type[FieldDescriptorProto_Type["UINT64"] = 4] = "UINT64"; + /** + * Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if + * negative values are likely. + * + * @generated from enum value: TYPE_INT32 = 5; + */ + FieldDescriptorProto_Type[FieldDescriptorProto_Type["INT32"] = 5] = "INT32"; + /** + * @generated from enum value: TYPE_FIXED64 = 6; + */ + FieldDescriptorProto_Type[FieldDescriptorProto_Type["FIXED64"] = 6] = "FIXED64"; + /** + * @generated from enum value: TYPE_FIXED32 = 7; + */ + FieldDescriptorProto_Type[FieldDescriptorProto_Type["FIXED32"] = 7] = "FIXED32"; + /** + * @generated from enum value: TYPE_BOOL = 8; + */ + FieldDescriptorProto_Type[FieldDescriptorProto_Type["BOOL"] = 8] = "BOOL"; + /** + * @generated from enum value: TYPE_STRING = 9; + */ + FieldDescriptorProto_Type[FieldDescriptorProto_Type["STRING"] = 9] = "STRING"; + /** + * Tag-delimited aggregate. + * Group type is deprecated and not supported after google.protobuf. However, Proto3 + * implementations should still be able to parse the group wire format and + * treat group fields as unknown fields. In Editions, the group wire format + * can be enabled via the `message_encoding` feature. + * + * @generated from enum value: TYPE_GROUP = 10; + */ + FieldDescriptorProto_Type[FieldDescriptorProto_Type["GROUP"] = 10] = "GROUP"; + /** + * Length-delimited aggregate. + * + * @generated from enum value: TYPE_MESSAGE = 11; + */ + FieldDescriptorProto_Type[FieldDescriptorProto_Type["MESSAGE"] = 11] = "MESSAGE"; + /** + * New in version 2. + * + * @generated from enum value: TYPE_BYTES = 12; + */ + FieldDescriptorProto_Type[FieldDescriptorProto_Type["BYTES"] = 12] = "BYTES"; + /** + * @generated from enum value: TYPE_UINT32 = 13; + */ + FieldDescriptorProto_Type[FieldDescriptorProto_Type["UINT32"] = 13] = "UINT32"; + /** + * @generated from enum value: TYPE_ENUM = 14; + */ + FieldDescriptorProto_Type[FieldDescriptorProto_Type["ENUM"] = 14] = "ENUM"; + /** + * @generated from enum value: TYPE_SFIXED32 = 15; + */ + FieldDescriptorProto_Type[FieldDescriptorProto_Type["SFIXED32"] = 15] = "SFIXED32"; + /** + * @generated from enum value: TYPE_SFIXED64 = 16; + */ + FieldDescriptorProto_Type[FieldDescriptorProto_Type["SFIXED64"] = 16] = "SFIXED64"; + /** + * Uses ZigZag encoding. + * + * @generated from enum value: TYPE_SINT32 = 17; + */ + FieldDescriptorProto_Type[FieldDescriptorProto_Type["SINT32"] = 17] = "SINT32"; + /** + * Uses ZigZag encoding. + * + * @generated from enum value: TYPE_SINT64 = 18; + */ + FieldDescriptorProto_Type[FieldDescriptorProto_Type["SINT64"] = 18] = "SINT64"; +})(FieldDescriptorProto_Type || (exports.FieldDescriptorProto_Type = FieldDescriptorProto_Type = {})); +/** + * Describes the enum google.protobuf.FieldDescriptorProto.Type. + */ +exports.FieldDescriptorProto_TypeSchema = (0, enum_js_1.enumDesc)(exports.file_google_protobuf_descriptor, 4, 0); +/** + * @generated from enum google.protobuf.FieldDescriptorProto.Label + */ +var FieldDescriptorProto_Label; +(function (FieldDescriptorProto_Label) { + /** + * 0 is reserved for errors + * + * @generated from enum value: LABEL_OPTIONAL = 1; + */ + FieldDescriptorProto_Label[FieldDescriptorProto_Label["OPTIONAL"] = 1] = "OPTIONAL"; + /** + * @generated from enum value: LABEL_REPEATED = 3; + */ + FieldDescriptorProto_Label[FieldDescriptorProto_Label["REPEATED"] = 3] = "REPEATED"; + /** + * The required label is only allowed in google.protobuf. In proto3 and Editions + * it's explicitly prohibited. In Editions, the `field_presence` feature + * can be used to get this behavior. + * + * @generated from enum value: LABEL_REQUIRED = 2; + */ + FieldDescriptorProto_Label[FieldDescriptorProto_Label["REQUIRED"] = 2] = "REQUIRED"; +})(FieldDescriptorProto_Label || (exports.FieldDescriptorProto_Label = FieldDescriptorProto_Label = {})); +/** + * Describes the enum google.protobuf.FieldDescriptorProto.Label. + */ +exports.FieldDescriptorProto_LabelSchema = (0, enum_js_1.enumDesc)(exports.file_google_protobuf_descriptor, 4, 1); +/** + * Describes the message google.protobuf.OneofDescriptorProto. + * Use `create(OneofDescriptorProtoSchema)` to create a new message. + */ +exports.OneofDescriptorProtoSchema = (0, message_js_1.messageDesc)(exports.file_google_protobuf_descriptor, 5); +/** + * Describes the message google.protobuf.EnumDescriptorProto. + * Use `create(EnumDescriptorProtoSchema)` to create a new message. + */ +exports.EnumDescriptorProtoSchema = (0, message_js_1.messageDesc)(exports.file_google_protobuf_descriptor, 6); +/** + * Describes the message google.protobuf.EnumDescriptorProto.EnumReservedRange. + * Use `create(EnumDescriptorProto_EnumReservedRangeSchema)` to create a new message. + */ +exports.EnumDescriptorProto_EnumReservedRangeSchema = (0, message_js_1.messageDesc)(exports.file_google_protobuf_descriptor, 6, 0); +/** + * Describes the message google.protobuf.EnumValueDescriptorProto. + * Use `create(EnumValueDescriptorProtoSchema)` to create a new message. + */ +exports.EnumValueDescriptorProtoSchema = (0, message_js_1.messageDesc)(exports.file_google_protobuf_descriptor, 7); +/** + * Describes the message google.protobuf.ServiceDescriptorProto. + * Use `create(ServiceDescriptorProtoSchema)` to create a new message. + */ +exports.ServiceDescriptorProtoSchema = (0, message_js_1.messageDesc)(exports.file_google_protobuf_descriptor, 8); +/** + * Describes the message google.protobuf.MethodDescriptorProto. + * Use `create(MethodDescriptorProtoSchema)` to create a new message. + */ +exports.MethodDescriptorProtoSchema = (0, message_js_1.messageDesc)(exports.file_google_protobuf_descriptor, 9); +/** + * Describes the message google.protobuf.FileOptions. + * Use `create(FileOptionsSchema)` to create a new message. + */ +exports.FileOptionsSchema = (0, message_js_1.messageDesc)(exports.file_google_protobuf_descriptor, 10); +/** + * Generated classes can be optimized for speed or code size. + * + * @generated from enum google.protobuf.FileOptions.OptimizeMode + */ +var FileOptions_OptimizeMode; +(function (FileOptions_OptimizeMode) { + /** + * Generate complete code for parsing, serialization, + * + * @generated from enum value: SPEED = 1; + */ + FileOptions_OptimizeMode[FileOptions_OptimizeMode["SPEED"] = 1] = "SPEED"; + /** + * etc. + * + * Use ReflectionOps to implement these methods. + * + * @generated from enum value: CODE_SIZE = 2; + */ + FileOptions_OptimizeMode[FileOptions_OptimizeMode["CODE_SIZE"] = 2] = "CODE_SIZE"; + /** + * Generate code using MessageLite and the lite runtime. + * + * @generated from enum value: LITE_RUNTIME = 3; + */ + FileOptions_OptimizeMode[FileOptions_OptimizeMode["LITE_RUNTIME"] = 3] = "LITE_RUNTIME"; +})(FileOptions_OptimizeMode || (exports.FileOptions_OptimizeMode = FileOptions_OptimizeMode = {})); +/** + * Describes the enum google.protobuf.FileOptions.OptimizeMode. + */ +exports.FileOptions_OptimizeModeSchema = (0, enum_js_1.enumDesc)(exports.file_google_protobuf_descriptor, 10, 0); +/** + * Describes the message google.protobuf.MessageOptions. + * Use `create(MessageOptionsSchema)` to create a new message. + */ +exports.MessageOptionsSchema = (0, message_js_1.messageDesc)(exports.file_google_protobuf_descriptor, 11); +/** + * Describes the message google.protobuf.FieldOptions. + * Use `create(FieldOptionsSchema)` to create a new message. + */ +exports.FieldOptionsSchema = (0, message_js_1.messageDesc)(exports.file_google_protobuf_descriptor, 12); +/** + * Describes the message google.protobuf.FieldOptions.EditionDefault. + * Use `create(FieldOptions_EditionDefaultSchema)` to create a new message. + */ +exports.FieldOptions_EditionDefaultSchema = (0, message_js_1.messageDesc)(exports.file_google_protobuf_descriptor, 12, 0); +/** + * Describes the message google.protobuf.FieldOptions.FeatureSupport. + * Use `create(FieldOptions_FeatureSupportSchema)` to create a new message. + */ +exports.FieldOptions_FeatureSupportSchema = (0, message_js_1.messageDesc)(exports.file_google_protobuf_descriptor, 12, 1); +/** + * @generated from enum google.protobuf.FieldOptions.CType + */ +var FieldOptions_CType; +(function (FieldOptions_CType) { + /** + * Default mode. + * + * @generated from enum value: STRING = 0; + */ + FieldOptions_CType[FieldOptions_CType["STRING"] = 0] = "STRING"; + /** + * The option [ctype=CORD] may be applied to a non-repeated field of type + * "bytes". It indicates that in C++, the data should be stored in a Cord + * instead of a string. For very large strings, this may reduce memory + * fragmentation. It may also allow better performance when parsing from a + * Cord, or when parsing with aliasing enabled, as the parsed Cord may then + * alias the original buffer. + * + * @generated from enum value: CORD = 1; + */ + FieldOptions_CType[FieldOptions_CType["CORD"] = 1] = "CORD"; + /** + * @generated from enum value: STRING_PIECE = 2; + */ + FieldOptions_CType[FieldOptions_CType["STRING_PIECE"] = 2] = "STRING_PIECE"; +})(FieldOptions_CType || (exports.FieldOptions_CType = FieldOptions_CType = {})); +/** + * Describes the enum google.protobuf.FieldOptions.CType. + */ +exports.FieldOptions_CTypeSchema = (0, enum_js_1.enumDesc)(exports.file_google_protobuf_descriptor, 12, 0); +/** + * @generated from enum google.protobuf.FieldOptions.JSType + */ +var FieldOptions_JSType; +(function (FieldOptions_JSType) { + /** + * Use the default type. + * + * @generated from enum value: JS_NORMAL = 0; + */ + FieldOptions_JSType[FieldOptions_JSType["JS_NORMAL"] = 0] = "JS_NORMAL"; + /** + * Use JavaScript strings. + * + * @generated from enum value: JS_STRING = 1; + */ + FieldOptions_JSType[FieldOptions_JSType["JS_STRING"] = 1] = "JS_STRING"; + /** + * Use JavaScript numbers. + * + * @generated from enum value: JS_NUMBER = 2; + */ + FieldOptions_JSType[FieldOptions_JSType["JS_NUMBER"] = 2] = "JS_NUMBER"; +})(FieldOptions_JSType || (exports.FieldOptions_JSType = FieldOptions_JSType = {})); +/** + * Describes the enum google.protobuf.FieldOptions.JSType. + */ +exports.FieldOptions_JSTypeSchema = (0, enum_js_1.enumDesc)(exports.file_google_protobuf_descriptor, 12, 1); +/** + * If set to RETENTION_SOURCE, the option will be omitted from the binary. + * + * @generated from enum google.protobuf.FieldOptions.OptionRetention + */ +var FieldOptions_OptionRetention; +(function (FieldOptions_OptionRetention) { + /** + * @generated from enum value: RETENTION_UNKNOWN = 0; + */ + FieldOptions_OptionRetention[FieldOptions_OptionRetention["RETENTION_UNKNOWN"] = 0] = "RETENTION_UNKNOWN"; + /** + * @generated from enum value: RETENTION_RUNTIME = 1; + */ + FieldOptions_OptionRetention[FieldOptions_OptionRetention["RETENTION_RUNTIME"] = 1] = "RETENTION_RUNTIME"; + /** + * @generated from enum value: RETENTION_SOURCE = 2; + */ + FieldOptions_OptionRetention[FieldOptions_OptionRetention["RETENTION_SOURCE"] = 2] = "RETENTION_SOURCE"; +})(FieldOptions_OptionRetention || (exports.FieldOptions_OptionRetention = FieldOptions_OptionRetention = {})); +/** + * Describes the enum google.protobuf.FieldOptions.OptionRetention. + */ +exports.FieldOptions_OptionRetentionSchema = (0, enum_js_1.enumDesc)(exports.file_google_protobuf_descriptor, 12, 2); +/** + * This indicates the types of entities that the field may apply to when used + * as an option. If it is unset, then the field may be freely used as an + * option on any kind of entity. + * + * @generated from enum google.protobuf.FieldOptions.OptionTargetType + */ +var FieldOptions_OptionTargetType; +(function (FieldOptions_OptionTargetType) { + /** + * @generated from enum value: TARGET_TYPE_UNKNOWN = 0; + */ + FieldOptions_OptionTargetType[FieldOptions_OptionTargetType["TARGET_TYPE_UNKNOWN"] = 0] = "TARGET_TYPE_UNKNOWN"; + /** + * @generated from enum value: TARGET_TYPE_FILE = 1; + */ + FieldOptions_OptionTargetType[FieldOptions_OptionTargetType["TARGET_TYPE_FILE"] = 1] = "TARGET_TYPE_FILE"; + /** + * @generated from enum value: TARGET_TYPE_EXTENSION_RANGE = 2; + */ + FieldOptions_OptionTargetType[FieldOptions_OptionTargetType["TARGET_TYPE_EXTENSION_RANGE"] = 2] = "TARGET_TYPE_EXTENSION_RANGE"; + /** + * @generated from enum value: TARGET_TYPE_MESSAGE = 3; + */ + FieldOptions_OptionTargetType[FieldOptions_OptionTargetType["TARGET_TYPE_MESSAGE"] = 3] = "TARGET_TYPE_MESSAGE"; + /** + * @generated from enum value: TARGET_TYPE_FIELD = 4; + */ + FieldOptions_OptionTargetType[FieldOptions_OptionTargetType["TARGET_TYPE_FIELD"] = 4] = "TARGET_TYPE_FIELD"; + /** + * @generated from enum value: TARGET_TYPE_ONEOF = 5; + */ + FieldOptions_OptionTargetType[FieldOptions_OptionTargetType["TARGET_TYPE_ONEOF"] = 5] = "TARGET_TYPE_ONEOF"; + /** + * @generated from enum value: TARGET_TYPE_ENUM = 6; + */ + FieldOptions_OptionTargetType[FieldOptions_OptionTargetType["TARGET_TYPE_ENUM"] = 6] = "TARGET_TYPE_ENUM"; + /** + * @generated from enum value: TARGET_TYPE_ENUM_ENTRY = 7; + */ + FieldOptions_OptionTargetType[FieldOptions_OptionTargetType["TARGET_TYPE_ENUM_ENTRY"] = 7] = "TARGET_TYPE_ENUM_ENTRY"; + /** + * @generated from enum value: TARGET_TYPE_SERVICE = 8; + */ + FieldOptions_OptionTargetType[FieldOptions_OptionTargetType["TARGET_TYPE_SERVICE"] = 8] = "TARGET_TYPE_SERVICE"; + /** + * @generated from enum value: TARGET_TYPE_METHOD = 9; + */ + FieldOptions_OptionTargetType[FieldOptions_OptionTargetType["TARGET_TYPE_METHOD"] = 9] = "TARGET_TYPE_METHOD"; +})(FieldOptions_OptionTargetType || (exports.FieldOptions_OptionTargetType = FieldOptions_OptionTargetType = {})); +/** + * Describes the enum google.protobuf.FieldOptions.OptionTargetType. + */ +exports.FieldOptions_OptionTargetTypeSchema = (0, enum_js_1.enumDesc)(exports.file_google_protobuf_descriptor, 12, 3); +/** + * Describes the message google.protobuf.OneofOptions. + * Use `create(OneofOptionsSchema)` to create a new message. + */ +exports.OneofOptionsSchema = (0, message_js_1.messageDesc)(exports.file_google_protobuf_descriptor, 13); +/** + * Describes the message google.protobuf.EnumOptions. + * Use `create(EnumOptionsSchema)` to create a new message. + */ +exports.EnumOptionsSchema = (0, message_js_1.messageDesc)(exports.file_google_protobuf_descriptor, 14); +/** + * Describes the message google.protobuf.EnumValueOptions. + * Use `create(EnumValueOptionsSchema)` to create a new message. + */ +exports.EnumValueOptionsSchema = (0, message_js_1.messageDesc)(exports.file_google_protobuf_descriptor, 15); +/** + * Describes the message google.protobuf.ServiceOptions. + * Use `create(ServiceOptionsSchema)` to create a new message. + */ +exports.ServiceOptionsSchema = (0, message_js_1.messageDesc)(exports.file_google_protobuf_descriptor, 16); +/** + * Describes the message google.protobuf.MethodOptions. + * Use `create(MethodOptionsSchema)` to create a new message. + */ +exports.MethodOptionsSchema = (0, message_js_1.messageDesc)(exports.file_google_protobuf_descriptor, 17); +/** + * Is this method side-effect-free (or safe in HTTP parlance), or idempotent, + * or neither? HTTP based RPC implementation may choose GET verb for safe + * methods, and PUT verb for idempotent methods instead of the default POST. + * + * @generated from enum google.protobuf.MethodOptions.IdempotencyLevel + */ +var MethodOptions_IdempotencyLevel; +(function (MethodOptions_IdempotencyLevel) { + /** + * @generated from enum value: IDEMPOTENCY_UNKNOWN = 0; + */ + MethodOptions_IdempotencyLevel[MethodOptions_IdempotencyLevel["IDEMPOTENCY_UNKNOWN"] = 0] = "IDEMPOTENCY_UNKNOWN"; + /** + * implies idempotent + * + * @generated from enum value: NO_SIDE_EFFECTS = 1; + */ + MethodOptions_IdempotencyLevel[MethodOptions_IdempotencyLevel["NO_SIDE_EFFECTS"] = 1] = "NO_SIDE_EFFECTS"; + /** + * idempotent, but may have side effects + * + * @generated from enum value: IDEMPOTENT = 2; + */ + MethodOptions_IdempotencyLevel[MethodOptions_IdempotencyLevel["IDEMPOTENT"] = 2] = "IDEMPOTENT"; +})(MethodOptions_IdempotencyLevel || (exports.MethodOptions_IdempotencyLevel = MethodOptions_IdempotencyLevel = {})); +/** + * Describes the enum google.protobuf.MethodOptions.IdempotencyLevel. + */ +exports.MethodOptions_IdempotencyLevelSchema = (0, enum_js_1.enumDesc)(exports.file_google_protobuf_descriptor, 17, 0); +/** + * Describes the message google.protobuf.UninterpretedOption. + * Use `create(UninterpretedOptionSchema)` to create a new message. + */ +exports.UninterpretedOptionSchema = (0, message_js_1.messageDesc)(exports.file_google_protobuf_descriptor, 18); +/** + * Describes the message google.protobuf.UninterpretedOption.NamePart. + * Use `create(UninterpretedOption_NamePartSchema)` to create a new message. + */ +exports.UninterpretedOption_NamePartSchema = (0, message_js_1.messageDesc)(exports.file_google_protobuf_descriptor, 18, 0); +/** + * Describes the message google.protobuf.FeatureSet. + * Use `create(FeatureSetSchema)` to create a new message. + */ +exports.FeatureSetSchema = (0, message_js_1.messageDesc)(exports.file_google_protobuf_descriptor, 19); +/** + * Describes the message google.protobuf.FeatureSet.VisibilityFeature. + * Use `create(FeatureSet_VisibilityFeatureSchema)` to create a new message. + */ +exports.FeatureSet_VisibilityFeatureSchema = (0, message_js_1.messageDesc)(exports.file_google_protobuf_descriptor, 19, 0); +/** + * @generated from enum google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility + */ +var FeatureSet_VisibilityFeature_DefaultSymbolVisibility; +(function (FeatureSet_VisibilityFeature_DefaultSymbolVisibility) { + /** + * @generated from enum value: DEFAULT_SYMBOL_VISIBILITY_UNKNOWN = 0; + */ + FeatureSet_VisibilityFeature_DefaultSymbolVisibility[FeatureSet_VisibilityFeature_DefaultSymbolVisibility["DEFAULT_SYMBOL_VISIBILITY_UNKNOWN"] = 0] = "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN"; + /** + * Default pre-EDITION_2024, all UNSET visibility are export. + * + * @generated from enum value: EXPORT_ALL = 1; + */ + FeatureSet_VisibilityFeature_DefaultSymbolVisibility[FeatureSet_VisibilityFeature_DefaultSymbolVisibility["EXPORT_ALL"] = 1] = "EXPORT_ALL"; + /** + * All top-level symbols default to export, nested default to local. + * + * @generated from enum value: EXPORT_TOP_LEVEL = 2; + */ + FeatureSet_VisibilityFeature_DefaultSymbolVisibility[FeatureSet_VisibilityFeature_DefaultSymbolVisibility["EXPORT_TOP_LEVEL"] = 2] = "EXPORT_TOP_LEVEL"; + /** + * All symbols default to local. + * + * @generated from enum value: LOCAL_ALL = 3; + */ + FeatureSet_VisibilityFeature_DefaultSymbolVisibility[FeatureSet_VisibilityFeature_DefaultSymbolVisibility["LOCAL_ALL"] = 3] = "LOCAL_ALL"; + /** + * All symbols local by default. Nested types cannot be exported. + * With special case caveat for message { enum {} reserved 1 to max; } + * This is the recommended setting for new protos. + * + * @generated from enum value: STRICT = 4; + */ + FeatureSet_VisibilityFeature_DefaultSymbolVisibility[FeatureSet_VisibilityFeature_DefaultSymbolVisibility["STRICT"] = 4] = "STRICT"; +})(FeatureSet_VisibilityFeature_DefaultSymbolVisibility || (exports.FeatureSet_VisibilityFeature_DefaultSymbolVisibility = FeatureSet_VisibilityFeature_DefaultSymbolVisibility = {})); +/** + * Describes the enum google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility. + */ +exports.FeatureSet_VisibilityFeature_DefaultSymbolVisibilitySchema = (0, enum_js_1.enumDesc)(exports.file_google_protobuf_descriptor, 19, 0, 0); +/** + * @generated from enum google.protobuf.FeatureSet.FieldPresence + */ +var FeatureSet_FieldPresence; +(function (FeatureSet_FieldPresence) { + /** + * @generated from enum value: FIELD_PRESENCE_UNKNOWN = 0; + */ + FeatureSet_FieldPresence[FeatureSet_FieldPresence["FIELD_PRESENCE_UNKNOWN"] = 0] = "FIELD_PRESENCE_UNKNOWN"; + /** + * @generated from enum value: EXPLICIT = 1; + */ + FeatureSet_FieldPresence[FeatureSet_FieldPresence["EXPLICIT"] = 1] = "EXPLICIT"; + /** + * @generated from enum value: IMPLICIT = 2; + */ + FeatureSet_FieldPresence[FeatureSet_FieldPresence["IMPLICIT"] = 2] = "IMPLICIT"; + /** + * @generated from enum value: LEGACY_REQUIRED = 3; + */ + FeatureSet_FieldPresence[FeatureSet_FieldPresence["LEGACY_REQUIRED"] = 3] = "LEGACY_REQUIRED"; +})(FeatureSet_FieldPresence || (exports.FeatureSet_FieldPresence = FeatureSet_FieldPresence = {})); +/** + * Describes the enum google.protobuf.FeatureSet.FieldPresence. + */ +exports.FeatureSet_FieldPresenceSchema = (0, enum_js_1.enumDesc)(exports.file_google_protobuf_descriptor, 19, 0); +/** + * @generated from enum google.protobuf.FeatureSet.EnumType + */ +var FeatureSet_EnumType; +(function (FeatureSet_EnumType) { + /** + * @generated from enum value: ENUM_TYPE_UNKNOWN = 0; + */ + FeatureSet_EnumType[FeatureSet_EnumType["ENUM_TYPE_UNKNOWN"] = 0] = "ENUM_TYPE_UNKNOWN"; + /** + * @generated from enum value: OPEN = 1; + */ + FeatureSet_EnumType[FeatureSet_EnumType["OPEN"] = 1] = "OPEN"; + /** + * @generated from enum value: CLOSED = 2; + */ + FeatureSet_EnumType[FeatureSet_EnumType["CLOSED"] = 2] = "CLOSED"; +})(FeatureSet_EnumType || (exports.FeatureSet_EnumType = FeatureSet_EnumType = {})); +/** + * Describes the enum google.protobuf.FeatureSet.EnumType. + */ +exports.FeatureSet_EnumTypeSchema = (0, enum_js_1.enumDesc)(exports.file_google_protobuf_descriptor, 19, 1); +/** + * @generated from enum google.protobuf.FeatureSet.RepeatedFieldEncoding + */ +var FeatureSet_RepeatedFieldEncoding; +(function (FeatureSet_RepeatedFieldEncoding) { + /** + * @generated from enum value: REPEATED_FIELD_ENCODING_UNKNOWN = 0; + */ + FeatureSet_RepeatedFieldEncoding[FeatureSet_RepeatedFieldEncoding["REPEATED_FIELD_ENCODING_UNKNOWN"] = 0] = "REPEATED_FIELD_ENCODING_UNKNOWN"; + /** + * @generated from enum value: PACKED = 1; + */ + FeatureSet_RepeatedFieldEncoding[FeatureSet_RepeatedFieldEncoding["PACKED"] = 1] = "PACKED"; + /** + * @generated from enum value: EXPANDED = 2; + */ + FeatureSet_RepeatedFieldEncoding[FeatureSet_RepeatedFieldEncoding["EXPANDED"] = 2] = "EXPANDED"; +})(FeatureSet_RepeatedFieldEncoding || (exports.FeatureSet_RepeatedFieldEncoding = FeatureSet_RepeatedFieldEncoding = {})); +/** + * Describes the enum google.protobuf.FeatureSet.RepeatedFieldEncoding. + */ +exports.FeatureSet_RepeatedFieldEncodingSchema = (0, enum_js_1.enumDesc)(exports.file_google_protobuf_descriptor, 19, 2); +/** + * @generated from enum google.protobuf.FeatureSet.Utf8Validation + */ +var FeatureSet_Utf8Validation; +(function (FeatureSet_Utf8Validation) { + /** + * @generated from enum value: UTF8_VALIDATION_UNKNOWN = 0; + */ + FeatureSet_Utf8Validation[FeatureSet_Utf8Validation["UTF8_VALIDATION_UNKNOWN"] = 0] = "UTF8_VALIDATION_UNKNOWN"; + /** + * @generated from enum value: VERIFY = 2; + */ + FeatureSet_Utf8Validation[FeatureSet_Utf8Validation["VERIFY"] = 2] = "VERIFY"; + /** + * @generated from enum value: NONE = 3; + */ + FeatureSet_Utf8Validation[FeatureSet_Utf8Validation["NONE"] = 3] = "NONE"; +})(FeatureSet_Utf8Validation || (exports.FeatureSet_Utf8Validation = FeatureSet_Utf8Validation = {})); +/** + * Describes the enum google.protobuf.FeatureSet.Utf8Validation. + */ +exports.FeatureSet_Utf8ValidationSchema = (0, enum_js_1.enumDesc)(exports.file_google_protobuf_descriptor, 19, 3); +/** + * @generated from enum google.protobuf.FeatureSet.MessageEncoding + */ +var FeatureSet_MessageEncoding; +(function (FeatureSet_MessageEncoding) { + /** + * @generated from enum value: MESSAGE_ENCODING_UNKNOWN = 0; + */ + FeatureSet_MessageEncoding[FeatureSet_MessageEncoding["MESSAGE_ENCODING_UNKNOWN"] = 0] = "MESSAGE_ENCODING_UNKNOWN"; + /** + * @generated from enum value: LENGTH_PREFIXED = 1; + */ + FeatureSet_MessageEncoding[FeatureSet_MessageEncoding["LENGTH_PREFIXED"] = 1] = "LENGTH_PREFIXED"; + /** + * @generated from enum value: DELIMITED = 2; + */ + FeatureSet_MessageEncoding[FeatureSet_MessageEncoding["DELIMITED"] = 2] = "DELIMITED"; +})(FeatureSet_MessageEncoding || (exports.FeatureSet_MessageEncoding = FeatureSet_MessageEncoding = {})); +/** + * Describes the enum google.protobuf.FeatureSet.MessageEncoding. + */ +exports.FeatureSet_MessageEncodingSchema = (0, enum_js_1.enumDesc)(exports.file_google_protobuf_descriptor, 19, 4); +/** + * @generated from enum google.protobuf.FeatureSet.JsonFormat + */ +var FeatureSet_JsonFormat; +(function (FeatureSet_JsonFormat) { + /** + * @generated from enum value: JSON_FORMAT_UNKNOWN = 0; + */ + FeatureSet_JsonFormat[FeatureSet_JsonFormat["JSON_FORMAT_UNKNOWN"] = 0] = "JSON_FORMAT_UNKNOWN"; + /** + * @generated from enum value: ALLOW = 1; + */ + FeatureSet_JsonFormat[FeatureSet_JsonFormat["ALLOW"] = 1] = "ALLOW"; + /** + * @generated from enum value: LEGACY_BEST_EFFORT = 2; + */ + FeatureSet_JsonFormat[FeatureSet_JsonFormat["LEGACY_BEST_EFFORT"] = 2] = "LEGACY_BEST_EFFORT"; +})(FeatureSet_JsonFormat || (exports.FeatureSet_JsonFormat = FeatureSet_JsonFormat = {})); +/** + * Describes the enum google.protobuf.FeatureSet.JsonFormat. + */ +exports.FeatureSet_JsonFormatSchema = (0, enum_js_1.enumDesc)(exports.file_google_protobuf_descriptor, 19, 5); +/** + * @generated from enum google.protobuf.FeatureSet.EnforceNamingStyle + */ +var FeatureSet_EnforceNamingStyle; +(function (FeatureSet_EnforceNamingStyle) { + /** + * @generated from enum value: ENFORCE_NAMING_STYLE_UNKNOWN = 0; + */ + FeatureSet_EnforceNamingStyle[FeatureSet_EnforceNamingStyle["ENFORCE_NAMING_STYLE_UNKNOWN"] = 0] = "ENFORCE_NAMING_STYLE_UNKNOWN"; + /** + * @generated from enum value: STYLE2024 = 1; + */ + FeatureSet_EnforceNamingStyle[FeatureSet_EnforceNamingStyle["STYLE2024"] = 1] = "STYLE2024"; + /** + * @generated from enum value: STYLE_LEGACY = 2; + */ + FeatureSet_EnforceNamingStyle[FeatureSet_EnforceNamingStyle["STYLE_LEGACY"] = 2] = "STYLE_LEGACY"; +})(FeatureSet_EnforceNamingStyle || (exports.FeatureSet_EnforceNamingStyle = FeatureSet_EnforceNamingStyle = {})); +/** + * Describes the enum google.protobuf.FeatureSet.EnforceNamingStyle. + */ +exports.FeatureSet_EnforceNamingStyleSchema = (0, enum_js_1.enumDesc)(exports.file_google_protobuf_descriptor, 19, 6); +/** + * Describes the message google.protobuf.FeatureSetDefaults. + * Use `create(FeatureSetDefaultsSchema)` to create a new message. + */ +exports.FeatureSetDefaultsSchema = (0, message_js_1.messageDesc)(exports.file_google_protobuf_descriptor, 20); +/** + * Describes the message google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault. + * Use `create(FeatureSetDefaults_FeatureSetEditionDefaultSchema)` to create a new message. + */ +exports.FeatureSetDefaults_FeatureSetEditionDefaultSchema = (0, message_js_1.messageDesc)(exports.file_google_protobuf_descriptor, 20, 0); +/** + * Describes the message google.protobuf.SourceCodeInfo. + * Use `create(SourceCodeInfoSchema)` to create a new message. + */ +exports.SourceCodeInfoSchema = (0, message_js_1.messageDesc)(exports.file_google_protobuf_descriptor, 21); +/** + * Describes the message google.protobuf.SourceCodeInfo.Location. + * Use `create(SourceCodeInfo_LocationSchema)` to create a new message. + */ +exports.SourceCodeInfo_LocationSchema = (0, message_js_1.messageDesc)(exports.file_google_protobuf_descriptor, 21, 0); +/** + * Describes the message google.protobuf.GeneratedCodeInfo. + * Use `create(GeneratedCodeInfoSchema)` to create a new message. + */ +exports.GeneratedCodeInfoSchema = (0, message_js_1.messageDesc)(exports.file_google_protobuf_descriptor, 22); +/** + * Describes the message google.protobuf.GeneratedCodeInfo.Annotation. + * Use `create(GeneratedCodeInfo_AnnotationSchema)` to create a new message. + */ +exports.GeneratedCodeInfo_AnnotationSchema = (0, message_js_1.messageDesc)(exports.file_google_protobuf_descriptor, 22, 0); +/** + * Represents the identified object's effect on the element in the original + * .proto file. + * + * @generated from enum google.protobuf.GeneratedCodeInfo.Annotation.Semantic + */ +var GeneratedCodeInfo_Annotation_Semantic; +(function (GeneratedCodeInfo_Annotation_Semantic) { + /** + * There is no effect or the effect is indescribable. + * + * @generated from enum value: NONE = 0; + */ + GeneratedCodeInfo_Annotation_Semantic[GeneratedCodeInfo_Annotation_Semantic["NONE"] = 0] = "NONE"; + /** + * The element is set or otherwise mutated. + * + * @generated from enum value: SET = 1; + */ + GeneratedCodeInfo_Annotation_Semantic[GeneratedCodeInfo_Annotation_Semantic["SET"] = 1] = "SET"; + /** + * An alias to the element is returned. + * + * @generated from enum value: ALIAS = 2; + */ + GeneratedCodeInfo_Annotation_Semantic[GeneratedCodeInfo_Annotation_Semantic["ALIAS"] = 2] = "ALIAS"; +})(GeneratedCodeInfo_Annotation_Semantic || (exports.GeneratedCodeInfo_Annotation_Semantic = GeneratedCodeInfo_Annotation_Semantic = {})); +/** + * Describes the enum google.protobuf.GeneratedCodeInfo.Annotation.Semantic. + */ +exports.GeneratedCodeInfo_Annotation_SemanticSchema = (0, enum_js_1.enumDesc)(exports.file_google_protobuf_descriptor, 22, 0, 0); +/** + * The full set of known editions. + * + * @generated from enum google.protobuf.Edition + */ +var Edition; +(function (Edition) { + /** + * A placeholder for an unknown edition value. + * + * @generated from enum value: EDITION_UNKNOWN = 0; + */ + Edition[Edition["EDITION_UNKNOWN"] = 0] = "EDITION_UNKNOWN"; + /** + * A placeholder edition for specifying default behaviors *before* a feature + * was first introduced. This is effectively an "infinite past". + * + * @generated from enum value: EDITION_LEGACY = 900; + */ + Edition[Edition["EDITION_LEGACY"] = 900] = "EDITION_LEGACY"; + /** + * Legacy syntax "editions". These pre-date editions, but behave much like + * distinct editions. These can't be used to specify the edition of proto + * files, but feature definitions must supply proto2/proto3 defaults for + * backwards compatibility. + * + * @generated from enum value: EDITION_PROTO2 = 998; + */ + Edition[Edition["EDITION_PROTO2"] = 998] = "EDITION_PROTO2"; + /** + * @generated from enum value: EDITION_PROTO3 = 999; + */ + Edition[Edition["EDITION_PROTO3"] = 999] = "EDITION_PROTO3"; + /** + * Editions that have been released. The specific values are arbitrary and + * should not be depended on, but they will always be time-ordered for easy + * comparison. + * + * @generated from enum value: EDITION_2023 = 1000; + */ + Edition[Edition["EDITION_2023"] = 1000] = "EDITION_2023"; + /** + * @generated from enum value: EDITION_2024 = 1001; + */ + Edition[Edition["EDITION_2024"] = 1001] = "EDITION_2024"; + /** + * A placeholder edition for developing and testing unscheduled features. + * + * @generated from enum value: EDITION_UNSTABLE = 9999; + */ + Edition[Edition["EDITION_UNSTABLE"] = 9999] = "EDITION_UNSTABLE"; + /** + * Placeholder editions for testing feature resolution. These should not be + * used or relied on outside of tests. + * + * @generated from enum value: EDITION_1_TEST_ONLY = 1; + */ + Edition[Edition["EDITION_1_TEST_ONLY"] = 1] = "EDITION_1_TEST_ONLY"; + /** + * @generated from enum value: EDITION_2_TEST_ONLY = 2; + */ + Edition[Edition["EDITION_2_TEST_ONLY"] = 2] = "EDITION_2_TEST_ONLY"; + /** + * @generated from enum value: EDITION_99997_TEST_ONLY = 99997; + */ + Edition[Edition["EDITION_99997_TEST_ONLY"] = 99997] = "EDITION_99997_TEST_ONLY"; + /** + * @generated from enum value: EDITION_99998_TEST_ONLY = 99998; + */ + Edition[Edition["EDITION_99998_TEST_ONLY"] = 99998] = "EDITION_99998_TEST_ONLY"; + /** + * @generated from enum value: EDITION_99999_TEST_ONLY = 99999; + */ + Edition[Edition["EDITION_99999_TEST_ONLY"] = 99999] = "EDITION_99999_TEST_ONLY"; + /** + * Placeholder for specifying unbounded edition support. This should only + * ever be used by plugins that can expect to never require any changes to + * support a new edition. + * + * @generated from enum value: EDITION_MAX = 2147483647; + */ + Edition[Edition["EDITION_MAX"] = 2147483647] = "EDITION_MAX"; +})(Edition || (exports.Edition = Edition = {})); +/** + * Describes the enum google.protobuf.Edition. + */ +exports.EditionSchema = (0, enum_js_1.enumDesc)(exports.file_google_protobuf_descriptor, 0); +/** + * Describes the 'visibility' of a symbol with respect to the proto import + * system. Symbols can only be imported when the visibility rules do not prevent + * it (ex: local symbols cannot be imported). Visibility modifiers can only set + * on `message` and `enum` as they are the only types available to be referenced + * from other files. + * + * @generated from enum google.protobuf.SymbolVisibility + */ +var SymbolVisibility; +(function (SymbolVisibility) { + /** + * @generated from enum value: VISIBILITY_UNSET = 0; + */ + SymbolVisibility[SymbolVisibility["VISIBILITY_UNSET"] = 0] = "VISIBILITY_UNSET"; + /** + * @generated from enum value: VISIBILITY_LOCAL = 1; + */ + SymbolVisibility[SymbolVisibility["VISIBILITY_LOCAL"] = 1] = "VISIBILITY_LOCAL"; + /** + * @generated from enum value: VISIBILITY_EXPORT = 2; + */ + SymbolVisibility[SymbolVisibility["VISIBILITY_EXPORT"] = 2] = "VISIBILITY_EXPORT"; +})(SymbolVisibility || (exports.SymbolVisibility = SymbolVisibility = {})); +/** + * Describes the enum google.protobuf.SymbolVisibility. + */ +exports.SymbolVisibilitySchema = (0, enum_js_1.enumDesc)(exports.file_google_protobuf_descriptor, 1); diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/duration_pb.d.ts b/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/duration_pb.d.ts new file mode 100644 index 0000000..a779ebf --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/duration_pb.d.ts @@ -0,0 +1,161 @@ +import type { GenFile, GenMessage } from "../../../../codegenv2/types.js"; +import type { Message } from "../../../../types.js"; +/** + * Describes the file google/protobuf/duration.proto. + */ +export declare const file_google_protobuf_duration: GenFile; +/** + * A Duration represents a signed, fixed-length span of time represented + * as a count of seconds and fractions of seconds at nanosecond + * resolution. It is independent of any calendar and concepts like "day" + * or "month". It is related to Timestamp in that the difference between + * two Timestamp values is a Duration and it can be added or subtracted + * from a Timestamp. Range is approximately +-10,000 years. + * + * # Examples + * + * Example 1: Compute Duration from two Timestamps in pseudo code. + * + * Timestamp start = ...; + * Timestamp end = ...; + * Duration duration = ...; + * + * duration.seconds = end.seconds - start.seconds; + * duration.nanos = end.nanos - start.nanos; + * + * if (duration.seconds < 0 && duration.nanos > 0) { + * duration.seconds += 1; + * duration.nanos -= 1000000000; + * } else if (duration.seconds > 0 && duration.nanos < 0) { + * duration.seconds -= 1; + * duration.nanos += 1000000000; + * } + * + * Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + * + * Timestamp start = ...; + * Duration duration = ...; + * Timestamp end = ...; + * + * end.seconds = start.seconds + duration.seconds; + * end.nanos = start.nanos + duration.nanos; + * + * if (end.nanos < 0) { + * end.seconds -= 1; + * end.nanos += 1000000000; + * } else if (end.nanos >= 1000000000) { + * end.seconds += 1; + * end.nanos -= 1000000000; + * } + * + * Example 3: Compute Duration from datetime.timedelta in Python. + * + * td = datetime.timedelta(days=3, minutes=10) + * duration = Duration() + * duration.FromTimedelta(td) + * + * # JSON Mapping + * + * In JSON format, the Duration type is encoded as a string rather than an + * object, where the string ends in the suffix "s" (indicating seconds) and + * is preceded by the number of seconds, with nanoseconds expressed as + * fractional seconds. For example, 3 seconds with 0 nanoseconds should be + * encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + * be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + * microsecond should be expressed in JSON format as "3.000001s". + * + * + * @generated from message google.protobuf.Duration + */ +export type Duration = Message<"google.protobuf.Duration"> & { + /** + * Signed seconds of the span of time. Must be from -315,576,000,000 + * to +315,576,000,000 inclusive. Note: these bounds are computed from: + * 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + * + * @generated from field: int64 seconds = 1; + */ + seconds: bigint; + /** + * Signed fractions of a second at nanosecond resolution of the span + * of time. Durations less than one second are represented with a 0 + * `seconds` field and a positive or negative `nanos` field. For durations + * of one second or more, a non-zero value for the `nanos` field must be + * of the same sign as the `seconds` field. Must be from -999,999,999 + * to +999,999,999 inclusive. + * + * @generated from field: int32 nanos = 2; + */ + nanos: number; +}; +/** + * A Duration represents a signed, fixed-length span of time represented + * as a count of seconds and fractions of seconds at nanosecond + * resolution. It is independent of any calendar and concepts like "day" + * or "month". It is related to Timestamp in that the difference between + * two Timestamp values is a Duration and it can be added or subtracted + * from a Timestamp. Range is approximately +-10,000 years. + * + * # Examples + * + * Example 1: Compute Duration from two Timestamps in pseudo code. + * + * Timestamp start = ...; + * Timestamp end = ...; + * Duration duration = ...; + * + * duration.seconds = end.seconds - start.seconds; + * duration.nanos = end.nanos - start.nanos; + * + * if (duration.seconds < 0 && duration.nanos > 0) { + * duration.seconds += 1; + * duration.nanos -= 1000000000; + * } else if (duration.seconds > 0 && duration.nanos < 0) { + * duration.seconds -= 1; + * duration.nanos += 1000000000; + * } + * + * Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + * + * Timestamp start = ...; + * Duration duration = ...; + * Timestamp end = ...; + * + * end.seconds = start.seconds + duration.seconds; + * end.nanos = start.nanos + duration.nanos; + * + * if (end.nanos < 0) { + * end.seconds -= 1; + * end.nanos += 1000000000; + * } else if (end.nanos >= 1000000000) { + * end.seconds += 1; + * end.nanos -= 1000000000; + * } + * + * Example 3: Compute Duration from datetime.timedelta in Python. + * + * td = datetime.timedelta(days=3, minutes=10) + * duration = Duration() + * duration.FromTimedelta(td) + * + * # JSON Mapping + * + * In JSON format, the Duration type is encoded as a string rather than an + * object, where the string ends in the suffix "s" (indicating seconds) and + * is preceded by the number of seconds, with nanoseconds expressed as + * fractional seconds. For example, 3 seconds with 0 nanoseconds should be + * encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + * be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + * microsecond should be expressed in JSON format as "3.000001s". + * + * + * @generated from message google.protobuf.Duration + */ +export type DurationJson = string; +/** + * Describes the message google.protobuf.Duration. + * Use `create(DurationSchema)` to create a new message. + */ +export declare const DurationSchema: GenMessage; diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/duration_pb.js b/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/duration_pb.js new file mode 100644 index 0000000..e278e53 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/duration_pb.js @@ -0,0 +1,27 @@ +"use strict"; +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DurationSchema = exports.file_google_protobuf_duration = void 0; +const file_js_1 = require("../../../../codegenv2/file.js"); +const message_js_1 = require("../../../../codegenv2/message.js"); +/** + * Describes the file google/protobuf/duration.proto. + */ +exports.file_google_protobuf_duration = (0, file_js_1.fileDesc)("Ch5nb29nbGUvcHJvdG9idWYvZHVyYXRpb24ucHJvdG8SD2dvb2dsZS5wcm90b2J1ZiIqCghEdXJhdGlvbhIPCgdzZWNvbmRzGAEgASgDEg0KBW5hbm9zGAIgASgFQoMBChNjb20uZ29vZ2xlLnByb3RvYnVmQg1EdXJhdGlvblByb3RvUAFaMWdvb2dsZS5nb2xhbmcub3JnL3Byb3RvYnVmL3R5cGVzL2tub3duL2R1cmF0aW9ucGL4AQGiAgNHUEKqAh5Hb29nbGUuUHJvdG9idWYuV2VsbEtub3duVHlwZXNiBnByb3RvMw"); +/** + * Describes the message google.protobuf.Duration. + * Use `create(DurationSchema)` to create a new message. + */ +exports.DurationSchema = (0, message_js_1.messageDesc)(exports.file_google_protobuf_duration, 0); diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/empty_pb.d.ts b/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/empty_pb.d.ts new file mode 100644 index 0000000..d53d568 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/empty_pb.d.ts @@ -0,0 +1,39 @@ +import type { GenFile, GenMessage } from "../../../../codegenv2/types.js"; +import type { Message } from "../../../../types.js"; +/** + * Describes the file google/protobuf/empty.proto. + */ +export declare const file_google_protobuf_empty: GenFile; +/** + * A generic empty message that you can re-use to avoid defining duplicated + * empty messages in your APIs. A typical example is to use it as the request + * or the response type of an API method. For instance: + * + * service Foo { + * rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); + * } + * + * + * @generated from message google.protobuf.Empty + */ +export type Empty = Message<"google.protobuf.Empty"> & {}; +/** + * A generic empty message that you can re-use to avoid defining duplicated + * empty messages in your APIs. A typical example is to use it as the request + * or the response type of an API method. For instance: + * + * service Foo { + * rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); + * } + * + * + * @generated from message google.protobuf.Empty + */ +export type EmptyJson = Record; +/** + * Describes the message google.protobuf.Empty. + * Use `create(EmptySchema)` to create a new message. + */ +export declare const EmptySchema: GenMessage; diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/empty_pb.js b/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/empty_pb.js new file mode 100644 index 0000000..63bc7b0 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/empty_pb.js @@ -0,0 +1,27 @@ +"use strict"; +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.EmptySchema = exports.file_google_protobuf_empty = void 0; +const file_js_1 = require("../../../../codegenv2/file.js"); +const message_js_1 = require("../../../../codegenv2/message.js"); +/** + * Describes the file google/protobuf/empty.proto. + */ +exports.file_google_protobuf_empty = (0, file_js_1.fileDesc)("Chtnb29nbGUvcHJvdG9idWYvZW1wdHkucHJvdG8SD2dvb2dsZS5wcm90b2J1ZiIHCgVFbXB0eUJ9ChNjb20uZ29vZ2xlLnByb3RvYnVmQgpFbXB0eVByb3RvUAFaLmdvb2dsZS5nb2xhbmcub3JnL3Byb3RvYnVmL3R5cGVzL2tub3duL2VtcHR5cGL4AQGiAgNHUEKqAh5Hb29nbGUuUHJvdG9idWYuV2VsbEtub3duVHlwZXNiBnByb3RvMw"); +/** + * Describes the message google.protobuf.Empty. + * Use `create(EmptySchema)` to create a new message. + */ +exports.EmptySchema = (0, message_js_1.messageDesc)(exports.file_google_protobuf_empty, 0); diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/field_mask_pb.d.ts b/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/field_mask_pb.d.ts new file mode 100644 index 0000000..e727833 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/field_mask_pb.d.ts @@ -0,0 +1,424 @@ +import type { GenFile, GenMessage } from "../../../../codegenv2/types.js"; +import type { Message } from "../../../../types.js"; +/** + * Describes the file google/protobuf/field_mask.proto. + */ +export declare const file_google_protobuf_field_mask: GenFile; +/** + * `FieldMask` represents a set of symbolic field paths, for example: + * + * paths: "f.a" + * paths: "f.b.d" + * + * Here `f` represents a field in some root message, `a` and `b` + * fields in the message found in `f`, and `d` a field found in the + * message in `f.b`. + * + * Field masks are used to specify a subset of fields that should be + * returned by a get operation or modified by an update operation. + * Field masks also have a custom JSON encoding (see below). + * + * # Field Masks in Projections + * + * When used in the context of a projection, a response message or + * sub-message is filtered by the API to only contain those fields as + * specified in the mask. For example, if the mask in the previous + * example is applied to a response message as follows: + * + * f { + * a : 22 + * b { + * d : 1 + * x : 2 + * } + * y : 13 + * } + * z: 8 + * + * The result will not contain specific values for fields x,y and z + * (their value will be set to the default, and omitted in proto text + * output): + * + * + * f { + * a : 22 + * b { + * d : 1 + * } + * } + * + * A repeated field is not allowed except at the last position of a + * paths string. + * + * If a FieldMask object is not present in a get operation, the + * operation applies to all fields (as if a FieldMask of all fields + * had been specified). + * + * Note that a field mask does not necessarily apply to the + * top-level response message. In case of a REST get operation, the + * field mask applies directly to the response, but in case of a REST + * list operation, the mask instead applies to each individual message + * in the returned resource list. In case of a REST custom method, + * other definitions may be used. Where the mask applies will be + * clearly documented together with its declaration in the API. In + * any case, the effect on the returned resource/resources is required + * behavior for APIs. + * + * # Field Masks in Update Operations + * + * A field mask in update operations specifies which fields of the + * targeted resource are going to be updated. The API is required + * to only change the values of the fields as specified in the mask + * and leave the others untouched. If a resource is passed in to + * describe the updated values, the API ignores the values of all + * fields not covered by the mask. + * + * If a repeated field is specified for an update operation, new values will + * be appended to the existing repeated field in the target resource. Note that + * a repeated field is only allowed in the last position of a `paths` string. + * + * If a sub-message is specified in the last position of the field mask for an + * update operation, then new value will be merged into the existing sub-message + * in the target resource. + * + * For example, given the target message: + * + * f { + * b { + * d: 1 + * x: 2 + * } + * c: [1] + * } + * + * And an update message: + * + * f { + * b { + * d: 10 + * } + * c: [2] + * } + * + * then if the field mask is: + * + * paths: ["f.b", "f.c"] + * + * then the result will be: + * + * f { + * b { + * d: 10 + * x: 2 + * } + * c: [1, 2] + * } + * + * An implementation may provide options to override this default behavior for + * repeated and message fields. + * + * Note that libraries which implement FieldMask resolution have various + * different behaviors in the face of empty masks or the special "*" mask. + * When implementing a service you should confirm these cases have the + * appropriate behavior in the underlying FieldMask library that you desire, + * and you may need to special case those cases in your application code if + * the underlying field mask library behavior differs from your intended + * service semantics. + * + * Update methods implementing https://google.aip.dev/134 + * - MUST support the special value * meaning "full replace" + * - MUST treat an omitted field mask as "replace fields which are present". + * + * Other methods implementing https://google.aip.dev/157 + * - SHOULD support the special value "*" to mean "get all". + * - MUST treat an omitted field mask to mean "get all", unless otherwise + * documented. + * + * ## Considerations for HTTP REST + * + * The HTTP kind of an update operation which uses a field mask must + * be set to PATCH instead of PUT in order to satisfy HTTP semantics + * (PUT must only be used for full updates). + * + * # JSON Encoding of Field Masks + * + * In JSON, a field mask is encoded as a single string where paths are + * separated by a comma. Fields name in each path are converted + * to/from lower-camel naming conventions. + * + * As an example, consider the following message declarations: + * + * message Profile { + * User user = 1; + * Photo photo = 2; + * } + * message User { + * string display_name = 1; + * string address = 2; + * } + * + * In proto a field mask for `Profile` may look as such: + * + * mask { + * paths: "user.display_name" + * paths: "photo" + * } + * + * In JSON, the same mask is represented as below: + * + * { + * mask: "user.displayName,photo" + * } + * + * # Field Masks and Oneof Fields + * + * Field masks treat fields in oneofs just as regular fields. Consider the + * following message: + * + * message SampleMessage { + * oneof test_oneof { + * string name = 4; + * SubMessage sub_message = 9; + * } + * } + * + * The field mask can be: + * + * mask { + * paths: "name" + * } + * + * Or: + * + * mask { + * paths: "sub_message" + * } + * + * Note that oneof type names ("test_oneof" in this case) cannot be used in + * paths. + * + * ## Field Mask Verification + * + * The implementation of any API method which has a FieldMask type field in the + * request should verify the included field paths, and return an + * `INVALID_ARGUMENT` error if any path is unmappable. + * + * @generated from message google.protobuf.FieldMask + */ +export type FieldMask = Message<"google.protobuf.FieldMask"> & { + /** + * The set of field mask paths. + * + * @generated from field: repeated string paths = 1; + */ + paths: string[]; +}; +/** + * `FieldMask` represents a set of symbolic field paths, for example: + * + * paths: "f.a" + * paths: "f.b.d" + * + * Here `f` represents a field in some root message, `a` and `b` + * fields in the message found in `f`, and `d` a field found in the + * message in `f.b`. + * + * Field masks are used to specify a subset of fields that should be + * returned by a get operation or modified by an update operation. + * Field masks also have a custom JSON encoding (see below). + * + * # Field Masks in Projections + * + * When used in the context of a projection, a response message or + * sub-message is filtered by the API to only contain those fields as + * specified in the mask. For example, if the mask in the previous + * example is applied to a response message as follows: + * + * f { + * a : 22 + * b { + * d : 1 + * x : 2 + * } + * y : 13 + * } + * z: 8 + * + * The result will not contain specific values for fields x,y and z + * (their value will be set to the default, and omitted in proto text + * output): + * + * + * f { + * a : 22 + * b { + * d : 1 + * } + * } + * + * A repeated field is not allowed except at the last position of a + * paths string. + * + * If a FieldMask object is not present in a get operation, the + * operation applies to all fields (as if a FieldMask of all fields + * had been specified). + * + * Note that a field mask does not necessarily apply to the + * top-level response message. In case of a REST get operation, the + * field mask applies directly to the response, but in case of a REST + * list operation, the mask instead applies to each individual message + * in the returned resource list. In case of a REST custom method, + * other definitions may be used. Where the mask applies will be + * clearly documented together with its declaration in the API. In + * any case, the effect on the returned resource/resources is required + * behavior for APIs. + * + * # Field Masks in Update Operations + * + * A field mask in update operations specifies which fields of the + * targeted resource are going to be updated. The API is required + * to only change the values of the fields as specified in the mask + * and leave the others untouched. If a resource is passed in to + * describe the updated values, the API ignores the values of all + * fields not covered by the mask. + * + * If a repeated field is specified for an update operation, new values will + * be appended to the existing repeated field in the target resource. Note that + * a repeated field is only allowed in the last position of a `paths` string. + * + * If a sub-message is specified in the last position of the field mask for an + * update operation, then new value will be merged into the existing sub-message + * in the target resource. + * + * For example, given the target message: + * + * f { + * b { + * d: 1 + * x: 2 + * } + * c: [1] + * } + * + * And an update message: + * + * f { + * b { + * d: 10 + * } + * c: [2] + * } + * + * then if the field mask is: + * + * paths: ["f.b", "f.c"] + * + * then the result will be: + * + * f { + * b { + * d: 10 + * x: 2 + * } + * c: [1, 2] + * } + * + * An implementation may provide options to override this default behavior for + * repeated and message fields. + * + * Note that libraries which implement FieldMask resolution have various + * different behaviors in the face of empty masks or the special "*" mask. + * When implementing a service you should confirm these cases have the + * appropriate behavior in the underlying FieldMask library that you desire, + * and you may need to special case those cases in your application code if + * the underlying field mask library behavior differs from your intended + * service semantics. + * + * Update methods implementing https://google.aip.dev/134 + * - MUST support the special value * meaning "full replace" + * - MUST treat an omitted field mask as "replace fields which are present". + * + * Other methods implementing https://google.aip.dev/157 + * - SHOULD support the special value "*" to mean "get all". + * - MUST treat an omitted field mask to mean "get all", unless otherwise + * documented. + * + * ## Considerations for HTTP REST + * + * The HTTP kind of an update operation which uses a field mask must + * be set to PATCH instead of PUT in order to satisfy HTTP semantics + * (PUT must only be used for full updates). + * + * # JSON Encoding of Field Masks + * + * In JSON, a field mask is encoded as a single string where paths are + * separated by a comma. Fields name in each path are converted + * to/from lower-camel naming conventions. + * + * As an example, consider the following message declarations: + * + * message Profile { + * User user = 1; + * Photo photo = 2; + * } + * message User { + * string display_name = 1; + * string address = 2; + * } + * + * In proto a field mask for `Profile` may look as such: + * + * mask { + * paths: "user.display_name" + * paths: "photo" + * } + * + * In JSON, the same mask is represented as below: + * + * { + * mask: "user.displayName,photo" + * } + * + * # Field Masks and Oneof Fields + * + * Field masks treat fields in oneofs just as regular fields. Consider the + * following message: + * + * message SampleMessage { + * oneof test_oneof { + * string name = 4; + * SubMessage sub_message = 9; + * } + * } + * + * The field mask can be: + * + * mask { + * paths: "name" + * } + * + * Or: + * + * mask { + * paths: "sub_message" + * } + * + * Note that oneof type names ("test_oneof" in this case) cannot be used in + * paths. + * + * ## Field Mask Verification + * + * The implementation of any API method which has a FieldMask type field in the + * request should verify the included field paths, and return an + * `INVALID_ARGUMENT` error if any path is unmappable. + * + * @generated from message google.protobuf.FieldMask + */ +export type FieldMaskJson = string; +/** + * Describes the message google.protobuf.FieldMask. + * Use `create(FieldMaskSchema)` to create a new message. + */ +export declare const FieldMaskSchema: GenMessage; diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/field_mask_pb.js b/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/field_mask_pb.js new file mode 100644 index 0000000..260ac39 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/field_mask_pb.js @@ -0,0 +1,27 @@ +"use strict"; +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.FieldMaskSchema = exports.file_google_protobuf_field_mask = void 0; +const file_js_1 = require("../../../../codegenv2/file.js"); +const message_js_1 = require("../../../../codegenv2/message.js"); +/** + * Describes the file google/protobuf/field_mask.proto. + */ +exports.file_google_protobuf_field_mask = (0, file_js_1.fileDesc)("CiBnb29nbGUvcHJvdG9idWYvZmllbGRfbWFzay5wcm90bxIPZ29vZ2xlLnByb3RvYnVmIhoKCUZpZWxkTWFzaxINCgVwYXRocxgBIAMoCUKFAQoTY29tLmdvb2dsZS5wcm90b2J1ZkIORmllbGRNYXNrUHJvdG9QAVoyZ29vZ2xlLmdvbGFuZy5vcmcvcHJvdG9idWYvdHlwZXMva25vd24vZmllbGRtYXNrcGL4AQGiAgNHUEKqAh5Hb29nbGUuUHJvdG9idWYuV2VsbEtub3duVHlwZXNiBnByb3RvMw"); +/** + * Describes the message google.protobuf.FieldMask. + * Use `create(FieldMaskSchema)` to create a new message. + */ +exports.FieldMaskSchema = (0, message_js_1.messageDesc)(exports.file_google_protobuf_field_mask, 0); diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/go_features_pb.d.ts b/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/go_features_pb.d.ts new file mode 100644 index 0000000..25bf617 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/go_features_pb.d.ts @@ -0,0 +1,189 @@ +import type { GenEnum, GenExtension, GenFile, GenMessage } from "../../../../codegenv2/types.js"; +import type { FeatureSet } from "./descriptor_pb.js"; +import type { Message } from "../../../../types.js"; +/** + * Describes the file google/protobuf/go_features.proto. + */ +export declare const file_google_protobuf_go_features: GenFile; +/** + * @generated from message pb.GoFeatures + */ +export type GoFeatures = Message<"pb.GoFeatures"> & { + /** + * Whether or not to generate the deprecated UnmarshalJSON method for enums. + * Can only be true for proto using the Open Struct api. + * + * @generated from field: optional bool legacy_unmarshal_json_enum = 1; + */ + legacyUnmarshalJsonEnum: boolean; + /** + * One of OPEN, HYBRID or OPAQUE. + * + * @generated from field: optional pb.GoFeatures.APILevel api_level = 2; + */ + apiLevel: GoFeatures_APILevel; + /** + * @generated from field: optional pb.GoFeatures.StripEnumPrefix strip_enum_prefix = 3; + */ + stripEnumPrefix: GoFeatures_StripEnumPrefix; + /** + * @generated from field: optional pb.GoFeatures.OptimizeModeFeature.OptimizeMode optimize_mode = 4; + */ + optimizeMode: GoFeatures_OptimizeModeFeature_OptimizeMode; +}; +/** + * @generated from message pb.GoFeatures + */ +export type GoFeaturesJson = { + /** + * Whether or not to generate the deprecated UnmarshalJSON method for enums. + * Can only be true for proto using the Open Struct api. + * + * @generated from field: optional bool legacy_unmarshal_json_enum = 1; + */ + legacyUnmarshalJsonEnum?: boolean; + /** + * One of OPEN, HYBRID or OPAQUE. + * + * @generated from field: optional pb.GoFeatures.APILevel api_level = 2; + */ + apiLevel?: GoFeatures_APILevelJson; + /** + * @generated from field: optional pb.GoFeatures.StripEnumPrefix strip_enum_prefix = 3; + */ + stripEnumPrefix?: GoFeatures_StripEnumPrefixJson; + /** + * @generated from field: optional pb.GoFeatures.OptimizeModeFeature.OptimizeMode optimize_mode = 4; + */ + optimizeMode?: GoFeatures_OptimizeModeFeature_OptimizeModeJson; +}; +/** + * Describes the message pb.GoFeatures. + * Use `create(GoFeaturesSchema)` to create a new message. + */ +export declare const GoFeaturesSchema: GenMessage; +/** + * Wrap the OptimizeMode enum in a message for scoping: + * This way, users can type shorter names (SPEED, CODE_SIZE). + * + * @generated from message pb.GoFeatures.OptimizeModeFeature + */ +export type GoFeatures_OptimizeModeFeature = Message<"pb.GoFeatures.OptimizeModeFeature"> & {}; +/** + * Wrap the OptimizeMode enum in a message for scoping: + * This way, users can type shorter names (SPEED, CODE_SIZE). + * + * @generated from message pb.GoFeatures.OptimizeModeFeature + */ +export type GoFeatures_OptimizeModeFeatureJson = {}; +/** + * Describes the message pb.GoFeatures.OptimizeModeFeature. + * Use `create(GoFeatures_OptimizeModeFeatureSchema)` to create a new message. + */ +export declare const GoFeatures_OptimizeModeFeatureSchema: GenMessage; +/** + * The name of this enum matches OptimizeMode in descriptor.proto. + * + * @generated from enum pb.GoFeatures.OptimizeModeFeature.OptimizeMode + */ +export declare enum GoFeatures_OptimizeModeFeature_OptimizeMode { + /** + * OPTIMIZE_MODE_UNSPECIFIED results in falling back to the default + * (optimize for code size), but needs to be a separate value to distinguish + * between an explicitly set optimize mode or a missing optimize mode. + * + * @generated from enum value: OPTIMIZE_MODE_UNSPECIFIED = 0; + */ + OPTIMIZE_MODE_UNSPECIFIED = 0, + /** + * @generated from enum value: SPEED = 1; + */ + SPEED = 1, + /** + * There is no enum entry for LITE_RUNTIME (descriptor.proto), + * because Go Protobuf does not have the concept of a lite runtime. + * + * @generated from enum value: CODE_SIZE = 2; + */ + CODE_SIZE = 2 +} +/** + * The name of this enum matches OptimizeMode in descriptor.proto. + * + * @generated from enum pb.GoFeatures.OptimizeModeFeature.OptimizeMode + */ +export type GoFeatures_OptimizeModeFeature_OptimizeModeJson = "OPTIMIZE_MODE_UNSPECIFIED" | "SPEED" | "CODE_SIZE"; +/** + * Describes the enum pb.GoFeatures.OptimizeModeFeature.OptimizeMode. + */ +export declare const GoFeatures_OptimizeModeFeature_OptimizeModeSchema: GenEnum; +/** + * @generated from enum pb.GoFeatures.APILevel + */ +export declare enum GoFeatures_APILevel { + /** + * API_LEVEL_UNSPECIFIED results in selecting the OPEN API, + * but needs to be a separate value to distinguish between + * an explicitly set api level or a missing api level. + * + * @generated from enum value: API_LEVEL_UNSPECIFIED = 0; + */ + API_LEVEL_UNSPECIFIED = 0, + /** + * @generated from enum value: API_OPEN = 1; + */ + API_OPEN = 1, + /** + * @generated from enum value: API_HYBRID = 2; + */ + API_HYBRID = 2, + /** + * @generated from enum value: API_OPAQUE = 3; + */ + API_OPAQUE = 3 +} +/** + * @generated from enum pb.GoFeatures.APILevel + */ +export type GoFeatures_APILevelJson = "API_LEVEL_UNSPECIFIED" | "API_OPEN" | "API_HYBRID" | "API_OPAQUE"; +/** + * Describes the enum pb.GoFeatures.APILevel. + */ +export declare const GoFeatures_APILevelSchema: GenEnum; +/** + * @generated from enum pb.GoFeatures.StripEnumPrefix + */ +export declare enum GoFeatures_StripEnumPrefix { + /** + * @generated from enum value: STRIP_ENUM_PREFIX_UNSPECIFIED = 0; + */ + UNSPECIFIED = 0, + /** + * @generated from enum value: STRIP_ENUM_PREFIX_KEEP = 1; + */ + KEEP = 1, + /** + * @generated from enum value: STRIP_ENUM_PREFIX_GENERATE_BOTH = 2; + */ + GENERATE_BOTH = 2, + /** + * @generated from enum value: STRIP_ENUM_PREFIX_STRIP = 3; + */ + STRIP = 3 +} +/** + * @generated from enum pb.GoFeatures.StripEnumPrefix + */ +export type GoFeatures_StripEnumPrefixJson = "STRIP_ENUM_PREFIX_UNSPECIFIED" | "STRIP_ENUM_PREFIX_KEEP" | "STRIP_ENUM_PREFIX_GENERATE_BOTH" | "STRIP_ENUM_PREFIX_STRIP"; +/** + * Describes the enum pb.GoFeatures.StripEnumPrefix. + */ +export declare const GoFeatures_StripEnumPrefixSchema: GenEnum; +/** + * @generated from extension: optional pb.GoFeatures go = 1002; + */ +export declare const go: GenExtension; diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/go_features_pb.js b/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/go_features_pb.js new file mode 100644 index 0000000..d1c2d73 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/go_features_pb.js @@ -0,0 +1,126 @@ +"use strict"; +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.go = exports.GoFeatures_StripEnumPrefixSchema = exports.GoFeatures_StripEnumPrefix = exports.GoFeatures_APILevelSchema = exports.GoFeatures_APILevel = exports.GoFeatures_OptimizeModeFeature_OptimizeModeSchema = exports.GoFeatures_OptimizeModeFeature_OptimizeMode = exports.GoFeatures_OptimizeModeFeatureSchema = exports.GoFeaturesSchema = exports.file_google_protobuf_go_features = void 0; +const file_js_1 = require("../../../../codegenv2/file.js"); +const descriptor_pb_js_1 = require("./descriptor_pb.js"); +const message_js_1 = require("../../../../codegenv2/message.js"); +const enum_js_1 = require("../../../../codegenv2/enum.js"); +const extension_js_1 = require("../../../../codegenv2/extension.js"); +/** + * Describes the file google/protobuf/go_features.proto. + */ +exports.file_google_protobuf_go_features = (0, file_js_1.fileDesc)("CiFnb29nbGUvcHJvdG9idWYvZ29fZmVhdHVyZXMucHJvdG8SAnBiItEGCgpHb0ZlYXR1cmVzEqUBChpsZWdhY3lfdW5tYXJzaGFsX2pzb25fZW51bRgBIAEoCEKAAYgBAZgBBpgBAaIBCRIEdHJ1ZRiEB6IBChIFZmFsc2UY5weyAVsI6AcQ6AcaU1RoZSBsZWdhY3kgVW5tYXJzaGFsSlNPTiBBUEkgaXMgZGVwcmVjYXRlZCBhbmQgd2lsbCBiZSByZW1vdmVkIGluIGEgZnV0dXJlIGVkaXRpb24uEmoKCWFwaV9sZXZlbBgCIAEoDjIXLnBiLkdvRmVhdHVyZXMuQVBJTGV2ZWxCPogBAZgBA5gBAaIBGhIVQVBJX0xFVkVMX1VOU1BFQ0lGSUVEGIQHogEPEgpBUElfT1BBUVVFGOkHsgEDCOgHEmsKEXN0cmlwX2VudW1fcHJlZml4GAMgASgOMh4ucGIuR29GZWF0dXJlcy5TdHJpcEVudW1QcmVmaXhCMIgBAZgBBpgBB5gBAaIBGxIWU1RSSVBfRU5VTV9QUkVGSVhfS0VFUBiEB7IBAwjpBxJ4Cg1vcHRpbWl6ZV9tb2RlGAQgASgOMi8ucGIuR29GZWF0dXJlcy5PcHRpbWl6ZU1vZGVGZWF0dXJlLk9wdGltaXplTW9kZUIwiAEBmAEDmAEBogEeEhlPUFRJTUlaRV9NT0RFX1VOU1BFQ0lGSUVEGIQHsgEDCOkHGl4KE09wdGltaXplTW9kZUZlYXR1cmUiRwoMT3B0aW1pemVNb2RlEh0KGU9QVElNSVpFX01PREVfVU5TUEVDSUZJRUQQABIJCgVTUEVFRBABEg0KCUNPREVfU0laRRACIlMKCEFQSUxldmVsEhkKFUFQSV9MRVZFTF9VTlNQRUNJRklFRBAAEgwKCEFQSV9PUEVOEAESDgoKQVBJX0hZQlJJRBACEg4KCkFQSV9PUEFRVUUQAyKSAQoPU3RyaXBFbnVtUHJlZml4EiEKHVNUUklQX0VOVU1fUFJFRklYX1VOU1BFQ0lGSUVEEAASGgoWU1RSSVBfRU5VTV9QUkVGSVhfS0VFUBABEiMKH1NUUklQX0VOVU1fUFJFRklYX0dFTkVSQVRFX0JPVEgQAhIbChdTVFJJUF9FTlVNX1BSRUZJWF9TVFJJUBADOjwKAmdvEhsuZ29vZ2xlLnByb3RvYnVmLkZlYXR1cmVTZXQY6gcgASgLMg4ucGIuR29GZWF0dXJlc1ICZ29CL1otZ29vZ2xlLmdvbGFuZy5vcmcvcHJvdG9idWYvdHlwZXMvZ29mZWF0dXJlc3Bi", [descriptor_pb_js_1.file_google_protobuf_descriptor]); +/** + * Describes the message pb.GoFeatures. + * Use `create(GoFeaturesSchema)` to create a new message. + */ +exports.GoFeaturesSchema = (0, message_js_1.messageDesc)(exports.file_google_protobuf_go_features, 0); +/** + * Describes the message pb.GoFeatures.OptimizeModeFeature. + * Use `create(GoFeatures_OptimizeModeFeatureSchema)` to create a new message. + */ +exports.GoFeatures_OptimizeModeFeatureSchema = (0, message_js_1.messageDesc)(exports.file_google_protobuf_go_features, 0, 0); +/** + * The name of this enum matches OptimizeMode in descriptor.proto. + * + * @generated from enum pb.GoFeatures.OptimizeModeFeature.OptimizeMode + */ +var GoFeatures_OptimizeModeFeature_OptimizeMode; +(function (GoFeatures_OptimizeModeFeature_OptimizeMode) { + /** + * OPTIMIZE_MODE_UNSPECIFIED results in falling back to the default + * (optimize for code size), but needs to be a separate value to distinguish + * between an explicitly set optimize mode or a missing optimize mode. + * + * @generated from enum value: OPTIMIZE_MODE_UNSPECIFIED = 0; + */ + GoFeatures_OptimizeModeFeature_OptimizeMode[GoFeatures_OptimizeModeFeature_OptimizeMode["OPTIMIZE_MODE_UNSPECIFIED"] = 0] = "OPTIMIZE_MODE_UNSPECIFIED"; + /** + * @generated from enum value: SPEED = 1; + */ + GoFeatures_OptimizeModeFeature_OptimizeMode[GoFeatures_OptimizeModeFeature_OptimizeMode["SPEED"] = 1] = "SPEED"; + /** + * There is no enum entry for LITE_RUNTIME (descriptor.proto), + * because Go Protobuf does not have the concept of a lite runtime. + * + * @generated from enum value: CODE_SIZE = 2; + */ + GoFeatures_OptimizeModeFeature_OptimizeMode[GoFeatures_OptimizeModeFeature_OptimizeMode["CODE_SIZE"] = 2] = "CODE_SIZE"; +})(GoFeatures_OptimizeModeFeature_OptimizeMode || (exports.GoFeatures_OptimizeModeFeature_OptimizeMode = GoFeatures_OptimizeModeFeature_OptimizeMode = {})); +/** + * Describes the enum pb.GoFeatures.OptimizeModeFeature.OptimizeMode. + */ +exports.GoFeatures_OptimizeModeFeature_OptimizeModeSchema = (0, enum_js_1.enumDesc)(exports.file_google_protobuf_go_features, 0, 0, 0); +/** + * @generated from enum pb.GoFeatures.APILevel + */ +var GoFeatures_APILevel; +(function (GoFeatures_APILevel) { + /** + * API_LEVEL_UNSPECIFIED results in selecting the OPEN API, + * but needs to be a separate value to distinguish between + * an explicitly set api level or a missing api level. + * + * @generated from enum value: API_LEVEL_UNSPECIFIED = 0; + */ + GoFeatures_APILevel[GoFeatures_APILevel["API_LEVEL_UNSPECIFIED"] = 0] = "API_LEVEL_UNSPECIFIED"; + /** + * @generated from enum value: API_OPEN = 1; + */ + GoFeatures_APILevel[GoFeatures_APILevel["API_OPEN"] = 1] = "API_OPEN"; + /** + * @generated from enum value: API_HYBRID = 2; + */ + GoFeatures_APILevel[GoFeatures_APILevel["API_HYBRID"] = 2] = "API_HYBRID"; + /** + * @generated from enum value: API_OPAQUE = 3; + */ + GoFeatures_APILevel[GoFeatures_APILevel["API_OPAQUE"] = 3] = "API_OPAQUE"; +})(GoFeatures_APILevel || (exports.GoFeatures_APILevel = GoFeatures_APILevel = {})); +/** + * Describes the enum pb.GoFeatures.APILevel. + */ +exports.GoFeatures_APILevelSchema = (0, enum_js_1.enumDesc)(exports.file_google_protobuf_go_features, 0, 0); +/** + * @generated from enum pb.GoFeatures.StripEnumPrefix + */ +var GoFeatures_StripEnumPrefix; +(function (GoFeatures_StripEnumPrefix) { + /** + * @generated from enum value: STRIP_ENUM_PREFIX_UNSPECIFIED = 0; + */ + GoFeatures_StripEnumPrefix[GoFeatures_StripEnumPrefix["UNSPECIFIED"] = 0] = "UNSPECIFIED"; + /** + * @generated from enum value: STRIP_ENUM_PREFIX_KEEP = 1; + */ + GoFeatures_StripEnumPrefix[GoFeatures_StripEnumPrefix["KEEP"] = 1] = "KEEP"; + /** + * @generated from enum value: STRIP_ENUM_PREFIX_GENERATE_BOTH = 2; + */ + GoFeatures_StripEnumPrefix[GoFeatures_StripEnumPrefix["GENERATE_BOTH"] = 2] = "GENERATE_BOTH"; + /** + * @generated from enum value: STRIP_ENUM_PREFIX_STRIP = 3; + */ + GoFeatures_StripEnumPrefix[GoFeatures_StripEnumPrefix["STRIP"] = 3] = "STRIP"; +})(GoFeatures_StripEnumPrefix || (exports.GoFeatures_StripEnumPrefix = GoFeatures_StripEnumPrefix = {})); +/** + * Describes the enum pb.GoFeatures.StripEnumPrefix. + */ +exports.GoFeatures_StripEnumPrefixSchema = (0, enum_js_1.enumDesc)(exports.file_google_protobuf_go_features, 0, 1); +/** + * @generated from extension: optional pb.GoFeatures go = 1002; + */ +exports.go = (0, extension_js_1.extDesc)(exports.file_google_protobuf_go_features, 0); diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/java_features_pb.d.ts b/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/java_features_pb.d.ts new file mode 100644 index 0000000..47f1503 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/java_features_pb.d.ts @@ -0,0 +1,194 @@ +import type { GenEnum, GenExtension, GenFile, GenMessage } from "../../../../codegenv2/types.js"; +import type { FeatureSet } from "./descriptor_pb.js"; +import type { Message } from "../../../../types.js"; +/** + * Describes the file google/protobuf/java_features.proto. + */ +export declare const file_google_protobuf_java_features: GenFile; +/** + * @generated from message pb.JavaFeatures + */ +export type JavaFeatures = Message<"pb.JavaFeatures"> & { + /** + * Whether or not to treat an enum field as closed. This option is only + * applicable to enum fields, and will be removed in the future. It is + * consistent with the legacy behavior of using proto3 enum types for proto2 + * fields. + * + * @generated from field: optional bool legacy_closed_enum = 1; + */ + legacyClosedEnum: boolean; + /** + * @generated from field: optional pb.JavaFeatures.Utf8Validation utf8_validation = 2; + */ + utf8Validation: JavaFeatures_Utf8Validation; + /** + * Allows creation of large Java enums, extending beyond the standard + * constant limits imposed by the Java language. + * + * @generated from field: optional bool large_enum = 3; + */ + largeEnum: boolean; + /** + * Whether to use the old default outer class name scheme, or the new feature + * which adds a "Proto" suffix to the outer class name. + * + * Users will not be able to set this option, because we removed it in the + * same edition that it was introduced. But we use it to determine which + * naming scheme to use for outer class name defaults. + * + * @generated from field: optional bool use_old_outer_classname_default = 4; + */ + useOldOuterClassnameDefault: boolean; + /** + * Whether to nest the generated class in the generated file class. This is + * only applicable to *top-level* messages, enums, and services. + * + * @generated from field: optional pb.JavaFeatures.NestInFileClassFeature.NestInFileClass nest_in_file_class = 5; + */ + nestInFileClass: JavaFeatures_NestInFileClassFeature_NestInFileClass; +}; +/** + * @generated from message pb.JavaFeatures + */ +export type JavaFeaturesJson = { + /** + * Whether or not to treat an enum field as closed. This option is only + * applicable to enum fields, and will be removed in the future. It is + * consistent with the legacy behavior of using proto3 enum types for proto2 + * fields. + * + * @generated from field: optional bool legacy_closed_enum = 1; + */ + legacyClosedEnum?: boolean; + /** + * @generated from field: optional pb.JavaFeatures.Utf8Validation utf8_validation = 2; + */ + utf8Validation?: JavaFeatures_Utf8ValidationJson; + /** + * Allows creation of large Java enums, extending beyond the standard + * constant limits imposed by the Java language. + * + * @generated from field: optional bool large_enum = 3; + */ + largeEnum?: boolean; + /** + * Whether to use the old default outer class name scheme, or the new feature + * which adds a "Proto" suffix to the outer class name. + * + * Users will not be able to set this option, because we removed it in the + * same edition that it was introduced. But we use it to determine which + * naming scheme to use for outer class name defaults. + * + * @generated from field: optional bool use_old_outer_classname_default = 4; + */ + useOldOuterClassnameDefault?: boolean; + /** + * Whether to nest the generated class in the generated file class. This is + * only applicable to *top-level* messages, enums, and services. + * + * @generated from field: optional pb.JavaFeatures.NestInFileClassFeature.NestInFileClass nest_in_file_class = 5; + */ + nestInFileClass?: JavaFeatures_NestInFileClassFeature_NestInFileClassJson; +}; +/** + * Describes the message pb.JavaFeatures. + * Use `create(JavaFeaturesSchema)` to create a new message. + */ +export declare const JavaFeaturesSchema: GenMessage; +/** + * @generated from message pb.JavaFeatures.NestInFileClassFeature + */ +export type JavaFeatures_NestInFileClassFeature = Message<"pb.JavaFeatures.NestInFileClassFeature"> & {}; +/** + * @generated from message pb.JavaFeatures.NestInFileClassFeature + */ +export type JavaFeatures_NestInFileClassFeatureJson = {}; +/** + * Describes the message pb.JavaFeatures.NestInFileClassFeature. + * Use `create(JavaFeatures_NestInFileClassFeatureSchema)` to create a new message. + */ +export declare const JavaFeatures_NestInFileClassFeatureSchema: GenMessage; +/** + * @generated from enum pb.JavaFeatures.NestInFileClassFeature.NestInFileClass + */ +export declare enum JavaFeatures_NestInFileClassFeature_NestInFileClass { + /** + * Invalid default, which should never be used. + * + * @generated from enum value: NEST_IN_FILE_CLASS_UNKNOWN = 0; + */ + NEST_IN_FILE_CLASS_UNKNOWN = 0, + /** + * Do not nest the generated class in the file class. + * + * @generated from enum value: NO = 1; + */ + NO = 1, + /** + * Nest the generated class in the file class. + * + * @generated from enum value: YES = 2; + */ + YES = 2, + /** + * Fall back to the `java_multiple_files` option. Users won't be able to + * set this option. + * + * @generated from enum value: LEGACY = 3; + */ + LEGACY = 3 +} +/** + * @generated from enum pb.JavaFeatures.NestInFileClassFeature.NestInFileClass + */ +export type JavaFeatures_NestInFileClassFeature_NestInFileClassJson = "NEST_IN_FILE_CLASS_UNKNOWN" | "NO" | "YES" | "LEGACY"; +/** + * Describes the enum pb.JavaFeatures.NestInFileClassFeature.NestInFileClass. + */ +export declare const JavaFeatures_NestInFileClassFeature_NestInFileClassSchema: GenEnum; +/** + * The UTF8 validation strategy to use. + * + * @generated from enum pb.JavaFeatures.Utf8Validation + */ +export declare enum JavaFeatures_Utf8Validation { + /** + * Invalid default, which should never be used. + * + * @generated from enum value: UTF8_VALIDATION_UNKNOWN = 0; + */ + UTF8_VALIDATION_UNKNOWN = 0, + /** + * Respect the UTF8 validation behavior specified by the global + * utf8_validation feature. + * + * @generated from enum value: DEFAULT = 1; + */ + DEFAULT = 1, + /** + * Verifies UTF8 validity overriding the global utf8_validation + * feature. This represents the legacy java_string_check_utf8 option. + * + * @generated from enum value: VERIFY = 2; + */ + VERIFY = 2 +} +/** + * The UTF8 validation strategy to use. + * + * @generated from enum pb.JavaFeatures.Utf8Validation + */ +export type JavaFeatures_Utf8ValidationJson = "UTF8_VALIDATION_UNKNOWN" | "DEFAULT" | "VERIFY"; +/** + * Describes the enum pb.JavaFeatures.Utf8Validation. + */ +export declare const JavaFeatures_Utf8ValidationSchema: GenEnum; +/** + * @generated from extension: optional pb.JavaFeatures java = 1001; + */ +export declare const java: GenExtension; diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/java_features_pb.js b/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/java_features_pb.js new file mode 100644 index 0000000..ed1a77b --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/java_features_pb.js @@ -0,0 +1,106 @@ +"use strict"; +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.java = exports.JavaFeatures_Utf8ValidationSchema = exports.JavaFeatures_Utf8Validation = exports.JavaFeatures_NestInFileClassFeature_NestInFileClassSchema = exports.JavaFeatures_NestInFileClassFeature_NestInFileClass = exports.JavaFeatures_NestInFileClassFeatureSchema = exports.JavaFeaturesSchema = exports.file_google_protobuf_java_features = void 0; +const file_js_1 = require("../../../../codegenv2/file.js"); +const descriptor_pb_js_1 = require("./descriptor_pb.js"); +const message_js_1 = require("../../../../codegenv2/message.js"); +const enum_js_1 = require("../../../../codegenv2/enum.js"); +const extension_js_1 = require("../../../../codegenv2/extension.js"); +/** + * Describes the file google/protobuf/java_features.proto. + */ +exports.file_google_protobuf_java_features = (0, file_js_1.fileDesc)("CiNnb29nbGUvcHJvdG9idWYvamF2YV9mZWF0dXJlcy5wcm90bxICcGIigwgKDEphdmFGZWF0dXJlcxL+AQoSbGVnYWN5X2Nsb3NlZF9lbnVtGAEgASgIQuEBiAEBmAEEmAEBogEJEgR0cnVlGIQHogEKEgVmYWxzZRjnB7IBuwEI6AcQ6AcasgFUaGUgbGVnYWN5IGNsb3NlZCBlbnVtIGJlaGF2aW9yIGluIEphdmEgaXMgZGVwcmVjYXRlZCBhbmQgaXMgc2NoZWR1bGVkIHRvIGJlIHJlbW92ZWQgaW4gZWRpdGlvbiAyMDI1LiAgU2VlIGh0dHA6Ly9wcm90b2J1Zi5kZXYvcHJvZ3JhbW1pbmctZ3VpZGVzL2VudW0vI2phdmEgZm9yIG1vcmUgaW5mb3JtYXRpb24uEp8CCg91dGY4X3ZhbGlkYXRpb24YAiABKA4yHy5wYi5KYXZhRmVhdHVyZXMuVXRmOFZhbGlkYXRpb25C5AGIAQGYAQSYAQGiAQwSB0RFRkFVTFQYhAeyAcgBCOgHEOkHGr8BVGhlIEphdmEtc3BlY2lmaWMgdXRmOCB2YWxpZGF0aW9uIGZlYXR1cmUgaXMgZGVwcmVjYXRlZCBhbmQgaXMgc2NoZWR1bGVkIHRvIGJlIHJlbW92ZWQgaW4gZWRpdGlvbiAyMDI1LiAgVXRmOCB2YWxpZGF0aW9uIGJlaGF2aW9yIHNob3VsZCB1c2UgdGhlIGdsb2JhbCBjcm9zcy1sYW5ndWFnZSB1dGY4X3ZhbGlkYXRpb24gZmVhdHVyZS4SMAoKbGFyZ2VfZW51bRgDIAEoCEIciAEBmAEGmAEBogEKEgVmYWxzZRiEB7IBAwjpBxJRCh91c2Vfb2xkX291dGVyX2NsYXNzbmFtZV9kZWZhdWx0GAQgASgIQiiIAQGYAQGiAQkSBHRydWUYhAeiAQoSBWZhbHNlGOkHsgEGCOkHIOkHEn8KEm5lc3RfaW5fZmlsZV9jbGFzcxgFIAEoDjI3LnBiLkphdmFGZWF0dXJlcy5OZXN0SW5GaWxlQ2xhc3NGZWF0dXJlLk5lc3RJbkZpbGVDbGFzc0IqiAEBmAEDmAEGmAEIogELEgZMRUdBQ1kYhAeiAQcSAk5PGOkHsgEDCOkHGnwKFk5lc3RJbkZpbGVDbGFzc0ZlYXR1cmUiWAoPTmVzdEluRmlsZUNsYXNzEh4KGk5FU1RfSU5fRklMRV9DTEFTU19VTktOT1dOEAASBgoCTk8QARIHCgNZRVMQAhIUCgZMRUdBQ1kQAxoIIgYI6Qcg6QdKCAgBEICAgIACIkYKDlV0ZjhWYWxpZGF0aW9uEhsKF1VURjhfVkFMSURBVElPTl9VTktOT1dOEAASCwoHREVGQVVMVBABEgoKBlZFUklGWRACSgQIBhAHOkIKBGphdmESGy5nb29nbGUucHJvdG9idWYuRmVhdHVyZVNldBjpByABKAsyEC5wYi5KYXZhRmVhdHVyZXNSBGphdmFCKAoTY29tLmdvb2dsZS5wcm90b2J1ZkIRSmF2YUZlYXR1cmVzUHJvdG8", [descriptor_pb_js_1.file_google_protobuf_descriptor]); +/** + * Describes the message pb.JavaFeatures. + * Use `create(JavaFeaturesSchema)` to create a new message. + */ +exports.JavaFeaturesSchema = (0, message_js_1.messageDesc)(exports.file_google_protobuf_java_features, 0); +/** + * Describes the message pb.JavaFeatures.NestInFileClassFeature. + * Use `create(JavaFeatures_NestInFileClassFeatureSchema)` to create a new message. + */ +exports.JavaFeatures_NestInFileClassFeatureSchema = (0, message_js_1.messageDesc)(exports.file_google_protobuf_java_features, 0, 0); +/** + * @generated from enum pb.JavaFeatures.NestInFileClassFeature.NestInFileClass + */ +var JavaFeatures_NestInFileClassFeature_NestInFileClass; +(function (JavaFeatures_NestInFileClassFeature_NestInFileClass) { + /** + * Invalid default, which should never be used. + * + * @generated from enum value: NEST_IN_FILE_CLASS_UNKNOWN = 0; + */ + JavaFeatures_NestInFileClassFeature_NestInFileClass[JavaFeatures_NestInFileClassFeature_NestInFileClass["NEST_IN_FILE_CLASS_UNKNOWN"] = 0] = "NEST_IN_FILE_CLASS_UNKNOWN"; + /** + * Do not nest the generated class in the file class. + * + * @generated from enum value: NO = 1; + */ + JavaFeatures_NestInFileClassFeature_NestInFileClass[JavaFeatures_NestInFileClassFeature_NestInFileClass["NO"] = 1] = "NO"; + /** + * Nest the generated class in the file class. + * + * @generated from enum value: YES = 2; + */ + JavaFeatures_NestInFileClassFeature_NestInFileClass[JavaFeatures_NestInFileClassFeature_NestInFileClass["YES"] = 2] = "YES"; + /** + * Fall back to the `java_multiple_files` option. Users won't be able to + * set this option. + * + * @generated from enum value: LEGACY = 3; + */ + JavaFeatures_NestInFileClassFeature_NestInFileClass[JavaFeatures_NestInFileClassFeature_NestInFileClass["LEGACY"] = 3] = "LEGACY"; +})(JavaFeatures_NestInFileClassFeature_NestInFileClass || (exports.JavaFeatures_NestInFileClassFeature_NestInFileClass = JavaFeatures_NestInFileClassFeature_NestInFileClass = {})); +/** + * Describes the enum pb.JavaFeatures.NestInFileClassFeature.NestInFileClass. + */ +exports.JavaFeatures_NestInFileClassFeature_NestInFileClassSchema = (0, enum_js_1.enumDesc)(exports.file_google_protobuf_java_features, 0, 0, 0); +/** + * The UTF8 validation strategy to use. + * + * @generated from enum pb.JavaFeatures.Utf8Validation + */ +var JavaFeatures_Utf8Validation; +(function (JavaFeatures_Utf8Validation) { + /** + * Invalid default, which should never be used. + * + * @generated from enum value: UTF8_VALIDATION_UNKNOWN = 0; + */ + JavaFeatures_Utf8Validation[JavaFeatures_Utf8Validation["UTF8_VALIDATION_UNKNOWN"] = 0] = "UTF8_VALIDATION_UNKNOWN"; + /** + * Respect the UTF8 validation behavior specified by the global + * utf8_validation feature. + * + * @generated from enum value: DEFAULT = 1; + */ + JavaFeatures_Utf8Validation[JavaFeatures_Utf8Validation["DEFAULT"] = 1] = "DEFAULT"; + /** + * Verifies UTF8 validity overriding the global utf8_validation + * feature. This represents the legacy java_string_check_utf8 option. + * + * @generated from enum value: VERIFY = 2; + */ + JavaFeatures_Utf8Validation[JavaFeatures_Utf8Validation["VERIFY"] = 2] = "VERIFY"; +})(JavaFeatures_Utf8Validation || (exports.JavaFeatures_Utf8Validation = JavaFeatures_Utf8Validation = {})); +/** + * Describes the enum pb.JavaFeatures.Utf8Validation. + */ +exports.JavaFeatures_Utf8ValidationSchema = (0, enum_js_1.enumDesc)(exports.file_google_protobuf_java_features, 0, 0); +/** + * @generated from extension: optional pb.JavaFeatures java = 1001; + */ +exports.java = (0, extension_js_1.extDesc)(exports.file_google_protobuf_java_features, 0); diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/source_context_pb.d.ts b/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/source_context_pb.d.ts new file mode 100644 index 0000000..d77cea4 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/source_context_pb.d.ts @@ -0,0 +1,43 @@ +import type { GenFile, GenMessage } from "../../../../codegenv2/types.js"; +import type { Message } from "../../../../types.js"; +/** + * Describes the file google/protobuf/source_context.proto. + */ +export declare const file_google_protobuf_source_context: GenFile; +/** + * `SourceContext` represents information about the source of a + * protobuf element, like the file in which it is defined. + * + * @generated from message google.protobuf.SourceContext + */ +export type SourceContext = Message<"google.protobuf.SourceContext"> & { + /** + * The path-qualified name of the .proto file that contained the associated + * protobuf element. For example: `"google/protobuf/source_context.proto"`. + * + * @generated from field: string file_name = 1; + */ + fileName: string; +}; +/** + * `SourceContext` represents information about the source of a + * protobuf element, like the file in which it is defined. + * + * @generated from message google.protobuf.SourceContext + */ +export type SourceContextJson = { + /** + * The path-qualified name of the .proto file that contained the associated + * protobuf element. For example: `"google/protobuf/source_context.proto"`. + * + * @generated from field: string file_name = 1; + */ + fileName?: string; +}; +/** + * Describes the message google.protobuf.SourceContext. + * Use `create(SourceContextSchema)` to create a new message. + */ +export declare const SourceContextSchema: GenMessage; diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/source_context_pb.js b/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/source_context_pb.js new file mode 100644 index 0000000..ddf113b --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/source_context_pb.js @@ -0,0 +1,27 @@ +"use strict"; +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SourceContextSchema = exports.file_google_protobuf_source_context = void 0; +const file_js_1 = require("../../../../codegenv2/file.js"); +const message_js_1 = require("../../../../codegenv2/message.js"); +/** + * Describes the file google/protobuf/source_context.proto. + */ +exports.file_google_protobuf_source_context = (0, file_js_1.fileDesc)("CiRnb29nbGUvcHJvdG9idWYvc291cmNlX2NvbnRleHQucHJvdG8SD2dvb2dsZS5wcm90b2J1ZiIiCg1Tb3VyY2VDb250ZXh0EhEKCWZpbGVfbmFtZRgBIAEoCUKKAQoTY29tLmdvb2dsZS5wcm90b2J1ZkISU291cmNlQ29udGV4dFByb3RvUAFaNmdvb2dsZS5nb2xhbmcub3JnL3Byb3RvYnVmL3R5cGVzL2tub3duL3NvdXJjZWNvbnRleHRwYqICA0dQQqoCHkdvb2dsZS5Qcm90b2J1Zi5XZWxsS25vd25UeXBlc2IGcHJvdG8z"); +/** + * Describes the message google.protobuf.SourceContext. + * Use `create(SourceContextSchema)` to create a new message. + */ +exports.SourceContextSchema = (0, message_js_1.messageDesc)(exports.file_google_protobuf_source_context, 0); diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/struct_pb.d.ts b/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/struct_pb.d.ts new file mode 100644 index 0000000..1bb79e7 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/struct_pb.d.ts @@ -0,0 +1,195 @@ +import type { GenEnum, GenFile, GenMessage } from "../../../../codegenv2/types.js"; +import type { Message } from "../../../../types.js"; +import type { JsonObject, JsonValue } from "../../../../json-value.js"; +/** + * Describes the file google/protobuf/struct.proto. + */ +export declare const file_google_protobuf_struct: GenFile; +/** + * `Struct` represents a structured data value, consisting of fields + * which map to dynamically typed values. In some languages, `Struct` + * might be supported by a native representation. For example, in + * scripting languages like JS a struct is represented as an + * object. The details of that representation are described together + * with the proto support for the language. + * + * The JSON representation for `Struct` is JSON object. + * + * @generated from message google.protobuf.Struct + */ +export type Struct = Message<"google.protobuf.Struct"> & { + /** + * Unordered map of dynamically typed values. + * + * @generated from field: map fields = 1; + */ + fields: { + [key: string]: Value; + }; +}; +/** + * `Struct` represents a structured data value, consisting of fields + * which map to dynamically typed values. In some languages, `Struct` + * might be supported by a native representation. For example, in + * scripting languages like JS a struct is represented as an + * object. The details of that representation are described together + * with the proto support for the language. + * + * The JSON representation for `Struct` is JSON object. + * + * @generated from message google.protobuf.Struct + */ +export type StructJson = JsonObject; +/** + * Describes the message google.protobuf.Struct. + * Use `create(StructSchema)` to create a new message. + */ +export declare const StructSchema: GenMessage; +/** + * `Value` represents a dynamically typed value which can be either + * null, a number, a string, a boolean, a recursive struct value, or a + * list of values. A producer of value is expected to set one of these + * variants. Absence of any variant indicates an error. + * + * The JSON representation for `Value` is JSON value. + * + * @generated from message google.protobuf.Value + */ +export type Value = Message<"google.protobuf.Value"> & { + /** + * The kind of value. + * + * @generated from oneof google.protobuf.Value.kind + */ + kind: { + /** + * Represents a null value. + * + * @generated from field: google.protobuf.NullValue null_value = 1; + */ + value: NullValue; + case: "nullValue"; + } | { + /** + * Represents a double value. + * + * @generated from field: double number_value = 2; + */ + value: number; + case: "numberValue"; + } | { + /** + * Represents a string value. + * + * @generated from field: string string_value = 3; + */ + value: string; + case: "stringValue"; + } | { + /** + * Represents a boolean value. + * + * @generated from field: bool bool_value = 4; + */ + value: boolean; + case: "boolValue"; + } | { + /** + * Represents a structured value. + * + * @generated from field: google.protobuf.Struct struct_value = 5; + */ + value: Struct; + case: "structValue"; + } | { + /** + * Represents a repeated `Value`. + * + * @generated from field: google.protobuf.ListValue list_value = 6; + */ + value: ListValue; + case: "listValue"; + } | { + case: undefined; + value?: undefined; + }; +}; +/** + * `Value` represents a dynamically typed value which can be either + * null, a number, a string, a boolean, a recursive struct value, or a + * list of values. A producer of value is expected to set one of these + * variants. Absence of any variant indicates an error. + * + * The JSON representation for `Value` is JSON value. + * + * @generated from message google.protobuf.Value + */ +export type ValueJson = JsonValue; +/** + * Describes the message google.protobuf.Value. + * Use `create(ValueSchema)` to create a new message. + */ +export declare const ValueSchema: GenMessage; +/** + * `ListValue` is a wrapper around a repeated field of values. + * + * The JSON representation for `ListValue` is JSON array. + * + * @generated from message google.protobuf.ListValue + */ +export type ListValue = Message<"google.protobuf.ListValue"> & { + /** + * Repeated field of dynamically typed values. + * + * @generated from field: repeated google.protobuf.Value values = 1; + */ + values: Value[]; +}; +/** + * `ListValue` is a wrapper around a repeated field of values. + * + * The JSON representation for `ListValue` is JSON array. + * + * @generated from message google.protobuf.ListValue + */ +export type ListValueJson = JsonValue[]; +/** + * Describes the message google.protobuf.ListValue. + * Use `create(ListValueSchema)` to create a new message. + */ +export declare const ListValueSchema: GenMessage; +/** + * `NullValue` is a singleton enumeration to represent the null value for the + * `Value` type union. + * + * The JSON representation for `NullValue` is JSON `null`. + * + * @generated from enum google.protobuf.NullValue + */ +export declare enum NullValue { + /** + * Null value. + * + * @generated from enum value: NULL_VALUE = 0; + */ + NULL_VALUE = 0 +} +/** + * `NullValue` is a singleton enumeration to represent the null value for the + * `Value` type union. + * + * The JSON representation for `NullValue` is JSON `null`. + * + * @generated from enum google.protobuf.NullValue + */ +export type NullValueJson = null; +/** + * Describes the enum google.protobuf.NullValue. + */ +export declare const NullValueSchema: GenEnum; diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/struct_pb.js b/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/struct_pb.js new file mode 100644 index 0000000..ed3caaf --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/struct_pb.js @@ -0,0 +1,59 @@ +"use strict"; +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.NullValueSchema = exports.NullValue = exports.ListValueSchema = exports.ValueSchema = exports.StructSchema = exports.file_google_protobuf_struct = void 0; +const file_js_1 = require("../../../../codegenv2/file.js"); +const message_js_1 = require("../../../../codegenv2/message.js"); +const enum_js_1 = require("../../../../codegenv2/enum.js"); +/** + * Describes the file google/protobuf/struct.proto. + */ +exports.file_google_protobuf_struct = (0, file_js_1.fileDesc)("Chxnb29nbGUvcHJvdG9idWYvc3RydWN0LnByb3RvEg9nb29nbGUucHJvdG9idWYihAEKBlN0cnVjdBIzCgZmaWVsZHMYASADKAsyIy5nb29nbGUucHJvdG9idWYuU3RydWN0LkZpZWxkc0VudHJ5GkUKC0ZpZWxkc0VudHJ5EgsKA2tleRgBIAEoCRIlCgV2YWx1ZRgCIAEoCzIWLmdvb2dsZS5wcm90b2J1Zi5WYWx1ZToCOAEi6gEKBVZhbHVlEjAKCm51bGxfdmFsdWUYASABKA4yGi5nb29nbGUucHJvdG9idWYuTnVsbFZhbHVlSAASFgoMbnVtYmVyX3ZhbHVlGAIgASgBSAASFgoMc3RyaW5nX3ZhbHVlGAMgASgJSAASFAoKYm9vbF92YWx1ZRgEIAEoCEgAEi8KDHN0cnVjdF92YWx1ZRgFIAEoCzIXLmdvb2dsZS5wcm90b2J1Zi5TdHJ1Y3RIABIwCgpsaXN0X3ZhbHVlGAYgASgLMhouZ29vZ2xlLnByb3RvYnVmLkxpc3RWYWx1ZUgAQgYKBGtpbmQiMwoJTGlzdFZhbHVlEiYKBnZhbHVlcxgBIAMoCzIWLmdvb2dsZS5wcm90b2J1Zi5WYWx1ZSobCglOdWxsVmFsdWUSDgoKTlVMTF9WQUxVRRAAQn8KE2NvbS5nb29nbGUucHJvdG9idWZCC1N0cnVjdFByb3RvUAFaL2dvb2dsZS5nb2xhbmcub3JnL3Byb3RvYnVmL3R5cGVzL2tub3duL3N0cnVjdHBi+AEBogIDR1BCqgIeR29vZ2xlLlByb3RvYnVmLldlbGxLbm93blR5cGVzYgZwcm90bzM"); +/** + * Describes the message google.protobuf.Struct. + * Use `create(StructSchema)` to create a new message. + */ +exports.StructSchema = (0, message_js_1.messageDesc)(exports.file_google_protobuf_struct, 0); +/** + * Describes the message google.protobuf.Value. + * Use `create(ValueSchema)` to create a new message. + */ +exports.ValueSchema = (0, message_js_1.messageDesc)(exports.file_google_protobuf_struct, 1); +/** + * Describes the message google.protobuf.ListValue. + * Use `create(ListValueSchema)` to create a new message. + */ +exports.ListValueSchema = (0, message_js_1.messageDesc)(exports.file_google_protobuf_struct, 2); +/** + * `NullValue` is a singleton enumeration to represent the null value for the + * `Value` type union. + * + * The JSON representation for `NullValue` is JSON `null`. + * + * @generated from enum google.protobuf.NullValue + */ +var NullValue; +(function (NullValue) { + /** + * Null value. + * + * @generated from enum value: NULL_VALUE = 0; + */ + NullValue[NullValue["NULL_VALUE"] = 0] = "NULL_VALUE"; +})(NullValue || (exports.NullValue = NullValue = {})); +/** + * Describes the enum google.protobuf.NullValue. + */ +exports.NullValueSchema = (0, enum_js_1.enumDesc)(exports.file_google_protobuf_struct, 0); diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/timestamp_pb.d.ts b/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/timestamp_pb.d.ts new file mode 100644 index 0000000..131e3fd --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/timestamp_pb.d.ts @@ -0,0 +1,222 @@ +import type { GenFile, GenMessage } from "../../../../codegenv2/types.js"; +import type { Message } from "../../../../types.js"; +/** + * Describes the file google/protobuf/timestamp.proto. + */ +export declare const file_google_protobuf_timestamp: GenFile; +/** + * A Timestamp represents a point in time independent of any time zone or local + * calendar, encoded as a count of seconds and fractions of seconds at + * nanosecond resolution. The count is relative to an epoch at UTC midnight on + * January 1, 1970, in the proleptic Gregorian calendar which extends the + * Gregorian calendar backwards to year one. + * + * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + * second table is needed for interpretation, using a [24-hour linear + * smear](https://developers.google.com/time/smear). + * + * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + * restricting to that range, we ensure that we can convert to and from [RFC + * 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + * + * # Examples + * + * Example 1: Compute Timestamp from POSIX `time()`. + * + * Timestamp timestamp; + * timestamp.set_seconds(time(NULL)); + * timestamp.set_nanos(0); + * + * Example 2: Compute Timestamp from POSIX `gettimeofday()`. + * + * struct timeval tv; + * gettimeofday(&tv, NULL); + * + * Timestamp timestamp; + * timestamp.set_seconds(tv.tv_sec); + * timestamp.set_nanos(tv.tv_usec * 1000); + * + * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + * + * FILETIME ft; + * GetSystemTimeAsFileTime(&ft); + * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + * + * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + * Timestamp timestamp; + * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + * + * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + * + * long millis = System.currentTimeMillis(); + * + * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + * .setNanos((int) ((millis % 1000) * 1000000)).build(); + * + * Example 5: Compute Timestamp from Java `Instant.now()`. + * + * Instant now = Instant.now(); + * + * Timestamp timestamp = + * Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + * .setNanos(now.getNano()).build(); + * + * Example 6: Compute Timestamp from current time in Python. + * + * timestamp = Timestamp() + * timestamp.GetCurrentTime() + * + * # JSON Mapping + * + * In JSON format, the Timestamp type is encoded as a string in the + * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the + * format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" + * where {year} is always expressed using four digits while {month}, {day}, + * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional + * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), + * are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone + * is required. A ProtoJSON serializer should always use UTC (as indicated by + * "Z") when printing the Timestamp type and a ProtoJSON parser should be + * able to accept both UTC and other timezones (as indicated by an offset). + * + * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past + * 01:30 UTC on January 15, 2017. + * + * In JavaScript, one can convert a Date object to this format using the + * standard + * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + * method. In Python, a standard `datetime.datetime` object can be converted + * to this format using + * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with + * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use + * the Joda Time's [`ISODateTimeFormat.dateTime()`]( + * http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() + * ) to obtain a formatter capable of generating timestamps in this format. + * + * + * @generated from message google.protobuf.Timestamp + */ +export type Timestamp = Message<"google.protobuf.Timestamp"> & { + /** + * Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must + * be between -62135596800 and 253402300799 inclusive (which corresponds to + * 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z). + * + * @generated from field: int64 seconds = 1; + */ + seconds: bigint; + /** + * Non-negative fractions of a second at nanosecond resolution. This field is + * the nanosecond portion of the duration, not an alternative to seconds. + * Negative second values with fractions must still have non-negative nanos + * values that count forward in time. Must be between 0 and 999,999,999 + * inclusive. + * + * @generated from field: int32 nanos = 2; + */ + nanos: number; +}; +/** + * A Timestamp represents a point in time independent of any time zone or local + * calendar, encoded as a count of seconds and fractions of seconds at + * nanosecond resolution. The count is relative to an epoch at UTC midnight on + * January 1, 1970, in the proleptic Gregorian calendar which extends the + * Gregorian calendar backwards to year one. + * + * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + * second table is needed for interpretation, using a [24-hour linear + * smear](https://developers.google.com/time/smear). + * + * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + * restricting to that range, we ensure that we can convert to and from [RFC + * 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + * + * # Examples + * + * Example 1: Compute Timestamp from POSIX `time()`. + * + * Timestamp timestamp; + * timestamp.set_seconds(time(NULL)); + * timestamp.set_nanos(0); + * + * Example 2: Compute Timestamp from POSIX `gettimeofday()`. + * + * struct timeval tv; + * gettimeofday(&tv, NULL); + * + * Timestamp timestamp; + * timestamp.set_seconds(tv.tv_sec); + * timestamp.set_nanos(tv.tv_usec * 1000); + * + * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + * + * FILETIME ft; + * GetSystemTimeAsFileTime(&ft); + * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + * + * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + * Timestamp timestamp; + * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + * + * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + * + * long millis = System.currentTimeMillis(); + * + * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + * .setNanos((int) ((millis % 1000) * 1000000)).build(); + * + * Example 5: Compute Timestamp from Java `Instant.now()`. + * + * Instant now = Instant.now(); + * + * Timestamp timestamp = + * Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + * .setNanos(now.getNano()).build(); + * + * Example 6: Compute Timestamp from current time in Python. + * + * timestamp = Timestamp() + * timestamp.GetCurrentTime() + * + * # JSON Mapping + * + * In JSON format, the Timestamp type is encoded as a string in the + * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the + * format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" + * where {year} is always expressed using four digits while {month}, {day}, + * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional + * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), + * are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone + * is required. A ProtoJSON serializer should always use UTC (as indicated by + * "Z") when printing the Timestamp type and a ProtoJSON parser should be + * able to accept both UTC and other timezones (as indicated by an offset). + * + * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past + * 01:30 UTC on January 15, 2017. + * + * In JavaScript, one can convert a Date object to this format using the + * standard + * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + * method. In Python, a standard `datetime.datetime` object can be converted + * to this format using + * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with + * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use + * the Joda Time's [`ISODateTimeFormat.dateTime()`]( + * http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() + * ) to obtain a formatter capable of generating timestamps in this format. + * + * + * @generated from message google.protobuf.Timestamp + */ +export type TimestampJson = string; +/** + * Describes the message google.protobuf.Timestamp. + * Use `create(TimestampSchema)` to create a new message. + */ +export declare const TimestampSchema: GenMessage; diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/timestamp_pb.js b/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/timestamp_pb.js new file mode 100644 index 0000000..d4c53ed --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/timestamp_pb.js @@ -0,0 +1,27 @@ +"use strict"; +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TimestampSchema = exports.file_google_protobuf_timestamp = void 0; +const file_js_1 = require("../../../../codegenv2/file.js"); +const message_js_1 = require("../../../../codegenv2/message.js"); +/** + * Describes the file google/protobuf/timestamp.proto. + */ +exports.file_google_protobuf_timestamp = (0, file_js_1.fileDesc)("Ch9nb29nbGUvcHJvdG9idWYvdGltZXN0YW1wLnByb3RvEg9nb29nbGUucHJvdG9idWYiKwoJVGltZXN0YW1wEg8KB3NlY29uZHMYASABKAMSDQoFbmFub3MYAiABKAVChQEKE2NvbS5nb29nbGUucHJvdG9idWZCDlRpbWVzdGFtcFByb3RvUAFaMmdvb2dsZS5nb2xhbmcub3JnL3Byb3RvYnVmL3R5cGVzL2tub3duL3RpbWVzdGFtcHBi+AEBogIDR1BCqgIeR29vZ2xlLlByb3RvYnVmLldlbGxLbm93blR5cGVzYgZwcm90bzM"); +/** + * Describes the message google.protobuf.Timestamp. + * Use `create(TimestampSchema)` to create a new message. + */ +exports.TimestampSchema = (0, message_js_1.messageDesc)(exports.file_google_protobuf_timestamp, 0); diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/type_pb.d.ts b/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/type_pb.d.ts new file mode 100644 index 0000000..db3d096 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/type_pb.d.ts @@ -0,0 +1,722 @@ +import type { GenEnum, GenFile, GenMessage } from "../../../../codegenv2/types.js"; +import type { Any, AnyJson } from "./any_pb.js"; +import type { SourceContext, SourceContextJson } from "./source_context_pb.js"; +import type { Message } from "../../../../types.js"; +/** + * Describes the file google/protobuf/type.proto. + */ +export declare const file_google_protobuf_type: GenFile; +/** + * A protocol buffer message type. + * + * New usages of this message as an alternative to DescriptorProto are strongly + * discouraged. This message does not reliability preserve all information + * necessary to model the schema and preserve semantics. Instead make use of + * FileDescriptorSet which preserves the necessary information. + * + * @generated from message google.protobuf.Type + */ +export type Type = Message<"google.protobuf.Type"> & { + /** + * The fully qualified message name. + * + * @generated from field: string name = 1; + */ + name: string; + /** + * The list of fields. + * + * @generated from field: repeated google.protobuf.Field fields = 2; + */ + fields: Field[]; + /** + * The list of types appearing in `oneof` definitions in this type. + * + * @generated from field: repeated string oneofs = 3; + */ + oneofs: string[]; + /** + * The protocol buffer options. + * + * @generated from field: repeated google.protobuf.Option options = 4; + */ + options: Option[]; + /** + * The source context. + * + * @generated from field: google.protobuf.SourceContext source_context = 5; + */ + sourceContext?: SourceContext | undefined; + /** + * The source syntax. + * + * @generated from field: google.protobuf.Syntax syntax = 6; + */ + syntax: Syntax; + /** + * The source edition string, only valid when syntax is SYNTAX_EDITIONS. + * + * @generated from field: string edition = 7; + */ + edition: string; +}; +/** + * A protocol buffer message type. + * + * New usages of this message as an alternative to DescriptorProto are strongly + * discouraged. This message does not reliability preserve all information + * necessary to model the schema and preserve semantics. Instead make use of + * FileDescriptorSet which preserves the necessary information. + * + * @generated from message google.protobuf.Type + */ +export type TypeJson = { + /** + * The fully qualified message name. + * + * @generated from field: string name = 1; + */ + name?: string; + /** + * The list of fields. + * + * @generated from field: repeated google.protobuf.Field fields = 2; + */ + fields?: FieldJson[]; + /** + * The list of types appearing in `oneof` definitions in this type. + * + * @generated from field: repeated string oneofs = 3; + */ + oneofs?: string[]; + /** + * The protocol buffer options. + * + * @generated from field: repeated google.protobuf.Option options = 4; + */ + options?: OptionJson[]; + /** + * The source context. + * + * @generated from field: google.protobuf.SourceContext source_context = 5; + */ + sourceContext?: SourceContextJson; + /** + * The source syntax. + * + * @generated from field: google.protobuf.Syntax syntax = 6; + */ + syntax?: SyntaxJson; + /** + * The source edition string, only valid when syntax is SYNTAX_EDITIONS. + * + * @generated from field: string edition = 7; + */ + edition?: string; +}; +/** + * Describes the message google.protobuf.Type. + * Use `create(TypeSchema)` to create a new message. + */ +export declare const TypeSchema: GenMessage; +/** + * A single field of a message type. + * + * New usages of this message as an alternative to FieldDescriptorProto are + * strongly discouraged. This message does not reliability preserve all + * information necessary to model the schema and preserve semantics. Instead + * make use of FileDescriptorSet which preserves the necessary information. + * + * @generated from message google.protobuf.Field + */ +export type Field = Message<"google.protobuf.Field"> & { + /** + * The field type. + * + * @generated from field: google.protobuf.Field.Kind kind = 1; + */ + kind: Field_Kind; + /** + * The field cardinality. + * + * @generated from field: google.protobuf.Field.Cardinality cardinality = 2; + */ + cardinality: Field_Cardinality; + /** + * The field number. + * + * @generated from field: int32 number = 3; + */ + number: number; + /** + * The field name. + * + * @generated from field: string name = 4; + */ + name: string; + /** + * The field type URL, without the scheme, for message or enumeration + * types. Example: `"type.googleapis.com/google.protobuf.Timestamp"`. + * + * @generated from field: string type_url = 6; + */ + typeUrl: string; + /** + * The index of the field type in `Type.oneofs`, for message or enumeration + * types. The first type has index 1; zero means the type is not in the list. + * + * @generated from field: int32 oneof_index = 7; + */ + oneofIndex: number; + /** + * Whether to use alternative packed wire representation. + * + * @generated from field: bool packed = 8; + */ + packed: boolean; + /** + * The protocol buffer options. + * + * @generated from field: repeated google.protobuf.Option options = 9; + */ + options: Option[]; + /** + * The field JSON name. + * + * @generated from field: string json_name = 10; + */ + jsonName: string; + /** + * The string value of the default value of this field. Proto2 syntax only. + * + * @generated from field: string default_value = 11; + */ + defaultValue: string; +}; +/** + * A single field of a message type. + * + * New usages of this message as an alternative to FieldDescriptorProto are + * strongly discouraged. This message does not reliability preserve all + * information necessary to model the schema and preserve semantics. Instead + * make use of FileDescriptorSet which preserves the necessary information. + * + * @generated from message google.protobuf.Field + */ +export type FieldJson = { + /** + * The field type. + * + * @generated from field: google.protobuf.Field.Kind kind = 1; + */ + kind?: Field_KindJson; + /** + * The field cardinality. + * + * @generated from field: google.protobuf.Field.Cardinality cardinality = 2; + */ + cardinality?: Field_CardinalityJson; + /** + * The field number. + * + * @generated from field: int32 number = 3; + */ + number?: number; + /** + * The field name. + * + * @generated from field: string name = 4; + */ + name?: string; + /** + * The field type URL, without the scheme, for message or enumeration + * types. Example: `"type.googleapis.com/google.protobuf.Timestamp"`. + * + * @generated from field: string type_url = 6; + */ + typeUrl?: string; + /** + * The index of the field type in `Type.oneofs`, for message or enumeration + * types. The first type has index 1; zero means the type is not in the list. + * + * @generated from field: int32 oneof_index = 7; + */ + oneofIndex?: number; + /** + * Whether to use alternative packed wire representation. + * + * @generated from field: bool packed = 8; + */ + packed?: boolean; + /** + * The protocol buffer options. + * + * @generated from field: repeated google.protobuf.Option options = 9; + */ + options?: OptionJson[]; + /** + * The field JSON name. + * + * @generated from field: string json_name = 10; + */ + jsonName?: string; + /** + * The string value of the default value of this field. Proto2 syntax only. + * + * @generated from field: string default_value = 11; + */ + defaultValue?: string; +}; +/** + * Describes the message google.protobuf.Field. + * Use `create(FieldSchema)` to create a new message. + */ +export declare const FieldSchema: GenMessage; +/** + * Basic field types. + * + * @generated from enum google.protobuf.Field.Kind + */ +export declare enum Field_Kind { + /** + * Field type unknown. + * + * @generated from enum value: TYPE_UNKNOWN = 0; + */ + TYPE_UNKNOWN = 0, + /** + * Field type double. + * + * @generated from enum value: TYPE_DOUBLE = 1; + */ + TYPE_DOUBLE = 1, + /** + * Field type float. + * + * @generated from enum value: TYPE_FLOAT = 2; + */ + TYPE_FLOAT = 2, + /** + * Field type int64. + * + * @generated from enum value: TYPE_INT64 = 3; + */ + TYPE_INT64 = 3, + /** + * Field type uint64. + * + * @generated from enum value: TYPE_UINT64 = 4; + */ + TYPE_UINT64 = 4, + /** + * Field type int32. + * + * @generated from enum value: TYPE_INT32 = 5; + */ + TYPE_INT32 = 5, + /** + * Field type fixed64. + * + * @generated from enum value: TYPE_FIXED64 = 6; + */ + TYPE_FIXED64 = 6, + /** + * Field type fixed32. + * + * @generated from enum value: TYPE_FIXED32 = 7; + */ + TYPE_FIXED32 = 7, + /** + * Field type bool. + * + * @generated from enum value: TYPE_BOOL = 8; + */ + TYPE_BOOL = 8, + /** + * Field type string. + * + * @generated from enum value: TYPE_STRING = 9; + */ + TYPE_STRING = 9, + /** + * Field type group. Proto2 syntax only, and deprecated. + * + * @generated from enum value: TYPE_GROUP = 10; + */ + TYPE_GROUP = 10, + /** + * Field type message. + * + * @generated from enum value: TYPE_MESSAGE = 11; + */ + TYPE_MESSAGE = 11, + /** + * Field type bytes. + * + * @generated from enum value: TYPE_BYTES = 12; + */ + TYPE_BYTES = 12, + /** + * Field type uint32. + * + * @generated from enum value: TYPE_UINT32 = 13; + */ + TYPE_UINT32 = 13, + /** + * Field type enum. + * + * @generated from enum value: TYPE_ENUM = 14; + */ + TYPE_ENUM = 14, + /** + * Field type sfixed32. + * + * @generated from enum value: TYPE_SFIXED32 = 15; + */ + TYPE_SFIXED32 = 15, + /** + * Field type sfixed64. + * + * @generated from enum value: TYPE_SFIXED64 = 16; + */ + TYPE_SFIXED64 = 16, + /** + * Field type sint32. + * + * @generated from enum value: TYPE_SINT32 = 17; + */ + TYPE_SINT32 = 17, + /** + * Field type sint64. + * + * @generated from enum value: TYPE_SINT64 = 18; + */ + TYPE_SINT64 = 18 +} +/** + * Basic field types. + * + * @generated from enum google.protobuf.Field.Kind + */ +export type Field_KindJson = "TYPE_UNKNOWN" | "TYPE_DOUBLE" | "TYPE_FLOAT" | "TYPE_INT64" | "TYPE_UINT64" | "TYPE_INT32" | "TYPE_FIXED64" | "TYPE_FIXED32" | "TYPE_BOOL" | "TYPE_STRING" | "TYPE_GROUP" | "TYPE_MESSAGE" | "TYPE_BYTES" | "TYPE_UINT32" | "TYPE_ENUM" | "TYPE_SFIXED32" | "TYPE_SFIXED64" | "TYPE_SINT32" | "TYPE_SINT64"; +/** + * Describes the enum google.protobuf.Field.Kind. + */ +export declare const Field_KindSchema: GenEnum; +/** + * Whether a field is optional, required, or repeated. + * + * @generated from enum google.protobuf.Field.Cardinality + */ +export declare enum Field_Cardinality { + /** + * For fields with unknown cardinality. + * + * @generated from enum value: CARDINALITY_UNKNOWN = 0; + */ + UNKNOWN = 0, + /** + * For optional fields. + * + * @generated from enum value: CARDINALITY_OPTIONAL = 1; + */ + OPTIONAL = 1, + /** + * For required fields. Proto2 syntax only. + * + * @generated from enum value: CARDINALITY_REQUIRED = 2; + */ + REQUIRED = 2, + /** + * For repeated fields. + * + * @generated from enum value: CARDINALITY_REPEATED = 3; + */ + REPEATED = 3 +} +/** + * Whether a field is optional, required, or repeated. + * + * @generated from enum google.protobuf.Field.Cardinality + */ +export type Field_CardinalityJson = "CARDINALITY_UNKNOWN" | "CARDINALITY_OPTIONAL" | "CARDINALITY_REQUIRED" | "CARDINALITY_REPEATED"; +/** + * Describes the enum google.protobuf.Field.Cardinality. + */ +export declare const Field_CardinalitySchema: GenEnum; +/** + * Enum type definition. + * + * New usages of this message as an alternative to EnumDescriptorProto are + * strongly discouraged. This message does not reliability preserve all + * information necessary to model the schema and preserve semantics. Instead + * make use of FileDescriptorSet which preserves the necessary information. + * + * @generated from message google.protobuf.Enum + */ +export type Enum = Message<"google.protobuf.Enum"> & { + /** + * Enum type name. + * + * @generated from field: string name = 1; + */ + name: string; + /** + * Enum value definitions. + * + * @generated from field: repeated google.protobuf.EnumValue enumvalue = 2; + */ + enumvalue: EnumValue[]; + /** + * Protocol buffer options. + * + * @generated from field: repeated google.protobuf.Option options = 3; + */ + options: Option[]; + /** + * The source context. + * + * @generated from field: google.protobuf.SourceContext source_context = 4; + */ + sourceContext?: SourceContext | undefined; + /** + * The source syntax. + * + * @generated from field: google.protobuf.Syntax syntax = 5; + */ + syntax: Syntax; + /** + * The source edition string, only valid when syntax is SYNTAX_EDITIONS. + * + * @generated from field: string edition = 6; + */ + edition: string; +}; +/** + * Enum type definition. + * + * New usages of this message as an alternative to EnumDescriptorProto are + * strongly discouraged. This message does not reliability preserve all + * information necessary to model the schema and preserve semantics. Instead + * make use of FileDescriptorSet which preserves the necessary information. + * + * @generated from message google.protobuf.Enum + */ +export type EnumJson = { + /** + * Enum type name. + * + * @generated from field: string name = 1; + */ + name?: string; + /** + * Enum value definitions. + * + * @generated from field: repeated google.protobuf.EnumValue enumvalue = 2; + */ + enumvalue?: EnumValueJson[]; + /** + * Protocol buffer options. + * + * @generated from field: repeated google.protobuf.Option options = 3; + */ + options?: OptionJson[]; + /** + * The source context. + * + * @generated from field: google.protobuf.SourceContext source_context = 4; + */ + sourceContext?: SourceContextJson; + /** + * The source syntax. + * + * @generated from field: google.protobuf.Syntax syntax = 5; + */ + syntax?: SyntaxJson; + /** + * The source edition string, only valid when syntax is SYNTAX_EDITIONS. + * + * @generated from field: string edition = 6; + */ + edition?: string; +}; +/** + * Describes the message google.protobuf.Enum. + * Use `create(EnumSchema)` to create a new message. + */ +export declare const EnumSchema: GenMessage; +/** + * Enum value definition. + * + * New usages of this message as an alternative to EnumValueDescriptorProto are + * strongly discouraged. This message does not reliability preserve all + * information necessary to model the schema and preserve semantics. Instead + * make use of FileDescriptorSet which preserves the necessary information. + * + * @generated from message google.protobuf.EnumValue + */ +export type EnumValue = Message<"google.protobuf.EnumValue"> & { + /** + * Enum value name. + * + * @generated from field: string name = 1; + */ + name: string; + /** + * Enum value number. + * + * @generated from field: int32 number = 2; + */ + number: number; + /** + * Protocol buffer options. + * + * @generated from field: repeated google.protobuf.Option options = 3; + */ + options: Option[]; +}; +/** + * Enum value definition. + * + * New usages of this message as an alternative to EnumValueDescriptorProto are + * strongly discouraged. This message does not reliability preserve all + * information necessary to model the schema and preserve semantics. Instead + * make use of FileDescriptorSet which preserves the necessary information. + * + * @generated from message google.protobuf.EnumValue + */ +export type EnumValueJson = { + /** + * Enum value name. + * + * @generated from field: string name = 1; + */ + name?: string; + /** + * Enum value number. + * + * @generated from field: int32 number = 2; + */ + number?: number; + /** + * Protocol buffer options. + * + * @generated from field: repeated google.protobuf.Option options = 3; + */ + options?: OptionJson[]; +}; +/** + * Describes the message google.protobuf.EnumValue. + * Use `create(EnumValueSchema)` to create a new message. + */ +export declare const EnumValueSchema: GenMessage; +/** + * A protocol buffer option, which can be attached to a message, field, + * enumeration, etc. + * + * New usages of this message as an alternative to FileOptions, MessageOptions, + * FieldOptions, EnumOptions, EnumValueOptions, ServiceOptions, or MethodOptions + * are strongly discouraged. + * + * @generated from message google.protobuf.Option + */ +export type Option = Message<"google.protobuf.Option"> & { + /** + * The option's name. For protobuf built-in options (options defined in + * descriptor.proto), this is the short name. For example, `"map_entry"`. + * For custom options, it should be the fully-qualified name. For example, + * `"google.api.http"`. + * + * @generated from field: string name = 1; + */ + name: string; + /** + * The option's value packed in an Any message. If the value is a primitive, + * the corresponding wrapper type defined in google/protobuf/wrappers.proto + * should be used. If the value is an enum, it should be stored as an int32 + * value using the google.protobuf.Int32Value type. + * + * @generated from field: google.protobuf.Any value = 2; + */ + value?: Any | undefined; +}; +/** + * A protocol buffer option, which can be attached to a message, field, + * enumeration, etc. + * + * New usages of this message as an alternative to FileOptions, MessageOptions, + * FieldOptions, EnumOptions, EnumValueOptions, ServiceOptions, or MethodOptions + * are strongly discouraged. + * + * @generated from message google.protobuf.Option + */ +export type OptionJson = { + /** + * The option's name. For protobuf built-in options (options defined in + * descriptor.proto), this is the short name. For example, `"map_entry"`. + * For custom options, it should be the fully-qualified name. For example, + * `"google.api.http"`. + * + * @generated from field: string name = 1; + */ + name?: string; + /** + * The option's value packed in an Any message. If the value is a primitive, + * the corresponding wrapper type defined in google/protobuf/wrappers.proto + * should be used. If the value is an enum, it should be stored as an int32 + * value using the google.protobuf.Int32Value type. + * + * @generated from field: google.protobuf.Any value = 2; + */ + value?: AnyJson; +}; +/** + * Describes the message google.protobuf.Option. + * Use `create(OptionSchema)` to create a new message. + */ +export declare const OptionSchema: GenMessage; +/** + * The syntax in which a protocol buffer element is defined. + * + * @generated from enum google.protobuf.Syntax + */ +export declare enum Syntax { + /** + * Syntax `proto2`. + * + * @generated from enum value: SYNTAX_PROTO2 = 0; + */ + PROTO2 = 0, + /** + * Syntax `proto3`. + * + * @generated from enum value: SYNTAX_PROTO3 = 1; + */ + PROTO3 = 1, + /** + * Syntax `editions`. + * + * @generated from enum value: SYNTAX_EDITIONS = 2; + */ + EDITIONS = 2 +} +/** + * The syntax in which a protocol buffer element is defined. + * + * @generated from enum google.protobuf.Syntax + */ +export type SyntaxJson = "SYNTAX_PROTO2" | "SYNTAX_PROTO3" | "SYNTAX_EDITIONS"; +/** + * Describes the enum google.protobuf.Syntax. + */ +export declare const SyntaxSchema: GenEnum; diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/type_pb.js b/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/type_pb.js new file mode 100644 index 0000000..a58ad10 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/type_pb.js @@ -0,0 +1,242 @@ +"use strict"; +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SyntaxSchema = exports.Syntax = exports.OptionSchema = exports.EnumValueSchema = exports.EnumSchema = exports.Field_CardinalitySchema = exports.Field_Cardinality = exports.Field_KindSchema = exports.Field_Kind = exports.FieldSchema = exports.TypeSchema = exports.file_google_protobuf_type = void 0; +const file_js_1 = require("../../../../codegenv2/file.js"); +const any_pb_js_1 = require("./any_pb.js"); +const source_context_pb_js_1 = require("./source_context_pb.js"); +const message_js_1 = require("../../../../codegenv2/message.js"); +const enum_js_1 = require("../../../../codegenv2/enum.js"); +/** + * Describes the file google/protobuf/type.proto. + */ +exports.file_google_protobuf_type = (0, file_js_1.fileDesc)("Chpnb29nbGUvcHJvdG9idWYvdHlwZS5wcm90bxIPZ29vZ2xlLnByb3RvYnVmIugBCgRUeXBlEgwKBG5hbWUYASABKAkSJgoGZmllbGRzGAIgAygLMhYuZ29vZ2xlLnByb3RvYnVmLkZpZWxkEg4KBm9uZW9mcxgDIAMoCRIoCgdvcHRpb25zGAQgAygLMhcuZ29vZ2xlLnByb3RvYnVmLk9wdGlvbhI2Cg5zb3VyY2VfY29udGV4dBgFIAEoCzIeLmdvb2dsZS5wcm90b2J1Zi5Tb3VyY2VDb250ZXh0EicKBnN5bnRheBgGIAEoDjIXLmdvb2dsZS5wcm90b2J1Zi5TeW50YXgSDwoHZWRpdGlvbhgHIAEoCSLVBQoFRmllbGQSKQoEa2luZBgBIAEoDjIbLmdvb2dsZS5wcm90b2J1Zi5GaWVsZC5LaW5kEjcKC2NhcmRpbmFsaXR5GAIgASgOMiIuZ29vZ2xlLnByb3RvYnVmLkZpZWxkLkNhcmRpbmFsaXR5Eg4KBm51bWJlchgDIAEoBRIMCgRuYW1lGAQgASgJEhAKCHR5cGVfdXJsGAYgASgJEhMKC29uZW9mX2luZGV4GAcgASgFEg4KBnBhY2tlZBgIIAEoCBIoCgdvcHRpb25zGAkgAygLMhcuZ29vZ2xlLnByb3RvYnVmLk9wdGlvbhIRCglqc29uX25hbWUYCiABKAkSFQoNZGVmYXVsdF92YWx1ZRgLIAEoCSLIAgoES2luZBIQCgxUWVBFX1VOS05PV04QABIPCgtUWVBFX0RPVUJMRRABEg4KClRZUEVfRkxPQVQQAhIOCgpUWVBFX0lOVDY0EAMSDwoLVFlQRV9VSU5UNjQQBBIOCgpUWVBFX0lOVDMyEAUSEAoMVFlQRV9GSVhFRDY0EAYSEAoMVFlQRV9GSVhFRDMyEAcSDQoJVFlQRV9CT09MEAgSDwoLVFlQRV9TVFJJTkcQCRIOCgpUWVBFX0dST1VQEAoSEAoMVFlQRV9NRVNTQUdFEAsSDgoKVFlQRV9CWVRFUxAMEg8KC1RZUEVfVUlOVDMyEA0SDQoJVFlQRV9FTlVNEA4SEQoNVFlQRV9TRklYRUQzMhAPEhEKDVRZUEVfU0ZJWEVENjQQEBIPCgtUWVBFX1NJTlQzMhAREg8KC1RZUEVfU0lOVDY0EBIidAoLQ2FyZGluYWxpdHkSFwoTQ0FSRElOQUxJVFlfVU5LTk9XThAAEhgKFENBUkRJTkFMSVRZX09QVElPTkFMEAESGAoUQ0FSRElOQUxJVFlfUkVRVUlSRUQQAhIYChRDQVJESU5BTElUWV9SRVBFQVRFRBADIt8BCgRFbnVtEgwKBG5hbWUYASABKAkSLQoJZW51bXZhbHVlGAIgAygLMhouZ29vZ2xlLnByb3RvYnVmLkVudW1WYWx1ZRIoCgdvcHRpb25zGAMgAygLMhcuZ29vZ2xlLnByb3RvYnVmLk9wdGlvbhI2Cg5zb3VyY2VfY29udGV4dBgEIAEoCzIeLmdvb2dsZS5wcm90b2J1Zi5Tb3VyY2VDb250ZXh0EicKBnN5bnRheBgFIAEoDjIXLmdvb2dsZS5wcm90b2J1Zi5TeW50YXgSDwoHZWRpdGlvbhgGIAEoCSJTCglFbnVtVmFsdWUSDAoEbmFtZRgBIAEoCRIOCgZudW1iZXIYAiABKAUSKAoHb3B0aW9ucxgDIAMoCzIXLmdvb2dsZS5wcm90b2J1Zi5PcHRpb24iOwoGT3B0aW9uEgwKBG5hbWUYASABKAkSIwoFdmFsdWUYAiABKAsyFC5nb29nbGUucHJvdG9idWYuQW55KkMKBlN5bnRheBIRCg1TWU5UQVhfUFJPVE8yEAASEQoNU1lOVEFYX1BST1RPMxABEhMKD1NZTlRBWF9FRElUSU9OUxACQnsKE2NvbS5nb29nbGUucHJvdG9idWZCCVR5cGVQcm90b1ABWi1nb29nbGUuZ29sYW5nLm9yZy9wcm90b2J1Zi90eXBlcy9rbm93bi90eXBlcGL4AQGiAgNHUEKqAh5Hb29nbGUuUHJvdG9idWYuV2VsbEtub3duVHlwZXNiBnByb3RvMw", [any_pb_js_1.file_google_protobuf_any, source_context_pb_js_1.file_google_protobuf_source_context]); +/** + * Describes the message google.protobuf.Type. + * Use `create(TypeSchema)` to create a new message. + */ +exports.TypeSchema = (0, message_js_1.messageDesc)(exports.file_google_protobuf_type, 0); +/** + * Describes the message google.protobuf.Field. + * Use `create(FieldSchema)` to create a new message. + */ +exports.FieldSchema = (0, message_js_1.messageDesc)(exports.file_google_protobuf_type, 1); +/** + * Basic field types. + * + * @generated from enum google.protobuf.Field.Kind + */ +var Field_Kind; +(function (Field_Kind) { + /** + * Field type unknown. + * + * @generated from enum value: TYPE_UNKNOWN = 0; + */ + Field_Kind[Field_Kind["TYPE_UNKNOWN"] = 0] = "TYPE_UNKNOWN"; + /** + * Field type double. + * + * @generated from enum value: TYPE_DOUBLE = 1; + */ + Field_Kind[Field_Kind["TYPE_DOUBLE"] = 1] = "TYPE_DOUBLE"; + /** + * Field type float. + * + * @generated from enum value: TYPE_FLOAT = 2; + */ + Field_Kind[Field_Kind["TYPE_FLOAT"] = 2] = "TYPE_FLOAT"; + /** + * Field type int64. + * + * @generated from enum value: TYPE_INT64 = 3; + */ + Field_Kind[Field_Kind["TYPE_INT64"] = 3] = "TYPE_INT64"; + /** + * Field type uint64. + * + * @generated from enum value: TYPE_UINT64 = 4; + */ + Field_Kind[Field_Kind["TYPE_UINT64"] = 4] = "TYPE_UINT64"; + /** + * Field type int32. + * + * @generated from enum value: TYPE_INT32 = 5; + */ + Field_Kind[Field_Kind["TYPE_INT32"] = 5] = "TYPE_INT32"; + /** + * Field type fixed64. + * + * @generated from enum value: TYPE_FIXED64 = 6; + */ + Field_Kind[Field_Kind["TYPE_FIXED64"] = 6] = "TYPE_FIXED64"; + /** + * Field type fixed32. + * + * @generated from enum value: TYPE_FIXED32 = 7; + */ + Field_Kind[Field_Kind["TYPE_FIXED32"] = 7] = "TYPE_FIXED32"; + /** + * Field type bool. + * + * @generated from enum value: TYPE_BOOL = 8; + */ + Field_Kind[Field_Kind["TYPE_BOOL"] = 8] = "TYPE_BOOL"; + /** + * Field type string. + * + * @generated from enum value: TYPE_STRING = 9; + */ + Field_Kind[Field_Kind["TYPE_STRING"] = 9] = "TYPE_STRING"; + /** + * Field type group. Proto2 syntax only, and deprecated. + * + * @generated from enum value: TYPE_GROUP = 10; + */ + Field_Kind[Field_Kind["TYPE_GROUP"] = 10] = "TYPE_GROUP"; + /** + * Field type message. + * + * @generated from enum value: TYPE_MESSAGE = 11; + */ + Field_Kind[Field_Kind["TYPE_MESSAGE"] = 11] = "TYPE_MESSAGE"; + /** + * Field type bytes. + * + * @generated from enum value: TYPE_BYTES = 12; + */ + Field_Kind[Field_Kind["TYPE_BYTES"] = 12] = "TYPE_BYTES"; + /** + * Field type uint32. + * + * @generated from enum value: TYPE_UINT32 = 13; + */ + Field_Kind[Field_Kind["TYPE_UINT32"] = 13] = "TYPE_UINT32"; + /** + * Field type enum. + * + * @generated from enum value: TYPE_ENUM = 14; + */ + Field_Kind[Field_Kind["TYPE_ENUM"] = 14] = "TYPE_ENUM"; + /** + * Field type sfixed32. + * + * @generated from enum value: TYPE_SFIXED32 = 15; + */ + Field_Kind[Field_Kind["TYPE_SFIXED32"] = 15] = "TYPE_SFIXED32"; + /** + * Field type sfixed64. + * + * @generated from enum value: TYPE_SFIXED64 = 16; + */ + Field_Kind[Field_Kind["TYPE_SFIXED64"] = 16] = "TYPE_SFIXED64"; + /** + * Field type sint32. + * + * @generated from enum value: TYPE_SINT32 = 17; + */ + Field_Kind[Field_Kind["TYPE_SINT32"] = 17] = "TYPE_SINT32"; + /** + * Field type sint64. + * + * @generated from enum value: TYPE_SINT64 = 18; + */ + Field_Kind[Field_Kind["TYPE_SINT64"] = 18] = "TYPE_SINT64"; +})(Field_Kind || (exports.Field_Kind = Field_Kind = {})); +/** + * Describes the enum google.protobuf.Field.Kind. + */ +exports.Field_KindSchema = (0, enum_js_1.enumDesc)(exports.file_google_protobuf_type, 1, 0); +/** + * Whether a field is optional, required, or repeated. + * + * @generated from enum google.protobuf.Field.Cardinality + */ +var Field_Cardinality; +(function (Field_Cardinality) { + /** + * For fields with unknown cardinality. + * + * @generated from enum value: CARDINALITY_UNKNOWN = 0; + */ + Field_Cardinality[Field_Cardinality["UNKNOWN"] = 0] = "UNKNOWN"; + /** + * For optional fields. + * + * @generated from enum value: CARDINALITY_OPTIONAL = 1; + */ + Field_Cardinality[Field_Cardinality["OPTIONAL"] = 1] = "OPTIONAL"; + /** + * For required fields. Proto2 syntax only. + * + * @generated from enum value: CARDINALITY_REQUIRED = 2; + */ + Field_Cardinality[Field_Cardinality["REQUIRED"] = 2] = "REQUIRED"; + /** + * For repeated fields. + * + * @generated from enum value: CARDINALITY_REPEATED = 3; + */ + Field_Cardinality[Field_Cardinality["REPEATED"] = 3] = "REPEATED"; +})(Field_Cardinality || (exports.Field_Cardinality = Field_Cardinality = {})); +/** + * Describes the enum google.protobuf.Field.Cardinality. + */ +exports.Field_CardinalitySchema = (0, enum_js_1.enumDesc)(exports.file_google_protobuf_type, 1, 1); +/** + * Describes the message google.protobuf.Enum. + * Use `create(EnumSchema)` to create a new message. + */ +exports.EnumSchema = (0, message_js_1.messageDesc)(exports.file_google_protobuf_type, 2); +/** + * Describes the message google.protobuf.EnumValue. + * Use `create(EnumValueSchema)` to create a new message. + */ +exports.EnumValueSchema = (0, message_js_1.messageDesc)(exports.file_google_protobuf_type, 3); +/** + * Describes the message google.protobuf.Option. + * Use `create(OptionSchema)` to create a new message. + */ +exports.OptionSchema = (0, message_js_1.messageDesc)(exports.file_google_protobuf_type, 4); +/** + * The syntax in which a protocol buffer element is defined. + * + * @generated from enum google.protobuf.Syntax + */ +var Syntax; +(function (Syntax) { + /** + * Syntax `proto2`. + * + * @generated from enum value: SYNTAX_PROTO2 = 0; + */ + Syntax[Syntax["PROTO2"] = 0] = "PROTO2"; + /** + * Syntax `proto3`. + * + * @generated from enum value: SYNTAX_PROTO3 = 1; + */ + Syntax[Syntax["PROTO3"] = 1] = "PROTO3"; + /** + * Syntax `editions`. + * + * @generated from enum value: SYNTAX_EDITIONS = 2; + */ + Syntax[Syntax["EDITIONS"] = 2] = "EDITIONS"; +})(Syntax || (exports.Syntax = Syntax = {})); +/** + * Describes the enum google.protobuf.Syntax. + */ +exports.SyntaxSchema = (0, enum_js_1.enumDesc)(exports.file_google_protobuf_type, 0); diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/wrappers_pb.d.ts b/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/wrappers_pb.d.ts new file mode 100644 index 0000000..c63820a --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/wrappers_pb.d.ts @@ -0,0 +1,330 @@ +import type { GenFile, GenMessage } from "../../../../codegenv2/types.js"; +import type { Message } from "../../../../types.js"; +/** + * Describes the file google/protobuf/wrappers.proto. + */ +export declare const file_google_protobuf_wrappers: GenFile; +/** + * Wrapper message for `double`. + * + * The JSON representation for `DoubleValue` is JSON number. + * + * Not recommended for use in new APIs, but still useful for legacy APIs and + * has no plan to be removed. + * + * @generated from message google.protobuf.DoubleValue + */ +export type DoubleValue = Message<"google.protobuf.DoubleValue"> & { + /** + * The double value. + * + * @generated from field: double value = 1; + */ + value: number; +}; +/** + * Wrapper message for `double`. + * + * The JSON representation for `DoubleValue` is JSON number. + * + * Not recommended for use in new APIs, but still useful for legacy APIs and + * has no plan to be removed. + * + * @generated from message google.protobuf.DoubleValue + */ +export type DoubleValueJson = number | "NaN" | "Infinity" | "-Infinity"; +/** + * Describes the message google.protobuf.DoubleValue. + * Use `create(DoubleValueSchema)` to create a new message. + */ +export declare const DoubleValueSchema: GenMessage; +/** + * Wrapper message for `float`. + * + * The JSON representation for `FloatValue` is JSON number. + * + * Not recommended for use in new APIs, but still useful for legacy APIs and + * has no plan to be removed. + * + * @generated from message google.protobuf.FloatValue + */ +export type FloatValue = Message<"google.protobuf.FloatValue"> & { + /** + * The float value. + * + * @generated from field: float value = 1; + */ + value: number; +}; +/** + * Wrapper message for `float`. + * + * The JSON representation for `FloatValue` is JSON number. + * + * Not recommended for use in new APIs, but still useful for legacy APIs and + * has no plan to be removed. + * + * @generated from message google.protobuf.FloatValue + */ +export type FloatValueJson = number | "NaN" | "Infinity" | "-Infinity"; +/** + * Describes the message google.protobuf.FloatValue. + * Use `create(FloatValueSchema)` to create a new message. + */ +export declare const FloatValueSchema: GenMessage; +/** + * Wrapper message for `int64`. + * + * The JSON representation for `Int64Value` is JSON string. + * + * Not recommended for use in new APIs, but still useful for legacy APIs and + * has no plan to be removed. + * + * @generated from message google.protobuf.Int64Value + */ +export type Int64Value = Message<"google.protobuf.Int64Value"> & { + /** + * The int64 value. + * + * @generated from field: int64 value = 1; + */ + value: bigint; +}; +/** + * Wrapper message for `int64`. + * + * The JSON representation for `Int64Value` is JSON string. + * + * Not recommended for use in new APIs, but still useful for legacy APIs and + * has no plan to be removed. + * + * @generated from message google.protobuf.Int64Value + */ +export type Int64ValueJson = string; +/** + * Describes the message google.protobuf.Int64Value. + * Use `create(Int64ValueSchema)` to create a new message. + */ +export declare const Int64ValueSchema: GenMessage; +/** + * Wrapper message for `uint64`. + * + * The JSON representation for `UInt64Value` is JSON string. + * + * Not recommended for use in new APIs, but still useful for legacy APIs and + * has no plan to be removed. + * + * @generated from message google.protobuf.UInt64Value + */ +export type UInt64Value = Message<"google.protobuf.UInt64Value"> & { + /** + * The uint64 value. + * + * @generated from field: uint64 value = 1; + */ + value: bigint; +}; +/** + * Wrapper message for `uint64`. + * + * The JSON representation for `UInt64Value` is JSON string. + * + * Not recommended for use in new APIs, but still useful for legacy APIs and + * has no plan to be removed. + * + * @generated from message google.protobuf.UInt64Value + */ +export type UInt64ValueJson = string; +/** + * Describes the message google.protobuf.UInt64Value. + * Use `create(UInt64ValueSchema)` to create a new message. + */ +export declare const UInt64ValueSchema: GenMessage; +/** + * Wrapper message for `int32`. + * + * The JSON representation for `Int32Value` is JSON number. + * + * Not recommended for use in new APIs, but still useful for legacy APIs and + * has no plan to be removed. + * + * @generated from message google.protobuf.Int32Value + */ +export type Int32Value = Message<"google.protobuf.Int32Value"> & { + /** + * The int32 value. + * + * @generated from field: int32 value = 1; + */ + value: number; +}; +/** + * Wrapper message for `int32`. + * + * The JSON representation for `Int32Value` is JSON number. + * + * Not recommended for use in new APIs, but still useful for legacy APIs and + * has no plan to be removed. + * + * @generated from message google.protobuf.Int32Value + */ +export type Int32ValueJson = number; +/** + * Describes the message google.protobuf.Int32Value. + * Use `create(Int32ValueSchema)` to create a new message. + */ +export declare const Int32ValueSchema: GenMessage; +/** + * Wrapper message for `uint32`. + * + * The JSON representation for `UInt32Value` is JSON number. + * + * Not recommended for use in new APIs, but still useful for legacy APIs and + * has no plan to be removed. + * + * @generated from message google.protobuf.UInt32Value + */ +export type UInt32Value = Message<"google.protobuf.UInt32Value"> & { + /** + * The uint32 value. + * + * @generated from field: uint32 value = 1; + */ + value: number; +}; +/** + * Wrapper message for `uint32`. + * + * The JSON representation for `UInt32Value` is JSON number. + * + * Not recommended for use in new APIs, but still useful for legacy APIs and + * has no plan to be removed. + * + * @generated from message google.protobuf.UInt32Value + */ +export type UInt32ValueJson = number; +/** + * Describes the message google.protobuf.UInt32Value. + * Use `create(UInt32ValueSchema)` to create a new message. + */ +export declare const UInt32ValueSchema: GenMessage; +/** + * Wrapper message for `bool`. + * + * The JSON representation for `BoolValue` is JSON `true` and `false`. + * + * Not recommended for use in new APIs, but still useful for legacy APIs and + * has no plan to be removed. + * + * @generated from message google.protobuf.BoolValue + */ +export type BoolValue = Message<"google.protobuf.BoolValue"> & { + /** + * The bool value. + * + * @generated from field: bool value = 1; + */ + value: boolean; +}; +/** + * Wrapper message for `bool`. + * + * The JSON representation for `BoolValue` is JSON `true` and `false`. + * + * Not recommended for use in new APIs, but still useful for legacy APIs and + * has no plan to be removed. + * + * @generated from message google.protobuf.BoolValue + */ +export type BoolValueJson = boolean; +/** + * Describes the message google.protobuf.BoolValue. + * Use `create(BoolValueSchema)` to create a new message. + */ +export declare const BoolValueSchema: GenMessage; +/** + * Wrapper message for `string`. + * + * The JSON representation for `StringValue` is JSON string. + * + * Not recommended for use in new APIs, but still useful for legacy APIs and + * has no plan to be removed. + * + * @generated from message google.protobuf.StringValue + */ +export type StringValue = Message<"google.protobuf.StringValue"> & { + /** + * The string value. + * + * @generated from field: string value = 1; + */ + value: string; +}; +/** + * Wrapper message for `string`. + * + * The JSON representation for `StringValue` is JSON string. + * + * Not recommended for use in new APIs, but still useful for legacy APIs and + * has no plan to be removed. + * + * @generated from message google.protobuf.StringValue + */ +export type StringValueJson = string; +/** + * Describes the message google.protobuf.StringValue. + * Use `create(StringValueSchema)` to create a new message. + */ +export declare const StringValueSchema: GenMessage; +/** + * Wrapper message for `bytes`. + * + * The JSON representation for `BytesValue` is JSON string. + * + * Not recommended for use in new APIs, but still useful for legacy APIs and + * has no plan to be removed. + * + * @generated from message google.protobuf.BytesValue + */ +export type BytesValue = Message<"google.protobuf.BytesValue"> & { + /** + * The bytes value. + * + * @generated from field: bytes value = 1; + */ + value: Uint8Array; +}; +/** + * Wrapper message for `bytes`. + * + * The JSON representation for `BytesValue` is JSON string. + * + * Not recommended for use in new APIs, but still useful for legacy APIs and + * has no plan to be removed. + * + * @generated from message google.protobuf.BytesValue + */ +export type BytesValueJson = string; +/** + * Describes the message google.protobuf.BytesValue. + * Use `create(BytesValueSchema)` to create a new message. + */ +export declare const BytesValueSchema: GenMessage; diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/wrappers_pb.js b/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/wrappers_pb.js new file mode 100644 index 0000000..108c122 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/wrappers_pb.js @@ -0,0 +1,67 @@ +"use strict"; +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.BytesValueSchema = exports.StringValueSchema = exports.BoolValueSchema = exports.UInt32ValueSchema = exports.Int32ValueSchema = exports.UInt64ValueSchema = exports.Int64ValueSchema = exports.FloatValueSchema = exports.DoubleValueSchema = exports.file_google_protobuf_wrappers = void 0; +const file_js_1 = require("../../../../codegenv2/file.js"); +const message_js_1 = require("../../../../codegenv2/message.js"); +/** + * Describes the file google/protobuf/wrappers.proto. + */ +exports.file_google_protobuf_wrappers = (0, file_js_1.fileDesc)("Ch5nb29nbGUvcHJvdG9idWYvd3JhcHBlcnMucHJvdG8SD2dvb2dsZS5wcm90b2J1ZiIcCgtEb3VibGVWYWx1ZRINCgV2YWx1ZRgBIAEoASIbCgpGbG9hdFZhbHVlEg0KBXZhbHVlGAEgASgCIhsKCkludDY0VmFsdWUSDQoFdmFsdWUYASABKAMiHAoLVUludDY0VmFsdWUSDQoFdmFsdWUYASABKAQiGwoKSW50MzJWYWx1ZRINCgV2YWx1ZRgBIAEoBSIcCgtVSW50MzJWYWx1ZRINCgV2YWx1ZRgBIAEoDSIaCglCb29sVmFsdWUSDQoFdmFsdWUYASABKAgiHAoLU3RyaW5nVmFsdWUSDQoFdmFsdWUYASABKAkiGwoKQnl0ZXNWYWx1ZRINCgV2YWx1ZRgBIAEoDEKDAQoTY29tLmdvb2dsZS5wcm90b2J1ZkINV3JhcHBlcnNQcm90b1ABWjFnb29nbGUuZ29sYW5nLm9yZy9wcm90b2J1Zi90eXBlcy9rbm93bi93cmFwcGVyc3Bi+AEBogIDR1BCqgIeR29vZ2xlLlByb3RvYnVmLldlbGxLbm93blR5cGVzYgZwcm90bzM"); +/** + * Describes the message google.protobuf.DoubleValue. + * Use `create(DoubleValueSchema)` to create a new message. + */ +exports.DoubleValueSchema = (0, message_js_1.messageDesc)(exports.file_google_protobuf_wrappers, 0); +/** + * Describes the message google.protobuf.FloatValue. + * Use `create(FloatValueSchema)` to create a new message. + */ +exports.FloatValueSchema = (0, message_js_1.messageDesc)(exports.file_google_protobuf_wrappers, 1); +/** + * Describes the message google.protobuf.Int64Value. + * Use `create(Int64ValueSchema)` to create a new message. + */ +exports.Int64ValueSchema = (0, message_js_1.messageDesc)(exports.file_google_protobuf_wrappers, 2); +/** + * Describes the message google.protobuf.UInt64Value. + * Use `create(UInt64ValueSchema)` to create a new message. + */ +exports.UInt64ValueSchema = (0, message_js_1.messageDesc)(exports.file_google_protobuf_wrappers, 3); +/** + * Describes the message google.protobuf.Int32Value. + * Use `create(Int32ValueSchema)` to create a new message. + */ +exports.Int32ValueSchema = (0, message_js_1.messageDesc)(exports.file_google_protobuf_wrappers, 4); +/** + * Describes the message google.protobuf.UInt32Value. + * Use `create(UInt32ValueSchema)` to create a new message. + */ +exports.UInt32ValueSchema = (0, message_js_1.messageDesc)(exports.file_google_protobuf_wrappers, 5); +/** + * Describes the message google.protobuf.BoolValue. + * Use `create(BoolValueSchema)` to create a new message. + */ +exports.BoolValueSchema = (0, message_js_1.messageDesc)(exports.file_google_protobuf_wrappers, 6); +/** + * Describes the message google.protobuf.StringValue. + * Use `create(StringValueSchema)` to create a new message. + */ +exports.StringValueSchema = (0, message_js_1.messageDesc)(exports.file_google_protobuf_wrappers, 7); +/** + * Describes the message google.protobuf.BytesValue. + * Use `create(BytesValueSchema)` to create a new message. + */ +exports.BytesValueSchema = (0, message_js_1.messageDesc)(exports.file_google_protobuf_wrappers, 8); diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/wkt/index.d.ts b/node_modules/@bufbuild/protobuf/dist/cjs/wkt/index.d.ts new file mode 100644 index 0000000..9218695 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/wkt/index.d.ts @@ -0,0 +1,19 @@ +export * from "./timestamp.js"; +export * from "./duration.js"; +export * from "./any.js"; +export * from "./wrappers.js"; +export * from "./gen/google/protobuf/any_pb.js"; +export * from "./gen/google/protobuf/api_pb.js"; +export * from "./gen/google/protobuf/cpp_features_pb.js"; +export * from "./gen/google/protobuf/descriptor_pb.js"; +export * from "./gen/google/protobuf/duration_pb.js"; +export * from "./gen/google/protobuf/empty_pb.js"; +export * from "./gen/google/protobuf/field_mask_pb.js"; +export * from "./gen/google/protobuf/go_features_pb.js"; +export * from "./gen/google/protobuf/java_features_pb.js"; +export * from "./gen/google/protobuf/source_context_pb.js"; +export * from "./gen/google/protobuf/struct_pb.js"; +export * from "./gen/google/protobuf/timestamp_pb.js"; +export * from "./gen/google/protobuf/type_pb.js"; +export * from "./gen/google/protobuf/wrappers_pb.js"; +export * from "./gen/google/protobuf/compiler/plugin_pb.js"; diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/wkt/index.js b/node_modules/@bufbuild/protobuf/dist/cjs/wkt/index.js new file mode 100644 index 0000000..147eb2b --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/wkt/index.js @@ -0,0 +1,48 @@ +"use strict"; +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./timestamp.js"), exports); +__exportStar(require("./duration.js"), exports); +__exportStar(require("./any.js"), exports); +__exportStar(require("./wrappers.js"), exports); +__exportStar(require("./gen/google/protobuf/any_pb.js"), exports); +__exportStar(require("./gen/google/protobuf/api_pb.js"), exports); +__exportStar(require("./gen/google/protobuf/cpp_features_pb.js"), exports); +__exportStar(require("./gen/google/protobuf/descriptor_pb.js"), exports); +__exportStar(require("./gen/google/protobuf/duration_pb.js"), exports); +__exportStar(require("./gen/google/protobuf/empty_pb.js"), exports); +__exportStar(require("./gen/google/protobuf/field_mask_pb.js"), exports); +__exportStar(require("./gen/google/protobuf/go_features_pb.js"), exports); +__exportStar(require("./gen/google/protobuf/java_features_pb.js"), exports); +__exportStar(require("./gen/google/protobuf/source_context_pb.js"), exports); +__exportStar(require("./gen/google/protobuf/struct_pb.js"), exports); +__exportStar(require("./gen/google/protobuf/timestamp_pb.js"), exports); +__exportStar(require("./gen/google/protobuf/type_pb.js"), exports); +__exportStar(require("./gen/google/protobuf/wrappers_pb.js"), exports); +__exportStar(require("./gen/google/protobuf/compiler/plugin_pb.js"), exports); diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/wkt/timestamp.d.ts b/node_modules/@bufbuild/protobuf/dist/cjs/wkt/timestamp.d.ts new file mode 100644 index 0000000..6ae7c19 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/wkt/timestamp.d.ts @@ -0,0 +1,21 @@ +import type { Timestamp } from "./gen/google/protobuf/timestamp_pb.js"; +/** + * Create a google.protobuf.Timestamp for the current time. + */ +export declare function timestampNow(): Timestamp; +/** + * Create a google.protobuf.Timestamp message from an ECMAScript Date. + */ +export declare function timestampFromDate(date: Date): Timestamp; +/** + * Convert a google.protobuf.Timestamp message to an ECMAScript Date. + */ +export declare function timestampDate(timestamp: Timestamp): Date; +/** + * Create a google.protobuf.Timestamp message from a Unix timestamp in milliseconds. + */ +export declare function timestampFromMs(timestampMs: number): Timestamp; +/** + * Convert a google.protobuf.Timestamp to a Unix timestamp in milliseconds. + */ +export declare function timestampMs(timestamp: Timestamp): number; diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/wkt/timestamp.js b/node_modules/@bufbuild/protobuf/dist/cjs/wkt/timestamp.js new file mode 100644 index 0000000..2aaba88 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/wkt/timestamp.js @@ -0,0 +1,57 @@ +"use strict"; +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.timestampNow = timestampNow; +exports.timestampFromDate = timestampFromDate; +exports.timestampDate = timestampDate; +exports.timestampFromMs = timestampFromMs; +exports.timestampMs = timestampMs; +const timestamp_pb_js_1 = require("./gen/google/protobuf/timestamp_pb.js"); +const create_js_1 = require("../create.js"); +const proto_int64_js_1 = require("../proto-int64.js"); +/** + * Create a google.protobuf.Timestamp for the current time. + */ +function timestampNow() { + return timestampFromDate(new Date()); +} +/** + * Create a google.protobuf.Timestamp message from an ECMAScript Date. + */ +function timestampFromDate(date) { + return timestampFromMs(date.getTime()); +} +/** + * Convert a google.protobuf.Timestamp message to an ECMAScript Date. + */ +function timestampDate(timestamp) { + return new Date(timestampMs(timestamp)); +} +/** + * Create a google.protobuf.Timestamp message from a Unix timestamp in milliseconds. + */ +function timestampFromMs(timestampMs) { + const seconds = Math.floor(timestampMs / 1000); + return (0, create_js_1.create)(timestamp_pb_js_1.TimestampSchema, { + seconds: proto_int64_js_1.protoInt64.parse(seconds), + nanos: (timestampMs - seconds * 1000) * 1000000, + }); +} +/** + * Convert a google.protobuf.Timestamp to a Unix timestamp in milliseconds. + */ +function timestampMs(timestamp) { + return (Number(timestamp.seconds) * 1000 + Math.round(timestamp.nanos / 1000000)); +} diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/wkt/wrappers.d.ts b/node_modules/@bufbuild/protobuf/dist/cjs/wkt/wrappers.d.ts new file mode 100644 index 0000000..0bfb6c0 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/wkt/wrappers.d.ts @@ -0,0 +1,25 @@ +import type { Message } from "../types.js"; +import type { BoolValue, BytesValue, DoubleValue, FloatValue, Int32Value, Int64Value, StringValue, UInt32Value, UInt64Value } from "./gen/google/protobuf/wrappers_pb.js"; +import type { DescField, DescMessage } from "../descriptors.js"; +export declare function isWrapper(arg: Message): arg is DoubleValue | FloatValue | Int64Value | UInt64Value | Int32Value | UInt32Value | BoolValue | StringValue | BytesValue; +export type WktWrapperDesc = DescMessage & { + fields: [ + DescField & { + fieldKind: "scalar"; + number: 1; + name: "value"; + oneof: undefined; + } + ]; +}; +export declare function isWrapperDesc(messageDesc: DescMessage): messageDesc is WktWrapperDesc; +/** + * Returns true if the descriptor is a well-known type with a custom JSON + * representation per the protobuf JSON spec. Examples: Timestamp as an + * RFC 3339 string, Duration as "5s", wrappers as the unwrapped scalar. + * + * When packed inside `google.protobuf.Any`, these messages are serialized + * as `{"@type": ..., "value": }`; all other messages embed + * their fields directly. + */ +export declare function hasCustomJsonRepresentation(desc: DescMessage): boolean; diff --git a/node_modules/@bufbuild/protobuf/dist/cjs/wkt/wrappers.js b/node_modules/@bufbuild/protobuf/dist/cjs/wkt/wrappers.js new file mode 100644 index 0000000..9582f3b --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/cjs/wkt/wrappers.js @@ -0,0 +1,66 @@ +"use strict"; +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isWrapper = isWrapper; +exports.isWrapperDesc = isWrapperDesc; +exports.hasCustomJsonRepresentation = hasCustomJsonRepresentation; +function isWrapper(arg) { + return isWrapperTypeName(arg.$typeName); +} +function isWrapperDesc(messageDesc) { + const f = messageDesc.fields[0]; + return (isWrapperTypeName(messageDesc.typeName) && + f !== undefined && + f.fieldKind == "scalar" && + f.name == "value" && + f.number == 1); +} +/** + * Returns true if the descriptor is a well-known type with a custom JSON + * representation per the protobuf JSON spec. Examples: Timestamp as an + * RFC 3339 string, Duration as "5s", wrappers as the unwrapped scalar. + * + * When packed inside `google.protobuf.Any`, these messages are serialized + * as `{"@type": ..., "value": }`; all other messages embed + * their fields directly. + */ +function hasCustomJsonRepresentation(desc) { + switch (desc.typeName) { + case "google.protobuf.Any": + case "google.protobuf.Timestamp": + case "google.protobuf.Duration": + case "google.protobuf.FieldMask": + case "google.protobuf.Struct": + case "google.protobuf.Value": + case "google.protobuf.ListValue": + return true; + default: + return isWrapperDesc(desc); + } +} +function isWrapperTypeName(name) { + return (name.startsWith("google.protobuf.") && + [ + "DoubleValue", + "FloatValue", + "Int64Value", + "UInt64Value", + "Int32Value", + "UInt32Value", + "BoolValue", + "StringValue", + "BytesValue", + ].includes(name.substring(16))); +} diff --git a/node_modules/@bufbuild/protobuf/dist/esm/clone.d.ts b/node_modules/@bufbuild/protobuf/dist/esm/clone.d.ts new file mode 100644 index 0000000..1bb50b6 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/clone.d.ts @@ -0,0 +1,6 @@ +import type { MessageShape } from "./types.js"; +import { type DescMessage } from "./descriptors.js"; +/** + * Create a deep copy of a message, including extensions and unknown fields. + */ +export declare function clone(schema: Desc, message: MessageShape): MessageShape; diff --git a/node_modules/@bufbuild/protobuf/dist/esm/clone.js b/node_modules/@bufbuild/protobuf/dist/esm/clone.js new file mode 100644 index 0000000..c95122e --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/clone.js @@ -0,0 +1,63 @@ +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +import { ScalarType } from "./descriptors.js"; +import { reflect } from "./reflect/reflect.js"; +import { isReflectMessage } from "./reflect/guard.js"; +/** + * Create a deep copy of a message, including extensions and unknown fields. + */ +export function clone(schema, message) { + return cloneReflect(reflect(schema, message)).message; +} +function cloneReflect(i) { + const o = reflect(i.desc); + for (const f of i.fields) { + if (!i.isSet(f)) { + continue; + } + switch (f.fieldKind) { + case "list": + const list = o.get(f); + for (const item of i.get(f)) { + list.add(cloneSingular(f, item)); + } + break; + case "map": + const map = o.get(f); + for (const entry of i.get(f).entries()) { + map.set(entry[0], cloneSingular(f, entry[1])); + } + break; + default: { + o.set(f, cloneSingular(f, i.get(f))); + break; + } + } + } + const unknown = i.getUnknown(); + if (unknown && unknown.length > 0) { + o.setUnknown([...unknown]); + } + return o; +} +function cloneSingular(field, value) { + if (field.message !== undefined && isReflectMessage(value)) { + return cloneReflect(value); + } + if (field.scalar == ScalarType.BYTES && value instanceof Uint8Array) { + // @ts-expect-error T cannot extend Uint8Array in practice + return value.slice(); + } + return value; +} diff --git a/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/enum.d.ts b/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/enum.d.ts new file mode 100644 index 0000000..8f5c83a --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/enum.d.ts @@ -0,0 +1,10 @@ +import type { DescFile } from "../descriptors.js"; +import type { GenEnum } from "./types.js"; +import type { JsonValue } from "../json-value.js"; +export { tsEnum } from "../codegenv2/enum.js"; +/** + * Hydrate an enum descriptor. + * + * @private + */ +export declare function enumDesc(file: DescFile, path: number, ...paths: number[]): GenEnum; diff --git a/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/enum.js b/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/enum.js new file mode 100644 index 0000000..7c8ec38 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/enum.js @@ -0,0 +1,26 @@ +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +export { tsEnum } from "../codegenv2/enum.js"; +/** + * Hydrate an enum descriptor. + * + * @private + */ +export function enumDesc(file, path, ...paths) { + if (paths.length == 0) { + return file.enums[path]; + } + const e = paths.pop(); // we checked length above + return paths.reduce((acc, cur) => acc.nestedMessages[cur], file.messages[path]).nestedEnums[e]; +} diff --git a/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/extension.d.ts b/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/extension.d.ts new file mode 100644 index 0000000..7d6374b --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/extension.d.ts @@ -0,0 +1,9 @@ +import type { Message } from "../types.js"; +import type { DescFile } from "../descriptors.js"; +import type { GenExtension } from "./types.js"; +/** + * Hydrate an extension descriptor. + * + * @private + */ +export declare function extDesc(file: DescFile, path: number, ...paths: number[]): GenExtension; diff --git a/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/extension.js b/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/extension.js new file mode 100644 index 0000000..9df5caa --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/extension.js @@ -0,0 +1,25 @@ +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +/** + * Hydrate an extension descriptor. + * + * @private + */ +export function extDesc(file, path, ...paths) { + if (paths.length == 0) { + return file.extensions[path]; + } + const e = paths.pop(); // we checked length above + return paths.reduce((acc, cur) => acc.nestedMessages[cur], file.messages[path]).nestedExtensions[e]; +} diff --git a/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/file.d.ts b/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/file.d.ts new file mode 100644 index 0000000..5c3a513 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/file.d.ts @@ -0,0 +1 @@ +export { fileDesc } from "../codegenv2/file.js"; diff --git a/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/file.js b/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/file.js new file mode 100644 index 0000000..0d18696 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/file.js @@ -0,0 +1,14 @@ +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +export { fileDesc } from "../codegenv2/file.js"; diff --git a/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/index.d.ts b/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/index.d.ts new file mode 100644 index 0000000..a3f2ade --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/index.d.ts @@ -0,0 +1,10 @@ +export * from "../codegenv2/boot.js"; +export * from "../codegenv2/embed.js"; +export * from "./enum.js"; +export * from "./extension.js"; +export * from "./file.js"; +export * from "./message.js"; +export * from "./service.js"; +export * from "./symbols.js"; +export * from "../codegenv2/scalar.js"; +export * from "./types.js"; diff --git a/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/index.js b/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/index.js new file mode 100644 index 0000000..0328671 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/index.js @@ -0,0 +1,23 @@ +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +export * from "../codegenv2/boot.js"; +export * from "../codegenv2/embed.js"; +export * from "./enum.js"; +export * from "./extension.js"; +export * from "./file.js"; +export * from "./message.js"; +export * from "./service.js"; +export * from "./symbols.js"; +export * from "../codegenv2/scalar.js"; +export * from "./types.js"; diff --git a/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/message.d.ts b/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/message.d.ts new file mode 100644 index 0000000..46ad4ad --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/message.d.ts @@ -0,0 +1,10 @@ +import type { Message } from "../types.js"; +import type { DescFile } from "../descriptors.js"; +import type { GenMessage } from "./types.js"; +import type { JsonValue } from "../json-value.js"; +/** + * Hydrate a message descriptor. + * + * @private + */ +export declare function messageDesc(file: DescFile, path: number, ...paths: number[]): GenMessage; diff --git a/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/message.js b/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/message.js new file mode 100644 index 0000000..83c97ac --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/message.js @@ -0,0 +1,21 @@ +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +/** + * Hydrate a message descriptor. + * + * @private + */ +export function messageDesc(file, path, ...paths) { + return paths.reduce((acc, cur) => acc.nestedMessages[cur], file.messages[path]); +} diff --git a/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/service.d.ts b/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/service.d.ts new file mode 100644 index 0000000..5818f75 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/service.d.ts @@ -0,0 +1,8 @@ +import type { GenService, GenServiceMethods } from "./types.js"; +import type { DescFile } from "../descriptors.js"; +/** + * Hydrate a service descriptor. + * + * @private + */ +export declare function serviceDesc(file: DescFile, path: number, ...paths: number[]): GenService; diff --git a/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/service.js b/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/service.js new file mode 100644 index 0000000..09ca4ba --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/service.js @@ -0,0 +1,24 @@ +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +/** + * Hydrate a service descriptor. + * + * @private + */ +export function serviceDesc(file, path, ...paths) { + if (paths.length > 0) { + throw new Error(); + } + return file.services[path]; +} diff --git a/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/symbols.d.ts b/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/symbols.d.ts new file mode 100644 index 0000000..fb9fd70 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/symbols.d.ts @@ -0,0 +1,135 @@ +/** + * @private + */ +export declare const packageName = "@bufbuild/protobuf"; +/** + * @private + */ +export declare const wktPublicImportPaths: Readonly>; +/** + * @private + */ +export declare const symbols: { + readonly codegen: { + readonly boot: { + readonly typeOnly: false; + readonly bootstrapWktFrom: "../../codegenv1/boot.js"; + readonly from: string; + }; + readonly fileDesc: { + readonly typeOnly: false; + readonly bootstrapWktFrom: "../../codegenv1/file.js"; + readonly from: string; + }; + readonly enumDesc: { + readonly typeOnly: false; + readonly bootstrapWktFrom: "../../codegenv1/enum.js"; + readonly from: string; + }; + readonly extDesc: { + readonly typeOnly: false; + readonly bootstrapWktFrom: "../../codegenv1/extension.js"; + readonly from: string; + }; + readonly messageDesc: { + readonly typeOnly: false; + readonly bootstrapWktFrom: "../../codegenv1/message.js"; + readonly from: string; + }; + readonly serviceDesc: { + readonly typeOnly: false; + readonly bootstrapWktFrom: "../../codegenv1/service.js"; + readonly from: string; + }; + readonly tsEnum: { + readonly typeOnly: false; + readonly bootstrapWktFrom: "../../codegenv1/enum.js"; + readonly from: string; + }; + readonly GenFile: { + readonly typeOnly: true; + readonly bootstrapWktFrom: "../../codegenv1/types.js"; + readonly from: string; + }; + readonly GenEnum: { + readonly typeOnly: true; + readonly bootstrapWktFrom: "../../codegenv1/types.js"; + readonly from: string; + }; + readonly GenExtension: { + readonly typeOnly: true; + readonly bootstrapWktFrom: "../../codegenv1/types.js"; + readonly from: string; + }; + readonly GenMessage: { + readonly typeOnly: true; + readonly bootstrapWktFrom: "../../codegenv1/types.js"; + readonly from: string; + }; + readonly GenService: { + readonly typeOnly: true; + readonly bootstrapWktFrom: "../../codegenv1/types.js"; + readonly from: string; + }; + }; + readonly isMessage: { + readonly typeOnly: false; + readonly bootstrapWktFrom: "../../is-message.js"; + readonly from: "@bufbuild/protobuf"; + }; + readonly Message: { + readonly typeOnly: true; + readonly bootstrapWktFrom: "../../types.js"; + readonly from: "@bufbuild/protobuf"; + }; + readonly create: { + readonly typeOnly: false; + readonly bootstrapWktFrom: "../../create.js"; + readonly from: "@bufbuild/protobuf"; + }; + readonly fromJson: { + readonly typeOnly: false; + readonly bootstrapWktFrom: "../../from-json.js"; + readonly from: "@bufbuild/protobuf"; + }; + readonly fromJsonString: { + readonly typeOnly: false; + readonly bootstrapWktFrom: "../../from-json.js"; + readonly from: "@bufbuild/protobuf"; + }; + readonly fromBinary: { + readonly typeOnly: false; + readonly bootstrapWktFrom: "../../from-binary.js"; + readonly from: "@bufbuild/protobuf"; + }; + readonly toBinary: { + readonly typeOnly: false; + readonly bootstrapWktFrom: "../../to-binary.js"; + readonly from: "@bufbuild/protobuf"; + }; + readonly toJson: { + readonly typeOnly: false; + readonly bootstrapWktFrom: "../../to-json.js"; + readonly from: "@bufbuild/protobuf"; + }; + readonly toJsonString: { + readonly typeOnly: false; + readonly bootstrapWktFrom: "../../to-json.js"; + readonly from: "@bufbuild/protobuf"; + }; + readonly protoInt64: { + readonly typeOnly: false; + readonly bootstrapWktFrom: "../../proto-int64.js"; + readonly from: "@bufbuild/protobuf"; + }; + readonly JsonValue: { + readonly typeOnly: true; + readonly bootstrapWktFrom: "../../json-value.js"; + readonly from: "@bufbuild/protobuf"; + }; + readonly JsonObject: { + readonly typeOnly: true; + readonly bootstrapWktFrom: "../../json-value.js"; + readonly from: "@bufbuild/protobuf"; + }; +}; diff --git a/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/symbols.js b/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/symbols.js new file mode 100644 index 0000000..39bcf61 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/symbols.js @@ -0,0 +1,40 @@ +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +import { symbols as symbolsV2, packageName as packageNameV1, wktPublicImportPaths as wktPublicImportPathsV2, } from "../codegenv2/symbols.js"; +/** + * @private + */ +export const packageName = packageNameV1; +/** + * @private + */ +export const wktPublicImportPaths = wktPublicImportPathsV2; +/** + * @private + */ +// biome-ignore format: want this to read well +export const symbols = Object.assign(Object.assign({}, symbolsV2), { codegen: { + boot: { typeOnly: false, bootstrapWktFrom: "../../codegenv1/boot.js", from: packageName + "/codegenv1" }, + fileDesc: { typeOnly: false, bootstrapWktFrom: "../../codegenv1/file.js", from: packageName + "/codegenv1" }, + enumDesc: { typeOnly: false, bootstrapWktFrom: "../../codegenv1/enum.js", from: packageName + "/codegenv1" }, + extDesc: { typeOnly: false, bootstrapWktFrom: "../../codegenv1/extension.js", from: packageName + "/codegenv1" }, + messageDesc: { typeOnly: false, bootstrapWktFrom: "../../codegenv1/message.js", from: packageName + "/codegenv1" }, + serviceDesc: { typeOnly: false, bootstrapWktFrom: "../../codegenv1/service.js", from: packageName + "/codegenv1" }, + tsEnum: { typeOnly: false, bootstrapWktFrom: "../../codegenv1/enum.js", from: packageName + "/codegenv1" }, + GenFile: { typeOnly: true, bootstrapWktFrom: "../../codegenv1/types.js", from: packageName + "/codegenv1" }, + GenEnum: { typeOnly: true, bootstrapWktFrom: "../../codegenv1/types.js", from: packageName + "/codegenv1" }, + GenExtension: { typeOnly: true, bootstrapWktFrom: "../../codegenv1/types.js", from: packageName + "/codegenv1" }, + GenMessage: { typeOnly: true, bootstrapWktFrom: "../../codegenv1/types.js", from: packageName + "/codegenv1" }, + GenService: { typeOnly: true, bootstrapWktFrom: "../../codegenv1/types.js", from: packageName + "/codegenv1" }, + } }); diff --git a/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/types.d.ts b/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/types.d.ts new file mode 100644 index 0000000..8060fad --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/types.d.ts @@ -0,0 +1,75 @@ +import type { Message } from "../types.js"; +import type { DescEnum, DescEnumValue, DescExtension, DescField, DescFile, DescMessage, DescMethod, DescService } from "../descriptors.js"; +import type { JsonValue } from "../json-value.js"; +/** + * Describes a protobuf source file. + * + * @private + */ +export type GenFile = DescFile; +/** + * Describes a message declaration in a protobuf source file. + * + * This type is identical to DescMessage, but carries additional type + * information. + * + * @private + */ +export type GenMessage = Omit & { + field: Record, DescField>; + typeName: RuntimeShape["$typeName"]; +} & brandv1; +/** + * Describes an enumeration in a protobuf source file. + * + * This type is identical to DescEnum, but carries additional type + * information. + * + * @private + */ +export type GenEnum = Omit & { + value: Record; +} & brandv1; +/** + * Describes an extension in a protobuf source file. + * + * This type is identical to DescExtension, but carries additional type + * information. + * + * @private + */ +export type GenExtension = DescExtension & brandv1; +/** + * Describes a service declaration in a protobuf source file. + * + * This type is identical to DescService, but carries additional type + * information. + * + * @private + */ +export type GenService = Omit & { + method: { + [K in keyof RuntimeShape]: RuntimeShape[K] & DescMethod; + }; +}; +/** + * @private + */ +export type GenServiceMethods = Record>; +declare class brandv1 { + protected v: "codegenv1"; + protected a: A | boolean; + protected b: B | boolean; +} +/** + * Union of the property names of all fields, including oneof members. + * For an anonymous message (no generated message shape), it's simply a string. + */ +type MessageFieldNames = Message extends T ? string : Exclude ? K : P]-?: true; +}, number | symbol>; +type Oneof = { + case: K | undefined; + value?: unknown; +}; +export {}; diff --git a/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/types.js b/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/types.js new file mode 100644 index 0000000..8eecc98 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/types.js @@ -0,0 +1,21 @@ +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +class brandv1 { + constructor() { + this.v = "codegenv1"; + this.a = false; + this.b = false; + } +} +export {}; diff --git a/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/boot.d.ts b/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/boot.d.ts new file mode 100644 index 0000000..3edbb6c --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/boot.d.ts @@ -0,0 +1,63 @@ +import type { DescriptorProto_ExtensionRange, FieldDescriptorProto_Label, FieldDescriptorProto_Type, FieldOptions_OptionRetention, FieldOptions_OptionTargetType, FieldOptions_EditionDefault, EnumValueDescriptorProto, FileDescriptorProto } from "../wkt/gen/google/protobuf/descriptor_pb.js"; +import type { DescFile } from "../descriptors.js"; +/** + * Hydrate a file descriptor for google/protobuf/descriptor.proto from a plain + * object. + * + * See createFileDescriptorProtoBoot() for details. + * + * @private + */ +export declare function boot(boot: FileDescriptorProtoBoot): DescFile; +/** + * An object literal for initializing the message google.protobuf.FileDescriptorProto + * for google/protobuf/descriptor.proto. + * + * See createFileDescriptorProtoBoot() for details. + * + * @private + */ +export type FileDescriptorProtoBoot = { + name: "google/protobuf/descriptor.proto"; + package: "google.protobuf"; + messageType: DescriptorProtoBoot[]; + enumType: EnumDescriptorProtoBoot[]; +}; +export type DescriptorProtoBoot = { + name: string; + field?: FieldDescriptorProtoBoot[]; + nestedType?: DescriptorProtoBoot[]; + enumType?: EnumDescriptorProtoBoot[]; + extensionRange?: Pick[]; +}; +export type FieldDescriptorProtoBoot = { + name: string; + number: number; + label?: FieldDescriptorProto_Label; + type: FieldDescriptorProto_Type; + typeName?: string; + extendee?: string; + defaultValue?: string; + options?: FieldOptionsBoot; +}; +export type FieldOptionsBoot = { + packed?: boolean; + deprecated?: boolean; + retention?: FieldOptions_OptionRetention; + targets?: FieldOptions_OptionTargetType[]; + editionDefaults?: FieldOptions_EditionDefaultBoot[]; +}; +export type FieldOptions_EditionDefaultBoot = Pick; +export type EnumDescriptorProtoBoot = { + name: string; + value: EnumValueDescriptorProtoBoot[]; +}; +export type EnumValueDescriptorProtoBoot = Pick; +/** + * Creates the message google.protobuf.FileDescriptorProto from an object literal. + * + * See createFileDescriptorProtoBoot() for details. + * + * @private + */ +export declare function bootFileDescriptorProto(init: FileDescriptorProtoBoot): FileDescriptorProto; diff --git a/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/boot.js b/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/boot.js new file mode 100644 index 0000000..1a37ad2 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/boot.js @@ -0,0 +1,101 @@ +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +import { restoreJsonNames } from "./restore-json-names.js"; +import { createFileRegistry } from "../registry.js"; +/** + * Hydrate a file descriptor for google/protobuf/descriptor.proto from a plain + * object. + * + * See createFileDescriptorProtoBoot() for details. + * + * @private + */ +export function boot(boot) { + const root = bootFileDescriptorProto(boot); + root.messageType.forEach(restoreJsonNames); + const reg = createFileRegistry(root, () => undefined); + // biome-ignore lint/style/noNonNullAssertion: non-null assertion because we just created the registry from the file we look up + return reg.getFile(root.name); +} +/** + * Creates the message google.protobuf.FileDescriptorProto from an object literal. + * + * See createFileDescriptorProtoBoot() for details. + * + * @private + */ +export function bootFileDescriptorProto(init) { + const proto = Object.create({ + syntax: "", + edition: 0, + }); + return Object.assign(proto, Object.assign(Object.assign({ $typeName: "google.protobuf.FileDescriptorProto", dependency: [], publicDependency: [], weakDependency: [], optionDependency: [], service: [], extension: [] }, init), { messageType: init.messageType.map(bootDescriptorProto), enumType: init.enumType.map(bootEnumDescriptorProto) })); +} +function bootDescriptorProto(init) { + var _a, _b, _c, _d, _e, _f, _g, _h; + const proto = Object.create({ + visibility: 0, + }); + return Object.assign(proto, { + $typeName: "google.protobuf.DescriptorProto", + name: init.name, + field: (_b = (_a = init.field) === null || _a === void 0 ? void 0 : _a.map(bootFieldDescriptorProto)) !== null && _b !== void 0 ? _b : [], + extension: [], + nestedType: (_d = (_c = init.nestedType) === null || _c === void 0 ? void 0 : _c.map(bootDescriptorProto)) !== null && _d !== void 0 ? _d : [], + enumType: (_f = (_e = init.enumType) === null || _e === void 0 ? void 0 : _e.map(bootEnumDescriptorProto)) !== null && _f !== void 0 ? _f : [], + extensionRange: (_h = (_g = init.extensionRange) === null || _g === void 0 ? void 0 : _g.map((e) => (Object.assign({ $typeName: "google.protobuf.DescriptorProto.ExtensionRange" }, e)))) !== null && _h !== void 0 ? _h : [], + oneofDecl: [], + reservedRange: [], + reservedName: [], + }); +} +function bootFieldDescriptorProto(init) { + const proto = Object.create({ + label: 1, + typeName: "", + extendee: "", + defaultValue: "", + oneofIndex: 0, + jsonName: "", + proto3Optional: false, + }); + return Object.assign(proto, Object.assign(Object.assign({ $typeName: "google.protobuf.FieldDescriptorProto" }, init), { options: init.options ? bootFieldOptions(init.options) : undefined })); +} +function bootFieldOptions(init) { + var _a, _b, _c; + const proto = Object.create({ + ctype: 0, + packed: false, + jstype: 0, + lazy: false, + unverifiedLazy: false, + deprecated: false, + weak: false, + debugRedact: false, + retention: 0, + }); + return Object.assign(proto, Object.assign(Object.assign({ $typeName: "google.protobuf.FieldOptions" }, init), { targets: (_a = init.targets) !== null && _a !== void 0 ? _a : [], editionDefaults: (_c = (_b = init.editionDefaults) === null || _b === void 0 ? void 0 : _b.map((e) => (Object.assign({ $typeName: "google.protobuf.FieldOptions.EditionDefault" }, e)))) !== null && _c !== void 0 ? _c : [], uninterpretedOption: [] })); +} +function bootEnumDescriptorProto(init) { + const proto = Object.create({ + visibility: 0, + }); + return Object.assign(proto, { + $typeName: "google.protobuf.EnumDescriptorProto", + name: init.name, + reservedName: [], + reservedRange: [], + value: init.value.map((e) => (Object.assign({ $typeName: "google.protobuf.EnumValueDescriptorProto" }, e))), + }); +} diff --git a/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/embed.d.ts b/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/embed.d.ts new file mode 100644 index 0000000..a0feea1 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/embed.d.ts @@ -0,0 +1,43 @@ +import type { DescEnum, DescExtension, DescMessage, DescService } from "../descriptors.js"; +import { type FileDescriptorProto } from "../wkt/gen/google/protobuf/descriptor_pb.js"; +import type { FileDescriptorProtoBoot } from "./boot.js"; +type EmbedUnknown = { + bootable: false; + proto(): FileDescriptorProto; + base64(): string; +}; +type EmbedDescriptorProto = Omit & { + bootable: true; + boot(): FileDescriptorProtoBoot; +}; +/** + * Create necessary information to embed a file descriptor in + * generated code. + * + * @private + */ +export declare function embedFileDesc(file: FileDescriptorProto): EmbedUnknown | EmbedDescriptorProto; +/** + * Compute the path to a message, enumeration, extension, or service in a + * file descriptor. + * + * @private + */ +export declare function pathInFileDesc(desc: DescMessage | DescEnum | DescExtension | DescService): number[]; +/** + * The file descriptor for google/protobuf/descriptor.proto cannot be embedded + * in serialized form, since it is required to parse itself. + * + * This function takes an instance of the message, and returns a plain object + * that can be hydrated to the message again via bootFileDescriptorProto(). + * + * This function only works with a message google.protobuf.FileDescriptorProto + * for google/protobuf/descriptor.proto, and only supports features that are + * relevant for the specific use case. For example, it discards file options, + * reserved ranges and reserved names, and field options that are unused in + * descriptor.proto. + * + * @private + */ +export declare function createFileDescriptorProtoBoot(proto: FileDescriptorProto): FileDescriptorProtoBoot; +export {}; diff --git a/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/embed.js b/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/embed.js new file mode 100644 index 0000000..ecb7394 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/embed.js @@ -0,0 +1,239 @@ +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +import { protoCamelCase } from "../reflect/names.js"; +import { isFieldSet, clearField } from "../fields.js"; +import { base64Encode } from "../wire/base64-encoding.js"; +import { toBinary } from "../to-binary.js"; +import { clone } from "../clone.js"; +import { Edition, FieldDescriptorProtoSchema, FieldOptionsSchema, FileDescriptorProtoSchema, DescriptorProtoSchema, EnumDescriptorProtoSchema, } from "../wkt/gen/google/protobuf/descriptor_pb.js"; +/** + * Create necessary information to embed a file descriptor in + * generated code. + * + * @private + */ +export function embedFileDesc(file) { + const embed = { + bootable: false, + proto() { + const stripped = clone(FileDescriptorProtoSchema, file); + clearField(stripped, FileDescriptorProtoSchema.field.dependency); + clearField(stripped, FileDescriptorProtoSchema.field.sourceCodeInfo); + stripped.messageType.map(stripJsonNames); + return stripped; + }, + base64() { + const bytes = toBinary(FileDescriptorProtoSchema, this.proto()); + return base64Encode(bytes, "std_raw"); + }, + }; + return file.name == "google/protobuf/descriptor.proto" + ? Object.assign(Object.assign({}, embed), { bootable: true, boot() { + return createFileDescriptorProtoBoot(this.proto()); + } }) : embed; +} +function stripJsonNames(d) { + for (const f of d.field) { + if (f.jsonName === protoCamelCase(f.name)) { + clearField(f, FieldDescriptorProtoSchema.field.jsonName); + } + } + for (const n of d.nestedType) { + stripJsonNames(n); + } +} +/** + * Compute the path to a message, enumeration, extension, or service in a + * file descriptor. + * + * @private + */ +export function pathInFileDesc(desc) { + if (desc.kind == "service") { + return [desc.file.services.indexOf(desc)]; + } + const parent = desc.parent; + if (parent == undefined) { + switch (desc.kind) { + case "enum": + return [desc.file.enums.indexOf(desc)]; + case "message": + return [desc.file.messages.indexOf(desc)]; + case "extension": + return [desc.file.extensions.indexOf(desc)]; + } + } + function findPath(cur) { + const nested = []; + for (let parent = cur.parent; parent;) { + const idx = parent.nestedMessages.indexOf(cur); + nested.unshift(idx); + cur = parent; + parent = cur.parent; + } + nested.unshift(cur.file.messages.indexOf(cur)); + return nested; + } + const path = findPath(parent); + switch (desc.kind) { + case "extension": + return [...path, parent.nestedExtensions.indexOf(desc)]; + case "message": + return [...path, parent.nestedMessages.indexOf(desc)]; + case "enum": + return [...path, parent.nestedEnums.indexOf(desc)]; + } +} +/** + * The file descriptor for google/protobuf/descriptor.proto cannot be embedded + * in serialized form, since it is required to parse itself. + * + * This function takes an instance of the message, and returns a plain object + * that can be hydrated to the message again via bootFileDescriptorProto(). + * + * This function only works with a message google.protobuf.FileDescriptorProto + * for google/protobuf/descriptor.proto, and only supports features that are + * relevant for the specific use case. For example, it discards file options, + * reserved ranges and reserved names, and field options that are unused in + * descriptor.proto. + * + * @private + */ +export function createFileDescriptorProtoBoot(proto) { + var _a; + assert(proto.name == "google/protobuf/descriptor.proto"); + assert(proto.package == "google.protobuf"); + assert(!proto.dependency.length); + assert(!proto.publicDependency.length); + assert(!proto.weakDependency.length); + assert(!proto.optionDependency.length); + assert(!proto.service.length); + assert(!proto.extension.length); + assert(proto.sourceCodeInfo === undefined); + assert(proto.syntax == "" || proto.syntax == "proto2"); + assert(!((_a = proto.options) === null || _a === void 0 ? void 0 : _a.features)); // we're dropping file options + assert(proto.edition === Edition.EDITION_UNKNOWN); + return { + name: proto.name, + package: proto.package, + messageType: proto.messageType.map(createDescriptorBoot), + enumType: proto.enumType.map(createEnumDescriptorBoot), + }; +} +function createDescriptorBoot(proto) { + assert(proto.extension.length == 0); + assert(!proto.oneofDecl.length); + assert(!proto.options); + assert(!isFieldSet(proto, DescriptorProtoSchema.field.visibility)); + const b = { + name: proto.name, + }; + if (proto.field.length) { + b.field = proto.field.map(createFieldDescriptorBoot); + } + if (proto.nestedType.length) { + b.nestedType = proto.nestedType.map(createDescriptorBoot); + } + if (proto.enumType.length) { + b.enumType = proto.enumType.map(createEnumDescriptorBoot); + } + if (proto.extensionRange.length) { + b.extensionRange = proto.extensionRange.map((r) => { + assert(!r.options); + return { start: r.start, end: r.end }; + }); + } + return b; +} +function createFieldDescriptorBoot(proto) { + assert(isFieldSet(proto, FieldDescriptorProtoSchema.field.name)); + assert(isFieldSet(proto, FieldDescriptorProtoSchema.field.number)); + assert(isFieldSet(proto, FieldDescriptorProtoSchema.field.type)); + assert(!isFieldSet(proto, FieldDescriptorProtoSchema.field.oneofIndex)); + assert(!isFieldSet(proto, FieldDescriptorProtoSchema.field.jsonName) || + proto.jsonName === protoCamelCase(proto.name)); + const b = { + name: proto.name, + number: proto.number, + type: proto.type, + }; + if (isFieldSet(proto, FieldDescriptorProtoSchema.field.label)) { + b.label = proto.label; + } + if (isFieldSet(proto, FieldDescriptorProtoSchema.field.typeName)) { + b.typeName = proto.typeName; + } + if (isFieldSet(proto, FieldDescriptorProtoSchema.field.extendee)) { + b.extendee = proto.extendee; + } + if (isFieldSet(proto, FieldDescriptorProtoSchema.field.defaultValue)) { + b.defaultValue = proto.defaultValue; + } + if (proto.options) { + b.options = createFieldOptionsBoot(proto.options); + } + return b; +} +function createFieldOptionsBoot(proto) { + const b = {}; + assert(!isFieldSet(proto, FieldOptionsSchema.field.ctype)); + if (isFieldSet(proto, FieldOptionsSchema.field.packed)) { + b.packed = proto.packed; + } + assert(!isFieldSet(proto, FieldOptionsSchema.field.jstype)); + assert(!isFieldSet(proto, FieldOptionsSchema.field.lazy)); + assert(!isFieldSet(proto, FieldOptionsSchema.field.unverifiedLazy)); + if (isFieldSet(proto, FieldOptionsSchema.field.deprecated)) { + b.deprecated = proto.deprecated; + } + assert(!isFieldSet(proto, FieldOptionsSchema.field.weak)); + assert(!isFieldSet(proto, FieldOptionsSchema.field.debugRedact)); + if (isFieldSet(proto, FieldOptionsSchema.field.retention)) { + b.retention = proto.retention; + } + if (proto.targets.length) { + b.targets = proto.targets; + } + if (proto.editionDefaults.length) { + b.editionDefaults = proto.editionDefaults.map((d) => ({ + value: d.value, + edition: d.edition, + })); + } + assert(!isFieldSet(proto, FieldOptionsSchema.field.features)); + assert(!isFieldSet(proto, FieldOptionsSchema.field.uninterpretedOption)); + return b; +} +function createEnumDescriptorBoot(proto) { + assert(!proto.options); + assert(!isFieldSet(proto, EnumDescriptorProtoSchema.field.visibility)); + return { + name: proto.name, + value: proto.value.map((v) => { + assert(!v.options); + return { + name: v.name, + number: v.number, + }; + }), + }; +} +/** + * Assert that condition is truthy or throw error. + */ +function assert(condition) { + if (!condition) { + throw new Error(); + } +} diff --git a/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/enum.d.ts b/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/enum.d.ts new file mode 100644 index 0000000..e77b8fe --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/enum.d.ts @@ -0,0 +1,18 @@ +import type { DescEnum, DescFile } from "../descriptors.js"; +import type { GenEnum } from "./types.js"; +import type { JsonValue } from "../json-value.js"; +/** + * Hydrate an enum descriptor. + * + * @private + */ +export declare function enumDesc(file: DescFile, path: number, ...paths: number[]): GenEnum; +/** + * Construct a TypeScript enum object at runtime from a descriptor. + */ +export declare function tsEnum(desc: DescEnum): enumObject; +type enumObject = { + [key: number]: string; + [k: string]: number | string; +}; +export {}; diff --git a/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/enum.js b/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/enum.js new file mode 100644 index 0000000..2f96ca3 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/enum.js @@ -0,0 +1,36 @@ +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +/** + * Hydrate an enum descriptor. + * + * @private + */ +export function enumDesc(file, path, ...paths) { + if (paths.length == 0) { + return file.enums[path]; + } + const e = paths.pop(); // we checked length above + return paths.reduce((acc, cur) => acc.nestedMessages[cur], file.messages[path]).nestedEnums[e]; +} +/** + * Construct a TypeScript enum object at runtime from a descriptor. + */ +export function tsEnum(desc) { + const enumObject = {}; + for (const value of desc.values) { + enumObject[value.localName] = value.number; + enumObject[value.number] = value.localName; + } + return enumObject; +} diff --git a/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/extension.d.ts b/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/extension.d.ts new file mode 100644 index 0000000..7d6374b --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/extension.d.ts @@ -0,0 +1,9 @@ +import type { Message } from "../types.js"; +import type { DescFile } from "../descriptors.js"; +import type { GenExtension } from "./types.js"; +/** + * Hydrate an extension descriptor. + * + * @private + */ +export declare function extDesc(file: DescFile, path: number, ...paths: number[]): GenExtension; diff --git a/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/extension.js b/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/extension.js new file mode 100644 index 0000000..9df5caa --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/extension.js @@ -0,0 +1,25 @@ +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +/** + * Hydrate an extension descriptor. + * + * @private + */ +export function extDesc(file, path, ...paths) { + if (paths.length == 0) { + return file.extensions[path]; + } + const e = paths.pop(); // we checked length above + return paths.reduce((acc, cur) => acc.nestedMessages[cur], file.messages[path]).nestedExtensions[e]; +} diff --git a/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/file.d.ts b/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/file.d.ts new file mode 100644 index 0000000..4d9853f --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/file.d.ts @@ -0,0 +1,7 @@ +import type { DescFile } from "../descriptors.js"; +/** + * Hydrate a file descriptor. + * + * @private + */ +export declare function fileDesc(b64: string, imports?: DescFile[]): DescFile; diff --git a/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/file.js b/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/file.js new file mode 100644 index 0000000..50fd84d --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/file.js @@ -0,0 +1,32 @@ +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +import { base64Decode } from "../wire/base64-encoding.js"; +import { FileDescriptorProtoSchema } from "../wkt/gen/google/protobuf/descriptor_pb.js"; +import { createFileRegistry } from "../registry.js"; +import { restoreJsonNames } from "./restore-json-names.js"; +import { fromBinary } from "../from-binary.js"; +/** + * Hydrate a file descriptor. + * + * @private + */ +export function fileDesc(b64, imports) { + var _a; + const root = fromBinary(FileDescriptorProtoSchema, base64Decode(b64)); + root.messageType.forEach(restoreJsonNames); + root.dependency = (_a = imports === null || imports === void 0 ? void 0 : imports.map((f) => f.proto.name)) !== null && _a !== void 0 ? _a : []; + const reg = createFileRegistry(root, (protoFileName) => imports === null || imports === void 0 ? void 0 : imports.find((f) => f.proto.name === protoFileName)); + // biome-ignore lint/style/noNonNullAssertion: non-null assertion because we just created the registry from the file we look up + return reg.getFile(root.name); +} diff --git a/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/index.d.ts b/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/index.d.ts new file mode 100644 index 0000000..b74cd36 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/index.d.ts @@ -0,0 +1,10 @@ +export * from "./boot.js"; +export * from "./embed.js"; +export * from "./enum.js"; +export * from "./extension.js"; +export * from "./file.js"; +export * from "./message.js"; +export * from "./service.js"; +export * from "./symbols.js"; +export * from "./scalar.js"; +export * from "./types.js"; diff --git a/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/index.js b/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/index.js new file mode 100644 index 0000000..3912c0e --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/index.js @@ -0,0 +1,23 @@ +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +export * from "./boot.js"; +export * from "./embed.js"; +export * from "./enum.js"; +export * from "./extension.js"; +export * from "./file.js"; +export * from "./message.js"; +export * from "./service.js"; +export * from "./symbols.js"; +export * from "./scalar.js"; +export * from "./types.js"; diff --git a/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/message.d.ts b/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/message.d.ts new file mode 100644 index 0000000..f0f3977 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/message.d.ts @@ -0,0 +1,15 @@ +import type { Message } from "../types.js"; +import type { DescFile } from "../descriptors.js"; +import type { GenMessage } from "./types.js"; +/** + * Hydrate a message descriptor. + * + * @private + */ +export declare function messageDesc(file: DescFile, path: number, ...paths: number[]): GenMessage; diff --git a/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/message.js b/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/message.js new file mode 100644 index 0000000..83c97ac --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/message.js @@ -0,0 +1,21 @@ +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +/** + * Hydrate a message descriptor. + * + * @private + */ +export function messageDesc(file, path, ...paths) { + return paths.reduce((acc, cur) => acc.nestedMessages[cur], file.messages[path]); +} diff --git a/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/restore-json-names.d.ts b/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/restore-json-names.d.ts new file mode 100644 index 0000000..d83d94d --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/restore-json-names.d.ts @@ -0,0 +1,5 @@ +import type { DescriptorProto } from "../wkt/gen/google/protobuf/descriptor_pb.js"; +/** + * @private + */ +export declare function restoreJsonNames(message: DescriptorProto): void; diff --git a/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/restore-json-names.js b/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/restore-json-names.js new file mode 100644 index 0000000..5423597 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/restore-json-names.js @@ -0,0 +1,26 @@ +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +import { protoCamelCase } from "../reflect/names.js"; +import { unsafeIsSetExplicit } from "../reflect/unsafe.js"; +/** + * @private + */ +export function restoreJsonNames(message) { + for (const f of message.field) { + if (!unsafeIsSetExplicit(f, "jsonName")) { + f.jsonName = protoCamelCase(f.name); + } + } + message.nestedType.forEach(restoreJsonNames); +} diff --git a/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/scalar.d.ts b/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/scalar.d.ts new file mode 100644 index 0000000..5c48fce --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/scalar.d.ts @@ -0,0 +1,9 @@ +import { ScalarType } from "../descriptors.js"; +/** + * Return the TypeScript type (as a string) for the given scalar type. + */ +export declare function scalarTypeScriptType(scalar: ScalarType, longAsString: boolean): "string" | "boolean" | "bigint" | "bigint | string" | "Uint8Array" | "number"; +/** + * Return the JSON type (as a string) for the given scalar type. + */ +export declare function scalarJsonType(scalar: ScalarType): "string" | "boolean" | "number" | `number | "NaN" | "Infinity" | "-Infinity"`; diff --git a/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/scalar.js b/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/scalar.js new file mode 100644 index 0000000..af322cc --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/scalar.js @@ -0,0 +1,63 @@ +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +import { ScalarType } from "../descriptors.js"; +/** + * Return the TypeScript type (as a string) for the given scalar type. + */ +export function scalarTypeScriptType(scalar, longAsString) { + switch (scalar) { + case ScalarType.STRING: + return "string"; + case ScalarType.BOOL: + return "boolean"; + case ScalarType.UINT64: + case ScalarType.SFIXED64: + case ScalarType.FIXED64: + case ScalarType.SINT64: + case ScalarType.INT64: + return longAsString ? "string" : "bigint"; + case ScalarType.BYTES: + return "Uint8Array"; + default: + return "number"; + } +} +/** + * Return the JSON type (as a string) for the given scalar type. + */ +export function scalarJsonType(scalar) { + switch (scalar) { + case ScalarType.DOUBLE: + case ScalarType.FLOAT: + return `number | "NaN" | "Infinity" | "-Infinity"`; + case ScalarType.UINT64: + case ScalarType.SFIXED64: + case ScalarType.FIXED64: + case ScalarType.SINT64: + case ScalarType.INT64: + return "string"; + case ScalarType.INT32: + case ScalarType.FIXED32: + case ScalarType.UINT32: + case ScalarType.SFIXED32: + case ScalarType.SINT32: + return "number"; + case ScalarType.STRING: + return "string"; + case ScalarType.BOOL: + return "boolean"; + case ScalarType.BYTES: + return "string"; + } +} diff --git a/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/service.d.ts b/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/service.d.ts new file mode 100644 index 0000000..5818f75 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/service.d.ts @@ -0,0 +1,8 @@ +import type { GenService, GenServiceMethods } from "./types.js"; +import type { DescFile } from "../descriptors.js"; +/** + * Hydrate a service descriptor. + * + * @private + */ +export declare function serviceDesc(file: DescFile, path: number, ...paths: number[]): GenService; diff --git a/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/service.js b/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/service.js new file mode 100644 index 0000000..09ca4ba --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/service.js @@ -0,0 +1,24 @@ +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +/** + * Hydrate a service descriptor. + * + * @private + */ +export function serviceDesc(file, path, ...paths) { + if (paths.length > 0) { + throw new Error(); + } + return file.services[path]; +} diff --git a/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/symbols.d.ts b/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/symbols.d.ts new file mode 100644 index 0000000..f9d8502 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/symbols.d.ts @@ -0,0 +1,135 @@ +/** + * @private + */ +export declare const packageName = "@bufbuild/protobuf"; +/** + * @private + */ +export declare const wktPublicImportPaths: Readonly>; +/** + * @private + */ +export declare const symbols: { + readonly isMessage: { + readonly typeOnly: false; + readonly bootstrapWktFrom: "../../is-message.js"; + readonly from: "@bufbuild/protobuf"; + }; + readonly Message: { + readonly typeOnly: true; + readonly bootstrapWktFrom: "../../types.js"; + readonly from: "@bufbuild/protobuf"; + }; + readonly create: { + readonly typeOnly: false; + readonly bootstrapWktFrom: "../../create.js"; + readonly from: "@bufbuild/protobuf"; + }; + readonly fromJson: { + readonly typeOnly: false; + readonly bootstrapWktFrom: "../../from-json.js"; + readonly from: "@bufbuild/protobuf"; + }; + readonly fromJsonString: { + readonly typeOnly: false; + readonly bootstrapWktFrom: "../../from-json.js"; + readonly from: "@bufbuild/protobuf"; + }; + readonly fromBinary: { + readonly typeOnly: false; + readonly bootstrapWktFrom: "../../from-binary.js"; + readonly from: "@bufbuild/protobuf"; + }; + readonly toBinary: { + readonly typeOnly: false; + readonly bootstrapWktFrom: "../../to-binary.js"; + readonly from: "@bufbuild/protobuf"; + }; + readonly toJson: { + readonly typeOnly: false; + readonly bootstrapWktFrom: "../../to-json.js"; + readonly from: "@bufbuild/protobuf"; + }; + readonly toJsonString: { + readonly typeOnly: false; + readonly bootstrapWktFrom: "../../to-json.js"; + readonly from: "@bufbuild/protobuf"; + }; + readonly protoInt64: { + readonly typeOnly: false; + readonly bootstrapWktFrom: "../../proto-int64.js"; + readonly from: "@bufbuild/protobuf"; + }; + readonly JsonValue: { + readonly typeOnly: true; + readonly bootstrapWktFrom: "../../json-value.js"; + readonly from: "@bufbuild/protobuf"; + }; + readonly JsonObject: { + readonly typeOnly: true; + readonly bootstrapWktFrom: "../../json-value.js"; + readonly from: "@bufbuild/protobuf"; + }; + readonly codegen: { + readonly boot: { + readonly typeOnly: false; + readonly bootstrapWktFrom: "../../codegenv2/boot.js"; + readonly from: string; + }; + readonly fileDesc: { + readonly typeOnly: false; + readonly bootstrapWktFrom: "../../codegenv2/file.js"; + readonly from: string; + }; + readonly enumDesc: { + readonly typeOnly: false; + readonly bootstrapWktFrom: "../../codegenv2/enum.js"; + readonly from: string; + }; + readonly extDesc: { + readonly typeOnly: false; + readonly bootstrapWktFrom: "../../codegenv2/extension.js"; + readonly from: string; + }; + readonly messageDesc: { + readonly typeOnly: false; + readonly bootstrapWktFrom: "../../codegenv2/message.js"; + readonly from: string; + }; + readonly serviceDesc: { + readonly typeOnly: false; + readonly bootstrapWktFrom: "../../codegenv2/service.js"; + readonly from: string; + }; + readonly tsEnum: { + readonly typeOnly: false; + readonly bootstrapWktFrom: "../../codegenv2/enum.js"; + readonly from: string; + }; + readonly GenFile: { + readonly typeOnly: true; + readonly bootstrapWktFrom: "../../codegenv2/types.js"; + readonly from: string; + }; + readonly GenEnum: { + readonly typeOnly: true; + readonly bootstrapWktFrom: "../../codegenv2/types.js"; + readonly from: string; + }; + readonly GenExtension: { + readonly typeOnly: true; + readonly bootstrapWktFrom: "../../codegenv2/types.js"; + readonly from: string; + }; + readonly GenMessage: { + readonly typeOnly: true; + readonly bootstrapWktFrom: "../../codegenv2/types.js"; + readonly from: string; + }; + readonly GenService: { + readonly typeOnly: true; + readonly bootstrapWktFrom: "../../codegenv2/types.js"; + readonly from: string; + }; + }; +}; diff --git a/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/symbols.js b/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/symbols.js new file mode 100644 index 0000000..791c8e0 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/symbols.js @@ -0,0 +1,69 @@ +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +/** + * @private + */ +export const packageName = "@bufbuild/protobuf"; +/** + * @private + */ +export const wktPublicImportPaths = { + "google/protobuf/compiler/plugin.proto": packageName + "/wkt", + "google/protobuf/any.proto": packageName + "/wkt", + "google/protobuf/api.proto": packageName + "/wkt", + "google/protobuf/cpp_features.proto": packageName + "/wkt", + "google/protobuf/descriptor.proto": packageName + "/wkt", + "google/protobuf/duration.proto": packageName + "/wkt", + "google/protobuf/empty.proto": packageName + "/wkt", + "google/protobuf/field_mask.proto": packageName + "/wkt", + "google/protobuf/go_features.proto": packageName + "/wkt", + "google/protobuf/java_features.proto": packageName + "/wkt", + "google/protobuf/source_context.proto": packageName + "/wkt", + "google/protobuf/struct.proto": packageName + "/wkt", + "google/protobuf/timestamp.proto": packageName + "/wkt", + "google/protobuf/type.proto": packageName + "/wkt", + "google/protobuf/wrappers.proto": packageName + "/wkt", +}; +/** + * @private + */ +// biome-ignore format: want this to read well +export const symbols = { + isMessage: { typeOnly: false, bootstrapWktFrom: "../../is-message.js", from: packageName }, + Message: { typeOnly: true, bootstrapWktFrom: "../../types.js", from: packageName }, + create: { typeOnly: false, bootstrapWktFrom: "../../create.js", from: packageName }, + fromJson: { typeOnly: false, bootstrapWktFrom: "../../from-json.js", from: packageName }, + fromJsonString: { typeOnly: false, bootstrapWktFrom: "../../from-json.js", from: packageName }, + fromBinary: { typeOnly: false, bootstrapWktFrom: "../../from-binary.js", from: packageName }, + toBinary: { typeOnly: false, bootstrapWktFrom: "../../to-binary.js", from: packageName }, + toJson: { typeOnly: false, bootstrapWktFrom: "../../to-json.js", from: packageName }, + toJsonString: { typeOnly: false, bootstrapWktFrom: "../../to-json.js", from: packageName }, + protoInt64: { typeOnly: false, bootstrapWktFrom: "../../proto-int64.js", from: packageName }, + JsonValue: { typeOnly: true, bootstrapWktFrom: "../../json-value.js", from: packageName }, + JsonObject: { typeOnly: true, bootstrapWktFrom: "../../json-value.js", from: packageName }, + codegen: { + boot: { typeOnly: false, bootstrapWktFrom: "../../codegenv2/boot.js", from: packageName + "/codegenv2" }, + fileDesc: { typeOnly: false, bootstrapWktFrom: "../../codegenv2/file.js", from: packageName + "/codegenv2" }, + enumDesc: { typeOnly: false, bootstrapWktFrom: "../../codegenv2/enum.js", from: packageName + "/codegenv2" }, + extDesc: { typeOnly: false, bootstrapWktFrom: "../../codegenv2/extension.js", from: packageName + "/codegenv2" }, + messageDesc: { typeOnly: false, bootstrapWktFrom: "../../codegenv2/message.js", from: packageName + "/codegenv2" }, + serviceDesc: { typeOnly: false, bootstrapWktFrom: "../../codegenv2/service.js", from: packageName + "/codegenv2" }, + tsEnum: { typeOnly: false, bootstrapWktFrom: "../../codegenv2/enum.js", from: packageName + "/codegenv2" }, + GenFile: { typeOnly: true, bootstrapWktFrom: "../../codegenv2/types.js", from: packageName + "/codegenv2" }, + GenEnum: { typeOnly: true, bootstrapWktFrom: "../../codegenv2/types.js", from: packageName + "/codegenv2" }, + GenExtension: { typeOnly: true, bootstrapWktFrom: "../../codegenv2/types.js", from: packageName + "/codegenv2" }, + GenMessage: { typeOnly: true, bootstrapWktFrom: "../../codegenv2/types.js", from: packageName + "/codegenv2" }, + GenService: { typeOnly: true, bootstrapWktFrom: "../../codegenv2/types.js", from: packageName + "/codegenv2" }, + }, +}; diff --git a/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/types.d.ts b/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/types.d.ts new file mode 100644 index 0000000..286d368 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/types.d.ts @@ -0,0 +1,81 @@ +import type { Message } from "../types.js"; +import type { DescEnum, DescEnumValue, DescExtension, DescField, DescFile, DescMessage, DescMethod, DescService } from "../descriptors.js"; +import type { JsonValue } from "../json-value.js"; +/** + * Describes a protobuf source file. + * + * @private + */ +export type GenFile = DescFile; +/** + * Describes a message declaration in a protobuf source file. + * + * This type is identical to DescMessage, but carries additional type + * information. + * + * @private + */ +export type GenMessage = Omit & { + field: Record, DescField>; + typeName: RuntimeShape["$typeName"]; +} & brandv2; +/** + * Describes an enumeration in a protobuf source file. + * + * This type is identical to DescEnum, but carries additional type + * information. + * + * @private + */ +export type GenEnum = Omit & { + value: Record; +} & brandv2; +/** + * Describes an extension in a protobuf source file. + * + * This type is identical to DescExtension, but carries additional type + * information. + * + * @private + */ +export type GenExtension = DescExtension & brandv2; +/** + * Describes a service declaration in a protobuf source file. + * + * This type is identical to DescService, but carries additional type + * information. + * + * @private + */ +export type GenService = Omit & { + method: { + [K in keyof RuntimeShape]: RuntimeShape[K] & DescMethod; + }; +}; +/** + * @private + */ +export type GenServiceMethods = Record>; +declare class brandv2 { + protected v: "codegenv2"; + protected a: A | boolean; + protected b: B | boolean; +} +/** + * Union of the property names of all fields, including oneof members. + * For an anonymous message (no generated message shape), it's simply a string. + */ +type MessageFieldNames = Message extends T ? string : Exclude ? K : P]-?: true; +}, number | symbol>; +type Oneof = { + case: K | undefined; + value?: unknown; +}; +export {}; diff --git a/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/types.js b/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/types.js new file mode 100644 index 0000000..1b7b6f3 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/types.js @@ -0,0 +1,21 @@ +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +class brandv2 { + constructor() { + this.v = "codegenv2"; + this.a = false; + this.b = false; + } +} +export {}; diff --git a/node_modules/@bufbuild/protobuf/dist/esm/create.d.ts b/node_modules/@bufbuild/protobuf/dist/esm/create.d.ts new file mode 100644 index 0000000..0f86a36 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/create.d.ts @@ -0,0 +1,9 @@ +import { type DescMessage } from "./descriptors.js"; +import type { MessageInitShape, MessageShape } from "./types.js"; +/** + * Create a new message instance. + * + * The second argument is an optional initializer object, where all fields are + * optional. + */ +export declare function create(schema: Desc, init?: MessageInitShape): MessageShape; diff --git a/node_modules/@bufbuild/protobuf/dist/esm/create.js b/node_modules/@bufbuild/protobuf/dist/esm/create.js new file mode 100644 index 0000000..2d8d5db --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/create.js @@ -0,0 +1,256 @@ +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +import { isMessage } from "./is-message.js"; +import { ScalarType, } from "./descriptors.js"; +import { scalarZeroValue } from "./reflect/scalar.js"; +import { isObject } from "./reflect/guard.js"; +import { unsafeGet, unsafeOneofCase, unsafeSet } from "./reflect/unsafe.js"; +import { isWrapperDesc } from "./wkt/wrappers.js"; +// bootstrap-inject google.protobuf.Edition.EDITION_PROTO3: const $name: Edition.$localName = $number; +const EDITION_PROTO3 = 999; +// bootstrap-inject google.protobuf.Edition.EDITION_PROTO2: const $name: Edition.$localName = $number; +const EDITION_PROTO2 = 998; +// bootstrap-inject google.protobuf.FeatureSet.FieldPresence.IMPLICIT: const $name: FeatureSet_FieldPresence.$localName = $number; +const IMPLICIT = 2; +/** + * Create a new message instance. + * + * The second argument is an optional initializer object, where all fields are + * optional. + */ +export function create(schema, init) { + if (isMessage(init, schema)) { + return init; + } + const message = createZeroMessage(schema); + if (init !== undefined) { + initMessage(schema, message, init); + } + return message; +} +/** + * Sets field values from a MessageInitShape on a zero message. + */ +function initMessage(messageDesc, message, init) { + for (const member of messageDesc.members) { + let value = init[member.localName]; + if (value == null) { + // intentionally ignore undefined and null + continue; + } + let field; + if (member.kind == "oneof") { + const oneofField = unsafeOneofCase(init, member); + if (!oneofField) { + continue; + } + field = oneofField; + value = unsafeGet(init, oneofField); + } + else { + field = member; + } + switch (field.fieldKind) { + case "message": + value = toMessage(field, value); + break; + case "scalar": + value = initScalar(field, value); + break; + case "list": + value = initList(field, value); + break; + case "map": + value = initMap(field, value); + break; + } + unsafeSet(message, field, value); + } + return message; +} +function initScalar(field, value) { + if (field.scalar == ScalarType.BYTES) { + return toU8Arr(value); + } + return value; +} +function initMap(field, value) { + if (isObject(value)) { + if (field.scalar == ScalarType.BYTES) { + return convertObjectValues(value, toU8Arr); + } + if (field.mapKind == "message") { + return convertObjectValues(value, (val) => toMessage(field, val)); + } + } + return value; +} +function initList(field, value) { + if (Array.isArray(value)) { + if (field.scalar == ScalarType.BYTES) { + return value.map(toU8Arr); + } + if (field.listKind == "message") { + return value.map((item) => toMessage(field, item)); + } + } + return value; +} +function toMessage(field, value) { + if (field.fieldKind == "message" && + !field.oneof && + isWrapperDesc(field.message)) { + // Types from google/protobuf/wrappers.proto are unwrapped when used in + // a singular field that is not part of a oneof group. + return initScalar(field.message.fields[0], value); + } + if (isObject(value)) { + if (field.message.typeName == "google.protobuf.Struct" && + field.parent.typeName !== "google.protobuf.Value") { + // google.protobuf.Struct is represented with JsonObject when used in a + // field, except when used in google.protobuf.Value. + return value; + } + if (!isMessage(value, field.message)) { + return create(field.message, value); + } + } + return value; +} +// converts any ArrayLike to Uint8Array if necessary. +function toU8Arr(value) { + return Array.isArray(value) ? new Uint8Array(value) : value; +} +function convertObjectValues(obj, fn) { + const ret = {}; + for (const entry of Object.entries(obj)) { + ret[entry[0]] = fn(entry[1]); + } + return ret; +} +const tokenZeroMessageField = Symbol(); +const messagePrototypes = new WeakMap(); +/** + * Create a zero message. + */ +function createZeroMessage(desc) { + let msg; + if (!needsPrototypeChain(desc)) { + msg = { + $typeName: desc.typeName, + }; + for (const member of desc.members) { + if (member.kind == "oneof" || member.presence == IMPLICIT) { + msg[member.localName] = createZeroField(member); + } + } + } + else { + // Support default values and track presence via the prototype chain + const cached = messagePrototypes.get(desc); + let prototype; + let members; + if (cached) { + ({ prototype, members } = cached); + } + else { + prototype = {}; + members = new Set(); + for (const member of desc.members) { + if (member.kind == "oneof") { + // we can only put immutable values on the prototype, + // oneof ADTs are mutable + continue; + } + if (member.fieldKind != "scalar" && member.fieldKind != "enum") { + // only scalar and enum values are immutable, map, list, and message + // are not + continue; + } + if (member.presence == IMPLICIT) { + // implicit presence tracks field presence by zero values - e.g. 0, false, "", are unset, 1, true, "x" are set. + // message, map, list fields are mutable, and also have IMPLICIT presence. + continue; + } + members.add(member); + prototype[member.localName] = createZeroField(member); + } + messagePrototypes.set(desc, { prototype, members }); + } + msg = Object.create(prototype); + msg.$typeName = desc.typeName; + for (const member of desc.members) { + if (members.has(member)) { + continue; + } + if (member.kind == "field") { + if (member.fieldKind == "message") { + continue; + } + if (member.fieldKind == "scalar" || member.fieldKind == "enum") { + if (member.presence != IMPLICIT) { + continue; + } + } + } + msg[member.localName] = createZeroField(member); + } + } + return msg; +} +/** + * Do we need the prototype chain to track field presence? + */ +function needsPrototypeChain(desc) { + switch (desc.file.edition) { + case EDITION_PROTO3: + // proto3 always uses implicit presence, we never need the prototype chain. + return false; + case EDITION_PROTO2: + // proto2 never uses implicit presence, we always need the prototype chain. + return true; + default: + // If a message uses scalar or enum fields with explicit presence, we need + // the prototype chain to track presence. This rule does not apply to fields + // in a oneof group - they use a different mechanism to track presence. + return desc.fields.some((f) => f.presence != IMPLICIT && f.fieldKind != "message" && !f.oneof); + } +} +/** + * Returns a zero value for oneof groups, and for every field kind except + * messages. Scalar and enum fields can have default values. + */ +function createZeroField(field) { + if (field.kind == "oneof") { + return { case: undefined }; + } + if (field.fieldKind == "list") { + return []; + } + if (field.fieldKind == "map") { + return {}; // Object.create(null) would be desirable here, but is unsupported by react https://react.dev/reference/react/use-server#serializable-parameters-and-return-values + } + if (field.fieldKind == "message") { + return tokenZeroMessageField; + } + const defaultValue = field.getDefaultValue(); + if (defaultValue !== undefined) { + return field.fieldKind == "scalar" && field.longAsString + ? defaultValue.toString() + : defaultValue; + } + return field.fieldKind == "scalar" + ? scalarZeroValue(field.scalar, field.longAsString) + : field.enum.values[0].number; +} diff --git a/node_modules/@bufbuild/protobuf/dist/esm/descriptors.d.ts b/node_modules/@bufbuild/protobuf/dist/esm/descriptors.d.ts new file mode 100644 index 0000000..239a1f9 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/descriptors.d.ts @@ -0,0 +1,634 @@ +import type { DescriptorProto, Edition, EnumDescriptorProto, EnumValueDescriptorProto, FeatureSet_FieldPresence, FieldDescriptorProto, FileDescriptorProto, MethodDescriptorProto, MethodOptions_IdempotencyLevel, OneofDescriptorProto, ServiceDescriptorProto } from "./wkt/gen/google/protobuf/descriptor_pb.js"; +import type { ScalarValue } from "./reflect/scalar.js"; +export type SupportedEdition = Extract; +type SupportedFieldPresence = Extract; +/** + * Scalar value types. This is a subset of field types declared by protobuf + * enum google.protobuf.FieldDescriptorProto.Type The types GROUP and MESSAGE + * are omitted, but the numerical values are identical. + */ +export declare enum ScalarType { + DOUBLE = 1, + FLOAT = 2, + INT64 = 3, + UINT64 = 4, + INT32 = 5, + FIXED64 = 6, + FIXED32 = 7, + BOOL = 8, + STRING = 9, + BYTES = 12, + UINT32 = 13, + SFIXED32 = 15, + SFIXED64 = 16, + SINT32 = 17,// Uses ZigZag encoding. + SINT64 = 18 +} +/** + * A union of all descriptors, discriminated by a `kind` property. + */ +export type AnyDesc = DescFile | DescEnum | DescEnumValue | DescMessage | DescField | DescExtension | DescOneof | DescService | DescMethod; +/** + * Describes a protobuf source file. + */ +export interface DescFile { + readonly kind: "file"; + /** + * The edition of the protobuf file. Will be EDITION_PROTO2 for syntax="proto2", + * EDITION_PROTO3 for syntax="proto3"; + */ + readonly edition: SupportedEdition; + /** + * The name of the file, excluding the .proto suffix. + * For a protobuf file `foo/bar.proto`, this is `foo/bar`. + */ + readonly name: string; + /** + * Files imported by this file. + */ + readonly dependencies: DescFile[]; + /** + * Top-level enumerations declared in this file. + * Note that more enumerations might be declared within message declarations. + */ + readonly enums: DescEnum[]; + /** + * Top-level messages declared in this file. + * Note that more messages might be declared within message declarations. + */ + readonly messages: DescMessage[]; + /** + * Top-level extensions declared in this file. + * Note that more extensions might be declared within message declarations. + */ + readonly extensions: DescExtension[]; + /** + * Services declared in this file. + */ + readonly services: DescService[]; + /** + * Marked as deprecated in the protobuf source. + */ + readonly deprecated: boolean; + /** + * The compiler-generated descriptor. + */ + readonly proto: FileDescriptorProto; + toString(): string; +} +/** + * Describes an enumeration in a protobuf source file. + */ +export interface DescEnum { + readonly kind: "enum"; + /** + * The fully qualified name of the enumeration. (We omit the leading dot.) + */ + readonly typeName: string; + /** + * The name of the enumeration, as declared in the protobuf source. + */ + readonly name: string; + /** + * The file this enumeration was declared in. + */ + readonly file: DescFile; + /** + * The parent message, if this enumeration was declared inside a message declaration. + */ + readonly parent: DescMessage | undefined; + /** + * Enumerations can be open or closed. + * See https://protobuf.dev/programming-guides/enum/ + */ + readonly open: boolean; + /** + * Values declared for this enumeration. + */ + readonly values: DescEnumValue[]; + /** + * All values of this enum by their number. + */ + readonly value: Record; + /** + * A prefix shared by all enum values. + * For example, `my_enum_` for `enum MyEnum {MY_ENUM_A=0; MY_ENUM_B=1;}` + */ + readonly sharedPrefix?: string | undefined; + /** + * Marked as deprecated in the protobuf source. + */ + readonly deprecated: boolean; + /** + * The compiler-generated descriptor. + */ + readonly proto: EnumDescriptorProto; + toString(): string; +} +/** + * Describes an individual value of an enumeration in a protobuf source file. + */ +export interface DescEnumValue { + readonly kind: "enum_value"; + /** + * The name of the enumeration value, as specified in the protobuf source. + */ + readonly name: string; + /** + * A safe and idiomatic name for the value in a TypeScript enum. + */ + readonly localName: string; + /** + * The enumeration this value belongs to. + */ + readonly parent: DescEnum; + /** + * The numeric enumeration value, as specified in the protobuf source. + */ + readonly number: number; + /** + * Marked as deprecated in the protobuf source. + */ + readonly deprecated: boolean; + /** + * The compiler-generated descriptor. + */ + readonly proto: EnumValueDescriptorProto; + toString(): string; +} +/** + * Describes a message declaration in a protobuf source file. + */ +export interface DescMessage { + readonly kind: "message"; + /** + * The fully qualified name of the message. (We omit the leading dot.) + */ + readonly typeName: string; + /** + * The name of the message, as specified in the protobuf source. + */ + readonly name: string; + /** + * The file this message was declared in. + */ + readonly file: DescFile; + /** + * The parent message, if this message was declared inside a message declaration. + */ + readonly parent: DescMessage | undefined; + /** + * Fields declared for this message, including fields declared in a oneof + * group. + */ + readonly fields: DescField[]; + /** + * All fields of this message by their "localName". + */ + readonly field: Record; + /** + * Oneof groups declared for this message. + * This does not include synthetic oneofs for proto3 optionals. + */ + readonly oneofs: DescOneof[]; + /** + * Standalone fields and oneof groups for this message, ordered by + * their appearance in the protobuf source. + */ + readonly members: (DescField | DescOneof)[]; + /** + * Enumerations declared within the message, if any. + */ + readonly nestedEnums: DescEnum[]; + /** + * Messages declared within the message, if any. + * This does not include synthetic messages like map entries. + */ + readonly nestedMessages: DescMessage[]; + /** + * Extensions declared within the message, if any. + */ + readonly nestedExtensions: DescExtension[]; + /** + * Marked as deprecated in the protobuf source. + */ + readonly deprecated: boolean; + /** + * The compiler-generated descriptor. + */ + readonly proto: DescriptorProto; + toString(): string; +} +/** + * Describes a field declaration in a protobuf source file. + */ +export type DescField = (descFieldScalar & descFieldCommon) | (descFieldList & descFieldCommon) | (descFieldMessage & descFieldCommon) | (descFieldEnum & descFieldCommon) | (descFieldMap & descFieldCommon); +type descFieldCommon = descFieldAndExtensionShared & { + readonly kind: "field"; + /** + * The message this field is declared on. + */ + readonly parent: DescMessage; + /** + * A safe and idiomatic name for the field as a property in ECMAScript. + */ + readonly localName: string; +}; +/** + * Describes an extension in a protobuf source file. + */ +export type DescExtension = (Omit & descExtensionCommon) | (Omit & descExtensionCommon) | (Omit & descExtensionCommon) | (descFieldList & descExtensionCommon); +type descExtensionCommon = descFieldAndExtensionShared & { + readonly kind: "extension"; + /** + * The fully qualified name of the extension. + */ + readonly typeName: string; + /** + * The file this extension was declared in. + */ + readonly file: DescFile; + /** + * The parent message, if this extension was declared inside a message declaration. + */ + readonly parent: DescMessage | undefined; + /** + * The message that this extension extends. + */ + readonly extendee: DescMessage; + /** + * The `oneof` group this field belongs to, if any. + */ + readonly oneof: undefined; +}; +interface descFieldAndExtensionShared { + /** + * The field name, as specified in the protobuf source + */ + readonly name: string; + /** + * The field number, as specified in the protobuf source. + */ + readonly number: number; + /** + * The field name in JSON. + */ + readonly jsonName: string; + /** + * Marked as deprecated in the protobuf source. + */ + readonly deprecated: boolean; + /** + * Presence of the field. + * See https://protobuf.dev/programming-guides/field_presence/ + */ + readonly presence: SupportedFieldPresence; + /** + * Whether to reject invalid UTF-8 when reading this field from the binary + * wire format. Reflects the resolved `utf8_validation` feature: true for + * VERIFY (proto3 and editions 2023+ default), false for NONE (proto2 + * default). + */ + readonly utf8Validation: boolean; + /** + * The compiler-generated descriptor. + */ + readonly proto: FieldDescriptorProto; + /** + * Get the edition features for this protobuf element. + */ + toString(): string; +} +type descFieldSingularCommon = { + /** + * The `oneof` group this field belongs to, if any. + * + * This does not include synthetic oneofs for proto3 optionals. + */ + readonly oneof: DescOneof | undefined; +}; +type descFieldScalar = T extends T ? { + readonly fieldKind: "scalar"; + /** + * Scalar type, if it is a scalar field. + */ + readonly scalar: T; + /** + * By default, 64-bit integral types (int64, uint64, sint64, fixed64, + * sfixed64) are represented with BigInt. + * + * If the field option `jstype = JS_STRING` is set, this property + * is true, and 64-bit integral types are represented with String. + */ + readonly longAsString: boolean; + /** + * The message type, if it is a message field. + */ + readonly message: undefined; + /** + * The enum type, if it is an enum field. + */ + readonly enum: undefined; + /** + * Return the default value specified in the protobuf source. + */ + getDefaultValue(): ScalarValue | undefined; +} & descFieldSingularCommon : never; +type descFieldMessage = { + readonly fieldKind: "message"; + /** + * Scalar type, if it is a scalar field. + */ + readonly scalar: undefined; + /** + * The message type, if it is a message field. + */ + readonly message: DescMessage; + /** + * Encode the message delimited (a.k.a. proto2 group encoding), or + * length-prefixed? + */ + readonly delimitedEncoding: boolean; + /** + * The enum type, if it is an enum field. + */ + readonly enum: undefined; + /** + * Return the default value specified in the protobuf source. + */ + getDefaultValue(): undefined; +} & descFieldSingularCommon; +type descFieldEnum = { + readonly fieldKind: "enum"; + /** + * Scalar type, if it is a scalar field. + */ + readonly scalar: undefined; + /** + * The message type, if it is a message field. + */ + readonly message: undefined; + /** + * The enum type, if it is an enum field. + */ + readonly enum: DescEnum; + /** + * Return the default value specified in the protobuf source. + */ + getDefaultValue(): number | undefined; +} & descFieldSingularCommon; +type descFieldList = (descFieldListScalar & descFieldListCommon) | (descFieldListEnum & descFieldListCommon) | (descFieldListMessage & descFieldListCommon); +type descFieldListCommon = { + readonly fieldKind: "list"; + /** + * Pack this repeated field? Only valid for repeated enum fields, and + * for repeated scalar fields except BYTES and STRING. + */ + readonly packed: boolean; + /** + * The `oneof` group this field belongs to, if any. + */ + readonly oneof: undefined; +}; +type descFieldListScalar = T extends T ? { + readonly listKind: "scalar"; + /** + * The enum list element type. + */ + readonly enum: undefined; + /** + * The message list element type. + */ + readonly message: undefined; + /** + * Scalar list element type. + */ + readonly scalar: T; + /** + * By default, 64-bit integral types (int64, uint64, sint64, fixed64, + * sfixed64) are represented with BigInt. + * + * If the field option `jstype = JS_STRING` is set, this property + * is true, and 64-bit integral types are represented with String. + */ + readonly longAsString: boolean; +} : never; +type descFieldListEnum = { + readonly listKind: "enum"; + /** + * The enum list element type. + */ + readonly enum: DescEnum; + /** + * The message list element type. + */ + readonly message: undefined; + /** + * Scalar list element type. + */ + readonly scalar: undefined; +}; +type descFieldListMessage = { + readonly listKind: "message"; + /** + * The enum list element type. + */ + readonly enum: undefined; + /** + * The message list element type. + */ + readonly message: DescMessage; + /** + * Scalar list element type. + */ + readonly scalar: undefined; + /** + * Encode the message delimited (a.k.a. proto2 group encoding), or + * length-prefixed? + */ + readonly delimitedEncoding: boolean; +}; +type descFieldMap = (descFieldMapScalar & descFieldMapCommon) | (descFieldMapEnum & descFieldMapCommon) | (descFieldMapMessage & descFieldMapCommon); +type descFieldMapCommon = T extends Exclude ? { + readonly fieldKind: "map"; + /** + * The scalar map key type. + */ + readonly mapKey: T; + /** + * The `oneof` group this field belongs to, if any. + */ + readonly oneof: undefined; + /** + * Encode the map entry message delimited (a.k.a. proto2 group encoding), + * or length-prefixed? As of Edition 2023, this is always false for map fields, + * and also applies to map values, if they are messages. + */ + readonly delimitedEncoding: false; +} : never; +type descFieldMapScalar = T extends T ? { + readonly mapKind: "scalar"; + /** + * The enum map value type. + */ + readonly enum: undefined; + /** + * The message map value type. + */ + readonly message: undefined; + /** + * Scalar map value type. + */ + readonly scalar: T; +} : never; +type descFieldMapEnum = { + readonly mapKind: "enum"; + /** + * The enum map value type. + */ + readonly enum: DescEnum; + /** + * The message map value type. + */ + readonly message: undefined; + /** + * Scalar map value type. + */ + readonly scalar: undefined; +}; +type descFieldMapMessage = { + readonly mapKind: "message"; + /** + * The enum map value type. + */ + readonly enum: undefined; + /** + * The message map value type. + */ + readonly message: DescMessage; + /** + * Scalar map value type. + */ + readonly scalar: undefined; +}; +/** + * Describes a oneof group in a protobuf source file. + */ +export interface DescOneof { + readonly kind: "oneof"; + /** + * The name of the oneof group, as specified in the protobuf source. + */ + readonly name: string; + /** + * A safe and idiomatic name for the oneof group as a property in ECMAScript. + */ + readonly localName: string; + /** + * The message this oneof group was declared in. + */ + readonly parent: DescMessage; + /** + * The fields declared in this oneof group. + */ + readonly fields: DescField[]; + /** + * Marked as deprecated in the protobuf source. + * Note that oneof groups cannot be marked as deprecated, this property + * only exists for consistency and will always be false. + */ + readonly deprecated: boolean; + /** + * The compiler-generated descriptor. + */ + readonly proto: OneofDescriptorProto; + toString(): string; +} +/** + * Describes a service declaration in a protobuf source file. + */ +export interface DescService { + readonly kind: "service"; + /** + * The fully qualified name of the service. (We omit the leading dot.) + */ + readonly typeName: string; + /** + * The name of the service, as specified in the protobuf source. + */ + readonly name: string; + /** + * The file this service was declared in. + */ + readonly file: DescFile; + /** + * The RPCs this service declares. + */ + readonly methods: DescMethod[]; + /** + * All methods of this service by their "localName". + */ + readonly method: Record; + /** + * Marked as deprecated in the protobuf source. + */ + readonly deprecated: boolean; + /** + * The compiler-generated descriptor. + */ + readonly proto: ServiceDescriptorProto; + toString(): string; +} +/** + * Describes an RPC declaration in a protobuf source file. + */ +export interface DescMethod { + readonly kind: "rpc"; + /** + * The name of the RPC, as specified in the protobuf source. + */ + readonly name: string; + /** + * A safe and idiomatic name for the RPC as a method in ECMAScript. + */ + readonly localName: string; + /** + * The parent service. + */ + readonly parent: DescService; + /** + * One of the four available method types. + */ + readonly methodKind: "unary" | "server_streaming" | "client_streaming" | "bidi_streaming"; + /** + * The message type for requests. + */ + readonly input: DescMessage; + /** + * The message type for responses. + */ + readonly output: DescMessage; + /** + * The idempotency level declared in the protobuf source, if any. + */ + readonly idempotency: MethodOptions_IdempotencyLevel; + /** + * Marked as deprecated in the protobuf source. + */ + readonly deprecated: boolean; + /** + * The compiler-generated descriptor. + */ + readonly proto: MethodDescriptorProto; + toString(): string; +} +/** + * Comments on an element in a protobuf source file. + */ +export interface DescComments { + readonly leadingDetached: readonly string[]; + readonly leading?: string | undefined; + readonly trailing?: string | undefined; + readonly sourcePath: readonly number[]; +} +export {}; diff --git a/node_modules/@bufbuild/protobuf/dist/esm/descriptors.js b/node_modules/@bufbuild/protobuf/dist/esm/descriptors.js new file mode 100644 index 0000000..59d0023 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/descriptors.js @@ -0,0 +1,50 @@ +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +/** + * Scalar value types. This is a subset of field types declared by protobuf + * enum google.protobuf.FieldDescriptorProto.Type The types GROUP and MESSAGE + * are omitted, but the numerical values are identical. + */ +export var ScalarType; +(function (ScalarType) { + // 0 is reserved for errors. + // Order is weird for historical reasons. + ScalarType[ScalarType["DOUBLE"] = 1] = "DOUBLE"; + ScalarType[ScalarType["FLOAT"] = 2] = "FLOAT"; + // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if + // negative values are likely. + ScalarType[ScalarType["INT64"] = 3] = "INT64"; + ScalarType[ScalarType["UINT64"] = 4] = "UINT64"; + // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if + // negative values are likely. + ScalarType[ScalarType["INT32"] = 5] = "INT32"; + ScalarType[ScalarType["FIXED64"] = 6] = "FIXED64"; + ScalarType[ScalarType["FIXED32"] = 7] = "FIXED32"; + ScalarType[ScalarType["BOOL"] = 8] = "BOOL"; + ScalarType[ScalarType["STRING"] = 9] = "STRING"; + // Tag-delimited aggregate. + // Group type is deprecated and not supported in proto3. However, Proto3 + // implementations should still be able to parse the group wire format and + // treat group fields as unknown fields. + // TYPE_GROUP = 10, + // TYPE_MESSAGE = 11, // Length-delimited aggregate. + // New in version 2. + ScalarType[ScalarType["BYTES"] = 12] = "BYTES"; + ScalarType[ScalarType["UINT32"] = 13] = "UINT32"; + // TYPE_ENUM = 14, + ScalarType[ScalarType["SFIXED32"] = 15] = "SFIXED32"; + ScalarType[ScalarType["SFIXED64"] = 16] = "SFIXED64"; + ScalarType[ScalarType["SINT32"] = 17] = "SINT32"; + ScalarType[ScalarType["SINT64"] = 18] = "SINT64"; +})(ScalarType || (ScalarType = {})); diff --git a/node_modules/@bufbuild/protobuf/dist/esm/equals.d.ts b/node_modules/@bufbuild/protobuf/dist/esm/equals.d.ts new file mode 100644 index 0000000..914048f --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/equals.d.ts @@ -0,0 +1,41 @@ +import type { MessageShape } from "./types.js"; +import { type DescMessage } from "./descriptors.js"; +import type { Registry } from "./registry.js"; +interface EqualsOptions { + /** + * A registry to look up extensions, and messages packed in Any. + * + * @private Experimental API, does not follow semantic versioning. + */ + registry: Registry; + /** + * Unpack google.protobuf.Any before comparing. + * If a type is not in the registry, comparison falls back to comparing the + * fields of Any. + * + * @private Experimental API, does not follow semantic versioning. + */ + unpackAny?: boolean; + /** + * Consider extensions when comparing. + * + * @private Experimental API, does not follow semantic versioning. + */ + extensions?: boolean; + /** + * Consider unknown fields when comparing. + * The registry is used to distinguish between extensions, and unknown fields + * caused by schema changes. + * + * @private Experimental API, does not follow semantic versioning. + */ + unknown?: boolean; +} +/** + * Compare two messages of the same type. + * + * Note that this function disregards extensions and unknown fields, and that + * NaN is not equal NaN, following the IEEE standard. + */ +export declare function equals(schema: Desc, a: MessageShape, b: MessageShape, options?: EqualsOptions): boolean; +export {}; diff --git a/node_modules/@bufbuild/protobuf/dist/esm/equals.js b/node_modules/@bufbuild/protobuf/dist/esm/equals.js new file mode 100644 index 0000000..270a391 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/equals.js @@ -0,0 +1,201 @@ +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +import { scalarEquals } from "./reflect/scalar.js"; +import { reflect } from "./reflect/reflect.js"; +import { ScalarType, } from "./descriptors.js"; +import { anyUnpack } from "./wkt/index.js"; +import { createExtensionContainer, getExtension } from "./extensions.js"; +/** + * Compare two messages of the same type. + * + * Note that this function disregards extensions and unknown fields, and that + * NaN is not equal NaN, following the IEEE standard. + */ +export function equals(schema, a, b, options) { + if (a.$typeName != schema.typeName || b.$typeName != schema.typeName) { + return false; + } + if (a === b) { + return true; + } + return reflectEquals(reflect(schema, a), reflect(schema, b), options); +} +function reflectEquals(a, b, opts) { + if (a.desc.typeName === "google.protobuf.Any" && (opts === null || opts === void 0 ? void 0 : opts.unpackAny) == true) { + return anyUnpackedEquals(a.message, b.message, opts); + } + for (const f of a.fields) { + if (!fieldEquals(f, a, b, opts)) { + return false; + } + } + if ((opts === null || opts === void 0 ? void 0 : opts.unknown) == true && !unknownEquals(a, b, opts.registry)) { + return false; + } + if ((opts === null || opts === void 0 ? void 0 : opts.extensions) == true && !extensionsEquals(a, b, opts)) { + return false; + } + return true; +} +// TODO(tstamm) add an option to consider NaN equal to NaN? +function fieldEquals(f, a, b, opts) { + if (!a.isSet(f) && !b.isSet(f)) { + return true; + } + if (!a.isSet(f) || !b.isSet(f)) { + return false; + } + switch (f.fieldKind) { + case "scalar": + return scalarEquals(f.scalar, a.get(f), b.get(f)); + case "enum": + return a.get(f) === b.get(f); + case "message": + return reflectEquals(a.get(f), b.get(f), opts); + case "map": { + // TODO(tstamm) can't we compare sizes first? + const mapA = a.get(f); + const mapB = b.get(f); + const keys = []; + for (const k of mapA.keys()) { + if (!mapB.has(k)) { + return false; + } + keys.push(k); + } + for (const k of mapB.keys()) { + if (!mapA.has(k)) { + return false; + } + } + for (const key of keys) { + const va = mapA.get(key); + const vb = mapB.get(key); + if (va === vb) { + continue; + } + switch (f.mapKind) { + case "enum": + return false; + case "message": + if (!reflectEquals(va, vb, opts)) { + return false; + } + break; + case "scalar": + if (!scalarEquals(f.scalar, va, vb)) { + return false; + } + break; + } + } + break; + } + case "list": { + const listA = a.get(f); + const listB = b.get(f); + if (listA.size != listB.size) { + return false; + } + for (let i = 0; i < listA.size; i++) { + const va = listA.get(i); + const vb = listB.get(i); + if (va === vb) { + continue; + } + switch (f.listKind) { + case "enum": + return false; + case "message": + if (!reflectEquals(va, vb, opts)) { + return false; + } + break; + case "scalar": + if (!scalarEquals(f.scalar, va, vb)) { + return false; + } + break; + } + } + break; + } + } + return true; +} +function anyUnpackedEquals(a, b, opts) { + if (a.typeUrl !== b.typeUrl) { + return false; + } + const unpackedA = anyUnpack(a, opts.registry); + const unpackedB = anyUnpack(b, opts.registry); + if (unpackedA && unpackedB) { + const schema = opts.registry.getMessage(unpackedA.$typeName); + if (schema) { + return equals(schema, unpackedA, unpackedB, opts); + } + } + return scalarEquals(ScalarType.BYTES, a.value, b.value); +} +function unknownEquals(a, b, registry) { + function getTrulyUnknown(msg, registry) { + var _a; + const u = (_a = msg.getUnknown()) !== null && _a !== void 0 ? _a : []; + return registry + ? u.filter((uf) => !registry.getExtensionFor(msg.desc, uf.no)) + : u; + } + const unknownA = getTrulyUnknown(a, registry); + const unknownB = getTrulyUnknown(b, registry); + if (unknownA.length != unknownB.length) { + return false; + } + for (let i = 0; i < unknownA.length; i++) { + const a = unknownA[i]; + const b = unknownB[i]; + if (a.no != b.no) { + return false; + } + if (a.wireType != b.wireType) { + return false; + } + if (!scalarEquals(ScalarType.BYTES, a.data, b.data)) { + return false; + } + } + return true; +} +function extensionsEquals(a, b, opts) { + function getSetExtensions(msg, registry) { + var _a; + return ((_a = msg.getUnknown()) !== null && _a !== void 0 ? _a : []) + .map((uf) => registry.getExtensionFor(msg.desc, uf.no)) + .filter((e) => e != undefined) + .filter((e, index, arr) => arr.indexOf(e) === index); + } + const extensionsA = getSetExtensions(a, opts.registry); + const extensionsB = getSetExtensions(b, opts.registry); + if (extensionsA.length != extensionsB.length || + extensionsA.some((e) => !extensionsB.includes(e))) { + return false; + } + for (const extension of extensionsA) { + const [containerA, field] = createExtensionContainer(extension, getExtension(a.message, extension)); + const [containerB] = createExtensionContainer(extension, getExtension(b.message, extension)); + if (!fieldEquals(field, containerA, containerB, opts)) { + return false; + } + } + return true; +} diff --git a/node_modules/@bufbuild/protobuf/dist/esm/extensions.d.ts b/node_modules/@bufbuild/protobuf/dist/esm/extensions.d.ts new file mode 100644 index 0000000..8336447 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/extensions.d.ts @@ -0,0 +1,59 @@ +import type { AnyDesc, DescEnum, DescEnumValue, DescExtension, DescField, DescFile, DescMessage, DescMethod, DescOneof, DescService } from "./descriptors.js"; +import type { ReflectMessage } from "./reflect/reflect-types.js"; +import type { Extendee, ExtensionValueShape } from "./types.js"; +import type { EnumOptions, EnumValueOptions, FieldOptions, FileOptions, MessageOptions, MethodOptions, OneofOptions, ServiceOptions } from "./wkt/gen/google/protobuf/descriptor_pb.js"; +/** + * Retrieve an extension value from a message. + * + * The function never returns undefined. Use hasExtension() to check whether an + * extension is set. If the extension is not set, this function returns the + * default value (if one was specified in the protobuf source), or the zero value + * (for example `0` for numeric types, `[]` for repeated extension fields, and + * an empty message instance for message fields). + * + * Extensions are stored as unknown fields on a message. To mutate an extension + * value, make sure to store the new value with setExtension() after mutating. + * + * If the extension does not extend the given message, an error is raised. + */ +export declare function getExtension(message: Extendee, extension: Desc): ExtensionValueShape; +/** + * Set an extension value on a message. If the message already has a value for + * this extension, the value is replaced. + * + * If the extension does not extend the given message, an error is raised. + */ +export declare function setExtension(message: Extendee, extension: Desc, value: ExtensionValueShape): void; +/** + * Remove an extension value from a message. + * + * If the extension does not extend the given message, an error is raised. + */ +export declare function clearExtension(message: Extendee, extension: Desc): void; +/** + * Check whether an extension is set on a message. + */ +export declare function hasExtension(message: Extendee, extension: Desc): boolean; +/** + * Check whether an option is set on a descriptor. + * + * Options are extensions to the `google.protobuf.*Options` messages defined in + * google/protobuf/descriptor.proto. This function gets the option message from + * the descriptor, and calls hasExtension(). + */ +export declare function hasOption>(element: Desc, option: Ext): boolean; +/** + * Retrieve an option value from a descriptor. + * + * Options are extensions to the `google.protobuf.*Options` messages defined in + * google/protobuf/descriptor.proto. This function gets the option message from + * the descriptor, and calls getExtension(). Same as getExtension(), this + * function never returns undefined. + */ +export declare function getOption>(element: Desc, option: Ext): ExtensionValueShape; +type DescForOptionExtension = Extendee extends FileOptions ? DescFile : Extendee extends EnumOptions ? DescEnum : Extendee extends EnumValueOptions ? DescEnumValue : Extendee extends MessageOptions ? DescMessage : Extendee extends MessageOptions ? DescEnum : Extendee extends FieldOptions ? DescField | DescExtension : Extendee extends OneofOptions ? DescOneof : Extendee extends ServiceOptions ? DescService : Extendee extends EnumOptions ? DescEnum : Extendee extends MethodOptions ? DescMethod : AnyDesc; +/** + * @private + */ +export declare function createExtensionContainer(extension: Desc, value?: ExtensionValueShape): [ReflectMessage, DescField, () => ExtensionValueShape]; +export {}; diff --git a/node_modules/@bufbuild/protobuf/dist/esm/extensions.js b/node_modules/@bufbuild/protobuf/dist/esm/extensions.js new file mode 100644 index 0000000..5ce39e3 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/extensions.js @@ -0,0 +1,160 @@ +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +import { create } from "./create.js"; +import { readField } from "./from-binary.js"; +import { reflect } from "./reflect/reflect.js"; +import { scalarZeroValue } from "./reflect/scalar.js"; +import { writeField } from "./to-binary.js"; +import { BinaryReader, BinaryWriter } from "./wire/binary-encoding.js"; +import { isWrapperDesc } from "./wkt/wrappers.js"; +/** + * Retrieve an extension value from a message. + * + * The function never returns undefined. Use hasExtension() to check whether an + * extension is set. If the extension is not set, this function returns the + * default value (if one was specified in the protobuf source), or the zero value + * (for example `0` for numeric types, `[]` for repeated extension fields, and + * an empty message instance for message fields). + * + * Extensions are stored as unknown fields on a message. To mutate an extension + * value, make sure to store the new value with setExtension() after mutating. + * + * If the extension does not extend the given message, an error is raised. + */ +export function getExtension(message, extension) { + assertExtendee(extension, message); + const ufs = filterUnknownFields(message.$unknown, extension); + const [container, field, get] = createExtensionContainer(extension); + for (const uf of ufs) { + readField(container, new BinaryReader(uf.data), field, uf.wireType, { + readUnknownFields: true, + }); + } + return get(); +} +/** + * Set an extension value on a message. If the message already has a value for + * this extension, the value is replaced. + * + * If the extension does not extend the given message, an error is raised. + */ +export function setExtension(message, extension, value) { + var _a; + assertExtendee(extension, message); + const ufs = ((_a = message.$unknown) !== null && _a !== void 0 ? _a : []).filter((uf) => uf.no !== extension.number); + const [container, field] = createExtensionContainer(extension, value); + const writer = new BinaryWriter(); + writeField(writer, { writeUnknownFields: true }, container, field); + const reader = new BinaryReader(writer.finish()); + while (reader.pos < reader.len) { + const [no, wireType] = reader.tag(); + const data = reader.skip(wireType, no); + ufs.push({ no, wireType, data }); + } + message.$unknown = ufs; +} +/** + * Remove an extension value from a message. + * + * If the extension does not extend the given message, an error is raised. + */ +export function clearExtension(message, extension) { + assertExtendee(extension, message); + if (message.$unknown === undefined) { + return; + } + message.$unknown = message.$unknown.filter((uf) => uf.no !== extension.number); +} +/** + * Check whether an extension is set on a message. + */ +export function hasExtension(message, extension) { + var _a; + return (extension.extendee.typeName === message.$typeName && + !!((_a = message.$unknown) === null || _a === void 0 ? void 0 : _a.find((uf) => uf.no === extension.number))); +} +/** + * Check whether an option is set on a descriptor. + * + * Options are extensions to the `google.protobuf.*Options` messages defined in + * google/protobuf/descriptor.proto. This function gets the option message from + * the descriptor, and calls hasExtension(). + */ +export function hasOption(element, option) { + const message = element.proto.options; + if (!message) { + return false; + } + return hasExtension(message, option); +} +/** + * Retrieve an option value from a descriptor. + * + * Options are extensions to the `google.protobuf.*Options` messages defined in + * google/protobuf/descriptor.proto. This function gets the option message from + * the descriptor, and calls getExtension(). Same as getExtension(), this + * function never returns undefined. + */ +export function getOption(element, option) { + const message = element.proto.options; + if (!message) { + const [, , get] = createExtensionContainer(option); + return get(); + } + return getExtension(message, option); +} +function filterUnknownFields(unknownFields, extension) { + if (unknownFields === undefined) + return []; + if (extension.fieldKind === "enum" || extension.fieldKind === "scalar") { + // singular scalar fields do not merge, we pick the last + for (let i = unknownFields.length - 1; i >= 0; --i) { + if (unknownFields[i].no == extension.number) { + return [unknownFields[i]]; + } + } + return []; + } + return unknownFields.filter((uf) => uf.no === extension.number); +} +/** + * @private + */ +export function createExtensionContainer(extension, value) { + const localName = extension.typeName; + const field = Object.assign(Object.assign({}, extension), { kind: "field", parent: extension.extendee, localName }); + const desc = Object.assign(Object.assign({}, extension.extendee), { fields: [field], members: [field], oneofs: [] }); + const container = create(desc, value !== undefined ? { [localName]: value } : undefined); + return [ + reflect(desc, container), + field, + () => { + const value = container[localName]; + if (value === undefined) { + // biome-ignore lint/style/noNonNullAssertion: Only message fields are undefined, rest will have a zero value. + const desc = extension.message; + if (isWrapperDesc(desc)) { + return scalarZeroValue(desc.fields[0].scalar, desc.fields[0].longAsString); + } + return create(desc); + } + return value; + }, + ]; +} +function assertExtendee(extension, message) { + if (extension.extendee.typeName != message.$typeName) { + throw new Error(`extension ${extension.typeName} can only be applied to message ${extension.extendee.typeName}`); + } +} diff --git a/node_modules/@bufbuild/protobuf/dist/esm/fields.d.ts b/node_modules/@bufbuild/protobuf/dist/esm/fields.d.ts new file mode 100644 index 0000000..a44a0c8 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/fields.d.ts @@ -0,0 +1,23 @@ +import type { MessageShape } from "./types.js"; +import type { DescField, DescMessage } from "./descriptors.js"; +/** + * Returns true if the field is set. + * + * - Scalar and enum fields with implicit presence (proto3): + * Set if not a zero value. + * + * - Scalar and enum fields with explicit presence (proto2, oneof): + * Set if a value was set when creating or parsing the message, or when a + * value was assigned to the field's property. + * + * - Message fields: + * Set if the property is not undefined. + * + * - List and map fields: + * Set if not empty. + */ +export declare function isFieldSet(message: MessageShape, field: DescField): boolean; +/** + * Resets the field, so that isFieldSet() will return false. + */ +export declare function clearField(message: MessageShape, field: DescField): void; diff --git a/node_modules/@bufbuild/protobuf/dist/esm/fields.js b/node_modules/@bufbuild/protobuf/dist/esm/fields.js new file mode 100644 index 0000000..cbcb81a --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/fields.js @@ -0,0 +1,41 @@ +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +import { unsafeClear, unsafeIsSet } from "./reflect/unsafe.js"; +/** + * Returns true if the field is set. + * + * - Scalar and enum fields with implicit presence (proto3): + * Set if not a zero value. + * + * - Scalar and enum fields with explicit presence (proto2, oneof): + * Set if a value was set when creating or parsing the message, or when a + * value was assigned to the field's property. + * + * - Message fields: + * Set if the property is not undefined. + * + * - List and map fields: + * Set if not empty. + */ +export function isFieldSet(message, field) { + return (field.parent.typeName == message.$typeName && unsafeIsSet(message, field)); +} +/** + * Resets the field, so that isFieldSet() will return false. + */ +export function clearField(message, field) { + if (field.parent.typeName == message.$typeName) { + unsafeClear(message, field); + } +} diff --git a/node_modules/@bufbuild/protobuf/dist/esm/from-binary.d.ts b/node_modules/@bufbuild/protobuf/dist/esm/from-binary.d.ts new file mode 100644 index 0000000..b04a9d3 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/from-binary.d.ts @@ -0,0 +1,34 @@ +import { type DescField, type DescMessage } from "./descriptors.js"; +import type { MessageShape } from "./types.js"; +import type { ReflectMessage } from "./reflect/index.js"; +import { BinaryReader, WireType } from "./wire/binary-encoding.js"; +/** + * Options for parsing binary data. + */ +export interface BinaryReadOptions { + /** + * Retain unknown fields during parsing? The default behavior is to retain + * unknown fields and include them in the serialized output. + * + * For more details see https://developers.google.com/protocol-buffers/docs/proto3#unknowns + */ + readUnknownFields: boolean; +} +/** + * Parse serialized binary data. + */ +export declare function fromBinary(schema: Desc, bytes: Uint8Array, options?: Partial): MessageShape; +/** + * Parse from binary data, merging fields. + * + * Repeated fields are appended. Map entries are added, overwriting + * existing keys. + * + * If a message field is already present, it will be merged with the + * new data. + */ +export declare function mergeFromBinary(schema: Desc, target: MessageShape, bytes: Uint8Array, options?: Partial): MessageShape; +/** + * @private + */ +export declare function readField(message: ReflectMessage, reader: BinaryReader, field: DescField, wireType: WireType, options: BinaryReadOptions): void; diff --git a/node_modules/@bufbuild/protobuf/dist/esm/from-binary.js b/node_modules/@bufbuild/protobuf/dist/esm/from-binary.js new file mode 100644 index 0000000..bbc57f8 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/from-binary.js @@ -0,0 +1,236 @@ +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +import { ScalarType } from "./descriptors.js"; +import { scalarZeroValue } from "./reflect/scalar.js"; +import { reflect } from "./reflect/reflect.js"; +import { BinaryReader, WireType } from "./wire/binary-encoding.js"; +import { varint32write } from "./wire/varint.js"; +// Default options for parsing binary data. +const readDefaults = { + readUnknownFields: true, +}; +function makeReadOptions(options) { + return options ? Object.assign(Object.assign({}, readDefaults), options) : readDefaults; +} +/** + * Parse serialized binary data. + */ +export function fromBinary(schema, bytes, options) { + const msg = reflect(schema, undefined, false); + readMessage(msg, new BinaryReader(bytes), makeReadOptions(options), false, bytes.byteLength); + return msg.message; +} +/** + * Parse from binary data, merging fields. + * + * Repeated fields are appended. Map entries are added, overwriting + * existing keys. + * + * If a message field is already present, it will be merged with the + * new data. + */ +export function mergeFromBinary(schema, target, bytes, options) { + readMessage(reflect(schema, target, false), new BinaryReader(bytes), makeReadOptions(options), false, bytes.byteLength); + return target; +} +/** + * If `delimited` is false, read the length given in `lengthOrDelimitedFieldNo`. + * + * If `delimited` is true, read until an EndGroup tag. `lengthOrDelimitedFieldNo` + * is the expected field number. + * + * @private + */ +function readMessage(message, reader, options, delimited, lengthOrDelimitedFieldNo) { + var _a; + const end = delimited ? reader.len : reader.pos + lengthOrDelimitedFieldNo; + let fieldNo; + let wireType; + const unknownFields = (_a = message.getUnknown()) !== null && _a !== void 0 ? _a : []; + while (reader.pos < end) { + [fieldNo, wireType] = reader.tag(); + if (delimited && wireType == WireType.EndGroup) { + break; + } + const field = message.findNumber(fieldNo); + if (!field) { + const data = reader.skip(wireType, fieldNo); + if (options.readUnknownFields) { + unknownFields.push({ no: fieldNo, wireType, data }); + } + continue; + } + readField(message, reader, field, wireType, options); + } + if (delimited) { + if (wireType != WireType.EndGroup || fieldNo !== lengthOrDelimitedFieldNo) { + throw new Error("invalid end group tag"); + } + } + if (unknownFields.length > 0) { + message.setUnknown(unknownFields); + } +} +/** + * @private + */ +export function readField(message, reader, field, wireType, options) { + var _a; + switch (field.fieldKind) { + case "scalar": + message.set(field, readScalar(reader, field.scalar, field.utf8Validation)); + break; + case "enum": + const val = readScalar(reader, ScalarType.INT32); + if (field.enum.open) { + message.set(field, val); + } + else { + const ok = field.enum.values.some((v) => v.number === val); + if (ok) { + message.set(field, val); + } + else if (options.readUnknownFields) { + const bytes = []; + varint32write(val, bytes); + const unknownFields = (_a = message.getUnknown()) !== null && _a !== void 0 ? _a : []; + unknownFields.push({ + no: field.number, + wireType, + data: new Uint8Array(bytes), + }); + message.setUnknown(unknownFields); + } + } + break; + case "message": + message.set(field, readMessageField(reader, options, field, message.get(field))); + break; + case "list": + readListField(reader, wireType, message.get(field), options); + break; + case "map": + readMapEntry(reader, message.get(field), options); + break; + } +} +// Read a map field, expecting key field = 1, value field = 2 +function readMapEntry(reader, map, options) { + const field = map.field(); + let key; + let val; + // Read the length of the map entry, which is a varint. + const len = reader.uint32(); + // WARNING: Calculate end AFTER advancing reader.pos (above), so that + // reader.pos is at the start of the map entry. + const end = reader.pos + len; + while (reader.pos < end) { + const [fieldNo] = reader.tag(); + switch (fieldNo) { + case 1: + key = readScalar(reader, field.mapKey, field.utf8Validation); + break; + case 2: + switch (field.mapKind) { + case "scalar": + val = readScalar(reader, field.scalar, field.utf8Validation); + break; + case "enum": + val = reader.int32(); + break; + case "message": + val = readMessageField(reader, options, field); + break; + } + break; + } + } + if (key === undefined) { + key = scalarZeroValue(field.mapKey, false); + } + if (val === undefined) { + switch (field.mapKind) { + case "scalar": + val = scalarZeroValue(field.scalar, false); + break; + case "enum": + val = field.enum.values[0].number; + break; + case "message": + val = reflect(field.message, undefined, false); + break; + } + } + map.set(key, val); +} +function readListField(reader, wireType, list, options) { + var _a; + const field = list.field(); + if (field.listKind === "message") { + list.add(readMessageField(reader, options, field)); + return; + } + const scalarType = (_a = field.scalar) !== null && _a !== void 0 ? _a : ScalarType.INT32; + const packed = wireType == WireType.LengthDelimited && + scalarType != ScalarType.STRING && + scalarType != ScalarType.BYTES; + if (!packed) { + list.add(readScalar(reader, scalarType, field.utf8Validation)); + return; + } + const e = reader.uint32() + reader.pos; + while (reader.pos < e) { + list.add(readScalar(reader, scalarType, field.utf8Validation)); + } +} +function readMessageField(reader, options, field, mergeMessage) { + const delimited = field.delimitedEncoding; + const message = mergeMessage !== null && mergeMessage !== void 0 ? mergeMessage : reflect(field.message, undefined, false); + readMessage(message, reader, options, delimited, delimited ? field.number : reader.uint32()); + return message; +} +function readScalar(reader, type, validateUtf8 = false) { + switch (type) { + case ScalarType.STRING: + return reader.string(validateUtf8); + case ScalarType.BOOL: + return reader.bool(); + case ScalarType.DOUBLE: + return reader.double(); + case ScalarType.FLOAT: + return reader.float(); + case ScalarType.INT32: + return reader.int32(); + case ScalarType.INT64: + return reader.int64(); + case ScalarType.UINT64: + return reader.uint64(); + case ScalarType.FIXED64: + return reader.fixed64(); + case ScalarType.BYTES: + return reader.bytes(); + case ScalarType.FIXED32: + return reader.fixed32(); + case ScalarType.SFIXED32: + return reader.sfixed32(); + case ScalarType.SFIXED64: + return reader.sfixed64(); + case ScalarType.SINT64: + return reader.sint64(); + case ScalarType.UINT32: + return reader.uint32(); + case ScalarType.SINT32: + return reader.sint32(); + } +} diff --git a/node_modules/@bufbuild/protobuf/dist/esm/from-json.d.ts b/node_modules/@bufbuild/protobuf/dist/esm/from-json.d.ts new file mode 100644 index 0000000..98942a6 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/from-json.d.ts @@ -0,0 +1,56 @@ +import { type DescEnum, type DescMessage } from "./descriptors.js"; +import type { JsonValue } from "./json-value.js"; +import type { Registry } from "./registry.js"; +import type { EnumJsonType, EnumShape, MessageShape } from "./types.js"; +/** + * Options for parsing JSON data. + */ +export interface JsonReadOptions { + /** + * Ignore unknown fields: Proto3 JSON parser should reject unknown fields + * by default. This option ignores unknown fields in parsing, as well as + * unrecognized enum string representations. + */ + ignoreUnknownFields: boolean; + /** + * This option is required to read `google.protobuf.Any` and extensions + * from JSON format. + */ + registry?: Registry | undefined; +} +/** + * Parse a message from a JSON string. + */ +export declare function fromJsonString(schema: Desc, json: string, options?: Partial): MessageShape; +/** + * Parse a message from a JSON string, merging fields. + * + * Repeated fields are appended. Map entries are added, overwriting + * existing keys. + * + * If a message field is already present, it will be merged with the + * new data. + */ +export declare function mergeFromJsonString(schema: Desc, target: MessageShape, json: string, options?: Partial): MessageShape; +/** + * Parse a message from a JSON value. + */ +export declare function fromJson(schema: Desc, json: JsonValue, options?: Partial): MessageShape; +/** + * Parse a message from a JSON value, merging fields. + * + * Repeated fields are appended. Map entries are added, overwriting + * existing keys. + * + * If a message field is already present, it will be merged with the + * new data. + */ +export declare function mergeFromJson(schema: Desc, target: MessageShape, json: JsonValue, options?: Partial): MessageShape; +/** + * Parses an enum value from JSON. + */ +export declare function enumFromJson(descEnum: Desc, json: EnumJsonType): EnumShape; +/** + * Is the given value a JSON enum value? + */ +export declare function isEnumJson(descEnum: Desc, value: unknown): value is EnumJsonType; diff --git a/node_modules/@bufbuild/protobuf/dist/esm/from-json.js b/node_modules/@bufbuild/protobuf/dist/esm/from-json.js new file mode 100644 index 0000000..0ea9e84 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/from-json.js @@ -0,0 +1,611 @@ +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +import { ScalarType, } from "./descriptors.js"; +import { protoInt64 } from "./proto-int64.js"; +import { create } from "./create.js"; +import { reflect } from "./reflect/reflect.js"; +import { FieldError, isFieldError } from "./reflect/error.js"; +import { formatVal } from "./reflect/reflect-check.js"; +import { protoSnakeCase } from "./reflect/names.js"; +import { base64Decode } from "./wire/base64-encoding.js"; +import { hasCustomJsonRepresentation, isWrapperDesc, anyPack, ListValueSchema, NullValue, StructSchema, ValueSchema, } from "./wkt/index.js"; +import { createExtensionContainer, setExtension } from "./extensions.js"; +// Default options for parsing JSON. +const jsonReadDefaults = { + ignoreUnknownFields: false, +}; +function makeReadOptions(options) { + return options ? Object.assign(Object.assign({}, jsonReadDefaults), options) : jsonReadDefaults; +} +/** + * Parse a message from a JSON string. + */ +export function fromJsonString(schema, json, options) { + return fromJson(schema, parseJsonString(json, schema.typeName), options); +} +/** + * Parse a message from a JSON string, merging fields. + * + * Repeated fields are appended. Map entries are added, overwriting + * existing keys. + * + * If a message field is already present, it will be merged with the + * new data. + */ +export function mergeFromJsonString(schema, target, json, options) { + return mergeFromJson(schema, target, parseJsonString(json, schema.typeName), options); +} +/** + * Parse a message from a JSON value. + */ +export function fromJson(schema, json, options) { + const msg = reflect(schema); + try { + readMessage(msg, json, makeReadOptions(options)); + } + catch (e) { + if (isFieldError(e)) { + // @ts-expect-error we use the ES2022 error CTOR option "cause" for better stack traces + throw new Error(`cannot decode ${e.field()} from JSON: ${e.message}`, { + cause: e, + }); + } + throw e; + } + return msg.message; +} +/** + * Parse a message from a JSON value, merging fields. + * + * Repeated fields are appended. Map entries are added, overwriting + * existing keys. + * + * If a message field is already present, it will be merged with the + * new data. + */ +export function mergeFromJson(schema, target, json, options) { + try { + readMessage(reflect(schema, target), json, makeReadOptions(options)); + } + catch (e) { + if (isFieldError(e)) { + // @ts-expect-error we use the ES2022 error CTOR option "cause" for better stack traces + throw new Error(`cannot decode ${e.field()} from JSON: ${e.message}`, { + cause: e, + }); + } + throw e; + } + return target; +} +/** + * Parses an enum value from JSON. + */ +export function enumFromJson(descEnum, json) { + return readEnum(descEnum, json, false); +} +/** + * Is the given value a JSON enum value? + */ +export function isEnumJson(descEnum, value) { + return undefined !== descEnum.values.find((v) => v.name === value); +} +const messageJsonFields = new WeakMap(); +function getJsonField(desc, jsonKey) { + var _a; + if (!messageJsonFields.has(desc)) { + const jsonNames = new Map(); + for (const field of desc.fields) { + jsonNames.set(field.name, field).set(field.jsonName, field); + } + messageJsonFields.set(desc, jsonNames); + } + return (_a = messageJsonFields.get(desc)) === null || _a === void 0 ? void 0 : _a.get(jsonKey); +} +function readMessage(msg, json, opts) { + var _a; + if (tryWktFromJson(msg, json, opts)) { + return; + } + if (json == null || Array.isArray(json) || typeof json != "object") { + throw new Error(`cannot decode ${msg.desc} from JSON: ${formatVal(json)}`); + } + const oneofSeen = new Map(); + for (const [jsonKey, jsonValue] of Object.entries(json)) { + const field = getJsonField(msg.desc, jsonKey); + if (field) { + if (field.oneof) { + if (jsonValue === null && field.fieldKind == "scalar") { + // see conformance test Required.Proto3.JsonInput.OneofFieldNull{First,Second} + continue; + } + const seen = oneofSeen.get(field.oneof); + if (seen !== undefined) { + throw new FieldError(field.oneof, `oneof set multiple times by ${seen.name} and ${field.name}`); + } + oneofSeen.set(field.oneof, field); + } + readField(msg, field, jsonValue, opts); + } + else { + let extension = undefined; + if (jsonKey.startsWith("[") && + jsonKey.endsWith("]") && + // biome-ignore lint/suspicious/noAssignInExpressions: no + (extension = (_a = opts.registry) === null || _a === void 0 ? void 0 : _a.getExtension(jsonKey.substring(1, jsonKey.length - 1))) && + extension.extendee.typeName === msg.desc.typeName) { + const [container, field, get] = createExtensionContainer(extension); + readField(container, field, jsonValue, opts); + setExtension(msg.message, extension, get()); + } + if (!extension && !opts.ignoreUnknownFields) { + throw new Error(`cannot decode ${msg.desc} from JSON: key "${jsonKey}" is unknown`); + } + } + } +} +function readField(msg, field, json, opts) { + switch (field.fieldKind) { + case "scalar": + readScalarField(msg, field, json); + break; + case "enum": + readEnumField(msg, field, json, opts); + break; + case "message": + readMessageField(msg, field, json, opts); + break; + case "list": + readListField(msg.get(field), json, opts); + break; + case "map": + readMapField(msg.get(field), json, opts); + break; + } +} +function readListOrMapItem(field, json, opts) { + if (field.scalar && json !== null) { + return scalarFromJson(field, json); + } + if (field.message && !isResetSentinelNullValue(field, json)) { + const msgValue = reflect(field.message); + readMessage(msgValue, json, opts); + return msgValue; + } + if (field.enum && !isResetSentinelNullValue(field, json)) { + return readEnum(field.enum, json, opts.ignoreUnknownFields); + } + throw new FieldError(field, `${field.fieldKind === "list" ? "list item" : "map value"} must not be null`); +} +function readMapField(map, json, opts) { + if (json === null) { + return; + } + const field = map.field(); + if (typeof json != "object" || Array.isArray(json)) { + throw new FieldError(field, "expected object, got " + formatVal(json)); + } + for (const [jsonMapKey, jsonMapValue] of Object.entries(json)) { + const key = mapKeyFromJson(field.mapKey, jsonMapKey); + const value = readListOrMapItem(field, jsonMapValue, opts); + if (value !== tokenIgnoredUnknownEnum) { + map.set(key, value); + } + } +} +function readListField(list, json, opts) { + if (json === null) { + return; + } + const field = list.field(); + if (!Array.isArray(json)) { + throw new FieldError(field, "expected Array, got " + formatVal(json)); + } + for (const jsonItem of json) { + const value = readListOrMapItem(field, jsonItem, opts); + if (value !== tokenIgnoredUnknownEnum) { + list.add(value); + } + } +} +function readMessageField(msg, field, json, opts) { + if (isResetSentinelNullValue(field, json)) { + msg.clear(field); + return; + } + const msgValue = msg.isSet(field) ? msg.get(field) : reflect(field.message); + readMessage(msgValue, json, opts); + msg.set(field, msgValue); +} +function readEnumField(msg, field, json, opts) { + if (isResetSentinelNullValue(field, json)) { + msg.clear(field); + return; + } + const enumValue = readEnum(field.enum, json, opts.ignoreUnknownFields); + if (enumValue !== tokenIgnoredUnknownEnum) { + msg.set(field, enumValue); + } +} +function readScalarField(msg, field, json) { + if (json === null) { + msg.clear(field); + } + else { + msg.set(field, scalarFromJson(field, json)); + } +} +/** + * Indicates whether a value is a sentinel for reseting a field. + * + * For this to be true, the value must be a JSON null and the field must not + * permit a present, Protobuf-serializable null. + * + * Only message google.protobuf.Value and enum google.protobuf.NullValue fields + * permit Protobuf-serializable nulls. + * + * Note that field-resetting sentinel nulls are not permitted in lists and maps. + */ +function isResetSentinelNullValue(field, json) { + var _a, _b; + return (json === null && + ((_a = field.message) === null || _a === void 0 ? void 0 : _a.typeName) != "google.protobuf.Value" && + ((_b = field.enum) === null || _b === void 0 ? void 0 : _b.typeName) != "google.protobuf.NullValue"); +} +const tokenIgnoredUnknownEnum = Symbol(); +function readEnum(desc, json, ignoreUnknownFields) { + if (json === null) { + return desc.values[0].number; + } + switch (typeof json) { + case "number": + if (Number.isInteger(json)) { + return json; + } + break; + case "string": + const value = desc.values.find((ev) => ev.name === json); + if (value !== undefined) { + return value.number; + } + if (ignoreUnknownFields) { + return tokenIgnoredUnknownEnum; + } + break; + } + throw new Error(`cannot decode ${desc} from JSON: ${formatVal(json)}`); +} +/** + * Try to parse a JSON value to a scalar value for the reflect API. + * + * Returns the input if the JSON value cannot be converted. Raises a FieldError + * if conversion would be ambiguous. + */ +function scalarFromJson(field, json) { + // int64, sfixed64, sint64, fixed64, uint64: Reflect supports string and number. + // string, bool: Supported by reflect. + switch (field.scalar) { + // float, double: JSON value will be a number or one of the special string values "NaN", "Infinity", and "-Infinity". + // Either numbers or strings are accepted. Exponent notation is also accepted. + case ScalarType.DOUBLE: + case ScalarType.FLOAT: + if (json === "NaN") + return NaN; + if (json === "Infinity") + return Number.POSITIVE_INFINITY; + if (json === "-Infinity") + return Number.NEGATIVE_INFINITY; + if (typeof json == "number") { + if (Number.isNaN(json)) { + // NaN must be encoded with string constants + throw new FieldError(field, "unexpected NaN number"); + } + if (!Number.isFinite(json)) { + // Infinity must be encoded with string constants + throw new FieldError(field, "unexpected infinite number"); + } + break; + } + if (typeof json == "string") { + if (json === "") { + // empty string is not a number + break; + } + if (json.trim().length !== json.length) { + // extra whitespace + break; + } + const float = Number(json); + if (!Number.isFinite(float)) { + // Infinity and NaN must be encoded with string constants + break; + } + return float; + } + break; + // int32, fixed32, uint32: JSON value will be a decimal number. Either numbers or strings are accepted. + case ScalarType.INT32: + case ScalarType.FIXED32: + case ScalarType.SFIXED32: + case ScalarType.SINT32: + case ScalarType.UINT32: + return int32FromJson(json); + // bytes: JSON value will be the data encoded as a string using standard base64 encoding with paddings. + // Either standard or URL-safe base64 encoding with/without paddings are accepted. + case ScalarType.BYTES: + if (typeof json == "string") { + if (json === "") { + return new Uint8Array(0); + } + try { + return base64Decode(json); + } + catch (e) { + const message = e instanceof Error ? e.message : String(e); + throw new FieldError(field, message); + } + } + break; + } + return json; +} +/** + * Try to parse a JSON value to a map key for the reflect API. + * + * Returns the input if the JSON value cannot be converted. + */ +function mapKeyFromJson(type, jsonString) { + switch (type) { + case ScalarType.BOOL: + switch (jsonString) { + case "true": + return true; + case "false": + return false; + } + return jsonString; + case ScalarType.INT32: + case ScalarType.FIXED32: + case ScalarType.UINT32: + case ScalarType.SFIXED32: + case ScalarType.SINT32: + return int32FromJson(jsonString); + default: + return jsonString; + } +} +/** + * Try to parse a JSON value to a 32-bit integer for the reflect API. + * + * Returns the input if the JSON value cannot be converted. + */ +function int32FromJson(json) { + if (typeof json == "string") { + if (json === "") { + // empty string is not a number + return json; + } + if (json.trim().length !== json.length) { + // extra whitespace + return json; + } + const num = Number(json); + if (Number.isNaN(num)) { + // not a number + return json; + } + return num; + } + return json; +} +function parseJsonString(jsonString, typeName) { + try { + return JSON.parse(jsonString); + } + catch (e) { + const message = e instanceof Error ? e.message : String(e); + throw new Error(`cannot decode message ${typeName} from JSON: ${message}`, + // @ts-expect-error we use the ES2022 error CTOR option "cause" for better stack traces + { cause: e }); + } +} +function tryWktFromJson(msg, jsonValue, opts) { + if (!msg.desc.typeName.startsWith("google.protobuf.")) { + return false; + } + switch (msg.desc.typeName) { + case "google.protobuf.Any": + anyFromJson(msg.message, jsonValue, opts); + return true; + case "google.protobuf.Timestamp": + timestampFromJson(msg.message, jsonValue); + return true; + case "google.protobuf.Duration": + durationFromJson(msg.message, jsonValue); + return true; + case "google.protobuf.FieldMask": + fieldMaskFromJson(msg.message, jsonValue); + return true; + case "google.protobuf.Struct": + structFromJson(msg.message, jsonValue); + return true; + case "google.protobuf.Value": + valueFromJson(msg.message, jsonValue); + return true; + case "google.protobuf.ListValue": + listValueFromJson(msg.message, jsonValue); + return true; + default: + if (isWrapperDesc(msg.desc)) { + const valueField = msg.desc.fields[0]; + if (jsonValue === null) { + msg.clear(valueField); + } + else { + msg.set(valueField, scalarFromJson(valueField, jsonValue)); + } + return true; + } + return false; + } +} +function anyFromJson(any, json, opts) { + var _a; + if (json === null || Array.isArray(json) || typeof json != "object") { + throw new Error(`cannot decode message ${any.$typeName} from JSON: expected object but got ${formatVal(json)}`); + } + if (Object.keys(json).length == 0) { + return; + } + const typeUrl = json["@type"]; + if (typeof typeUrl != "string" || typeUrl == "") { + throw new Error(`cannot decode message ${any.$typeName} from JSON: "@type" is empty`); + } + const typeName = typeUrl.includes("/") + ? typeUrl.substring(typeUrl.lastIndexOf("/") + 1) + : typeUrl; + if (!typeName.length) { + throw new Error(`cannot decode message ${any.$typeName} from JSON: "@type" is invalid`); + } + const desc = (_a = opts.registry) === null || _a === void 0 ? void 0 : _a.getMessage(typeName); + if (!desc) { + throw new Error(`cannot decode message ${any.$typeName} from JSON: ${typeUrl} is not in the type registry`); + } + const msg = reflect(desc); + if (hasCustomJsonRepresentation(desc) && + Object.prototype.hasOwnProperty.call(json, "value")) { + const value = json.value; + readMessage(msg, value, opts); + } + else { + const copy = Object.assign({}, json); + // biome-ignore lint/performance/noDelete: + delete copy["@type"]; + readMessage(msg, copy, opts); + } + anyPack(msg.desc, msg.message, any); +} +function timestampFromJson(timestamp, json) { + if (typeof json !== "string") { + throw new Error(`cannot decode message ${timestamp.$typeName} from JSON: ${formatVal(json)}`); + } + const matches = json.match(/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(?:\.([0-9]{1,9}))?(?:Z|([+-][0-9][0-9]:[0-9][0-9]))$/); + if (!matches) { + throw new Error(`cannot decode message ${timestamp.$typeName} from JSON: invalid RFC 3339 string`); + } + const ms = Date.parse( + // biome-ignore format: want this to read well + matches[1] + "-" + matches[2] + "-" + matches[3] + "T" + matches[4] + ":" + matches[5] + ":" + matches[6] + (matches[8] ? matches[8] : "Z")); + if (Number.isNaN(ms)) { + throw new Error(`cannot decode message ${timestamp.$typeName} from JSON: invalid RFC 3339 string`); + } + if (ms < Date.parse("0001-01-01T00:00:00Z") || + ms > Date.parse("9999-12-31T23:59:59Z")) { + throw new Error(`cannot decode message ${timestamp.$typeName} from JSON: must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive`); + } + timestamp.seconds = protoInt64.parse(ms / 1000); + timestamp.nanos = 0; + if (matches[7]) { + timestamp.nanos = + parseInt("1" + matches[7] + "0".repeat(9 - matches[7].length)) - + 1000000000; + } +} +function durationFromJson(duration, json) { + if (typeof json !== "string") { + throw new Error(`cannot decode message ${duration.$typeName} from JSON: ${formatVal(json)}`); + } + const match = json.match(/^(-?[0-9]+)(?:\.([0-9]+))?s/); + if (match === null) { + throw new Error(`cannot decode message ${duration.$typeName} from JSON: ${formatVal(json)}`); + } + const longSeconds = Number(match[1]); + if (longSeconds > 315576000000 || longSeconds < -315576000000) { + throw new Error(`cannot decode message ${duration.$typeName} from JSON: ${formatVal(json)}`); + } + duration.seconds = protoInt64.parse(longSeconds); + if (typeof match[2] !== "string") { + return; + } + const nanosStr = match[2] + "0".repeat(9 - match[2].length); + duration.nanos = parseInt(nanosStr); + if (longSeconds < 0 || Object.is(longSeconds, -0)) { + duration.nanos = -duration.nanos; + } +} +function fieldMaskFromJson(fieldMask, json) { + if (typeof json !== "string") { + throw new Error(`cannot decode message ${fieldMask.$typeName} from JSON: ${formatVal(json)}`); + } + if (json === "") { + return; + } + fieldMask.paths = json.split(",").map((path) => { + if (path.includes("_")) { + throw new Error(`cannot decode message ${fieldMask.$typeName} from JSON: path names must be lowerCamelCase`); + } + return protoSnakeCase(path); + }); +} +function structFromJson(struct, json) { + if (typeof json != "object" || json == null || Array.isArray(json)) { + throw new Error(`cannot decode message ${struct.$typeName} from JSON ${formatVal(json)}`); + } + for (const [k, v] of Object.entries(json)) { + const parsedV = create(ValueSchema); + valueFromJson(parsedV, v); + struct.fields[k] = parsedV; + } +} +function valueFromJson(value, json) { + switch (typeof json) { + case "number": + value.kind = { case: "numberValue", value: json }; + break; + case "string": + value.kind = { case: "stringValue", value: json }; + break; + case "boolean": + value.kind = { case: "boolValue", value: json }; + break; + case "object": + if (json === null) { + value.kind = { case: "nullValue", value: NullValue.NULL_VALUE }; + } + else if (Array.isArray(json)) { + const listValue = create(ListValueSchema); + listValueFromJson(listValue, json); + value.kind = { case: "listValue", value: listValue }; + } + else { + const struct = create(StructSchema); + structFromJson(struct, json); + value.kind = { case: "structValue", value: struct }; + } + break; + default: + throw new Error(`cannot decode message ${value.$typeName} from JSON ${formatVal(json)}`); + } + return value; +} +function listValueFromJson(listValue, json) { + if (!Array.isArray(json)) { + throw new Error(`cannot decode message ${listValue.$typeName} from JSON ${formatVal(json)}`); + } + for (const e of json) { + const value = create(ValueSchema); + valueFromJson(value, e); + listValue.values.push(value); + } +} diff --git a/node_modules/@bufbuild/protobuf/dist/esm/index.d.ts b/node_modules/@bufbuild/protobuf/dist/esm/index.d.ts new file mode 100644 index 0000000..7a23115 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/index.d.ts @@ -0,0 +1,18 @@ +export * from "./types.js"; +export * from "./is-message.js"; +export * from "./create.js"; +export * from "./clone.js"; +export * from "./descriptors.js"; +export * from "./equals.js"; +export * from "./fields.js"; +export * from "./registry.js"; +export type { JsonValue, JsonObject } from "./json-value.js"; +export { toBinary } from "./to-binary.js"; +export type { BinaryWriteOptions } from "./to-binary.js"; +export { fromBinary, mergeFromBinary } from "./from-binary.js"; +export type { BinaryReadOptions } from "./from-binary.js"; +export * from "./to-json.js"; +export * from "./from-json.js"; +export * from "./merge.js"; +export { hasExtension, getExtension, setExtension, clearExtension, hasOption, getOption, } from "./extensions.js"; +export * from "./proto-int64.js"; diff --git a/node_modules/@bufbuild/protobuf/dist/esm/index.js b/node_modules/@bufbuild/protobuf/dist/esm/index.js new file mode 100644 index 0000000..7a2970f --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/index.js @@ -0,0 +1,28 @@ +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +export * from "./types.js"; +export * from "./is-message.js"; +export * from "./create.js"; +export * from "./clone.js"; +export * from "./descriptors.js"; +export * from "./equals.js"; +export * from "./fields.js"; +export * from "./registry.js"; +export { toBinary } from "./to-binary.js"; +export { fromBinary, mergeFromBinary } from "./from-binary.js"; +export * from "./to-json.js"; +export * from "./from-json.js"; +export * from "./merge.js"; +export { hasExtension, getExtension, setExtension, clearExtension, hasOption, getOption, } from "./extensions.js"; +export * from "./proto-int64.js"; diff --git a/node_modules/@bufbuild/protobuf/dist/esm/is-message.d.ts b/node_modules/@bufbuild/protobuf/dist/esm/is-message.d.ts new file mode 100644 index 0000000..085782d --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/is-message.d.ts @@ -0,0 +1,7 @@ +import type { MessageShape } from "./types.js"; +import type { DescMessage } from "./descriptors.js"; +/** + * Determine whether the given `arg` is a message. + * If `desc` is set, determine whether `arg` is this specific message. + */ +export declare function isMessage(arg: unknown, schema?: Desc): arg is MessageShape; diff --git a/node_modules/@bufbuild/protobuf/dist/esm/is-message.js b/node_modules/@bufbuild/protobuf/dist/esm/is-message.js new file mode 100644 index 0000000..b7da7f4 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/is-message.js @@ -0,0 +1,30 @@ +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +/** + * Determine whether the given `arg` is a message. + * If `desc` is set, determine whether `arg` is this specific message. + */ +export function isMessage(arg, schema) { + const isMessage = arg !== null && + typeof arg == "object" && + "$typeName" in arg && + typeof arg.$typeName == "string"; + if (!isMessage) { + return false; + } + if (schema === undefined) { + return true; + } + return schema.typeName === arg.$typeName; +} diff --git a/node_modules/@bufbuild/protobuf/dist/esm/json-value.d.ts b/node_modules/@bufbuild/protobuf/dist/esm/json-value.d.ts new file mode 100644 index 0000000..3857eb8 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/json-value.d.ts @@ -0,0 +1,16 @@ +/** + * Represents any possible JSON value: + * - number + * - string + * - boolean + * - null + * - object (with any JSON value as property) + * - array (with any JSON value as element) + */ +export type JsonValue = number | string | boolean | null | JsonObject | JsonValue[]; +/** + * Represents a JSON object. + */ +export type JsonObject = { + [k: string]: JsonValue; +}; diff --git a/node_modules/@bufbuild/protobuf/dist/esm/json-value.js b/node_modules/@bufbuild/protobuf/dist/esm/json-value.js new file mode 100644 index 0000000..c3ad5eb --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/json-value.js @@ -0,0 +1,14 @@ +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +export {}; diff --git a/node_modules/@bufbuild/protobuf/dist/esm/merge.d.ts b/node_modules/@bufbuild/protobuf/dist/esm/merge.d.ts new file mode 100644 index 0000000..aad01ed --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/merge.d.ts @@ -0,0 +1,13 @@ +import type { MessageShape } from "./types.js"; +import type { DescMessage } from "./descriptors.js"; +/** + * Merge message `source` into message `target`, following Protobuf semantics. + * + * This is the same as serializing the source message, then deserializing it + * into the target message via `mergeFromBinary()`, with one difference: + * While serialization will create a copy of all values, `merge()` will copy + * the reference for `bytes` and messages. + * + * Also see https://protobuf.com/docs/language-spec#merging-protobuf-messages + */ +export declare function merge(schema: Desc, target: MessageShape, source: MessageShape): void; diff --git a/node_modules/@bufbuild/protobuf/dist/esm/merge.js b/node_modules/@bufbuild/protobuf/dist/esm/merge.js new file mode 100644 index 0000000..cf56ba4 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/merge.js @@ -0,0 +1,67 @@ +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +import { reflect } from "./reflect/reflect.js"; +/** + * Merge message `source` into message `target`, following Protobuf semantics. + * + * This is the same as serializing the source message, then deserializing it + * into the target message via `mergeFromBinary()`, with one difference: + * While serialization will create a copy of all values, `merge()` will copy + * the reference for `bytes` and messages. + * + * Also see https://protobuf.com/docs/language-spec#merging-protobuf-messages + */ +export function merge(schema, target, source) { + reflectMerge(reflect(schema, target), reflect(schema, source)); +} +function reflectMerge(target, source) { + var _a; + var _b; + const sourceUnknown = source.message.$unknown; + if (sourceUnknown !== undefined && sourceUnknown.length > 0) { + (_a = (_b = target.message).$unknown) !== null && _a !== void 0 ? _a : (_b.$unknown = []); + target.message.$unknown.push(...sourceUnknown); + } + for (const f of target.fields) { + if (!source.isSet(f)) { + continue; + } + switch (f.fieldKind) { + case "scalar": + case "enum": + target.set(f, source.get(f)); + break; + case "message": + if (target.isSet(f)) { + reflectMerge(target.get(f), source.get(f)); + } + else { + target.set(f, source.get(f)); + } + break; + case "list": + const list = target.get(f); + for (const e of source.get(f)) { + list.add(e); + } + break; + case "map": + const map = target.get(f); + for (const [k, v] of source.get(f)) { + map.set(k, v); + } + break; + } + } +} diff --git a/node_modules/@bufbuild/protobuf/dist/esm/proto-int64.d.ts b/node_modules/@bufbuild/protobuf/dist/esm/proto-int64.d.ts new file mode 100644 index 0000000..3eaf231 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/proto-int64.d.ts @@ -0,0 +1,98 @@ +/** + * Int64Support for the current environment. + */ +export declare const protoInt64: Int64Support; +/** + * We use the `bigint` primitive to represent 64-bit integral types. If bigint + * is unavailable, we fall back to a string representation, which means that + * all values typed as `bigint` will actually be strings. + * + * If your code is intended to run in an environment where bigint may be + * unavailable, it must handle both the bigint and the string representation. + * For presenting values, this is straight-forward with implicit or explicit + * conversion to string: + * + * ```ts + * let el = document.createElement("span"); + * el.innerText = message.int64Field; // assuming a protobuf int64 field + * + * console.log(`int64: ${message.int64Field}`); + * + * let str: string = message.int64Field.toString(); + * ``` + * + * If you need to manipulate 64-bit integral values and are sure the values + * can be safely represented as an IEEE-754 double precision number, you can + * convert to a JavaScript Number: + * + * ```ts + * console.log(message.int64Field.toString()) + * let num = Number(message.int64Field); + * num = num + 1; + * message.int64Field = protoInt64.parse(num); + * ``` + * + * If you need to manipulate 64-bit integral values that are outside the + * range of safe representation as a JavaScript Number, we recommend you + * use a third party library, for example the npm package "long": + * + * ```ts + * // convert the field value to a Long + * const bits = protoInt64.enc(message.int64Field); + * const longValue = Long.fromBits(bits.lo, bits.hi); + * + * // perform arithmetic + * const longResult = longValue.subtract(1); + * + * // set the result in the field + * message.int64Field = protoInt64.dec(longResult.low, longResult.high); + * + * // Assuming int64Field contains 9223372036854775807: + * console.log(message.int64Field); // 9223372036854775806 + * ``` + */ +interface Int64Support { + /** + * 0n if bigint is available, "0" if unavailable. + */ + readonly zero: bigint; + /** + * Is bigint available? + */ + readonly supported: boolean; + /** + * Parse a signed 64-bit integer. + * Returns a bigint if available, a string otherwise. + */ + parse(value: string | number | bigint): bigint; + /** + * Parse an unsigned 64-bit integer. + * Returns a bigint if available, a string otherwise. + */ + uParse(value: string | number | bigint): bigint; + /** + * Convert a signed 64-bit integral value to a two's complement. + */ + enc(value: string | number | bigint): { + lo: number; + hi: number; + }; + /** + * Convert an unsigned 64-bit integral value to a two's complement. + */ + uEnc(value: string | number | bigint): { + lo: number; + hi: number; + }; + /** + * Convert a two's complement to a signed 64-bit integral value. + * Returns a bigint if available, a string otherwise. + */ + dec(lo: number, hi: number): bigint; + /** + * Convert a two's complement to an unsigned 64-bit integral value. + * Returns a bigint if available, a string otherwise. + */ + uDec(lo: number, hi: number): bigint; +} +export {}; diff --git a/node_modules/@bufbuild/protobuf/dist/esm/proto-int64.js b/node_modules/@bufbuild/protobuf/dist/esm/proto-int64.js new file mode 100644 index 0000000..1d00c2c --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/proto-int64.js @@ -0,0 +1,127 @@ +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +import { int64FromString, int64ToString, uInt64ToString, } from "./wire/varint.js"; +/** + * Int64Support for the current environment. + */ +export const protoInt64 = /*@__PURE__*/ makeInt64Support(); +function makeInt64Support() { + const dv = new DataView(new ArrayBuffer(8)); + // note that Safari 14 implements BigInt, but not the DataView methods + const ok = typeof BigInt === "function" && + typeof dv.getBigInt64 === "function" && + typeof dv.getBigUint64 === "function" && + typeof dv.setBigInt64 === "function" && + typeof dv.setBigUint64 === "function" && + (!!globalThis.Deno || + typeof process != "object" || + typeof process.env != "object" || + process.env.BUF_BIGINT_DISABLE !== "1"); + if (ok) { + const MIN = BigInt("-9223372036854775808"); + const MAX = BigInt("9223372036854775807"); + const UMIN = BigInt("0"); + const UMAX = BigInt("18446744073709551615"); + return { + zero: BigInt(0), + supported: true, + parse(value) { + const bi = typeof value == "bigint" ? value : BigInt(value); + if (bi > MAX || bi < MIN) { + throw new Error(`invalid int64: ${value}`); + } + return bi; + }, + uParse(value) { + const bi = typeof value == "bigint" ? value : BigInt(value); + if (bi > UMAX || bi < UMIN) { + throw new Error(`invalid uint64: ${value}`); + } + return bi; + }, + enc(value) { + dv.setBigInt64(0, this.parse(value), true); + return { + lo: dv.getInt32(0, true), + hi: dv.getInt32(4, true), + }; + }, + uEnc(value) { + dv.setBigInt64(0, this.uParse(value), true); + return { + lo: dv.getInt32(0, true), + hi: dv.getInt32(4, true), + }; + }, + dec(lo, hi) { + dv.setInt32(0, lo, true); + dv.setInt32(4, hi, true); + return dv.getBigInt64(0, true); + }, + uDec(lo, hi) { + dv.setInt32(0, lo, true); + dv.setInt32(4, hi, true); + return dv.getBigUint64(0, true); + }, + }; + } + return { + zero: "0", + supported: false, + parse(value) { + if (typeof value != "string") { + value = value.toString(); + } + assertInt64String(value); + return value; + }, + uParse(value) { + if (typeof value != "string") { + value = value.toString(); + } + assertUInt64String(value); + return value; + }, + enc(value) { + if (typeof value != "string") { + value = value.toString(); + } + assertInt64String(value); + return int64FromString(value); + }, + uEnc(value) { + if (typeof value != "string") { + value = value.toString(); + } + assertUInt64String(value); + return int64FromString(value); + }, + dec(lo, hi) { + return int64ToString(lo, hi); + }, + uDec(lo, hi) { + return uInt64ToString(lo, hi); + }, + }; +} +function assertInt64String(value) { + if (!/^-?[0-9]+$/.test(value)) { + throw new Error("invalid int64: " + value); + } +} +function assertUInt64String(value) { + if (!/^[0-9]+$/.test(value)) { + throw new Error("invalid uint64: " + value); + } +} diff --git a/node_modules/@bufbuild/protobuf/dist/esm/reflect/error.d.ts b/node_modules/@bufbuild/protobuf/dist/esm/reflect/error.d.ts new file mode 100644 index 0000000..c6bf1db --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/reflect/error.d.ts @@ -0,0 +1,9 @@ +import type { DescField, DescOneof } from "../descriptors.js"; +declare const errorNames: string[]; +export declare class FieldError extends Error { + readonly name: (typeof errorNames)[number]; + constructor(fieldOrOneof: DescField | DescOneof, message: string, name?: (typeof errorNames)[number]); + readonly field: () => DescField | DescOneof; +} +export declare function isFieldError(arg: unknown): arg is FieldError; +export {}; diff --git a/node_modules/@bufbuild/protobuf/dist/esm/reflect/error.js b/node_modules/@bufbuild/protobuf/dist/esm/reflect/error.js new file mode 100644 index 0000000..d80524d --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/reflect/error.js @@ -0,0 +1,31 @@ +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +const errorNames = [ + "FieldValueInvalidError", + "FieldListRangeError", + "ForeignFieldError", +]; +export class FieldError extends Error { + constructor(fieldOrOneof, message, name = "FieldValueInvalidError") { + super(message); + this.name = name; + this.field = () => fieldOrOneof; + } +} +export function isFieldError(arg) { + return (arg instanceof Error && + errorNames.includes(arg.name) && + "field" in arg && + typeof arg.field == "function"); +} diff --git a/node_modules/@bufbuild/protobuf/dist/esm/reflect/guard.d.ts b/node_modules/@bufbuild/protobuf/dist/esm/reflect/guard.d.ts new file mode 100644 index 0000000..c53aeb2 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/reflect/guard.d.ts @@ -0,0 +1,20 @@ +import type { Message } from "../types.js"; +import type { ScalarValue } from "./scalar.js"; +import type { ReflectList, ReflectMap, ReflectMessage } from "./reflect-types.js"; +import type { DescField, DescMessage } from "../descriptors.js"; +export declare function isObject(arg: unknown): arg is Record; +export declare function isOneofADT(arg: unknown): arg is OneofADT; +export type OneofADT = { + case: undefined; + value?: undefined; +} | { + case: string; + value: Message | ScalarValue; +}; +export declare function isReflectList(arg: unknown, field?: DescField & { + fieldKind: "list"; +}): arg is ReflectList; +export declare function isReflectMap(arg: unknown, field?: DescField & { + fieldKind: "map"; +}): arg is ReflectMap; +export declare function isReflectMessage(arg: unknown, messageDesc?: DescMessage): arg is ReflectMessage; diff --git a/node_modules/@bufbuild/protobuf/dist/esm/reflect/guard.js b/node_modules/@bufbuild/protobuf/dist/esm/reflect/guard.js new file mode 100644 index 0000000..f8a7440 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/reflect/guard.js @@ -0,0 +1,71 @@ +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +import { unsafeLocal } from "./unsafe.js"; +export function isObject(arg) { + return arg !== null && typeof arg == "object" && !Array.isArray(arg); +} +export function isOneofADT(arg) { + return (arg !== null && + typeof arg == "object" && + "case" in arg && + ((typeof arg.case == "string" && "value" in arg && arg.value != null) || + (arg.case === undefined && + (!("value" in arg) || arg.value === undefined)))); +} +export function isReflectList(arg, field) { + var _a, _b, _c, _d; + if (isObject(arg) && + unsafeLocal in arg && + "add" in arg && + "field" in arg && + typeof arg.field == "function") { + if (field !== undefined) { + const a = field; + const b = arg.field(); + return (a.listKind == b.listKind && + a.scalar === b.scalar && + ((_a = a.message) === null || _a === void 0 ? void 0 : _a.typeName) === ((_b = b.message) === null || _b === void 0 ? void 0 : _b.typeName) && + ((_c = a.enum) === null || _c === void 0 ? void 0 : _c.typeName) === ((_d = b.enum) === null || _d === void 0 ? void 0 : _d.typeName)); + } + return true; + } + return false; +} +export function isReflectMap(arg, field) { + var _a, _b, _c, _d; + if (isObject(arg) && + unsafeLocal in arg && + "has" in arg && + "field" in arg && + typeof arg.field == "function") { + if (field !== undefined) { + const a = field, b = arg.field(); + return (a.mapKey === b.mapKey && + a.mapKind == b.mapKind && + a.scalar === b.scalar && + ((_a = a.message) === null || _a === void 0 ? void 0 : _a.typeName) === ((_b = b.message) === null || _b === void 0 ? void 0 : _b.typeName) && + ((_c = a.enum) === null || _c === void 0 ? void 0 : _c.typeName) === ((_d = b.enum) === null || _d === void 0 ? void 0 : _d.typeName)); + } + return true; + } + return false; +} +export function isReflectMessage(arg, messageDesc) { + return (isObject(arg) && + unsafeLocal in arg && + "desc" in arg && + isObject(arg.desc) && + arg.desc.kind === "message" && + (messageDesc === undefined || arg.desc.typeName == messageDesc.typeName)); +} diff --git a/node_modules/@bufbuild/protobuf/dist/esm/reflect/index.d.ts b/node_modules/@bufbuild/protobuf/dist/esm/reflect/index.d.ts new file mode 100644 index 0000000..97a7130 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/reflect/index.d.ts @@ -0,0 +1,8 @@ +export * from "./error.js"; +export * from "./names.js"; +export * from "./nested-types.js"; +export * from "./reflect.js"; +export * from "./reflect-types.js"; +export * from "./scalar.js"; +export * from "./path.js"; +export { isReflectList, isReflectMap, isReflectMessage } from "./guard.js"; diff --git a/node_modules/@bufbuild/protobuf/dist/esm/reflect/index.js b/node_modules/@bufbuild/protobuf/dist/esm/reflect/index.js new file mode 100644 index 0000000..d6a305f --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/reflect/index.js @@ -0,0 +1,21 @@ +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +export * from "./error.js"; +export * from "./names.js"; +export * from "./nested-types.js"; +export * from "./reflect.js"; +export * from "./reflect-types.js"; +export * from "./scalar.js"; +export * from "./path.js"; +export { isReflectList, isReflectMap, isReflectMessage } from "./guard.js"; diff --git a/node_modules/@bufbuild/protobuf/dist/esm/reflect/names.d.ts b/node_modules/@bufbuild/protobuf/dist/esm/reflect/names.d.ts new file mode 100644 index 0000000..79810d3 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/reflect/names.d.ts @@ -0,0 +1,30 @@ +import type { AnyDesc } from "../descriptors.js"; +/** + * Return a fully-qualified name for a Protobuf descriptor. + * For a file descriptor, return the original file path. + * + * See https://protobuf.com/docs/language-spec#fully-qualified-names + */ +export declare function qualifiedName(desc: AnyDesc): string; +/** + * Converts snake_case to protoCamelCase according to the convention + * used by protoc to convert a field name to a JSON name. + * + * See https://protobuf.com/docs/language-spec#default-json-names + * + * The function protoSnakeCase provides the reverse. + */ +export declare function protoCamelCase(snakeCase: string): string; +/** + * Converts protoCamelCase to snake_case. + * + * This function is the reverse of function protoCamelCase. Note that some names + * are not reversible - for example, "foo__bar" -> "fooBar" -> "foo_bar". + */ +export declare function protoSnakeCase(lowerCamelCase: string): string; +/** + * Escapes names that are reserved for ECMAScript built-in object properties. + * + * Also see safeIdentifier() from @bufbuild/protoplugin. + */ +export declare function safeObjectProperty(name: string): string; diff --git a/node_modules/@bufbuild/protobuf/dist/esm/reflect/names.js b/node_modules/@bufbuild/protobuf/dist/esm/reflect/names.js new file mode 100644 index 0000000..303218c --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/reflect/names.js @@ -0,0 +1,109 @@ +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +/** + * Return a fully-qualified name for a Protobuf descriptor. + * For a file descriptor, return the original file path. + * + * See https://protobuf.com/docs/language-spec#fully-qualified-names + */ +export function qualifiedName(desc) { + switch (desc.kind) { + case "field": + case "oneof": + case "rpc": + return desc.parent.typeName + "." + desc.name; + case "enum_value": { + const p = desc.parent.parent + ? desc.parent.parent.typeName + : desc.parent.file.proto.package; + return p + (p.length > 0 ? "." : "") + desc.name; + } + case "service": + case "message": + case "enum": + case "extension": + return desc.typeName; + case "file": + return desc.proto.name; + } +} +/** + * Converts snake_case to protoCamelCase according to the convention + * used by protoc to convert a field name to a JSON name. + * + * See https://protobuf.com/docs/language-spec#default-json-names + * + * The function protoSnakeCase provides the reverse. + */ +export function protoCamelCase(snakeCase) { + let capNext = false; + const b = []; + for (let i = 0; i < snakeCase.length; i++) { + let c = snakeCase.charAt(i); + switch (c) { + case "_": + capNext = true; + break; + case "0": + case "1": + case "2": + case "3": + case "4": + case "5": + case "6": + case "7": + case "8": + case "9": + b.push(c); + capNext = false; + break; + default: + if (capNext) { + capNext = false; + c = c.toUpperCase(); + } + b.push(c); + break; + } + } + return b.join(""); +} +/** + * Converts protoCamelCase to snake_case. + * + * This function is the reverse of function protoCamelCase. Note that some names + * are not reversible - for example, "foo__bar" -> "fooBar" -> "foo_bar". + */ +export function protoSnakeCase(lowerCamelCase) { + return lowerCamelCase.replace(/[A-Z]/g, (letter) => "_" + letter.toLowerCase()); +} +/** + * Names that cannot be used for object properties because they are reserved + * by built-in JavaScript properties. + */ +const reservedObjectProperties = new Set([ + // names reserved by JavaScript + "constructor", + "toString", + "toJSON", + "valueOf", +]); +/** + * Escapes names that are reserved for ECMAScript built-in object properties. + * + * Also see safeIdentifier() from @bufbuild/protoplugin. + */ +export function safeObjectProperty(name) { + return reservedObjectProperties.has(name) ? name + "$" : name; +} diff --git a/node_modules/@bufbuild/protobuf/dist/esm/reflect/nested-types.d.ts b/node_modules/@bufbuild/protobuf/dist/esm/reflect/nested-types.d.ts new file mode 100644 index 0000000..3817501 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/reflect/nested-types.d.ts @@ -0,0 +1,35 @@ +import type { AnyDesc, DescEnum, DescExtension, DescFile, DescMessage, DescService } from "../descriptors.js"; +/** + * Iterate over all types - enumerations, extensions, services, messages - + * and enumerations, extensions and messages nested in messages. + */ +export declare function nestedTypes(desc: DescFile | DescMessage): Iterable; +/** + * Iterate over types referenced by fields of the given message. + * + * For example: + * + * ```proto + * syntax="proto3"; + * + * message Example { + * Msg singular = 1; + * repeated Level list = 2; + * } + * + * message Msg {} + * + * enum Level { + * LEVEL_UNSPECIFIED = 0; + * } + * ``` + * + * The message Example references the message Msg, and the enum Level. + */ +export declare function usedTypes(descMessage: DescMessage): Iterable; +/** + * Returns the ancestors of a given Protobuf element, up to the file. + */ +export declare function parentTypes(desc: AnyDesc): Parent[]; +type Parent = DescFile | DescEnum | DescMessage | DescService; +export {}; diff --git a/node_modules/@bufbuild/protobuf/dist/esm/reflect/nested-types.js b/node_modules/@bufbuild/protobuf/dist/esm/reflect/nested-types.js new file mode 100644 index 0000000..59da0fd --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/reflect/nested-types.js @@ -0,0 +1,105 @@ +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +/** + * Iterate over all types - enumerations, extensions, services, messages - + * and enumerations, extensions and messages nested in messages. + */ +export function* nestedTypes(desc) { + switch (desc.kind) { + case "file": + for (const message of desc.messages) { + yield message; + yield* nestedTypes(message); + } + yield* desc.enums; + yield* desc.services; + yield* desc.extensions; + break; + case "message": + for (const message of desc.nestedMessages) { + yield message; + yield* nestedTypes(message); + } + yield* desc.nestedEnums; + yield* desc.nestedExtensions; + break; + } +} +/** + * Iterate over types referenced by fields of the given message. + * + * For example: + * + * ```proto + * syntax="proto3"; + * + * message Example { + * Msg singular = 1; + * repeated Level list = 2; + * } + * + * message Msg {} + * + * enum Level { + * LEVEL_UNSPECIFIED = 0; + * } + * ``` + * + * The message Example references the message Msg, and the enum Level. + */ +export function usedTypes(descMessage) { + return usedTypesInternal(descMessage, new Set()); +} +function* usedTypesInternal(descMessage, seen) { + var _a, _b; + for (const field of descMessage.fields) { + const ref = (_b = (_a = field.enum) !== null && _a !== void 0 ? _a : field.message) !== null && _b !== void 0 ? _b : undefined; + if (!ref || seen.has(ref.typeName)) { + continue; + } + seen.add(ref.typeName); + yield ref; + if (ref.kind == "message") { + yield* usedTypesInternal(ref, seen); + } + } +} +/** + * Returns the ancestors of a given Protobuf element, up to the file. + */ +export function parentTypes(desc) { + const parents = []; + while (desc.kind !== "file") { + const p = parent(desc); + desc = p; + parents.push(p); + } + return parents; +} +function parent(desc) { + var _a; + switch (desc.kind) { + case "enum_value": + case "field": + case "oneof": + case "rpc": + return desc.parent; + case "service": + return desc.file; + case "extension": + case "enum": + case "message": + return (_a = desc.parent) !== null && _a !== void 0 ? _a : desc.file; + } +} diff --git a/node_modules/@bufbuild/protobuf/dist/esm/reflect/path.d.ts b/node_modules/@bufbuild/protobuf/dist/esm/reflect/path.d.ts new file mode 100644 index 0000000..9aa5db2 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/reflect/path.d.ts @@ -0,0 +1,107 @@ +import { type DescExtension, type DescField, type DescMessage, type DescOneof } from "../descriptors.js"; +import type { Registry } from "../registry.js"; +/** + * A path to a (nested) member of a Protobuf message, such as a field, oneof, + * extension, list element, or map entry. + * + * Note that we may add additional types to this union in the future to support + * more use cases. + */ +export type Path = (DescField | DescExtension | DescOneof | { + kind: "list_sub"; + index: number; +} | { + kind: "map_sub"; + key: string | number | bigint | boolean; +})[]; +/** + * Builds a Path. + */ +export type PathBuilder = { + /** + * The root message of the path. + */ + readonly schema: DescMessage; + /** + * Add field access. + * + * Throws an InvalidPathError if the field cannot be added to the path. + */ + field(field: DescField): PathBuilder; + /** + * Access a oneof. + * + * Throws an InvalidPathError if the oneof cannot be added to the path. + * + */ + oneof(oneof: DescOneof): PathBuilder; + /** + * Access an extension. + * + * Throws an InvalidPathError if the extension cannot be added to the path. + */ + extension(extension: DescExtension): PathBuilder; + /** + * Access a list field by index. + * + * Throws an InvalidPathError if the list access cannot be added to the path. + */ + list(index: number): PathBuilder; + /** + * Access a map field by key. + * + * Throws an InvalidPathError if the map access cannot be added to the path. + */ + map(key: string | number | bigint | boolean): PathBuilder; + /** + * Append a path. + * + * Throws an InvalidPathError if the path cannot be added. + */ + add(path: Path | PathBuilder): PathBuilder; + /** + * Return the path. + */ + toPath(): Path; + /** + * Create a copy of this builder. + */ + clone(): PathBuilder; + /** + * Get the current container - a list, map, or message. + */ + getLeft(): DescMessage | (DescField & { + fieldKind: "list"; + }) | (DescField & { + fieldKind: "map"; + }) | undefined; +}; +/** + * Create a PathBuilder. + */ +export declare function buildPath(schema: DescMessage): PathBuilder; +/** + * Parse a Path from a string. + * + * Throws an InvalidPathError if the path is invalid. + * + * Note that a Registry must be provided via the options argument to parse + * paths that refer to an extension. + */ +export declare function parsePath(schema: DescMessage, path: string, options?: { + registry?: Registry | undefined; +}): Path; +/** + * Stringify a path. + */ +export declare function pathToString(path: Path): string; +/** + * InvalidPathError is thrown for invalid Paths, for example during parsing from + * a string, or when a new Path is built. + */ +export declare class InvalidPathError extends Error { + name: string; + readonly schema: DescMessage; + readonly path: Path | string; + constructor(schema: DescMessage, message: string, path: string | Path); +} diff --git a/node_modules/@bufbuild/protobuf/dist/esm/reflect/path.js b/node_modules/@bufbuild/protobuf/dist/esm/reflect/path.js new file mode 100644 index 0000000..bf16f11 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/reflect/path.js @@ -0,0 +1,369 @@ +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +import { ScalarType, } from "../descriptors.js"; +/** + * Create a PathBuilder. + */ +export function buildPath(schema) { + return new PathBuilderImpl(schema, schema, []); +} +/** + * Parse a Path from a string. + * + * Throws an InvalidPathError if the path is invalid. + * + * Note that a Registry must be provided via the options argument to parse + * paths that refer to an extension. + */ +export function parsePath(schema, path, options) { + var _a, _b; + const builder = new PathBuilderImpl(schema, schema, []); + const err = (message, i) => new InvalidPathError(schema, message + " at column " + (i + 1), path); + for (let i = 0; i < path.length;) { + const token = nextToken(i, path); + const left = builder.getLeft(); + let right = undefined; + if ("field" in token) { + right = + (left === null || left === void 0 ? void 0 : left.kind) != "message" + ? undefined + : ((_a = left.fields.find((field) => field.name === token.field)) !== null && _a !== void 0 ? _a : left.oneofs.find((oneof) => oneof.name === token.field)); + if (!right) { + throw err(`Unknown field "${token.field}"`, i); + } + } + else if ("ext" in token) { + right = (_b = options === null || options === void 0 ? void 0 : options.registry) === null || _b === void 0 ? void 0 : _b.getExtension(token.ext); + if (!right) { + throw err(`Unknown extension "${token.ext}"`, i); + } + } + else if ("val" in token) { + // list or map + right = + (left === null || left === void 0 ? void 0 : left.kind) == "field" && + left.fieldKind == "list" && + typeof token.val == "bigint" + ? { kind: "list_sub", index: Number(token.val) } + : { kind: "map_sub", key: token.val }; + } + else if ("err" in token) { + throw err(token.err, token.i); + } + if (right) { + try { + builder.add([right]); + } + catch (e) { + throw err(e instanceof InvalidPathError ? e.message : String(e), i); + } + } + i = token.i; + } + return builder.toPath(); +} +/** + * Stringify a path. + */ +export function pathToString(path) { + const str = []; + for (const ele of path) { + switch (ele.kind) { + case "field": + case "oneof": + if (str.length > 0) { + str.push("."); + } + str.push(ele.name); + break; + case "extension": + str.push("[", ele.typeName, "]"); + break; + case "list_sub": + str.push("[", ele.index, "]"); + break; + case "map_sub": + if (typeof ele.key == "string") { + str.push('["', ele.key + .split("\\") + .join("\\\\") + .split('"') + .join('\\"') + .split("\r") + .join("\\r") + .split("\n") + .join("\\n"), '"]'); + } + else { + str.push("[", ele.key, "]"); + } + break; + } + } + return str.join(""); +} +/** + * InvalidPathError is thrown for invalid Paths, for example during parsing from + * a string, or when a new Path is built. + */ +export class InvalidPathError extends Error { + constructor(schema, message, path) { + super(message); + this.name = "InvalidPathError"; + this.schema = schema; + this.path = path; + // see https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-2.html#example + Object.setPrototypeOf(this, new.target.prototype); + } +} +class PathBuilderImpl { + constructor(schema, left, path) { + this.schema = schema; + this.left = left; + this.path = path; + } + getLeft() { + return this.left; + } + field(field) { + return this.push(field); + } + oneof(oneof) { + return this.push(oneof); + } + extension(extension) { + return this.push(extension); + } + list(index) { + return this.push({ kind: "list_sub", index }); + } + map(key) { + return this.push({ kind: "map_sub", key }); + } + add(pathOrBuilder) { + const path = Array.isArray(pathOrBuilder) + ? pathOrBuilder + : pathOrBuilder.toPath(); + const l = this.path.length; + try { + for (const ele of path) { + this.push(ele); + } + } + catch (e) { + // undo pushes + this.path.splice(l); + throw e; + } + return this; + } + toPath() { + return this.path.concat(); + } + clone() { + return new PathBuilderImpl(this.schema, this.left, this.path.concat()); + } + push(ele) { + switch (ele.kind) { + case "field": + if (!this.left || + this.left.kind != "message" || + this.left.typeName != ele.parent.typeName) { + throw this.err("field access"); + } + this.path.push(ele); + this.left = + ele.fieldKind == "message" + ? ele.message + : ele.fieldKind == "list" || ele.fieldKind == "map" + ? ele + : undefined; + return this; + case "oneof": + if (!this.left || + this.left.kind != "message" || + this.left.typeName != ele.parent.typeName) { + throw this.err("oneof access"); + } + this.path.push(ele); + this.left = undefined; + return this; + case "extension": + if (!this.left || + this.left.kind != "message" || + this.left.typeName != ele.extendee.typeName) { + throw this.err("extension access"); + } + this.path.push(ele); + this.left = ele.fieldKind == "message" ? ele.message : undefined; + return this; + case "list_sub": + if (!this.left || + this.left.kind != "field" || + this.left.fieldKind != "list") { + throw this.err("list access"); + } + if (ele.index < 0 || !Number.isInteger(ele.index)) { + throw this.err("list index"); + } + this.path.push(ele); + this.left = + this.left.listKind == "message" ? this.left.message : undefined; + return this; + case "map_sub": + if (!this.left || + this.left.kind != "field" || + this.left.fieldKind != "map") { + throw this.err("map access"); + } + if (!checkKeyType(ele.key, this.left.mapKey)) { + throw this.err("map key"); + } + this.path.push(ele); + this.left = + this.left.mapKind == "message" ? this.left.message : undefined; + return this; + } + } + err(what) { + return new InvalidPathError(this.schema, "Invalid " + what, this.path); + } +} +function checkKeyType(key, type) { + switch (type) { + case ScalarType.STRING: + return typeof key == "string"; + case ScalarType.INT32: + case ScalarType.UINT32: + case ScalarType.SINT32: + case ScalarType.SFIXED32: + case ScalarType.FIXED32: + return typeof key == "number"; + case ScalarType.UINT64: + case ScalarType.INT64: + case ScalarType.FIXED64: + case ScalarType.SFIXED64: + case ScalarType.SINT64: + return typeof key == "bigint"; + case ScalarType.BOOL: + return typeof key == "boolean"; + } +} +function nextToken(i, path) { + const re_extension = /^[A-Za-z_][A-Za-z_0-9]*(?:\.[A-Za-z_][A-Za-z_0-9]*)*$/; + const re_field = /^[A-Za-z_][A-Za-z_0-9]*$/; + if (path[i] == "[") { + i++; + while (path[i] == " ") { + // skip leading whitespace + i++; + } + if (i >= path.length) { + return { err: "Premature end", i: path.length - 1 }; + } + let token; + if (path[i] == `"`) { + // string literal + i++; + let val = ""; + for (;;) { + if (path[i] == `"`) { + // end of string literal + i++; + break; + } + if (path[i] == "\\") { + switch (path[i + 1]) { + case `"`: + case "\\": + val += path[i + 1]; + break; + case "r": + val += "\r"; + break; + case "n": + val += "\n"; + break; + default: + return { err: "Invalid escape sequence", i }; + } + i++; + } + else { + val += path[i]; + } + if (i >= path.length) { + return { err: "Premature end of string", i: path.length - 1 }; + } + i++; + } + token = { val }; + } + else if (path[i].match(/\d/)) { + // integer literal + const start = i; + while (i < path.length && /\d/.test(path[i])) { + i++; + } + token = { val: BigInt(path.substring(start, i)) }; + } + else if (path[i] == "]") { + return { err: "Premature ]", i }; + } + else { + // extension identifier or bool literal + const start = i; + while (i < path.length && path[i] != " " && path[i] != "]") { + i++; + } + const name = path.substring(start, i); + if (name === "true") { + token = { val: true }; + } + else if (name === "false") { + token = { val: false }; + } + else if (re_extension.test(name)) { + token = { ext: name }; + } + else { + return { err: "Invalid ident", i: start }; + } + } + while (path[i] == " ") { + // skip trailing whitespace + i++; + } + if (path[i] != "]") { + return { err: "Missing ]", i }; + } + i++; + return Object.assign(Object.assign({}, token), { i }); + } + // field identifier + if (i > 0) { + if (path[i] != ".") { + return { err: `Expected "."`, i }; + } + i++; + } + const start = i; + while (i < path.length && path[i] != "." && path[i] != "[") { + i++; + } + const field = path.substring(start, i); + return re_field.test(field) + ? { field, i } + : { err: "Invalid ident", i: start }; +} diff --git a/node_modules/@bufbuild/protobuf/dist/esm/reflect/reflect-check.d.ts b/node_modules/@bufbuild/protobuf/dist/esm/reflect/reflect-check.d.ts new file mode 100644 index 0000000..63f27b9 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/reflect/reflect-check.d.ts @@ -0,0 +1,19 @@ +import { type DescField } from "../descriptors.js"; +import { FieldError } from "./error.js"; +/** + * Check whether the given field value is valid for the reflect API. + */ +export declare function checkField(field: DescField, value: unknown): FieldError | undefined; +/** + * Check whether the given list item is valid for the reflect API. + */ +export declare function checkListItem(field: DescField & { + fieldKind: "list"; +}, index: number, value: unknown): FieldError | undefined; +/** + * Check whether the given map key and value are valid for the reflect API. + */ +export declare function checkMapEntry(field: DescField & { + fieldKind: "map"; +}, key: unknown, value: unknown): FieldError | undefined; +export declare function formatVal(val: unknown): string; diff --git a/node_modules/@bufbuild/protobuf/dist/esm/reflect/reflect-check.js b/node_modules/@bufbuild/protobuf/dist/esm/reflect/reflect-check.js new file mode 100644 index 0000000..cc38f94 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/reflect/reflect-check.js @@ -0,0 +1,260 @@ +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +import { ScalarType, } from "../descriptors.js"; +import { isMessage } from "../is-message.js"; +import { FieldError } from "./error.js"; +import { isReflectList, isReflectMap, isReflectMessage } from "./guard.js"; +import { FLOAT32_MAX, FLOAT32_MIN, INT32_MAX, INT32_MIN, UINT32_MAX, } from "../wire/binary-encoding.js"; +import { getTextEncoding } from "../wire/text-encoding.js"; +import { protoInt64 } from "../proto-int64.js"; +/** + * Check whether the given field value is valid for the reflect API. + */ +export function checkField(field, value) { + const check = field.fieldKind == "list" + ? isReflectList(value, field) + : field.fieldKind == "map" + ? isReflectMap(value, field) + : checkSingular(field, value); + if (check === true) { + return undefined; + } + let reason; + switch (field.fieldKind) { + case "list": + reason = `expected ${formatReflectList(field)}, got ${formatVal(value)}`; + break; + case "map": + reason = `expected ${formatReflectMap(field)}, got ${formatVal(value)}`; + break; + default: { + reason = reasonSingular(field, value, check); + } + } + return new FieldError(field, reason); +} +/** + * Check whether the given list item is valid for the reflect API. + */ +export function checkListItem(field, index, value) { + const check = checkSingular(field, value); + if (check !== true) { + return new FieldError(field, `list item #${index + 1}: ${reasonSingular(field, value, check)}`); + } + return undefined; +} +/** + * Check whether the given map key and value are valid for the reflect API. + */ +export function checkMapEntry(field, key, value) { + const checkKey = checkScalarValue(key, field.mapKey); + if (checkKey !== true) { + return new FieldError(field, `invalid map key: ${reasonSingular({ scalar: field.mapKey }, key, checkKey)}`); + } + const checkVal = checkSingular(field, value); + if (checkVal !== true) { + return new FieldError(field, `map entry ${formatVal(key)}: ${reasonSingular(field, value, checkVal)}`); + } + return undefined; +} +function checkSingular(field, value) { + if (field.scalar !== undefined) { + return checkScalarValue(value, field.scalar); + } + if (field.enum !== undefined) { + if (field.enum.open) { + return Number.isInteger(value); + } + return field.enum.values.some((v) => v.number === value); + } + return isReflectMessage(value, field.message); +} +function checkScalarValue(value, scalar) { + switch (scalar) { + case ScalarType.DOUBLE: + return typeof value == "number"; + case ScalarType.FLOAT: + if (typeof value != "number") { + return false; + } + if (Number.isNaN(value) || !Number.isFinite(value)) { + return true; + } + if (value > FLOAT32_MAX || value < FLOAT32_MIN) { + return `${value.toFixed()} out of range`; + } + return true; + case ScalarType.INT32: + case ScalarType.SFIXED32: + case ScalarType.SINT32: + // signed + if (typeof value !== "number" || !Number.isInteger(value)) { + return false; + } + if (value > INT32_MAX || value < INT32_MIN) { + return `${value.toFixed()} out of range`; + } + return true; + case ScalarType.FIXED32: + case ScalarType.UINT32: + // unsigned + if (typeof value !== "number" || !Number.isInteger(value)) { + return false; + } + if (value > UINT32_MAX || value < 0) { + return `${value.toFixed()} out of range`; + } + return true; + case ScalarType.BOOL: + return typeof value == "boolean"; + case ScalarType.STRING: + if (typeof value != "string") { + return false; + } + return getTextEncoding().checkUtf8(value) || "invalid UTF8"; + case ScalarType.BYTES: + return value instanceof Uint8Array; + case ScalarType.INT64: + case ScalarType.SFIXED64: + case ScalarType.SINT64: + // signed + if (typeof value == "bigint" || + typeof value == "number" || + (typeof value == "string" && value.length > 0)) { + try { + protoInt64.parse(value); + return true; + } + catch (_) { + return `${value} out of range`; + } + } + return false; + case ScalarType.FIXED64: + case ScalarType.UINT64: + // unsigned + if (typeof value == "bigint" || + typeof value == "number" || + (typeof value == "string" && value.length > 0)) { + try { + protoInt64.uParse(value); + return true; + } + catch (_) { + return `${value} out of range`; + } + } + return false; + } +} +function reasonSingular(field, val, details) { + details = + typeof details == "string" ? `: ${details}` : `, got ${formatVal(val)}`; + if (field.scalar !== undefined) { + return `expected ${scalarTypeDescription(field.scalar)}` + details; + } + if (field.enum !== undefined) { + return `expected ${field.enum.toString()}` + details; + } + return `expected ${formatReflectMessage(field.message)}` + details; +} +export function formatVal(val) { + switch (typeof val) { + case "object": + if (val === null) { + return "null"; + } + if (val instanceof Uint8Array) { + return `Uint8Array(${val.length})`; + } + if (Array.isArray(val)) { + return `Array(${val.length})`; + } + if (isReflectList(val)) { + return formatReflectList(val.field()); + } + if (isReflectMap(val)) { + return formatReflectMap(val.field()); + } + if (isReflectMessage(val)) { + return formatReflectMessage(val.desc); + } + if (isMessage(val)) { + return `message ${val.$typeName}`; + } + return "object"; + case "string": + return val.length > 30 ? "string" : `"${val.split('"').join('\\"')}"`; + case "boolean": + return String(val); + case "number": + return String(val); + case "bigint": + return String(val) + "n"; + default: + // "symbol" | "undefined" | "object" | "function" + return typeof val; + } +} +function formatReflectMessage(desc) { + return `ReflectMessage (${desc.typeName})`; +} +function formatReflectList(field) { + switch (field.listKind) { + case "message": + return `ReflectList (${field.message.toString()})`; + case "enum": + return `ReflectList (${field.enum.toString()})`; + case "scalar": + return `ReflectList (${ScalarType[field.scalar]})`; + } +} +function formatReflectMap(field) { + switch (field.mapKind) { + case "message": + return `ReflectMap (${ScalarType[field.mapKey]}, ${field.message.toString()})`; + case "enum": + return `ReflectMap (${ScalarType[field.mapKey]}, ${field.enum.toString()})`; + case "scalar": + return `ReflectMap (${ScalarType[field.mapKey]}, ${ScalarType[field.scalar]})`; + } +} +function scalarTypeDescription(scalar) { + switch (scalar) { + case ScalarType.STRING: + return "string"; + case ScalarType.BOOL: + return "boolean"; + case ScalarType.INT64: + case ScalarType.SINT64: + case ScalarType.SFIXED64: + return "bigint (int64)"; + case ScalarType.UINT64: + case ScalarType.FIXED64: + return "bigint (uint64)"; + case ScalarType.BYTES: + return "Uint8Array"; + case ScalarType.DOUBLE: + return "number (float64)"; + case ScalarType.FLOAT: + return "number (float32)"; + case ScalarType.FIXED32: + case ScalarType.UINT32: + return "number (uint32)"; + case ScalarType.INT32: + case ScalarType.SFIXED32: + case ScalarType.SINT32: + return "number (int32)"; + } +} diff --git a/node_modules/@bufbuild/protobuf/dist/esm/reflect/reflect-types.d.ts b/node_modules/@bufbuild/protobuf/dist/esm/reflect/reflect-types.d.ts new file mode 100644 index 0000000..f300dd9 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/reflect/reflect-types.d.ts @@ -0,0 +1,217 @@ +import type { DescField, DescMessage, DescOneof } from "../descriptors.js"; +import { unsafeLocal } from "./unsafe.js"; +import type { Message, UnknownField } from "../types.js"; +import type { ScalarValue } from "./scalar.js"; +/** + * ReflectMessage provides dynamic access and manipulation of a message. + */ +export interface ReflectMessage { + /** + * The underlying message instance. + */ + readonly message: Message; + /** + * The descriptor for the message. + */ + readonly desc: DescMessage; + /** + * The fields of the message. This is a shortcut to message.fields. + */ + readonly fields: readonly DescField[]; + /** + * The fields of the message, sorted by field number ascending. + */ + readonly sortedFields: readonly DescField[]; + /** + * Oneof groups of the message. This is a shortcut to message.oneofs. + */ + readonly oneofs: readonly DescOneof[]; + /** + * Fields and oneof groups for this message. This is a shortcut to message.members. + */ + readonly members: readonly (DescField | DescOneof)[]; + /** + * Find a field by number. + */ + findNumber(number: number): DescField | undefined; + /** + * Returns true if the field is set. + * + * - Scalar and enum fields with implicit presence (proto3): + * Set if not a zero value. + * + * - Scalar and enum fields with explicit presence (proto2, oneof): + * Set if a value was set when creating or parsing the message, or when a + * value was assigned to the field's property. + * + * - Message fields: + * Set if the property is not undefined. + * + * - List and map fields: + * Set if not empty. + */ + isSet(field: DescField): boolean; + /** + * Resets the field, so that isSet() will return false. + */ + clear(field: DescField): void; + /** + * Return the selected field of a oneof group. + */ + oneofCase(oneof: DescOneof): DescField | undefined; + /** + * Returns the field value. Values are converted or wrapped to make it easier + * to manipulate messages. + * + * - Scalar fields: + * Returns the value, but converts 64-bit integer fields with the option + * `jstype=JS_STRING` to a bigint value. + * If the field is not set, the default value is returned. If no default + * value is set, the zero value is returned. + * + * - Enum fields: + * Returns the numeric value. If the field is not set, the default value is + * returned. If no default value is set, the zero value is returned. + * + * - Message fields: + * Returns a ReflectMessage. If the field is not set, a new message is + * returned, but not set on the field. + * + * - List fields: + * Returns a ReflectList object. + * + * - Map fields: + * Returns a ReflectMap object. + * + * Note that get() never returns `undefined`. To determine whether a field is + * set, use isSet(). + */ + get(field: Field): ReflectMessageGet; + /** + * Set a field value. + * + * Expects values in the same form that get() returns: + * + * - Scalar fields: + * 64-bit integer fields with the option `jstype=JS_STRING` as a bigint value. + * + * - Message fields: + * ReflectMessage. + * + * - List fields: + * ReflectList. + * + * - Map fields: + * ReflectMap. + * + * Throws an error if the value is invalid for the field. `undefined` is not + * a valid value. To reset a field, use clear(). + */ + set(field: Field, value: unknown): void; + /** + * Returns the unknown fields of the message. + */ + getUnknown(): UnknownField[] | undefined; + /** + * Sets the unknown fields of the message, overwriting any previous values. + */ + setUnknown(value: UnknownField[]): void; + [unsafeLocal]: Message; +} +/** + * ReflectList provides dynamic access and manipulation of a list field on a + * message. + * + * ReflectList is iterable - you can loop through all items with a for...of loop. + * + * Values are converted or wrapped to make it easier to manipulate them: + * - Scalar 64-bit integer fields with the option `jstype=JS_STRING` are + * converted to bigint. + * - Messages are wrapped in a ReflectMessage. + */ +export interface ReflectList extends Iterable { + /** + * Returns the list field. + */ + field(): DescField & { + fieldKind: "list"; + }; + /** + * The size of the list. + */ + readonly size: number; + /** + * Retrieves the item at the specified index, or undefined if the index + * is out of range. + */ + get(index: number): V | undefined; + /** + * Adds an item at the end of the list. + * Throws an error if an item is invalid for this list. + */ + add(item: V): void; + /** + * Replaces the item at the specified index with the specified item. + * Throws an error if the index is out of range (index < 0 || index >= size). + * Throws an error if the item is invalid for this list. + */ + set(index: number, item: V): void; + /** + * Removes all items from the list. + */ + clear(): void; + [Symbol.iterator](): IterableIterator; + entries(): IterableIterator<[number, V]>; + keys(): IterableIterator; + values(): IterableIterator; + [unsafeLocal]: unknown[]; +} +/** + * ReflectMap provides dynamic access and manipulation of a map field on a + * message. + * + * ReflectMap is iterable - you can loop through all entries with a for...of loop. + * + * Keys and values are converted or wrapped to make it easier to manipulate them: + * - A map field is a record object on a message, where keys are always strings. + * ReflectMap converts keys to their closest possible type in TypeScript. + * - Messages are wrapped in a ReflectMessage. + */ +export interface ReflectMap extends ReadonlyMap { + /** + * Returns the map field. + */ + field(): DescField & { + fieldKind: "map"; + }; + /** + * Removes the entry for the specified key. + * Returns false if the key is unknown. + */ + delete(key: K): boolean; + /** + * Sets or replaces the item at the specified key with the specified value. + * Throws an error if the key or value is invalid for this map. + */ + set(key: K, value: V): this; + /** + * Removes all entries from the map. + */ + clear(): void; + [unsafeLocal]: Record; +} +/** + * The return type of ReflectMessage.get() + */ +export type ReflectMessageGet = (Field extends { + fieldKind: "map"; +} ? ReflectMap : Field extends { + fieldKind: "list"; +} ? ReflectList : Field extends { + fieldKind: "enum"; +} ? number : Field extends { + fieldKind: "message"; +} ? ReflectMessage : Field extends { + fieldKind: "scalar"; + scalar: infer T; +} ? ScalarValue : never); diff --git a/node_modules/@bufbuild/protobuf/dist/esm/reflect/reflect-types.js b/node_modules/@bufbuild/protobuf/dist/esm/reflect/reflect-types.js new file mode 100644 index 0000000..928cb92 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/reflect/reflect-types.js @@ -0,0 +1,14 @@ +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +import { unsafeLocal } from "./unsafe.js"; diff --git a/node_modules/@bufbuild/protobuf/dist/esm/reflect/reflect.d.ts b/node_modules/@bufbuild/protobuf/dist/esm/reflect/reflect.d.ts new file mode 100644 index 0000000..3bfb1ad --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/reflect/reflect.d.ts @@ -0,0 +1,43 @@ +import { type DescField, type DescMessage } from "../descriptors.js"; +import type { MessageShape } from "../types.js"; +import type { ReflectList, ReflectMap, ReflectMessage } from "./reflect-types.js"; +/** + * Create a ReflectMessage. + */ +export declare function reflect(messageDesc: Desc, message?: MessageShape, +/** + * By default, field values are validated when setting them. For example, + * a value for an uint32 field must be a ECMAScript Number >= 0. + * + * When field values are trusted, performance can be improved by disabling + * checks. + */ +check?: boolean): ReflectMessage; +/** + * Create a ReflectList. + */ +export declare function reflectList(field: DescField & { + fieldKind: "list"; +}, unsafeInput?: unknown[], +/** + * By default, field values are validated when setting them. For example, + * a value for an uint32 field must be a ECMAScript Number >= 0. + * + * When field values are trusted, performance can be improved by disabling + * checks. + */ +check?: boolean): ReflectList; +/** + * Create a ReflectMap. + */ +export declare function reflectMap(field: DescField & { + fieldKind: "map"; +}, unsafeInput?: Record, +/** + * By default, field values are validated when setting them. For example, + * a value for an uint32 field must be a ECMAScript Number >= 0. + * + * When field values are trusted, performance can be improved by disabling + * checks. + */ +check?: boolean): ReflectMap; diff --git a/node_modules/@bufbuild/protobuf/dist/esm/reflect/reflect.js b/node_modules/@bufbuild/protobuf/dist/esm/reflect/reflect.js new file mode 100644 index 0000000..3fae324 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/reflect/reflect.js @@ -0,0 +1,540 @@ +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +import { ScalarType, } from "../descriptors.js"; +import { checkField, checkListItem, checkMapEntry } from "./reflect-check.js"; +import { FieldError } from "./error.js"; +import { unsafeClear, unsafeGet, unsafeIsSet, unsafeLocal, unsafeOneofCase, unsafeSet, } from "./unsafe.js"; +import { create } from "../create.js"; +import { isWrapper, isWrapperDesc } from "../wkt/wrappers.js"; +import { scalarZeroValue } from "./scalar.js"; +import { protoInt64 } from "../proto-int64.js"; +import { isObject, isReflectList, isReflectMap, isReflectMessage, } from "./guard.js"; +/** + * Create a ReflectMessage. + */ +export function reflect(messageDesc, message, +/** + * By default, field values are validated when setting them. For example, + * a value for an uint32 field must be a ECMAScript Number >= 0. + * + * When field values are trusted, performance can be improved by disabling + * checks. + */ +check = true) { + return new ReflectMessageImpl(messageDesc, message, check); +} +const messageSortedFields = new WeakMap(); +class ReflectMessageImpl { + get sortedFields() { + const cached = messageSortedFields.get(this.desc); + if (cached) { + return cached; + } + const sortedFields = this.desc.fields + .concat() + .sort((a, b) => a.number - b.number); + messageSortedFields.set(this.desc, sortedFields); + return sortedFields; + } + constructor(messageDesc, message, check = true) { + this.lists = new Map(); + this.maps = new Map(); + this.check = check; + this.desc = messageDesc; + this.message = this[unsafeLocal] = message !== null && message !== void 0 ? message : create(messageDesc); + this.fields = messageDesc.fields; + this.oneofs = messageDesc.oneofs; + this.members = messageDesc.members; + } + findNumber(number) { + if (!this._fieldsByNumber) { + this._fieldsByNumber = new Map(this.desc.fields.map((f) => [f.number, f])); + } + return this._fieldsByNumber.get(number); + } + oneofCase(oneof) { + assertOwn(this.message, oneof); + return unsafeOneofCase(this.message, oneof); + } + isSet(field) { + assertOwn(this.message, field); + return unsafeIsSet(this.message, field); + } + clear(field) { + assertOwn(this.message, field); + unsafeClear(this.message, field); + } + get(field) { + assertOwn(this.message, field); + const value = unsafeGet(this.message, field); + switch (field.fieldKind) { + case "list": + // eslint-disable-next-line no-case-declarations + let list = this.lists.get(field); + if (!list || list[unsafeLocal] !== value) { + this.lists.set(field, + // biome-ignore lint/suspicious/noAssignInExpressions: no + (list = new ReflectListImpl(field, value, this.check))); + } + return list; + case "map": + let map = this.maps.get(field); + if (!map || map[unsafeLocal] !== value) { + this.maps.set(field, + // biome-ignore lint/suspicious/noAssignInExpressions: no + (map = new ReflectMapImpl(field, value, this.check))); + } + return map; + case "message": + return messageToReflect(field, value, this.check); + case "scalar": + return (value === undefined + ? scalarZeroValue(field.scalar, false) + : longToReflect(field, value)); + case "enum": + return (value !== null && value !== void 0 ? value : field.enum.values[0].number); + } + } + set(field, value) { + assertOwn(this.message, field); + if (this.check) { + const err = checkField(field, value); + if (err) { + throw err; + } + } + let local; + if (field.fieldKind == "message") { + local = messageToLocal(field, value); + } + else if (isReflectMap(value) || isReflectList(value)) { + local = value[unsafeLocal]; + } + else { + local = longToLocal(field, value); + } + unsafeSet(this.message, field, local); + } + getUnknown() { + return this.message.$unknown; + } + setUnknown(value) { + this.message.$unknown = value; + } +} +function assertOwn(owner, member) { + if (member.parent.typeName !== owner.$typeName) { + throw new FieldError(member, `cannot use ${member.toString()} with message ${owner.$typeName}`, "ForeignFieldError"); + } +} +/** + * Create a ReflectList. + */ +export function reflectList(field, unsafeInput, +/** + * By default, field values are validated when setting them. For example, + * a value for an uint32 field must be a ECMAScript Number >= 0. + * + * When field values are trusted, performance can be improved by disabling + * checks. + */ +check = true) { + return new ReflectListImpl(field, unsafeInput !== null && unsafeInput !== void 0 ? unsafeInput : [], check); +} +class ReflectListImpl { + field() { + return this._field; + } + get size() { + return this._arr.length; + } + constructor(field, unsafeInput, check) { + this._field = field; + this._arr = this[unsafeLocal] = unsafeInput; + this.check = check; + } + get(index) { + const item = this._arr[index]; + return item === undefined + ? undefined + : listItemToReflect(this._field, item, this.check); + } + set(index, item) { + if (index < 0 || index >= this._arr.length) { + throw new FieldError(this._field, `list item #${index + 1}: out of range`); + } + if (this.check) { + const err = checkListItem(this._field, index, item); + if (err) { + throw err; + } + } + this._arr[index] = listItemToLocal(this._field, item); + } + add(item) { + if (this.check) { + const err = checkListItem(this._field, this._arr.length, item); + if (err) { + throw err; + } + } + this._arr.push(listItemToLocal(this._field, item)); + return undefined; + } + clear() { + this._arr.splice(0, this._arr.length); + } + [Symbol.iterator]() { + return this.values(); + } + keys() { + return this._arr.keys(); + } + *values() { + for (const item of this._arr) { + yield listItemToReflect(this._field, item, this.check); + } + } + *entries() { + for (let i = 0; i < this._arr.length; i++) { + yield [i, listItemToReflect(this._field, this._arr[i], this.check)]; + } + } +} +/** + * Create a ReflectMap. + */ +export function reflectMap(field, unsafeInput, +/** + * By default, field values are validated when setting them. For example, + * a value for an uint32 field must be a ECMAScript Number >= 0. + * + * When field values are trusted, performance can be improved by disabling + * checks. + */ +check = true) { + return new ReflectMapImpl(field, unsafeInput, check); +} +class ReflectMapImpl { + constructor(field, unsafeInput, check = true) { + this.obj = this[unsafeLocal] = unsafeInput !== null && unsafeInput !== void 0 ? unsafeInput : {}; + this.check = check; + this._field = field; + } + field() { + return this._field; + } + set(key, value) { + if (this.check) { + const err = checkMapEntry(this._field, key, value); + if (err) { + throw err; + } + } + this.obj[mapKeyToLocal(key)] = mapValueToLocal(this._field, value); + return this; + } + delete(key) { + const k = mapKeyToLocal(key); + const has = Object.prototype.hasOwnProperty.call(this.obj, k); + if (has) { + delete this.obj[k]; + } + return has; + } + clear() { + for (const key of Object.keys(this.obj)) { + delete this.obj[key]; + } + } + get(key) { + let val = this.obj[mapKeyToLocal(key)]; + if (val !== undefined) { + val = mapValueToReflect(this._field, val, this.check); + } + return val; + } + has(key) { + return Object.prototype.hasOwnProperty.call(this.obj, mapKeyToLocal(key)); + } + *keys() { + for (const objKey of Object.keys(this.obj)) { + yield mapKeyToReflect(objKey, this._field.mapKey); + } + } + *entries() { + for (const objEntry of Object.entries(this.obj)) { + yield [ + mapKeyToReflect(objEntry[0], this._field.mapKey), + mapValueToReflect(this._field, objEntry[1], this.check), + ]; + } + } + [Symbol.iterator]() { + return this.entries(); + } + get size() { + return Object.keys(this.obj).length; + } + *values() { + for (const val of Object.values(this.obj)) { + yield mapValueToReflect(this._field, val, this.check); + } + } + forEach(callbackfn, thisArg) { + for (const mapEntry of this.entries()) { + callbackfn.call(thisArg, mapEntry[1], mapEntry[0], this); + } + } +} +function messageToLocal(field, value) { + if (!isReflectMessage(value)) { + return value; + } + if (isWrapper(value.message) && + !field.oneof && + field.fieldKind == "message") { + // Types from google/protobuf/wrappers.proto are unwrapped when used in + // a singular field that is not part of a oneof group. + return value.message.value; + } + if (value.desc.typeName == "google.protobuf.Struct" && + field.parent.typeName != "google.protobuf.Value") { + // google.protobuf.Struct is represented with JsonObject when used in a + // field, except when used in google.protobuf.Value. + return wktStructToLocal(value.message); + } + return value.message; +} +function messageToReflect(field, value, check) { + if (value !== undefined) { + if (isWrapperDesc(field.message) && + !field.oneof && + field.fieldKind == "message") { + // Types from google/protobuf/wrappers.proto are unwrapped when used in + // a singular field that is not part of a oneof group. + value = { + $typeName: field.message.typeName, + value: longToReflect(field.message.fields[0], value), + }; + } + else if (field.message.typeName == "google.protobuf.Struct" && + field.parent.typeName != "google.protobuf.Value" && + isObject(value)) { + // google.protobuf.Struct is represented with JsonObject when used in a + // field, except when used in google.protobuf.Value. + value = wktStructToReflect(value); + } + } + return new ReflectMessageImpl(field.message, value, check); +} +function listItemToLocal(field, value) { + if (field.listKind == "message") { + return messageToLocal(field, value); + } + return longToLocal(field, value); +} +function listItemToReflect(field, value, check) { + if (field.listKind == "message") { + return messageToReflect(field, value, check); + } + return longToReflect(field, value); +} +function mapValueToLocal(field, value) { + if (field.mapKind == "message") { + return messageToLocal(field, value); + } + return longToLocal(field, value); +} +function mapValueToReflect(field, value, check) { + if (field.mapKind == "message") { + return messageToReflect(field, value, check); + } + return value; +} +function mapKeyToLocal(key) { + return typeof key == "string" || typeof key == "number" ? key : String(key); +} +/** + * Converts a map key (any scalar value except float, double, or bytes) from its + * representation in a message (string or number, the only possible object key + * types) to the closest possible type in ECMAScript. + */ +function mapKeyToReflect(key, type) { + switch (type) { + case ScalarType.STRING: + return key; + case ScalarType.INT32: + case ScalarType.FIXED32: + case ScalarType.UINT32: + case ScalarType.SFIXED32: + case ScalarType.SINT32: { + const n = Number.parseInt(key); + if (Number.isFinite(n)) { + return n; + } + break; + } + case ScalarType.BOOL: + switch (key) { + case "true": + return true; + case "false": + return false; + } + break; + case ScalarType.UINT64: + case ScalarType.FIXED64: + try { + return protoInt64.uParse(key); + } + catch (_a) { + // + } + break; + default: + // INT64, SFIXED64, SINT64 + try { + return protoInt64.parse(key); + } + catch (_b) { + // + } + break; + } + return key; +} +function longToReflect(field, value) { + switch (field.scalar) { + case ScalarType.INT64: + case ScalarType.SFIXED64: + case ScalarType.SINT64: + if ("longAsString" in field && + field.longAsString && + typeof value == "string") { + value = protoInt64.parse(value); + } + break; + case ScalarType.FIXED64: + case ScalarType.UINT64: + if ("longAsString" in field && + field.longAsString && + typeof value == "string") { + value = protoInt64.uParse(value); + } + break; + } + return value; +} +function longToLocal(field, value) { + switch (field.scalar) { + case ScalarType.INT64: + case ScalarType.SFIXED64: + case ScalarType.SINT64: + if ("longAsString" in field && field.longAsString) { + value = String(value); + } + else if (typeof value == "string" || typeof value == "number") { + value = protoInt64.parse(value); + } + break; + case ScalarType.FIXED64: + case ScalarType.UINT64: + if ("longAsString" in field && field.longAsString) { + value = String(value); + } + else if (typeof value == "string" || typeof value == "number") { + value = protoInt64.uParse(value); + } + break; + } + return value; +} +function wktStructToReflect(json) { + const struct = { + $typeName: "google.protobuf.Struct", + fields: {}, + }; + if (isObject(json)) { + for (const [k, v] of Object.entries(json)) { + struct.fields[k] = wktValueToReflect(v); + } + } + return struct; +} +function wktStructToLocal(val) { + const json = {}; + for (const [k, v] of Object.entries(val.fields)) { + json[k] = wktValueToLocal(v); + } + return json; +} +function wktValueToLocal(val) { + switch (val.kind.case) { + case "structValue": + return wktStructToLocal(val.kind.value); + case "listValue": + return val.kind.value.values.map(wktValueToLocal); + case "nullValue": + case undefined: + return null; + default: + return val.kind.value; + } +} +function wktValueToReflect(json) { + const value = { + $typeName: "google.protobuf.Value", + kind: { case: undefined }, + }; + switch (typeof json) { + case "number": + value.kind = { case: "numberValue", value: json }; + break; + case "string": + value.kind = { case: "stringValue", value: json }; + break; + case "boolean": + value.kind = { case: "boolValue", value: json }; + break; + case "object": + if (json === null) { + const nullValue = 0; + value.kind = { case: "nullValue", value: nullValue }; + } + else if (Array.isArray(json)) { + const listValue = { + $typeName: "google.protobuf.ListValue", + values: [], + }; + if (Array.isArray(json)) { + for (const e of json) { + listValue.values.push(wktValueToReflect(e)); + } + } + value.kind = { + case: "listValue", + value: listValue, + }; + } + else { + value.kind = { + case: "structValue", + value: wktStructToReflect(json), + }; + } + break; + } + return value; +} diff --git a/node_modules/@bufbuild/protobuf/dist/esm/reflect/scalar.d.ts b/node_modules/@bufbuild/protobuf/dist/esm/reflect/scalar.d.ts new file mode 100644 index 0000000..16ac91f --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/reflect/scalar.d.ts @@ -0,0 +1,21 @@ +import { ScalarType } from "../descriptors.js"; +/** + * ScalarValue maps from a scalar field type to a TypeScript value type. + */ +export type ScalarValue = T extends ScalarType.STRING ? string : T extends ScalarType.INT32 ? number : T extends ScalarType.UINT32 ? number : T extends ScalarType.SINT32 ? number : T extends ScalarType.FIXED32 ? number : T extends ScalarType.SFIXED32 ? number : T extends ScalarType.FLOAT ? number : T extends ScalarType.DOUBLE ? number : T extends ScalarType.INT64 ? LongAsString extends true ? string : bigint : T extends ScalarType.SINT64 ? LongAsString extends true ? string : bigint : T extends ScalarType.SFIXED64 ? LongAsString extends true ? string : bigint : T extends ScalarType.UINT64 ? LongAsString extends true ? string : bigint : T extends ScalarType.FIXED64 ? LongAsString extends true ? string : bigint : T extends ScalarType.BOOL ? boolean : T extends ScalarType.BYTES ? Uint8Array : never; +/** + * Returns true if both scalar values are equal. + */ +export declare function scalarEquals(type: ScalarType, a: ScalarValue | undefined, b: ScalarValue | undefined): boolean; +/** + * Returns the zero value for the given scalar type. + */ +export declare function scalarZeroValue(type: T, longAsString: LongAsString): ScalarValue; +/** + * Returns true for a zero-value. For example, an integer has the zero-value `0`, + * a boolean is `false`, a string is `""`, and bytes is an empty Uint8Array. + * + * In proto3, zero-values are not written to the wire, unless the field is + * optional or repeated. + */ +export declare function isScalarZeroValue(type: ScalarType, value: unknown): boolean; diff --git a/node_modules/@bufbuild/protobuf/dist/esm/reflect/scalar.js b/node_modules/@bufbuild/protobuf/dist/esm/reflect/scalar.js new file mode 100644 index 0000000..12679d5 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/reflect/scalar.js @@ -0,0 +1,97 @@ +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +import { protoInt64 } from "../proto-int64.js"; +import { ScalarType } from "../descriptors.js"; +/** + * Returns true if both scalar values are equal. + */ +export function scalarEquals(type, a, b) { + if (a === b) { + // This correctly matches equal values except BYTES and (possibly) 64-bit integers. + return true; + } + // Special case BYTES - we need to compare each byte individually + if (type == ScalarType.BYTES) { + if (!(a instanceof Uint8Array) || !(b instanceof Uint8Array)) { + return false; + } + if (a.length !== b.length) { + return false; + } + for (let i = 0; i < a.length; i++) { + if (a[i] !== b[i]) { + return false; + } + } + return true; + } + // Special case 64-bit integers - we support number, string and bigint representation. + switch (type) { + case ScalarType.UINT64: + case ScalarType.FIXED64: + case ScalarType.INT64: + case ScalarType.SFIXED64: + case ScalarType.SINT64: + // Loose comparison will match between 0n, 0 and "0". + return a == b; + } + // Anything that hasn't been caught by strict comparison or special cased + // BYTES and 64-bit integers is not equal. + return false; +} +/** + * Returns the zero value for the given scalar type. + */ +export function scalarZeroValue(type, longAsString) { + switch (type) { + case ScalarType.STRING: + return ""; + case ScalarType.BOOL: + return false; + case ScalarType.DOUBLE: + case ScalarType.FLOAT: + return 0.0; + case ScalarType.INT64: + case ScalarType.UINT64: + case ScalarType.SFIXED64: + case ScalarType.FIXED64: + case ScalarType.SINT64: + return (longAsString ? "0" : protoInt64.zero); + case ScalarType.BYTES: + return new Uint8Array(0); + default: + // Handles INT32, UINT32, SINT32, FIXED32, SFIXED32. + // We do not use individual cases to save a few bytes code size. + return 0; + } +} +/** + * Returns true for a zero-value. For example, an integer has the zero-value `0`, + * a boolean is `false`, a string is `""`, and bytes is an empty Uint8Array. + * + * In proto3, zero-values are not written to the wire, unless the field is + * optional or repeated. + */ +export function isScalarZeroValue(type, value) { + switch (type) { + case ScalarType.BOOL: + return value === false; + case ScalarType.STRING: + return value === ""; + case ScalarType.BYTES: + return value instanceof Uint8Array && !value.byteLength; + default: + return value == 0; // Loose comparison matches 0n, 0 and "0" + } +} diff --git a/node_modules/@bufbuild/protobuf/dist/esm/reflect/unsafe.d.ts b/node_modules/@bufbuild/protobuf/dist/esm/reflect/unsafe.d.ts new file mode 100644 index 0000000..02fd72f --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/reflect/unsafe.d.ts @@ -0,0 +1,39 @@ +import type { DescField, DescOneof } from "../descriptors.js"; +export declare const unsafeLocal: unique symbol; +/** + * Return the selected field of a oneof group. + * + * @private + */ +export declare function unsafeOneofCase(target: Record, oneof: DescOneof): DescField | undefined; +/** + * Returns true if the field is set. + * + * @private + */ +export declare function unsafeIsSet(target: Record, field: DescField): boolean; +/** + * Returns true if the field is set, but only for singular fields with explicit + * presence (proto2). + * + * @private + */ +export declare function unsafeIsSetExplicit(target: object, localName: string): boolean; +/** + * Return a field value, respecting oneof groups. + * + * @private + */ +export declare function unsafeGet(target: Record, field: DescField): unknown; +/** + * Set a field value, respecting oneof groups. + * + * @private + */ +export declare function unsafeSet(target: Record, field: DescField, value: unknown): void; +/** + * Resets the field, so that unsafeIsSet() will return false. + * + * @private + */ +export declare function unsafeClear(target: Record, field: DescField): void; diff --git a/node_modules/@bufbuild/protobuf/dist/esm/reflect/unsafe.js b/node_modules/@bufbuild/protobuf/dist/esm/reflect/unsafe.js new file mode 100644 index 0000000..6cee72c --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/reflect/unsafe.js @@ -0,0 +1,140 @@ +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +import { isScalarZeroValue, scalarZeroValue } from "./scalar.js"; +// bootstrap-inject google.protobuf.FeatureSet.FieldPresence.IMPLICIT: const $name: FeatureSet_FieldPresence.$localName = $number; +const IMPLICIT = 2; +export const unsafeLocal = Symbol.for("reflect unsafe local"); +/** + * Return the selected field of a oneof group. + * + * @private + */ +export function unsafeOneofCase( +// biome-ignore lint/suspicious/noExplicitAny: `any` is the best choice for dynamic access +target, oneof) { + const c = target[oneof.localName].case; + if (c === undefined) { + return c; + } + return oneof.fields.find((f) => f.localName === c); +} +/** + * Returns true if the field is set. + * + * @private + */ +export function unsafeIsSet( +// biome-ignore lint/suspicious/noExplicitAny: `any` is the best choice for dynamic access +target, field) { + const name = field.localName; + if (field.oneof) { + return target[field.oneof.localName].case === name; + } + if (field.presence != IMPLICIT) { + // Fields with explicit presence have properties on the prototype chain + // for default / zero values (except for proto3). + return (target[name] !== undefined && + Object.prototype.hasOwnProperty.call(target, name)); + } + switch (field.fieldKind) { + case "list": + return target[name].length > 0; + case "map": + return Object.keys(target[name]).length > 0; + case "scalar": + return !isScalarZeroValue(field.scalar, target[name]); + case "enum": + return target[name] !== field.enum.values[0].number; + } + throw new Error("message field with implicit presence"); +} +/** + * Returns true if the field is set, but only for singular fields with explicit + * presence (proto2). + * + * @private + */ +export function unsafeIsSetExplicit(target, localName) { + return (Object.prototype.hasOwnProperty.call(target, localName) && + target[localName] !== undefined); +} +/** + * Return a field value, respecting oneof groups. + * + * @private + */ +export function unsafeGet(target, field) { + if (field.oneof) { + const oneof = target[field.oneof.localName]; + if (oneof.case === field.localName) { + return oneof.value; + } + return undefined; + } + return target[field.localName]; +} +/** + * Set a field value, respecting oneof groups. + * + * @private + */ +export function unsafeSet(target, field, value) { + if (field.oneof) { + target[field.oneof.localName] = { + case: field.localName, + value: value, + }; + } + else { + target[field.localName] = value; + } +} +/** + * Resets the field, so that unsafeIsSet() will return false. + * + * @private + */ +export function unsafeClear( +// biome-ignore lint/suspicious/noExplicitAny: `any` is the best choice for dynamic access +target, field) { + const name = field.localName; + if (field.oneof) { + const oneofLocalName = field.oneof.localName; + if (target[oneofLocalName].case === name) { + target[oneofLocalName] = { case: undefined }; + } + } + else if (field.presence != IMPLICIT) { + // Fields with explicit presence have properties on the prototype chain + // for default / zero values (except for proto3). By deleting their own + // property, the field is reset. + delete target[name]; + } + else { + switch (field.fieldKind) { + case "map": + target[name] = {}; + break; + case "list": + target[name] = []; + break; + case "enum": + target[name] = field.enum.values[0].number; + break; + case "scalar": + target[name] = scalarZeroValue(field.scalar, field.longAsString); + break; + } + } +} diff --git a/node_modules/@bufbuild/protobuf/dist/esm/registry.d.ts b/node_modules/@bufbuild/protobuf/dist/esm/registry.d.ts new file mode 100644 index 0000000..4a1b5ae --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/registry.d.ts @@ -0,0 +1,98 @@ +import type { FileDescriptorProto, FileDescriptorSet } from "./wkt/gen/google/protobuf/descriptor_pb.js"; +import { type DescEnum, type DescExtension, type DescFile, type DescMessage, type DescService, type SupportedEdition } from "./descriptors.js"; +/** + * A set of descriptors for messages, enumerations, extensions, + * and services. + */ +export interface Registry { + readonly kind: "registry"; + /** + * All types (message, enumeration, extension, or service) contained + * in this registry. + */ + [Symbol.iterator](): IterableIterator; + /** + * Look up a type (message, enumeration, extension, or service) by + * its fully qualified name. + */ + get(typeName: string): DescMessage | DescEnum | DescExtension | DescService | undefined; + /** + * Look up a message descriptor by its fully qualified name. + */ + getMessage(typeName: string): DescMessage | undefined; + /** + * Look up an enumeration descriptor by its fully qualified name. + */ + getEnum(typeName: string): DescEnum | undefined; + /** + * Look up an extension descriptor by its fully qualified name. + */ + getExtension(typeName: string): DescExtension | undefined; + /** + * Look up an extension by the extendee - the message it extends - and + * the extension number. + */ + getExtensionFor(extendee: DescMessage, no: number): DescExtension | undefined; + /** + * Look up a service descriptor by its fully qualified name. + */ + getService(typeName: string): DescService | undefined; +} +/** + * A registry that allows adding and removing descriptors. + */ +export interface MutableRegistry extends Registry { + /** + * Adds the given descriptor - but not types nested within - to the registry. + */ + add(desc: DescMessage | DescEnum | DescExtension | DescService): void; + /** + * Remove the given descriptor - but not types nested within - from the registry. + */ + remove(desc: DescMessage | DescEnum | DescExtension | DescService): void; +} +/** + * A registry that includes files. + */ +export interface FileRegistry extends Registry { + /** + * All files in this registry. + */ + readonly files: Iterable; + /** + * Look up a file descriptor by file name. + */ + getFile(fileName: string): DescFile | undefined; +} +/** + * Create a registry from the given inputs. + * + * An input can be: + * - Any message, enum, service, or extension descriptor, which adds just the + * descriptor for this type. + * - A file descriptor, which adds all typed defined in this file. + * - A registry, which adds all types from the registry. + * + * For duplicate descriptors (same type name), the one given last wins. + */ +export declare function createRegistry(...input: (Registry | DescFile | DescMessage | DescEnum | DescExtension | DescService)[]): Registry; +/** + * Create a registry that allows adding and removing descriptors. + */ +export declare function createMutableRegistry(...input: (Registry | DescFile | DescMessage | DescEnum | DescExtension | DescService)[]): MutableRegistry; +/** + * Create a registry (including file descriptors) from a google.protobuf.FileDescriptorSet + * message. + */ +export declare function createFileRegistry(fileDescriptorSet: FileDescriptorSet): FileRegistry; +/** + * Create a registry (including file descriptors) from a google.protobuf.FileDescriptorProto + * message. For every import, the given resolver function is called. + */ +export declare function createFileRegistry(fileDescriptorProto: FileDescriptorProto, resolve: (protoFileName: string) => FileDescriptorProto | DescFile | undefined): FileRegistry; +/** + * Create a registry (including file descriptors) from one or more registries, + * merging them. + */ +export declare function createFileRegistry(...registries: FileRegistry[]): FileRegistry; +export declare const minimumEdition: SupportedEdition, maximumEdition: SupportedEdition; diff --git a/node_modules/@bufbuild/protobuf/dist/esm/registry.js b/node_modules/@bufbuild/protobuf/dist/esm/registry.js new file mode 100644 index 0000000..8d27460 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/registry.js @@ -0,0 +1,939 @@ +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +import { ScalarType, } from "./descriptors.js"; +import { parseTextFormatEnumValue, parseTextFormatScalarValue, } from "./wire/text-format.js"; +import { nestedTypes } from "./reflect/nested-types.js"; +import { unsafeIsSetExplicit } from "./reflect/unsafe.js"; +import { protoCamelCase, safeObjectProperty } from "./reflect/names.js"; +/** + * Create a registry from the given inputs. + * + * An input can be: + * - Any message, enum, service, or extension descriptor, which adds just the + * descriptor for this type. + * - A file descriptor, which adds all typed defined in this file. + * - A registry, which adds all types from the registry. + * + * For duplicate descriptors (same type name), the one given last wins. + */ +export function createRegistry(...input) { + return initBaseRegistry(input); +} +/** + * Create a registry that allows adding and removing descriptors. + */ +export function createMutableRegistry(...input) { + const reg = initBaseRegistry(input); + return Object.assign(Object.assign({}, reg), { remove(desc) { + var _a; + if (desc.kind == "extension") { + (_a = reg.extendees.get(desc.extendee.typeName)) === null || _a === void 0 ? void 0 : _a.delete(desc.number); + } + reg.types.delete(desc.typeName); + } }); +} +export function createFileRegistry(...args) { + const registry = createBaseRegistry(); + if (!args.length) { + return registry; + } + if ("$typeName" in args[0] && + args[0].$typeName == "google.protobuf.FileDescriptorSet") { + for (const file of args[0].file) { + addFile(file, registry); + } + return registry; + } + if ("$typeName" in args[0]) { + const input = args[0]; + const resolve = args[1]; + const seen = new Set(); + function recurseDeps(file) { + const deps = []; + for (const protoFileName of file.dependency) { + if (registry.getFile(protoFileName) != undefined) { + continue; + } + if (seen.has(protoFileName)) { + continue; + } + const dep = resolve(protoFileName); + if (!dep) { + throw new Error(`Unable to resolve ${protoFileName}, imported by ${file.name}`); + } + if ("kind" in dep) { + registry.addFile(dep, false, true); + } + else { + seen.add(dep.name); + deps.push(dep); + } + } + return deps.concat(...deps.map(recurseDeps)); + } + for (const file of [input, ...recurseDeps(input)].reverse()) { + addFile(file, registry); + } + } + else { + for (const fileReg of args) { + for (const file of fileReg.files) { + registry.addFile(file); + } + } + } + return registry; +} +/** + * @private + */ +function createBaseRegistry() { + const types = new Map(); + const extendees = new Map(); + const files = new Map(); + return { + kind: "registry", + types, + extendees, + [Symbol.iterator]() { + return types.values(); + }, + get files() { + return files.values(); + }, + addFile(file, skipTypes, withDeps) { + files.set(file.proto.name, file); + if (!skipTypes) { + for (const type of nestedTypes(file)) { + this.add(type); + } + } + if (withDeps) { + for (const f of file.dependencies) { + this.addFile(f, skipTypes, withDeps); + } + } + }, + add(desc) { + if (desc.kind == "extension") { + let numberToExt = extendees.get(desc.extendee.typeName); + if (!numberToExt) { + extendees.set(desc.extendee.typeName, + // biome-ignore lint/suspicious/noAssignInExpressions: no + (numberToExt = new Map())); + } + numberToExt.set(desc.number, desc); + } + types.set(desc.typeName, desc); + }, + get(typeName) { + return types.get(typeName); + }, + getFile(fileName) { + return files.get(fileName); + }, + getMessage(typeName) { + const t = types.get(typeName); + return (t === null || t === void 0 ? void 0 : t.kind) == "message" ? t : undefined; + }, + getEnum(typeName) { + const t = types.get(typeName); + return (t === null || t === void 0 ? void 0 : t.kind) == "enum" ? t : undefined; + }, + getExtension(typeName) { + const t = types.get(typeName); + return (t === null || t === void 0 ? void 0 : t.kind) == "extension" ? t : undefined; + }, + getExtensionFor(extendee, no) { + var _a; + return (_a = extendees.get(extendee.typeName)) === null || _a === void 0 ? void 0 : _a.get(no); + }, + getService(typeName) { + const t = types.get(typeName); + return (t === null || t === void 0 ? void 0 : t.kind) == "service" ? t : undefined; + }, + }; +} +/** + * @private + */ +function initBaseRegistry(inputs) { + const registry = createBaseRegistry(); + for (const input of inputs) { + switch (input.kind) { + case "registry": + for (const n of input) { + registry.add(n); + } + break; + case "file": + registry.addFile(input); + break; + default: + registry.add(input); + break; + } + } + return registry; +} +// bootstrap-inject google.protobuf.Edition.EDITION_PROTO2: const $name: Edition.$localName = $number; +const EDITION_PROTO2 = 998; +// bootstrap-inject google.protobuf.Edition.EDITION_PROTO3: const $name: Edition.$localName = $number; +const EDITION_PROTO3 = 999; +// bootstrap-inject google.protobuf.Edition.EDITION_UNSTABLE: const $name: Edition.$localName = $number; +const EDITION_UNSTABLE = 9999; +// bootstrap-inject google.protobuf.FieldDescriptorProto.Type.TYPE_STRING: const $name: FieldDescriptorProto_Type.$localName = $number; +const TYPE_STRING = 9; +// bootstrap-inject google.protobuf.FieldDescriptorProto.Type.TYPE_GROUP: const $name: FieldDescriptorProto_Type.$localName = $number; +const TYPE_GROUP = 10; +// bootstrap-inject google.protobuf.FieldDescriptorProto.Type.TYPE_MESSAGE: const $name: FieldDescriptorProto_Type.$localName = $number; +const TYPE_MESSAGE = 11; +// bootstrap-inject google.protobuf.FieldDescriptorProto.Type.TYPE_BYTES: const $name: FieldDescriptorProto_Type.$localName = $number; +const TYPE_BYTES = 12; +// bootstrap-inject google.protobuf.FieldDescriptorProto.Type.TYPE_ENUM: const $name: FieldDescriptorProto_Type.$localName = $number; +const TYPE_ENUM = 14; +// bootstrap-inject google.protobuf.FieldDescriptorProto.Label.LABEL_REPEATED: const $name: FieldDescriptorProto_Label.$localName = $number; +const LABEL_REPEATED = 3; +// bootstrap-inject google.protobuf.FieldDescriptorProto.Label.LABEL_REQUIRED: const $name: FieldDescriptorProto_Label.$localName = $number; +const LABEL_REQUIRED = 2; +// bootstrap-inject google.protobuf.FieldOptions.JSType.JS_STRING: const $name: FieldOptions_JSType.$localName = $number; +const JS_STRING = 1; +// bootstrap-inject google.protobuf.MethodOptions.IdempotencyLevel.IDEMPOTENCY_UNKNOWN: const $name: MethodOptions_IdempotencyLevel.$localName = $number; +const IDEMPOTENCY_UNKNOWN = 0; +// bootstrap-inject google.protobuf.FeatureSet.FieldPresence.EXPLICIT: const $name: FeatureSet_FieldPresence.$localName = $number; +const EXPLICIT = 1; +// bootstrap-inject google.protobuf.FeatureSet.FieldPresence.IMPLICIT: const $name: FeatureSet_FieldPresence.$localName = $number; +const IMPLICIT = 2; +// bootstrap-inject google.protobuf.FeatureSet.FieldPresence.LEGACY_REQUIRED: const $name: FeatureSet_FieldPresence.$localName = $number; +const LEGACY_REQUIRED = 3; +// bootstrap-inject google.protobuf.FeatureSet.RepeatedFieldEncoding.PACKED: const $name: FeatureSet_RepeatedFieldEncoding.$localName = $number; +const PACKED = 1; +// bootstrap-inject google.protobuf.FeatureSet.MessageEncoding.DELIMITED: const $name: FeatureSet_MessageEncoding.$localName = $number; +const DELIMITED = 2; +// bootstrap-inject google.protobuf.FeatureSet.EnumType.OPEN: const $name: FeatureSet_EnumType.$localName = $number; +const OPEN = 1; +// bootstrap-inject google.protobuf.FeatureSet.Utf8Validation.VERIFY: const $name: FeatureSet_Utf8Validation.$localName = $number; +const VERIFY = 2; +// biome-ignore format: want this to read well +// bootstrap-inject defaults: EDITION_PROTO2 to EDITION_2024: export const minimumEdition: SupportedEdition = $minimumEdition, maximumEdition: SupportedEdition = $maximumEdition; +// generated from protoc v34.0 +export const minimumEdition = 998, maximumEdition = 1001; +const featureDefaults = { + // EDITION_PROTO2 + 998: { + fieldPresence: 1, // EXPLICIT, + enumType: 2, // CLOSED, + repeatedFieldEncoding: 2, // EXPANDED, + utf8Validation: 3, // NONE, + messageEncoding: 1, // LENGTH_PREFIXED, + jsonFormat: 2, // LEGACY_BEST_EFFORT, + enforceNamingStyle: 2, // STYLE_LEGACY, + defaultSymbolVisibility: 1, // EXPORT_ALL, + }, + // EDITION_PROTO3 + 999: { + fieldPresence: 2, // IMPLICIT, + enumType: 1, // OPEN, + repeatedFieldEncoding: 1, // PACKED, + utf8Validation: 2, // VERIFY, + messageEncoding: 1, // LENGTH_PREFIXED, + jsonFormat: 1, // ALLOW, + enforceNamingStyle: 2, // STYLE_LEGACY, + defaultSymbolVisibility: 1, // EXPORT_ALL, + }, + // EDITION_2023 + 1000: { + fieldPresence: 1, // EXPLICIT, + enumType: 1, // OPEN, + repeatedFieldEncoding: 1, // PACKED, + utf8Validation: 2, // VERIFY, + messageEncoding: 1, // LENGTH_PREFIXED, + jsonFormat: 1, // ALLOW, + enforceNamingStyle: 2, // STYLE_LEGACY, + defaultSymbolVisibility: 1, // EXPORT_ALL, + }, + // EDITION_2024 + 1001: { + fieldPresence: 1, // EXPLICIT, + enumType: 1, // OPEN, + repeatedFieldEncoding: 1, // PACKED, + utf8Validation: 2, // VERIFY, + messageEncoding: 1, // LENGTH_PREFIXED, + jsonFormat: 1, // ALLOW, + enforceNamingStyle: 1, // STYLE2024, + defaultSymbolVisibility: 2, // EXPORT_TOP_LEVEL, + }, +}; +/** + * Create a descriptor for a file, add it to the registry. + */ +function addFile(proto, reg) { + var _a, _b; + const file = { + kind: "file", + proto, + deprecated: (_b = (_a = proto.options) === null || _a === void 0 ? void 0 : _a.deprecated) !== null && _b !== void 0 ? _b : false, + edition: getFileEdition(proto), + name: proto.name.replace(/\.proto$/, ""), + dependencies: findFileDependencies(proto, reg), + enums: [], + messages: [], + extensions: [], + services: [], + toString() { + // eslint-disable-next-line @typescript-eslint/restrict-template-expressions -- we asserted above + return `file ${proto.name}`; + }, + }; + const mapEntriesStore = new Map(); + const mapEntries = { + get(typeName) { + return mapEntriesStore.get(typeName); + }, + add(desc) { + var _a; + assert(((_a = desc.proto.options) === null || _a === void 0 ? void 0 : _a.mapEntry) === true); + mapEntriesStore.set(desc.typeName, desc); + }, + }; + for (const enumProto of proto.enumType) { + addEnum(enumProto, file, undefined, reg); + } + for (const messageProto of proto.messageType) { + addMessage(messageProto, file, undefined, reg, mapEntries); + } + for (const serviceProto of proto.service) { + addService(serviceProto, file, reg); + } + addExtensions(file, reg); + for (const mapEntry of mapEntriesStore.values()) { + // to create a map field, we need access to the map entry's fields + addFields(mapEntry, reg, mapEntries); + } + for (const message of file.messages) { + addFields(message, reg, mapEntries); + addExtensions(message, reg); + } + reg.addFile(file, true); +} +/** + * Create descriptors for extensions, and add them to the message / file, + * and to our cart. + * Recurses into nested types. + */ +function addExtensions(desc, reg) { + switch (desc.kind) { + case "file": + for (const proto of desc.proto.extension) { + const ext = newField(proto, desc, reg); + desc.extensions.push(ext); + reg.add(ext); + } + break; + case "message": + for (const proto of desc.proto.extension) { + const ext = newField(proto, desc, reg); + desc.nestedExtensions.push(ext); + reg.add(ext); + } + for (const message of desc.nestedMessages) { + addExtensions(message, reg); + } + break; + } +} +/** + * Create descriptors for fields and oneof groups, and add them to the message. + * Recurses into nested types. + */ +function addFields(message, reg, mapEntries) { + const allOneofs = message.proto.oneofDecl.map((proto) => newOneof(proto, message)); + const oneofsSeen = new Set(); + for (const proto of message.proto.field) { + const oneof = findOneof(proto, allOneofs); + const field = newField(proto, message, reg, oneof, mapEntries); + message.fields.push(field); + message.field[field.localName] = field; + if (oneof === undefined) { + message.members.push(field); + } + else { + oneof.fields.push(field); + if (!oneofsSeen.has(oneof)) { + oneofsSeen.add(oneof); + message.members.push(oneof); + } + } + } + for (const oneof of allOneofs.filter((o) => oneofsSeen.has(o))) { + message.oneofs.push(oneof); + } + for (const child of message.nestedMessages) { + addFields(child, reg, mapEntries); + } +} +/** + * Create a descriptor for an enumeration, and add it our cart and to the + * parent type, if any. + */ +function addEnum(proto, file, parent, reg) { + var _a, _b, _c, _d, _e; + const sharedPrefix = findEnumSharedPrefix(proto.name, proto.value); + const desc = { + kind: "enum", + proto, + deprecated: (_b = (_a = proto.options) === null || _a === void 0 ? void 0 : _a.deprecated) !== null && _b !== void 0 ? _b : false, + file, + parent, + open: true, + name: proto.name, + typeName: makeTypeName(proto, parent, file), + value: {}, + values: [], + sharedPrefix, + toString() { + return `enum ${this.typeName}`; + }, + }; + desc.open = isEnumOpen(desc); + reg.add(desc); + for (const p of proto.value) { + const name = p.name; + desc.values.push( + // biome-ignore lint/suspicious/noAssignInExpressions: no + (desc.value[p.number] = { + kind: "enum_value", + proto: p, + deprecated: (_d = (_c = p.options) === null || _c === void 0 ? void 0 : _c.deprecated) !== null && _d !== void 0 ? _d : false, + parent: desc, + name, + localName: safeObjectProperty(sharedPrefix == undefined + ? name + : name.substring(sharedPrefix.length)), + number: p.number, + toString() { + return `enum value ${desc.typeName}.${name}`; + }, + })); + } + ((_e = parent === null || parent === void 0 ? void 0 : parent.nestedEnums) !== null && _e !== void 0 ? _e : file.enums).push(desc); +} +/** + * Create a descriptor for a message, including nested types, and add it to our + * cart. Note that this does not create descriptors fields. + */ +function addMessage(proto, file, parent, reg, mapEntries) { + var _a, _b, _c, _d; + const desc = { + kind: "message", + proto, + deprecated: (_b = (_a = proto.options) === null || _a === void 0 ? void 0 : _a.deprecated) !== null && _b !== void 0 ? _b : false, + file, + parent, + name: proto.name, + typeName: makeTypeName(proto, parent, file), + fields: [], + field: {}, + oneofs: [], + members: [], + nestedEnums: [], + nestedMessages: [], + nestedExtensions: [], + toString() { + return `message ${this.typeName}`; + }, + }; + if (((_c = proto.options) === null || _c === void 0 ? void 0 : _c.mapEntry) === true) { + mapEntries.add(desc); + } + else { + ((_d = parent === null || parent === void 0 ? void 0 : parent.nestedMessages) !== null && _d !== void 0 ? _d : file.messages).push(desc); + reg.add(desc); + } + for (const enumProto of proto.enumType) { + addEnum(enumProto, file, desc, reg); + } + for (const messageProto of proto.nestedType) { + addMessage(messageProto, file, desc, reg, mapEntries); + } +} +/** + * Create a descriptor for a service, including methods, and add it to our + * cart. + */ +function addService(proto, file, reg) { + var _a, _b; + const desc = { + kind: "service", + proto, + deprecated: (_b = (_a = proto.options) === null || _a === void 0 ? void 0 : _a.deprecated) !== null && _b !== void 0 ? _b : false, + file, + name: proto.name, + typeName: makeTypeName(proto, undefined, file), + methods: [], + method: {}, + toString() { + return `service ${this.typeName}`; + }, + }; + file.services.push(desc); + reg.add(desc); + for (const methodProto of proto.method) { + const method = newMethod(methodProto, desc, reg); + desc.methods.push(method); + desc.method[method.localName] = method; + } +} +/** + * Create a descriptor for a method. + */ +function newMethod(proto, parent, reg) { + var _a, _b, _c, _d; + let methodKind; + if (proto.clientStreaming && proto.serverStreaming) { + methodKind = "bidi_streaming"; + } + else if (proto.clientStreaming) { + methodKind = "client_streaming"; + } + else if (proto.serverStreaming) { + methodKind = "server_streaming"; + } + else { + methodKind = "unary"; + } + const input = reg.getMessage(trimLeadingDot(proto.inputType)); + const output = reg.getMessage(trimLeadingDot(proto.outputType)); + assert(input, `invalid MethodDescriptorProto: input_type ${proto.inputType} not found`); + assert(output, `invalid MethodDescriptorProto: output_type ${proto.inputType} not found`); + const name = proto.name; + return { + kind: "rpc", + proto, + deprecated: (_b = (_a = proto.options) === null || _a === void 0 ? void 0 : _a.deprecated) !== null && _b !== void 0 ? _b : false, + parent, + name, + localName: safeObjectProperty(name.length + ? safeObjectProperty(name[0].toLowerCase() + name.substring(1)) + : name), + methodKind, + input, + output, + idempotency: (_d = (_c = proto.options) === null || _c === void 0 ? void 0 : _c.idempotencyLevel) !== null && _d !== void 0 ? _d : IDEMPOTENCY_UNKNOWN, + toString() { + return `rpc ${parent.typeName}.${name}`; + }, + }; +} +/** + * Create a descriptor for a oneof group. + */ +function newOneof(proto, parent) { + return { + kind: "oneof", + proto, + deprecated: false, + parent, + fields: [], + name: proto.name, + localName: safeObjectProperty(protoCamelCase(proto.name)), + toString() { + return `oneof ${parent.typeName}.${this.name}`; + }, + }; +} +function newField(proto, parentOrFile, reg, oneof, mapEntries) { + var _a, _b, _c; + const isExtension = mapEntries === undefined; + const field = { + kind: "field", + proto, + deprecated: (_b = (_a = proto.options) === null || _a === void 0 ? void 0 : _a.deprecated) !== null && _b !== void 0 ? _b : false, + name: proto.name, + number: proto.number, + scalar: undefined, + message: undefined, + enum: undefined, + presence: getFieldPresence(proto, oneof, isExtension, parentOrFile), + utf8Validation: isUtf8Validated(proto, parentOrFile), + listKind: undefined, + mapKind: undefined, + mapKey: undefined, + delimitedEncoding: undefined, + packed: undefined, + longAsString: false, + getDefaultValue: undefined, + }; + if (isExtension) { + // extension field + const file = parentOrFile.kind == "file" ? parentOrFile : parentOrFile.file; + const parent = parentOrFile.kind == "file" ? undefined : parentOrFile; + const typeName = makeTypeName(proto, parent, file); + field.kind = "extension"; + field.file = file; + field.parent = parent; + field.oneof = undefined; + field.typeName = typeName; + field.jsonName = `[${typeName}]`; // option json_name is not allowed on extension fields + field.toString = () => `extension ${typeName}`; + const extendee = reg.getMessage(trimLeadingDot(proto.extendee)); + assert(extendee, `invalid FieldDescriptorProto: extendee ${proto.extendee} not found`); + field.extendee = extendee; + } + else { + // regular field + const parent = parentOrFile; + assert(parent.kind == "message"); + field.parent = parent; + field.oneof = oneof; + field.localName = oneof + ? protoCamelCase(proto.name) + : safeObjectProperty(protoCamelCase(proto.name)); + field.jsonName = proto.jsonName; + field.toString = () => `field ${parent.typeName}.${proto.name}`; + } + const label = proto.label; + const type = proto.type; + const jstype = (_c = proto.options) === null || _c === void 0 ? void 0 : _c.jstype; + if (label === LABEL_REPEATED) { + // list or map field + const mapEntry = type == TYPE_MESSAGE + ? mapEntries === null || mapEntries === void 0 ? void 0 : mapEntries.get(trimLeadingDot(proto.typeName)) + : undefined; + if (mapEntry) { + // map field + field.fieldKind = "map"; + const { key, value } = findMapEntryFields(mapEntry); + field.mapKey = key.scalar; + field.mapKind = value.fieldKind; + field.message = value.message; + field.delimitedEncoding = false; // map fields are always LENGTH_PREFIXED + field.enum = value.enum; + field.scalar = value.scalar; + return field; + } + // list field + field.fieldKind = "list"; + switch (type) { + case TYPE_MESSAGE: + case TYPE_GROUP: + field.listKind = "message"; + field.message = reg.getMessage(trimLeadingDot(proto.typeName)); + assert(field.message); + field.delimitedEncoding = isDelimitedEncoding(proto, parentOrFile); + break; + case TYPE_ENUM: + field.listKind = "enum"; + field.enum = reg.getEnum(trimLeadingDot(proto.typeName)); + assert(field.enum); + break; + default: + field.listKind = "scalar"; + field.scalar = type; + field.longAsString = jstype == JS_STRING; + break; + } + field.packed = isPackedField(proto, parentOrFile); + return field; + } + // singular + switch (type) { + case TYPE_MESSAGE: + case TYPE_GROUP: + field.fieldKind = "message"; + field.message = reg.getMessage(trimLeadingDot(proto.typeName)); + assert(field.message, `invalid FieldDescriptorProto: type_name ${proto.typeName} not found`); + field.delimitedEncoding = isDelimitedEncoding(proto, parentOrFile); + field.getDefaultValue = () => undefined; + break; + case TYPE_ENUM: { + const enumeration = reg.getEnum(trimLeadingDot(proto.typeName)); + assert(enumeration !== undefined, `invalid FieldDescriptorProto: type_name ${proto.typeName} not found`); + field.fieldKind = "enum"; + field.enum = reg.getEnum(trimLeadingDot(proto.typeName)); + field.getDefaultValue = () => { + return unsafeIsSetExplicit(proto, "defaultValue") + ? parseTextFormatEnumValue(enumeration, proto.defaultValue) + : undefined; + }; + break; + } + default: { + field.fieldKind = "scalar"; + field.scalar = type; + field.longAsString = jstype == JS_STRING; + field.getDefaultValue = () => { + return unsafeIsSetExplicit(proto, "defaultValue") + ? parseTextFormatScalarValue(type, proto.defaultValue) + : undefined; + }; + break; + } + } + return field; +} +/** + * Parse the "syntax" and "edition" fields, returning one of the supported + * editions. + */ +function getFileEdition(proto) { + switch (proto.syntax) { + case "": + case "proto2": + return EDITION_PROTO2; + case "proto3": + return EDITION_PROTO3; + case "editions": + // EDITION_UNSTABLE is a sandbox for in-development features. Collapse + // it to maximumEdition so SupportedEdition and feature resolution do + // not leak the test-only edition to users. + if (proto.edition === EDITION_UNSTABLE) { + return maximumEdition; + } + if (proto.edition in featureDefaults) { + return proto.edition; + } + throw new Error(`${proto.name}: unsupported edition`); + default: + throw new Error(`${proto.name}: unsupported syntax "${proto.syntax}"`); + } +} +/** + * Resolve dependencies of FileDescriptorProto to DescFile. + */ +function findFileDependencies(proto, reg) { + return proto.dependency.map((wantName) => { + const dep = reg.getFile(wantName); + if (!dep) { + throw new Error(`Cannot find ${wantName}, imported by ${proto.name}`); + } + return dep; + }); +} +/** + * Finds a prefix shared by enum values, for example `my_enum_` for + * `enum MyEnum {MY_ENUM_A=0; MY_ENUM_B=1;}`. + */ +function findEnumSharedPrefix(enumName, values) { + const prefix = camelToSnakeCase(enumName) + "_"; + for (const value of values) { + if (!value.name.toLowerCase().startsWith(prefix)) { + return undefined; + } + const shortName = value.name.substring(prefix.length); + if (shortName.length == 0) { + return undefined; + } + if (/^\d/.test(shortName)) { + // identifiers must not start with numbers + return undefined; + } + } + return prefix; +} +/** + * Converts lowerCamelCase or UpperCamelCase into lower_snake_case. + * This is used to find shared prefixes in an enum. + */ +function camelToSnakeCase(camel) { + return (camel.substring(0, 1) + camel.substring(1).replace(/[A-Z]/g, (c) => "_" + c)).toLowerCase(); +} +/** + * Create a fully qualified name for a protobuf type or extension field. + * + * The fully qualified name for messages, enumerations, and services is + * constructed by concatenating the package name (if present), parent + * message names (for nested types), and the type name. We omit the leading + * dot added by protobuf compilers. Examples: + * - mypackage.MyMessage + * - mypackage.MyMessage.NestedMessage + * + * The fully qualified name for extension fields is constructed by + * concatenating the package name (if present), parent message names (for + * extensions declared within a message), and the field name. Examples: + * - mypackage.extfield + * - mypackage.MyMessage.extfield + */ +function makeTypeName(proto, parent, file) { + let typeName; + if (parent) { + typeName = `${parent.typeName}.${proto.name}`; + } + else if (file.proto.package.length > 0) { + typeName = `${file.proto.package}.${proto.name}`; + } + else { + typeName = `${proto.name}`; + } + return typeName; +} +/** + * Remove the leading dot from a fully qualified type name. + */ +function trimLeadingDot(typeName) { + return typeName.startsWith(".") ? typeName.substring(1) : typeName; +} +/** + * Did the user put the field in a oneof group? + * Synthetic oneofs for proto3 optionals are ignored. + */ +function findOneof(proto, allOneofs) { + if (!unsafeIsSetExplicit(proto, "oneofIndex")) { + return undefined; + } + if (proto.proto3Optional) { + return undefined; + } + const oneof = allOneofs[proto.oneofIndex]; + assert(oneof, `invalid FieldDescriptorProto: oneof #${proto.oneofIndex} for field #${proto.number} not found`); + return oneof; +} +/** + * Presence of the field. + * See https://protobuf.dev/programming-guides/field_presence/ + */ +function getFieldPresence(proto, oneof, isExtension, parent) { + if (proto.label == LABEL_REQUIRED) { + // proto2 required is LEGACY_REQUIRED + return LEGACY_REQUIRED; + } + if (proto.label == LABEL_REPEATED) { + // repeated fields (including maps) do not track presence + return IMPLICIT; + } + if (!!oneof || proto.proto3Optional) { + // oneof is always explicit + return EXPLICIT; + } + if (isExtension) { + // extensions always track presence + return EXPLICIT; + } + const resolved = resolveFeature("fieldPresence", { proto, parent }); + if (resolved == IMPLICIT && + (proto.type == TYPE_MESSAGE || proto.type == TYPE_GROUP)) { + // singular message field cannot be implicit + return EXPLICIT; + } + return resolved; +} +/** + * Pack this repeated field? + */ +function isPackedField(proto, parent) { + if (proto.label != LABEL_REPEATED) { + return false; + } + switch (proto.type) { + case TYPE_STRING: + case TYPE_BYTES: + case TYPE_GROUP: + case TYPE_MESSAGE: + // length-delimited types cannot be packed + return false; + } + const o = proto.options; + if (o && unsafeIsSetExplicit(o, "packed")) { + // prefer the field option over edition features + return o.packed; + } + return (PACKED == + resolveFeature("repeatedFieldEncoding", { + proto, + parent, + })); +} +/** + * Find the key and value fields of a synthetic map entry message. + */ +function findMapEntryFields(mapEntry) { + const key = mapEntry.fields.find((f) => f.number === 1); + const value = mapEntry.fields.find((f) => f.number === 2); + assert(key && + key.fieldKind == "scalar" && + key.scalar != ScalarType.BYTES && + key.scalar != ScalarType.FLOAT && + key.scalar != ScalarType.DOUBLE && + value && + value.fieldKind != "list" && + value.fieldKind != "map"); + return { key, value }; +} +/** + * Enumerations can be open or closed. + * See https://protobuf.dev/programming-guides/enum/ + */ +function isEnumOpen(desc) { + var _a; + return (OPEN == + resolveFeature("enumType", { + proto: desc.proto, + parent: (_a = desc.parent) !== null && _a !== void 0 ? _a : desc.file, + })); +} +/** + * Encode the message delimited (a.k.a. proto2 group encoding), or + * length-prefixed? + */ +function isDelimitedEncoding(proto, parent) { + if (proto.type == TYPE_GROUP) { + return true; + } + return (DELIMITED == + resolveFeature("messageEncoding", { + proto, + parent, + })); +} +/** + * Reject invalid UTF-8 when reading string fields from the binary wire format? + * Driven by the resolved `utf8_validation` feature: VERIFY (proto3 / editions + * 2023+ default) enforces; NONE (proto2 default) does not. + */ +function isUtf8Validated(proto, parent) { + return (VERIFY == + resolveFeature("utf8Validation", { + proto, + parent, + })); +} +function resolveFeature(name, ref) { + var _a, _b; + const featureSet = (_a = ref.proto.options) === null || _a === void 0 ? void 0 : _a.features; + if (featureSet) { + const val = featureSet[name]; + if (val != 0) { + return val; + } + } + if ("kind" in ref) { + if (ref.kind == "message") { + return resolveFeature(name, (_b = ref.parent) !== null && _b !== void 0 ? _b : ref.file); + } + const editionDefaults = featureDefaults[ref.edition]; + if (!editionDefaults) { + throw new Error(`feature default for edition ${ref.edition} not found`); + } + return editionDefaults[name]; + } + return resolveFeature(name, ref.parent); +} +/** + * Assert that condition is truthy or throw error (with message) + */ +function assert(condition, msg) { + if (!condition) { + throw new Error(msg); + } +} diff --git a/node_modules/@bufbuild/protobuf/dist/esm/to-binary.d.ts b/node_modules/@bufbuild/protobuf/dist/esm/to-binary.d.ts new file mode 100644 index 0000000..236ed49 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/to-binary.d.ts @@ -0,0 +1,24 @@ +import type { MessageShape } from "./types.js"; +import { BinaryWriter } from "./wire/binary-encoding.js"; +import { type DescField, type DescMessage } from "./descriptors.js"; +import type { ReflectMessage } from "./reflect/index.js"; +/** + * Options for serializing to binary data. + * + * V1 also had the option `readerFactory` for using a custom implementation to + * encode to binary. + */ +export interface BinaryWriteOptions { + /** + * Include unknown fields in the serialized output? The default behavior + * is to retain unknown fields and include them in the serialized output. + * + * For more details see https://developers.google.com/protocol-buffers/docs/proto3#unknowns + */ + writeUnknownFields: boolean; +} +export declare function toBinary(schema: Desc, message: MessageShape, options?: Partial): Uint8Array; +/** + * @private + */ +export declare function writeField(writer: BinaryWriter, opts: BinaryWriteOptions, msg: ReflectMessage, field: DescField): void; diff --git a/node_modules/@bufbuild/protobuf/dist/esm/to-binary.js b/node_modules/@bufbuild/protobuf/dist/esm/to-binary.js new file mode 100644 index 0000000..e9e7529 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/to-binary.js @@ -0,0 +1,195 @@ +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +import { reflect } from "./reflect/reflect.js"; +import { BinaryWriter, WireType } from "./wire/binary-encoding.js"; +import { ScalarType } from "./descriptors.js"; +// bootstrap-inject google.protobuf.FeatureSet.FieldPresence.LEGACY_REQUIRED: const $name: FeatureSet_FieldPresence.$localName = $number; +const LEGACY_REQUIRED = 3; +// Default options for serializing binary data. +const writeDefaults = { + writeUnknownFields: true, +}; +function makeWriteOptions(options) { + return options ? Object.assign(Object.assign({}, writeDefaults), options) : writeDefaults; +} +export function toBinary(schema, message, options) { + return writeFields(new BinaryWriter(), makeWriteOptions(options), reflect(schema, message)).finish(); +} +function writeFields(writer, opts, msg) { + var _a; + for (const f of msg.sortedFields) { + if (!msg.isSet(f)) { + if (f.presence == LEGACY_REQUIRED) { + throw new Error(`cannot encode ${f} to binary: required field not set`); + } + continue; + } + writeField(writer, opts, msg, f); + } + if (opts.writeUnknownFields) { + for (const { no, wireType, data } of (_a = msg.getUnknown()) !== null && _a !== void 0 ? _a : []) { + writer.tag(no, wireType).raw(data); + } + } + return writer; +} +/** + * @private + */ +export function writeField(writer, opts, msg, field) { + var _a; + switch (field.fieldKind) { + case "scalar": + case "enum": + writeScalar(writer, msg.desc.typeName, field.name, (_a = field.scalar) !== null && _a !== void 0 ? _a : ScalarType.INT32, field.number, msg.get(field)); + break; + case "list": + writeListField(writer, opts, field, msg.get(field)); + break; + case "message": + writeMessageField(writer, opts, field, msg.get(field)); + break; + case "map": + for (const [key, val] of msg.get(field)) { + writeMapEntry(writer, opts, field, key, val); + } + break; + } +} +function writeScalar(writer, msgName, fieldName, scalarType, fieldNo, value) { + writeScalarValue(writer.tag(fieldNo, writeTypeOfScalar(scalarType)), msgName, fieldName, scalarType, value); +} +function writeMessageField(writer, opts, field, message) { + if (field.delimitedEncoding) { + writeFields(writer.tag(field.number, WireType.StartGroup), opts, message).tag(field.number, WireType.EndGroup); + } + else { + writeFields(writer.tag(field.number, WireType.LengthDelimited).fork(), opts, message).join(); + } +} +function writeListField(writer, opts, field, list) { + var _a; + if (field.listKind == "message") { + for (const item of list) { + writeMessageField(writer, opts, field, item); + } + return; + } + const scalarType = (_a = field.scalar) !== null && _a !== void 0 ? _a : ScalarType.INT32; + if (field.packed) { + if (!list.size) { + return; + } + writer.tag(field.number, WireType.LengthDelimited).fork(); + for (const item of list) { + writeScalarValue(writer, field.parent.typeName, field.name, scalarType, item); + } + writer.join(); + return; + } + for (const item of list) { + writeScalar(writer, field.parent.typeName, field.name, scalarType, field.number, item); + } +} +function writeMapEntry(writer, opts, field, key, value) { + var _a; + writer.tag(field.number, WireType.LengthDelimited).fork(); + // write key, expecting key field number = 1 + writeScalar(writer, field.parent.typeName, field.name, field.mapKey, 1, key); + // write value, expecting value field number = 2 + switch (field.mapKind) { + case "scalar": + case "enum": + writeScalar(writer, field.parent.typeName, field.name, (_a = field.scalar) !== null && _a !== void 0 ? _a : ScalarType.INT32, 2, value); + break; + case "message": + writeFields(writer.tag(2, WireType.LengthDelimited).fork(), opts, value).join(); + break; + } + writer.join(); +} +function writeScalarValue(writer, msgName, fieldName, type, value) { + try { + switch (type) { + case ScalarType.STRING: + writer.string(value); + break; + case ScalarType.BOOL: + writer.bool(value); + break; + case ScalarType.DOUBLE: + writer.double(value); + break; + case ScalarType.FLOAT: + writer.float(value); + break; + case ScalarType.INT32: + writer.int32(value); + break; + case ScalarType.INT64: + writer.int64(value); + break; + case ScalarType.UINT64: + writer.uint64(value); + break; + case ScalarType.FIXED64: + writer.fixed64(value); + break; + case ScalarType.BYTES: + writer.bytes(value); + break; + case ScalarType.FIXED32: + writer.fixed32(value); + break; + case ScalarType.SFIXED32: + writer.sfixed32(value); + break; + case ScalarType.SFIXED64: + writer.sfixed64(value); + break; + case ScalarType.SINT64: + writer.sint64(value); + break; + case ScalarType.UINT32: + writer.uint32(value); + break; + case ScalarType.SINT32: + writer.sint32(value); + break; + } + } + catch (e) { + if (e instanceof Error) { + throw new Error(`cannot encode field ${msgName}.${fieldName} to binary: ${e.message}`); + } + throw e; + } +} +function writeTypeOfScalar(type) { + switch (type) { + case ScalarType.BYTES: + case ScalarType.STRING: + return WireType.LengthDelimited; + case ScalarType.DOUBLE: + case ScalarType.FIXED64: + case ScalarType.SFIXED64: + return WireType.Bit64; + case ScalarType.FIXED32: + case ScalarType.SFIXED32: + case ScalarType.FLOAT: + return WireType.Bit32; + default: + return WireType.Varint; + } +} diff --git a/node_modules/@bufbuild/protobuf/dist/esm/to-json.d.ts b/node_modules/@bufbuild/protobuf/dist/esm/to-json.d.ts new file mode 100644 index 0000000..66a4a2c --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/to-json.d.ts @@ -0,0 +1,67 @@ +import { type DescEnum, type DescMessage } from "./descriptors.js"; +import type { JsonValue } from "./json-value.js"; +import type { Registry } from "./registry.js"; +import type { EnumJsonType, EnumShape, MessageJsonType, MessageShape } from "./types.js"; +/** + * Options for serializing to JSON. + */ +export interface JsonWriteOptions { + /** + * By default, fields with implicit presence are not serialized if they are + * unset. For example, an empty list field or a proto3 int32 field with 0 is + * not serialized. With this option enabled, such fields are included in the + * output. + */ + alwaysEmitImplicit: boolean; + /** + * Emit enum values as integers instead of strings: The name of an enum + * value is used by default in JSON output. An option may be provided to + * use the numeric value of the enum value instead. + */ + enumAsInteger: boolean; + /** + * Use proto field name instead of lowerCamelCase name: By default proto3 + * JSON printer should convert the field name to lowerCamelCase and use + * that as the JSON name. An implementation may provide an option to use + * proto field name as the JSON name instead. Proto3 JSON parsers are + * required to accept both the converted lowerCamelCase name and the proto + * field name. + */ + useProtoFieldName: boolean; + /** + * This option is required to write `google.protobuf.Any` and extensions + * to JSON format. + */ + registry?: Registry | undefined; +} +/** + * Options for serializing to JSON. + */ +export interface JsonWriteStringOptions extends JsonWriteOptions { + /** + * Format JSON with indentation. Indicates the number of space characters to + * be used as indentation. + * + * This option is passed to JSON.stringify as `space`. + */ + prettySpaces: number; +} +/** + * Serialize the message to a JSON value, a JavaScript value that can be + * passed to JSON.stringify(). + */ +export declare function toJson | undefined = undefined>(schema: Desc, message: MessageShape, options?: Opts): ToJson; +type ToJson> = Opts extends undefined | { + alwaysEmitImplicit?: false; + enumAsInteger?: false; + useProtoFieldName?: false; +} ? MessageJsonType : JsonValue; +/** + * Serialize the message to a JSON string. + */ +export declare function toJsonString(schema: Desc, message: MessageShape, options?: Partial): string; +/** + * Serialize a single enum value to JSON. + */ +export declare function enumToJson(descEnum: Desc, value: EnumShape): EnumJsonType; +export {}; diff --git a/node_modules/@bufbuild/protobuf/dist/esm/to-json.js b/node_modules/@bufbuild/protobuf/dist/esm/to-json.js new file mode 100644 index 0000000..dc1b80d --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/to-json.js @@ -0,0 +1,386 @@ +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +import { ScalarType, } from "./descriptors.js"; +import { protoCamelCase, protoSnakeCase } from "./reflect/names.js"; +import { reflect } from "./reflect/reflect.js"; +import { anyUnpack } from "./wkt/index.js"; +import { hasCustomJsonRepresentation, isWrapperDesc } from "./wkt/wrappers.js"; +import { base64Encode } from "./wire/index.js"; +import { createExtensionContainer, getExtension } from "./extensions.js"; +import { checkField, formatVal } from "./reflect/reflect-check.js"; +// bootstrap-inject google.protobuf.FeatureSet.FieldPresence.LEGACY_REQUIRED: const $name: FeatureSet_FieldPresence.$localName = $number; +const LEGACY_REQUIRED = 3; +// bootstrap-inject google.protobuf.FeatureSet.FieldPresence.IMPLICIT: const $name: FeatureSet_FieldPresence.$localName = $number; +const IMPLICIT = 2; +// Default options for serializing to JSON. +const jsonWriteDefaults = { + alwaysEmitImplicit: false, + enumAsInteger: false, + useProtoFieldName: false, +}; +function makeWriteOptions(options) { + return options ? Object.assign(Object.assign({}, jsonWriteDefaults), options) : jsonWriteDefaults; +} +/** + * Serialize the message to a JSON value, a JavaScript value that can be + * passed to JSON.stringify(). + */ +export function toJson(schema, message, options) { + return reflectToJson(reflect(schema, message), makeWriteOptions(options)); +} +/** + * Serialize the message to a JSON string. + */ +export function toJsonString(schema, message, options) { + var _a; + const jsonValue = toJson(schema, message, options); + return JSON.stringify(jsonValue, null, (_a = options === null || options === void 0 ? void 0 : options.prettySpaces) !== null && _a !== void 0 ? _a : 0); +} +/** + * Serialize a single enum value to JSON. + */ +export function enumToJson(descEnum, value) { + var _a; + if (descEnum.typeName == "google.protobuf.NullValue") { + return null; + } + const name = (_a = descEnum.value[value]) === null || _a === void 0 ? void 0 : _a.name; + if (name === undefined) { + throw new Error(`${value} is not a value in ${descEnum}`); + } + return name; +} +function reflectToJson(msg, opts) { + var _a; + const wktJson = tryWktToJson(msg, opts); + if (wktJson !== undefined) + return wktJson; + const json = {}; + for (const f of msg.sortedFields) { + if (!msg.isSet(f)) { + if (f.presence == LEGACY_REQUIRED) { + throw new Error(`cannot encode ${f} to JSON: required field not set`); + } + if (!opts.alwaysEmitImplicit || f.presence !== IMPLICIT) { + // Fields with implicit presence omit zero values (e.g. empty string) by default + continue; + } + } + const jsonValue = fieldToJson(f, msg.get(f), opts); + if (jsonValue !== undefined) { + json[jsonName(f, opts)] = jsonValue; + } + } + if (opts.registry) { + const tagSeen = new Set(); + for (const { no } of (_a = msg.getUnknown()) !== null && _a !== void 0 ? _a : []) { + // Same tag can appear multiple times, so we + // keep track and skip identical ones. + if (!tagSeen.has(no)) { + tagSeen.add(no); + const extension = opts.registry.getExtensionFor(msg.desc, no); + if (!extension) { + continue; + } + const value = getExtension(msg.message, extension); + const [container, field] = createExtensionContainer(extension, value); + const jsonValue = fieldToJson(field, container.get(field), opts); + if (jsonValue !== undefined) { + json[extension.jsonName] = jsonValue; + } + } + } + } + return json; +} +function fieldToJson(f, val, opts) { + switch (f.fieldKind) { + case "scalar": + return scalarToJson(f, val); + case "message": + return reflectToJson(val, opts); + case "enum": + return enumToJsonInternal(f.enum, val, opts.enumAsInteger); + case "list": + return listToJson(val, opts); + case "map": + return mapToJson(val, opts); + } +} +function mapToJson(map, opts) { + const f = map.field(); + const jsonObj = {}; + switch (f.mapKind) { + case "scalar": + for (const [entryKey, entryValue] of map) { + jsonObj[entryKey] = scalarToJson(f, entryValue); + } + break; + case "message": + for (const [entryKey, entryValue] of map) { + jsonObj[entryKey] = reflectToJson(entryValue, opts); + } + break; + case "enum": + for (const [entryKey, entryValue] of map) { + jsonObj[entryKey] = enumToJsonInternal(f.enum, entryValue, opts.enumAsInteger); + } + break; + } + return opts.alwaysEmitImplicit || map.size > 0 ? jsonObj : undefined; +} +function listToJson(list, opts) { + const f = list.field(); + const jsonArr = []; + switch (f.listKind) { + case "scalar": + for (const item of list) { + jsonArr.push(scalarToJson(f, item)); + } + break; + case "enum": + for (const item of list) { + jsonArr.push(enumToJsonInternal(f.enum, item, opts.enumAsInteger)); + } + break; + case "message": + for (const item of list) { + jsonArr.push(reflectToJson(item, opts)); + } + break; + } + return opts.alwaysEmitImplicit || jsonArr.length > 0 ? jsonArr : undefined; +} +function enumToJsonInternal(desc, value, enumAsInteger) { + var _a; + if (typeof value != "number") { + throw new Error(`cannot encode ${desc} to JSON: expected number, got ${formatVal(value)}`); + } + if (desc.typeName == "google.protobuf.NullValue") { + return null; + } + if (enumAsInteger) { + return value; + } + const val = desc.value[value]; + return (_a = val === null || val === void 0 ? void 0 : val.name) !== null && _a !== void 0 ? _a : value; // if we don't know the enum value, just return the number +} +function scalarToJson(field, value) { + var _a, _b, _c, _d, _e, _f; + switch (field.scalar) { + // int32, fixed32, uint32: JSON value will be a decimal number. Either numbers or strings are accepted. + case ScalarType.INT32: + case ScalarType.SFIXED32: + case ScalarType.SINT32: + case ScalarType.FIXED32: + case ScalarType.UINT32: + if (typeof value != "number") { + throw new Error(`cannot encode ${field} to JSON: ${(_a = checkField(field, value)) === null || _a === void 0 ? void 0 : _a.message}`); + } + return value; + // float, double: JSON value will be a number or one of the special string values "NaN", "Infinity", and "-Infinity". + // Either numbers or strings are accepted. Exponent notation is also accepted. + case ScalarType.FLOAT: + case ScalarType.DOUBLE: // eslint-disable-line no-fallthrough + if (typeof value != "number") { + throw new Error(`cannot encode ${field} to JSON: ${(_b = checkField(field, value)) === null || _b === void 0 ? void 0 : _b.message}`); + } + if (Number.isNaN(value)) + return "NaN"; + if (value === Number.POSITIVE_INFINITY) + return "Infinity"; + if (value === Number.NEGATIVE_INFINITY) + return "-Infinity"; + return value; + // string: + case ScalarType.STRING: + if (typeof value != "string") { + throw new Error(`cannot encode ${field} to JSON: ${(_c = checkField(field, value)) === null || _c === void 0 ? void 0 : _c.message}`); + } + return value; + // bool: + case ScalarType.BOOL: + if (typeof value != "boolean") { + throw new Error(`cannot encode ${field} to JSON: ${(_d = checkField(field, value)) === null || _d === void 0 ? void 0 : _d.message}`); + } + return value; + // JSON value will be a decimal string. Either numbers or strings are accepted. + case ScalarType.UINT64: + case ScalarType.FIXED64: + case ScalarType.INT64: + case ScalarType.SFIXED64: + case ScalarType.SINT64: + if (typeof value == "bigint" || + typeof value == "string" || + (typeof value == "number" && Number.isInteger(value))) { + return value.toString(); + } + throw new Error(`cannot encode ${field} to JSON: ${(_e = checkField(field, value)) === null || _e === void 0 ? void 0 : _e.message}`); + // bytes: JSON value will be the data encoded as a string using standard base64 encoding with paddings. + // Either standard or URL-safe base64 encoding with/without paddings are accepted. + case ScalarType.BYTES: + if (value instanceof Uint8Array) { + return base64Encode(value); + } + throw new Error(`cannot encode ${field} to JSON: ${(_f = checkField(field, value)) === null || _f === void 0 ? void 0 : _f.message}`); + } +} +function jsonName(f, opts) { + return opts.useProtoFieldName ? f.name : f.jsonName; +} +// returns a json value if wkt, otherwise returns undefined. +function tryWktToJson(msg, opts) { + if (!msg.desc.typeName.startsWith("google.protobuf.")) { + return undefined; + } + switch (msg.desc.typeName) { + case "google.protobuf.Any": + return anyToJson(msg.message, opts); + case "google.protobuf.Timestamp": + return timestampToJson(msg.message); + case "google.protobuf.Duration": + return durationToJson(msg.message); + case "google.protobuf.FieldMask": + return fieldMaskToJson(msg.message); + case "google.protobuf.Struct": + return structToJson(msg.message); + case "google.protobuf.Value": + return valueToJson(msg.message); + case "google.protobuf.ListValue": + return listValueToJson(msg.message); + default: + if (isWrapperDesc(msg.desc)) { + const valueField = msg.desc.fields[0]; + return scalarToJson(valueField, msg.get(valueField)); + } + return undefined; + } +} +function anyToJson(val, opts) { + if (val.typeUrl === "") { + return {}; + } + const { registry } = opts; + let message; + let desc; + if (registry) { + message = anyUnpack(val, registry); + if (message) { + desc = registry.getMessage(message.$typeName); + } + } + if (!desc || !message) { + throw new Error(`cannot encode message ${val.$typeName} to JSON: "${val.typeUrl}" is not in the type registry`); + } + const reflected = reflect(desc, message); + const json = hasCustomJsonRepresentation(desc) + ? { value: tryWktToJson(reflected, opts) } + : reflectToJson(reflected, opts); + json["@type"] = val.typeUrl; + return json; +} +function durationToJson(val) { + const seconds = Number(val.seconds); + const nanos = val.nanos; + if (seconds > 315576000000 || seconds < -315576000000) { + throw new Error(`cannot encode message ${val.$typeName} to JSON: value out of range`); + } + if ((seconds > 0 && nanos < 0) || (seconds < 0 && nanos > 0)) { + throw new Error(`cannot encode message ${val.$typeName} to JSON: nanos sign must match seconds sign`); + } + let text = val.seconds.toString(); + if (nanos !== 0) { + let nanosStr = Math.abs(nanos).toString(); + nanosStr = "0".repeat(9 - nanosStr.length) + nanosStr; + if (nanosStr.substring(3) === "000000") { + nanosStr = nanosStr.substring(0, 3); + } + else if (nanosStr.substring(6) === "000") { + nanosStr = nanosStr.substring(0, 6); + } + text += "." + nanosStr; + if (nanos < 0 && seconds == 0) { + text = "-" + text; + } + } + return text + "s"; +} +function fieldMaskToJson(val) { + return val.paths + .map((p) => { + if (protoSnakeCase(protoCamelCase(p)) !== p) { + throw new Error(`cannot encode message ${val.$typeName} to JSON: lowerCamelCase of path name "${p}" is irreversible`); + } + return protoCamelCase(p); + }) + .join(","); +} +function structToJson(val) { + const json = {}; + for (const [k, v] of Object.entries(val.fields)) { + json[k] = valueToJson(v); + } + return json; +} +function valueToJson(val) { + switch (val.kind.case) { + case "nullValue": + return null; + case "numberValue": + if (!Number.isFinite(val.kind.value)) { + throw new Error(`${val.$typeName} cannot be NaN or Infinity`); + } + return val.kind.value; + case "boolValue": + return val.kind.value; + case "stringValue": + return val.kind.value; + case "structValue": + return structToJson(val.kind.value); + case "listValue": + return listValueToJson(val.kind.value); + default: + throw new Error(`${val.$typeName} must have a value`); + } +} +function listValueToJson(val) { + return val.values.map(valueToJson); +} +function timestampToJson(val) { + const ms = Number(val.seconds) * 1000; + if (ms < Date.parse("0001-01-01T00:00:00Z") || + ms > Date.parse("9999-12-31T23:59:59Z")) { + throw new Error(`cannot encode message ${val.$typeName} to JSON: must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive`); + } + if (val.nanos < 0) { + throw new Error(`cannot encode message ${val.$typeName} to JSON: nanos must not be negative`); + } + if (val.nanos > 999999999) { + throw new Error(`cannot encode message ${val.$typeName} to JSON: nanos must not be greater than 99999999`); + } + let z = "Z"; + if (val.nanos > 0) { + const nanosStr = (val.nanos + 1000000000).toString().substring(1); + if (nanosStr.substring(3) === "000000") { + z = "." + nanosStr.substring(0, 3) + "Z"; + } + else if (nanosStr.substring(6) === "000") { + z = "." + nanosStr.substring(0, 6) + "Z"; + } + else { + z = "." + nanosStr + "Z"; + } + } + return new Date(ms).toISOString().replace(".000Z", z); +} diff --git a/node_modules/@bufbuild/protobuf/dist/esm/types.d.ts b/node_modules/@bufbuild/protobuf/dist/esm/types.d.ts new file mode 100644 index 0000000..56fa28d --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/types.d.ts @@ -0,0 +1,128 @@ +import type { GenEnum as GenEnumV1, GenExtension as GenExtensionV1, GenMessage as GenMessageV1 } from "./codegenv1/types.js"; +import type { GenEnum as GenEnumV2, GenExtension as GenExtensionV2, GenMessage as GenMessageV2 } from "./codegenv2/types.js"; +import type { DescEnum, DescExtension, DescMessage, DescMethod } from "./descriptors.js"; +import type { OneofADT } from "./reflect/guard.js"; +import type { WireType } from "./wire/index.js"; +import type { JsonValue } from "./json-value.js"; +/** + * The type `Message` contains the properties shared by all messages. + */ +export type Message = { + /** + * The fully qualified Protobuf type-name of the message. + */ + readonly $typeName: TypeName; + /** + * Unknown fields and extensions stored on the message. + */ + $unknown?: UnknownField[] | undefined; +}; +/** + * Extract the message type from a message descriptor. + */ +export type MessageShape = Desc extends GenMessageV1 ? RuntimeShapeV1 : Desc extends GenMessageV2 ? RuntimeShape : Message; +/** + * Extract the message JSON type from a message descriptor. + * + * JSON types are only available for code generated with the plugin option + * `json_types=true`. If JSON types are unavailable, this type falls back to the + * `JsonValue` type. + */ +export type MessageJsonType = Desc extends GenMessageV1 ? JsonTypeV1 : Desc extends GenMessageV2 ? JsonType : JsonValue; +/** + * Extract the message Valid type from a message descriptor. + * + * Valid types are only available for code generated with the plugin option + * `valid_types`. If Valid types are unavailable, this type falls back to the + * regular message shape. + */ +export type MessageValidType = Desc extends GenMessageV1 ? RuntimeShapeV1 : Desc extends GenMessageV2 ? ValidType : Desc extends GenMessageV2 ? RuntimeShape : Message; +/** + * Extract the init type from a message descriptor. + * The init type is accepted by the function create(). + */ +export type MessageInitShape = Desc extends GenMessageV1 ? MessageInit : Desc extends GenMessageV2 ? MessageInit : Record; +/** + * Extract the enum type of from an enum descriptor. + */ +export type EnumShape = Desc extends GenEnumV1 ? RuntimeShape : Desc extends GenEnumV2 ? RuntimeShape : number; +/** + * Extract the enum JSON type from a enum descriptor. + */ +export type EnumJsonType = Desc extends GenEnumV1 ? JsonType : Desc extends GenEnumV2 ? JsonType : string | null; +/** + * Extract the value type from an extension descriptor. + */ +export type ExtensionValueShape = Desc extends GenExtensionV1 ? RuntimeShape : Desc extends GenExtensionV2 ? RuntimeShape : unknown; +/** + * Extract the type of the extended message from an extension descriptor. + */ +export type Extendee = Desc extends GenExtensionV1 ? Extendee : Desc extends GenExtensionV2 ? Extendee : Message; +/** + * Unknown fields are fields that were not recognized during parsing, or + * extension. + */ +export type UnknownField = { + readonly no: number; + readonly wireType: WireType; + readonly data: Uint8Array; +}; +/** + * Describes a streaming RPC declaration. + */ +export type DescMethodStreaming = DescMethodClientStreaming | DescMethodServerStreaming | DescMethodBiDiStreaming; +/** + * Describes a unary RPC declaration. + */ +export type DescMethodUnary = DescMethodTyped<"unary", I, O>; +/** + * Describes a server streaming RPC declaration. + */ +export type DescMethodServerStreaming = DescMethodTyped<"server_streaming", I, O>; +/** + * Describes a client streaming RPC declaration. + */ +export type DescMethodClientStreaming = DescMethodTyped<"client_streaming", I, O>; +/** + * Describes a bidi streaming RPC declaration. + */ +export type DescMethodBiDiStreaming = DescMethodTyped<"bidi_streaming", I, O>; +/** + * The init type for a message, which makes all fields optional. + * The init type is accepted by the function create(). + */ +type MessageInit = T | { + [P in keyof T as P extends "$unknown" ? never : P]?: P extends "$typeName" ? never : FieldInit; +}; +type FieldInit = F extends (Date | Uint8Array | bigint | boolean | string | number) ? F : F extends Array ? Array> : F extends ReadonlyArray ? ReadonlyArray> : F extends Message ? MessageInit : F extends OneofSelectedMessage ? { + case: C; + value: MessageInit; +} : F extends OneofADT ? F : F extends MapWithMessage ? { + [key: string | number]: MessageInit; +} : F; +type MapWithMessage = { + [key: string | number]: V; +}; +type OneofSelectedMessage = { + case: K; + value: M; +}; +type DescMethodTyped = Omit & { + /** + * One of the four available method types. + */ + readonly methodKind: K; + /** + * The message type for requests. + */ + readonly input: I; + /** + * The message type for responses. + */ + readonly output: O; +}; +export {}; diff --git a/node_modules/@bufbuild/protobuf/dist/esm/types.js b/node_modules/@bufbuild/protobuf/dist/esm/types.js new file mode 100644 index 0000000..c3ad5eb --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/types.js @@ -0,0 +1,14 @@ +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +export {}; diff --git a/node_modules/@bufbuild/protobuf/dist/esm/wire/base64-encoding.d.ts b/node_modules/@bufbuild/protobuf/dist/esm/wire/base64-encoding.d.ts new file mode 100644 index 0000000..bbe3d7d --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/wire/base64-encoding.d.ts @@ -0,0 +1,23 @@ +/** + * Decodes a base64 string to a byte array. + * + * - ignores white-space, including line breaks and tabs + * - allows inner padding (can decode concatenated base64 strings) + * - does not require padding + * - understands base64url encoding: + * "-" instead of "+", + * "_" instead of "/", + * no padding + */ +export declare function base64Decode(base64Str: string): Uint8Array; +/** + * Encode a byte array to a base64 string. + * + * By default, this function uses the standard base64 encoding with padding. + * + * To encode without padding, use encoding = "std_raw". + * + * To encode with the URL encoding, use encoding = "url", which replaces the + * characters +/ by their URL-safe counterparts -_, and omits padding. + */ +export declare function base64Encode(bytes: Uint8Array, encoding?: "std" | "std_raw" | "url"): string; diff --git a/node_modules/@bufbuild/protobuf/dist/esm/wire/base64-encoding.js b/node_modules/@bufbuild/protobuf/dist/esm/wire/base64-encoding.js new file mode 100644 index 0000000..edf1298 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/wire/base64-encoding.js @@ -0,0 +1,152 @@ +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +/** + * Decodes a base64 string to a byte array. + * + * - ignores white-space, including line breaks and tabs + * - allows inner padding (can decode concatenated base64 strings) + * - does not require padding + * - understands base64url encoding: + * "-" instead of "+", + * "_" instead of "/", + * no padding + */ +export function base64Decode(base64Str) { + const table = getDecodeTable(); + // estimate byte size, not accounting for inner padding and whitespace + let es = (base64Str.length * 3) / 4; + if (base64Str[base64Str.length - 2] == "=") + es -= 2; + else if (base64Str[base64Str.length - 1] == "=") + es -= 1; + let bytes = new Uint8Array(es), bytePos = 0, // position in byte array + groupPos = 0, // position in base64 group + b, // current byte + p = 0; // previous byte + for (let i = 0; i < base64Str.length; i++) { + b = table[base64Str.charCodeAt(i)]; + if (b === undefined) { + switch (base64Str[i]) { + // @ts-ignore TS7029: Fallthrough case in switch -- ignore instead of expect-error for compiler settings without noFallthroughCasesInSwitch: true + case "=": + groupPos = 0; // reset state when padding found + case "\n": + case "\r": + case "\t": + case " ": + continue; // skip white-space, and padding + default: + throw Error("invalid base64 string"); + } + } + switch (groupPos) { + case 0: + p = b; + groupPos = 1; + break; + case 1: + bytes[bytePos++] = (p << 2) | ((b & 48) >> 4); + p = b; + groupPos = 2; + break; + case 2: + bytes[bytePos++] = ((p & 15) << 4) | ((b & 60) >> 2); + p = b; + groupPos = 3; + break; + case 3: + bytes[bytePos++] = ((p & 3) << 6) | b; + groupPos = 0; + break; + } + } + if (groupPos == 1) + throw Error("invalid base64 string"); + return bytes.subarray(0, bytePos); +} +/** + * Encode a byte array to a base64 string. + * + * By default, this function uses the standard base64 encoding with padding. + * + * To encode without padding, use encoding = "std_raw". + * + * To encode with the URL encoding, use encoding = "url", which replaces the + * characters +/ by their URL-safe counterparts -_, and omits padding. + */ +export function base64Encode(bytes, encoding = "std") { + const table = getEncodeTable(encoding); + const pad = encoding == "std"; + let base64 = "", groupPos = 0, // position in base64 group + b, // current byte + p = 0; // carry over from previous byte + for (let i = 0; i < bytes.length; i++) { + b = bytes[i]; + switch (groupPos) { + case 0: + base64 += table[b >> 2]; + p = (b & 3) << 4; + groupPos = 1; + break; + case 1: + base64 += table[p | (b >> 4)]; + p = (b & 15) << 2; + groupPos = 2; + break; + case 2: + base64 += table[p | (b >> 6)]; + base64 += table[b & 63]; + groupPos = 0; + break; + } + } + // add output padding + if (groupPos) { + base64 += table[p]; + if (pad) { + base64 += "="; + if (groupPos == 1) + base64 += "="; + } + } + return base64; +} +// lookup table from base64 character to byte +let encodeTableStd; +let encodeTableUrl; +// lookup table from base64 character *code* to byte because lookup by number is fast +let decodeTable; +function getEncodeTable(encoding) { + if (!encodeTableStd) { + encodeTableStd = + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""); + encodeTableUrl = encodeTableStd.slice(0, -2).concat("-", "_"); + } + return encoding == "url" + ? // biome-ignore lint/style/noNonNullAssertion: TS fails to narrow down + encodeTableUrl + : encodeTableStd; +} +function getDecodeTable() { + if (!decodeTable) { + decodeTable = []; + const encodeTable = getEncodeTable("std"); + for (let i = 0; i < encodeTable.length; i++) + decodeTable[encodeTable[i].charCodeAt(0)] = i; + // support base64url variants + decodeTable["-".charCodeAt(0)] = encodeTable.indexOf("+"); + decodeTable["_".charCodeAt(0)] = encodeTable.indexOf("/"); + } + return decodeTable; +} diff --git a/node_modules/@bufbuild/protobuf/dist/esm/wire/binary-encoding.d.ts b/node_modules/@bufbuild/protobuf/dist/esm/wire/binary-encoding.d.ts new file mode 100644 index 0000000..53b6573 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/wire/binary-encoding.d.ts @@ -0,0 +1,266 @@ +/** + * Protobuf binary format wire types. + * + * A wire type provides just enough information to find the length of the + * following value. + * + * See https://developers.google.com/protocol-buffers/docs/encoding#structure + */ +export declare enum WireType { + /** + * Used for int32, int64, uint32, uint64, sint32, sint64, bool, enum + */ + Varint = 0, + /** + * Used for fixed64, sfixed64, double. + * Always 8 bytes with little-endian byte order. + */ + Bit64 = 1, + /** + * Used for string, bytes, embedded messages, packed repeated fields + * + * Only repeated numeric types (types which use the varint, 32-bit, + * or 64-bit wire types) can be packed. In proto3, such fields are + * packed by default. + */ + LengthDelimited = 2, + /** + * Start of a tag-delimited aggregate, such as a proto2 group, or a message + * in editions with message_encoding = DELIMITED. + */ + StartGroup = 3, + /** + * End of a tag-delimited aggregate. + */ + EndGroup = 4, + /** + * Used for fixed32, sfixed32, float. + * Always 4 bytes with little-endian byte order. + */ + Bit32 = 5 +} +/** + * Maximum value for a 32-bit floating point value (Protobuf FLOAT). + */ +export declare const FLOAT32_MAX = 3.4028234663852886e+38; +/** + * Minimum value for a 32-bit floating point value (Protobuf FLOAT). + */ +export declare const FLOAT32_MIN = -3.4028234663852886e+38; +/** + * Maximum value for an unsigned 32-bit integer (Protobuf UINT32, FIXED32). + */ +export declare const UINT32_MAX = 4294967295; +/** + * Maximum value for a signed 32-bit integer (Protobuf INT32, SFIXED32, SINT32). + */ +export declare const INT32_MAX = 2147483647; +/** + * Minimum value for a signed 32-bit integer (Protobuf INT32, SFIXED32, SINT32). + */ +export declare const INT32_MIN = -2147483648; +export declare class BinaryWriter { + private readonly encodeUtf8; + /** + * We cannot allocate a buffer for the entire output + * because we don't know its size. + * + * So we collect smaller chunks of known size and + * concat them later. + * + * Use `raw()` to push data to this array. It will flush + * `buf` first. + */ + private chunks; + /** + * A growing buffer for byte values. If you don't know + * the size of the data you are writing, push to this + * array. + */ + protected buf: number[]; + /** + * Previous fork states. + */ + private stack; + constructor(encodeUtf8?: (text: string) => Uint8Array); + /** + * Return all bytes written and reset this writer. + */ + finish(): Uint8Array; + /** + * Start a new fork for length-delimited data like a message + * or a packed repeated field. + * + * Must be joined later with `join()`. + */ + fork(): this; + /** + * Join the last fork. Write its length and bytes, then + * return to the previous state. + */ + join(): this; + /** + * Writes a tag (field number and wire type). + * + * Equivalent to `uint32( (fieldNo << 3 | type) >>> 0 )`. + * + * Generated code should compute the tag ahead of time and call `uint32()`. + */ + tag(fieldNo: number, type: WireType): this; + /** + * Write a chunk of raw bytes. + */ + raw(chunk: Uint8Array): this; + /** + * Write a `uint32` value, an unsigned 32 bit varint. + */ + uint32(value: number): this; + /** + * Write a `int32` value, a signed 32 bit varint. + */ + int32(value: number): this; + /** + * Write a `bool` value, a varint. + */ + bool(value: boolean): this; + /** + * Write a `bytes` value, length-delimited arbitrary data. + */ + bytes(value: Uint8Array): this; + /** + * Write a `string` value, length-delimited data converted to UTF-8 text. + */ + string(value: string): this; + /** + * Write a `float` value, 32-bit floating point number. + */ + float(value: number): this; + /** + * Write a `double` value, a 64-bit floating point number. + */ + double(value: number): this; + /** + * Write a `fixed32` value, an unsigned, fixed-length 32-bit integer. + */ + fixed32(value: number): this; + /** + * Write a `sfixed32` value, a signed, fixed-length 32-bit integer. + */ + sfixed32(value: number): this; + /** + * Write a `sint32` value, a signed, zigzag-encoded 32-bit varint. + */ + sint32(value: number): this; + /** + * Write a `sfixed64` value, a signed, fixed-length 64-bit integer. + */ + sfixed64(value: string | number | bigint): this; + /** + * Write a `fixed64` value, an unsigned, fixed-length 64 bit integer. + */ + fixed64(value: string | number | bigint): this; + /** + * Write a `int64` value, a signed 64-bit varint. + */ + int64(value: string | number | bigint): this; + /** + * Write a `sint64` value, a signed, zig-zag-encoded 64-bit varint. + */ + sint64(value: string | number | bigint): this; + /** + * Write a `uint64` value, an unsigned 64-bit varint. + */ + uint64(value: string | number | bigint): this; +} +export declare class BinaryReader { + private readonly decodeUtf8; + /** + * Current position. + */ + pos: number; + /** + * Number of bytes available in this reader. + */ + readonly len: number; + protected readonly buf: Uint8Array; + private readonly view; + constructor(buf: Uint8Array, decodeUtf8?: (bytes: Uint8Array, strict?: boolean) => string); + /** + * Reads a tag - field number and wire type. Tags are uint32 varints; values + * that do not fit in uint32 are rejected. + */ + tag(): [number, WireType]; + /** + * Skip one element and return the skipped data. + * + * When skipping StartGroup, provide the tags field number to check for + * matching field number in the EndGroup tag. + */ + skip(wireType: WireType, fieldNo?: number): Uint8Array; + protected varint64: () => [number, number]; + /** + * Throws error if position in byte array is out of range. + */ + protected assertBounds(): void; + /** + * Read a `uint32` field, an unsigned 32 bit varint. + */ + uint32: () => number; + /** + * Read a `int32` field, a signed 32 bit varint. + */ + int32(): number; + /** + * Read a `sint32` field, a signed, zigzag-encoded 32-bit varint. + */ + sint32(): number; + /** + * Read a `int64` field, a signed 64-bit varint. + */ + int64(): bigint | string; + /** + * Read a `uint64` field, an unsigned 64-bit varint. + */ + uint64(): bigint | string; + /** + * Read a `sint64` field, a signed, zig-zag-encoded 64-bit varint. + */ + sint64(): bigint | string; + /** + * Read a `bool` field, a variant. + */ + bool(): boolean; + /** + * Read a `fixed32` field, an unsigned, fixed-length 32-bit integer. + */ + fixed32(): number; + /** + * Read a `sfixed32` field, a signed, fixed-length 32-bit integer. + */ + sfixed32(): number; + /** + * Read a `fixed64` field, an unsigned, fixed-length 64 bit integer. + */ + fixed64(): bigint | string; + /** + * Read a `fixed64` field, a signed, fixed-length 64-bit integer. + */ + sfixed64(): bigint | string; + /** + * Read a `float` field, 32-bit floating point number. + */ + float(): number; + /** + * Read a `double` field, a 64-bit floating point number. + */ + double(): number; + /** + * Read a `bytes` field, length-delimited arbitrary data. + */ + bytes(): Uint8Array; + /** + * Read a `string` field, length-delimited data converted to UTF-8 text. If + * `strict` is true, throw on invalid UTF-8 instead of substituting U+FFFD. + */ + string(strict?: boolean): string; +} diff --git a/node_modules/@bufbuild/protobuf/dist/esm/wire/binary-encoding.js b/node_modules/@bufbuild/protobuf/dist/esm/wire/binary-encoding.js new file mode 100644 index 0000000..d5eef6a --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/wire/binary-encoding.js @@ -0,0 +1,520 @@ +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +import { varint32read, varint32write, varint64read, varint64write, } from "./varint.js"; +import { protoInt64 } from "../proto-int64.js"; +import { getTextEncoding } from "./text-encoding.js"; +/** + * Protobuf binary format wire types. + * + * A wire type provides just enough information to find the length of the + * following value. + * + * See https://developers.google.com/protocol-buffers/docs/encoding#structure + */ +export var WireType; +(function (WireType) { + /** + * Used for int32, int64, uint32, uint64, sint32, sint64, bool, enum + */ + WireType[WireType["Varint"] = 0] = "Varint"; + /** + * Used for fixed64, sfixed64, double. + * Always 8 bytes with little-endian byte order. + */ + WireType[WireType["Bit64"] = 1] = "Bit64"; + /** + * Used for string, bytes, embedded messages, packed repeated fields + * + * Only repeated numeric types (types which use the varint, 32-bit, + * or 64-bit wire types) can be packed. In proto3, such fields are + * packed by default. + */ + WireType[WireType["LengthDelimited"] = 2] = "LengthDelimited"; + /** + * Start of a tag-delimited aggregate, such as a proto2 group, or a message + * in editions with message_encoding = DELIMITED. + */ + WireType[WireType["StartGroup"] = 3] = "StartGroup"; + /** + * End of a tag-delimited aggregate. + */ + WireType[WireType["EndGroup"] = 4] = "EndGroup"; + /** + * Used for fixed32, sfixed32, float. + * Always 4 bytes with little-endian byte order. + */ + WireType[WireType["Bit32"] = 5] = "Bit32"; +})(WireType || (WireType = {})); +/** + * Maximum value for a 32-bit floating point value (Protobuf FLOAT). + */ +export const FLOAT32_MAX = 3.4028234663852886e38; +/** + * Minimum value for a 32-bit floating point value (Protobuf FLOAT). + */ +export const FLOAT32_MIN = -3.4028234663852886e38; +/** + * Maximum value for an unsigned 32-bit integer (Protobuf UINT32, FIXED32). + */ +export const UINT32_MAX = 0xffffffff; +/** + * Maximum value for a signed 32-bit integer (Protobuf INT32, SFIXED32, SINT32). + */ +export const INT32_MAX = 0x7fffffff; +/** + * Minimum value for a signed 32-bit integer (Protobuf INT32, SFIXED32, SINT32). + */ +export const INT32_MIN = -0x80000000; +export class BinaryWriter { + constructor(encodeUtf8 = getTextEncoding().encodeUtf8) { + this.encodeUtf8 = encodeUtf8; + /** + * Previous fork states. + */ + this.stack = []; + this.chunks = []; + this.buf = []; + } + /** + * Return all bytes written and reset this writer. + */ + finish() { + if (this.buf.length) { + this.chunks.push(new Uint8Array(this.buf)); // flush the buffer + this.buf = []; + } + let len = 0; + for (let i = 0; i < this.chunks.length; i++) + len += this.chunks[i].length; + let bytes = new Uint8Array(len); + let offset = 0; + for (let i = 0; i < this.chunks.length; i++) { + bytes.set(this.chunks[i], offset); + offset += this.chunks[i].length; + } + this.chunks = []; + return bytes; + } + /** + * Start a new fork for length-delimited data like a message + * or a packed repeated field. + * + * Must be joined later with `join()`. + */ + fork() { + this.stack.push({ chunks: this.chunks, buf: this.buf }); + this.chunks = []; + this.buf = []; + return this; + } + /** + * Join the last fork. Write its length and bytes, then + * return to the previous state. + */ + join() { + // get chunk of fork + let chunk = this.finish(); + // restore previous state + let prev = this.stack.pop(); + if (!prev) + throw new Error("invalid state, fork stack empty"); + this.chunks = prev.chunks; + this.buf = prev.buf; + // write length of chunk as varint + this.uint32(chunk.byteLength); + return this.raw(chunk); + } + /** + * Writes a tag (field number and wire type). + * + * Equivalent to `uint32( (fieldNo << 3 | type) >>> 0 )`. + * + * Generated code should compute the tag ahead of time and call `uint32()`. + */ + tag(fieldNo, type) { + return this.uint32(((fieldNo << 3) | type) >>> 0); + } + /** + * Write a chunk of raw bytes. + */ + raw(chunk) { + if (this.buf.length) { + this.chunks.push(new Uint8Array(this.buf)); + this.buf = []; + } + this.chunks.push(chunk); + return this; + } + /** + * Write a `uint32` value, an unsigned 32 bit varint. + */ + uint32(value) { + assertUInt32(value); + // write value as varint 32, inlined for speed + while (value > 0x7f) { + this.buf.push((value & 0x7f) | 0x80); + value = value >>> 7; + } + this.buf.push(value); + return this; + } + /** + * Write a `int32` value, a signed 32 bit varint. + */ + int32(value) { + assertInt32(value); + varint32write(value, this.buf); + return this; + } + /** + * Write a `bool` value, a varint. + */ + bool(value) { + this.buf.push(value ? 1 : 0); + return this; + } + /** + * Write a `bytes` value, length-delimited arbitrary data. + */ + bytes(value) { + this.uint32(value.byteLength); // write length of chunk as varint + return this.raw(value); + } + /** + * Write a `string` value, length-delimited data converted to UTF-8 text. + */ + string(value) { + let chunk = this.encodeUtf8(value); + this.uint32(chunk.byteLength); // write length of chunk as varint + return this.raw(chunk); + } + /** + * Write a `float` value, 32-bit floating point number. + */ + float(value) { + assertFloat32(value); + let chunk = new Uint8Array(4); + new DataView(chunk.buffer).setFloat32(0, value, true); + return this.raw(chunk); + } + /** + * Write a `double` value, a 64-bit floating point number. + */ + double(value) { + let chunk = new Uint8Array(8); + new DataView(chunk.buffer).setFloat64(0, value, true); + return this.raw(chunk); + } + /** + * Write a `fixed32` value, an unsigned, fixed-length 32-bit integer. + */ + fixed32(value) { + assertUInt32(value); + let chunk = new Uint8Array(4); + new DataView(chunk.buffer).setUint32(0, value, true); + return this.raw(chunk); + } + /** + * Write a `sfixed32` value, a signed, fixed-length 32-bit integer. + */ + sfixed32(value) { + assertInt32(value); + let chunk = new Uint8Array(4); + new DataView(chunk.buffer).setInt32(0, value, true); + return this.raw(chunk); + } + /** + * Write a `sint32` value, a signed, zigzag-encoded 32-bit varint. + */ + sint32(value) { + assertInt32(value); + // zigzag encode + value = ((value << 1) ^ (value >> 31)) >>> 0; + varint32write(value, this.buf); + return this; + } + /** + * Write a `sfixed64` value, a signed, fixed-length 64-bit integer. + */ + sfixed64(value) { + let chunk = new Uint8Array(8), view = new DataView(chunk.buffer), tc = protoInt64.enc(value); + view.setInt32(0, tc.lo, true); + view.setInt32(4, tc.hi, true); + return this.raw(chunk); + } + /** + * Write a `fixed64` value, an unsigned, fixed-length 64 bit integer. + */ + fixed64(value) { + let chunk = new Uint8Array(8), view = new DataView(chunk.buffer), tc = protoInt64.uEnc(value); + view.setInt32(0, tc.lo, true); + view.setInt32(4, tc.hi, true); + return this.raw(chunk); + } + /** + * Write a `int64` value, a signed 64-bit varint. + */ + int64(value) { + let tc = protoInt64.enc(value); + varint64write(tc.lo, tc.hi, this.buf); + return this; + } + /** + * Write a `sint64` value, a signed, zig-zag-encoded 64-bit varint. + */ + sint64(value) { + const tc = protoInt64.enc(value), + // zigzag encode + sign = tc.hi >> 31, lo = (tc.lo << 1) ^ sign, hi = ((tc.hi << 1) | (tc.lo >>> 31)) ^ sign; + varint64write(lo, hi, this.buf); + return this; + } + /** + * Write a `uint64` value, an unsigned 64-bit varint. + */ + uint64(value) { + const tc = protoInt64.uEnc(value); + varint64write(tc.lo, tc.hi, this.buf); + return this; + } +} +export class BinaryReader { + constructor(buf, decodeUtf8 = getTextEncoding().decodeUtf8) { + this.decodeUtf8 = decodeUtf8; + this.varint64 = varint64read; // dirty cast for `this` + /** + * Read a `uint32` field, an unsigned 32 bit varint. + */ + this.uint32 = varint32read; + this.buf = buf; + this.len = buf.length; + this.pos = 0; + this.view = new DataView(buf.buffer, buf.byteOffset, buf.byteLength); + } + /** + * Reads a tag - field number and wire type. Tags are uint32 varints; values + * that do not fit in uint32 are rejected. + */ + tag() { + const start = this.pos; + const tag = this.uint32(); + const bytesRead = this.pos - start; + if (bytesRead > 5 || (bytesRead == 5 && this.buf[this.pos - 1] > 0x0f)) { + throw new Error("illegal tag: varint overflows uint32"); + } + const fieldNo = tag >>> 3; + const wireType = tag & 7; + if (fieldNo <= 0 || wireType > 5) { + throw new Error("illegal tag: field no " + fieldNo + " wire type " + wireType); + } + return [fieldNo, wireType]; + } + /** + * Skip one element and return the skipped data. + * + * When skipping StartGroup, provide the tags field number to check for + * matching field number in the EndGroup tag. + */ + skip(wireType, fieldNo) { + let start = this.pos; + switch (wireType) { + case WireType.Varint: + while (this.buf[this.pos++] & 0x80) { + // ignore + } + break; + // @ts-ignore TS7029: Fallthrough case in switch -- ignore instead of expect-error for compiler settings without noFallthroughCasesInSwitch: true + case WireType.Bit64: + this.pos += 4; + case WireType.Bit32: + this.pos += 4; + break; + case WireType.LengthDelimited: + let len = this.uint32(); + this.pos += len; + break; + case WireType.StartGroup: + for (;;) { + const [fn, wt] = this.tag(); + if (wt === WireType.EndGroup) { + if (fieldNo !== undefined && fn !== fieldNo) { + throw new Error("invalid end group tag"); + } + break; + } + this.skip(wt, fn); + } + break; + default: + throw new Error("cant skip wire type " + wireType); + } + this.assertBounds(); + return this.buf.subarray(start, this.pos); + } + /** + * Throws error if position in byte array is out of range. + */ + assertBounds() { + if (this.pos > this.len) + throw new RangeError("premature EOF"); + } + /** + * Read a `int32` field, a signed 32 bit varint. + */ + int32() { + return this.uint32() | 0; + } + /** + * Read a `sint32` field, a signed, zigzag-encoded 32-bit varint. + */ + sint32() { + let zze = this.uint32(); + // decode zigzag + return (zze >>> 1) ^ -(zze & 1); + } + /** + * Read a `int64` field, a signed 64-bit varint. + */ + int64() { + return protoInt64.dec(...this.varint64()); + } + /** + * Read a `uint64` field, an unsigned 64-bit varint. + */ + uint64() { + return protoInt64.uDec(...this.varint64()); + } + /** + * Read a `sint64` field, a signed, zig-zag-encoded 64-bit varint. + */ + sint64() { + let [lo, hi] = this.varint64(); + // decode zig zag + let s = -(lo & 1); + lo = ((lo >>> 1) | ((hi & 1) << 31)) ^ s; + hi = (hi >>> 1) ^ s; + return protoInt64.dec(lo, hi); + } + /** + * Read a `bool` field, a variant. + */ + bool() { + let [lo, hi] = this.varint64(); + return lo !== 0 || hi !== 0; + } + /** + * Read a `fixed32` field, an unsigned, fixed-length 32-bit integer. + */ + fixed32() { + // biome-ignore lint/suspicious/noAssignInExpressions: no + return this.view.getUint32((this.pos += 4) - 4, true); + } + /** + * Read a `sfixed32` field, a signed, fixed-length 32-bit integer. + */ + sfixed32() { + // biome-ignore lint/suspicious/noAssignInExpressions: no + return this.view.getInt32((this.pos += 4) - 4, true); + } + /** + * Read a `fixed64` field, an unsigned, fixed-length 64 bit integer. + */ + fixed64() { + return protoInt64.uDec(this.sfixed32(), this.sfixed32()); + } + /** + * Read a `fixed64` field, a signed, fixed-length 64-bit integer. + */ + sfixed64() { + return protoInt64.dec(this.sfixed32(), this.sfixed32()); + } + /** + * Read a `float` field, 32-bit floating point number. + */ + float() { + // biome-ignore lint/suspicious/noAssignInExpressions: no + return this.view.getFloat32((this.pos += 4) - 4, true); + } + /** + * Read a `double` field, a 64-bit floating point number. + */ + double() { + // biome-ignore lint/suspicious/noAssignInExpressions: no + return this.view.getFloat64((this.pos += 8) - 8, true); + } + /** + * Read a `bytes` field, length-delimited arbitrary data. + */ + bytes() { + let len = this.uint32(), start = this.pos; + this.pos += len; + this.assertBounds(); + return this.buf.subarray(start, start + len); + } + /** + * Read a `string` field, length-delimited data converted to UTF-8 text. If + * `strict` is true, throw on invalid UTF-8 instead of substituting U+FFFD. + */ + string(strict) { + return this.decodeUtf8(this.bytes(), strict); + } +} +/** + * Assert a valid signed protobuf 32-bit integer as a number or string. + */ +function assertInt32(arg) { + if (typeof arg == "string") { + arg = Number(arg); + } + else if (typeof arg != "number") { + throw new Error("invalid int32: " + typeof arg); + } + if (!Number.isInteger(arg) || + arg > INT32_MAX || + arg < INT32_MIN) + throw new Error("invalid int32: " + arg); +} +/** + * Assert a valid unsigned protobuf 32-bit integer as a number or string. + */ +function assertUInt32(arg) { + if (typeof arg == "string") { + arg = Number(arg); + } + else if (typeof arg != "number") { + throw new Error("invalid uint32: " + typeof arg); + } + if (!Number.isInteger(arg) || + arg > UINT32_MAX || + arg < 0) + throw new Error("invalid uint32: " + arg); +} +/** + * Assert a valid protobuf float value as a number or string. + */ +function assertFloat32(arg) { + if (typeof arg == "string") { + const o = arg; + arg = Number(arg); + if (Number.isNaN(arg) && o !== "NaN") { + throw new Error("invalid float32: " + o); + } + } + else if (typeof arg != "number") { + throw new Error("invalid float32: " + typeof arg); + } + if (Number.isFinite(arg) && + (arg > FLOAT32_MAX || arg < FLOAT32_MIN)) + throw new Error("invalid float32: " + arg); +} diff --git a/node_modules/@bufbuild/protobuf/dist/esm/wire/index.d.ts b/node_modules/@bufbuild/protobuf/dist/esm/wire/index.d.ts new file mode 100644 index 0000000..8630d1f --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/wire/index.d.ts @@ -0,0 +1,5 @@ +export * from "./binary-encoding.js"; +export * from "./base64-encoding.js"; +export * from "./text-encoding.js"; +export * from "./text-format.js"; +export * from "./size-delimited.js"; diff --git a/node_modules/@bufbuild/protobuf/dist/esm/wire/index.js b/node_modules/@bufbuild/protobuf/dist/esm/wire/index.js new file mode 100644 index 0000000..73d5cfd --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/wire/index.js @@ -0,0 +1,18 @@ +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +export * from "./binary-encoding.js"; +export * from "./base64-encoding.js"; +export * from "./text-encoding.js"; +export * from "./text-format.js"; +export * from "./size-delimited.js"; diff --git a/node_modules/@bufbuild/protobuf/dist/esm/wire/size-delimited.d.ts b/node_modules/@bufbuild/protobuf/dist/esm/wire/size-delimited.d.ts new file mode 100644 index 0000000..0294989 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/wire/size-delimited.d.ts @@ -0,0 +1,51 @@ +import type { DescMessage } from "../descriptors.js"; +import type { BinaryWriteOptions } from "../to-binary.js"; +import type { MessageShape } from "../types.js"; +import type { BinaryReadOptions } from "../from-binary.js"; +/** + * Serialize a message, prefixing it with its size. + * + * A size-delimited message is a varint size in bytes, followed by exactly + * that many bytes of a message serialized with the binary format. + * + * This size-delimited format is compatible with other implementations. + * For details, see https://github.com/protocolbuffers/protobuf/issues/10229 + */ +export declare function sizeDelimitedEncode(messageDesc: Desc, message: MessageShape, options?: BinaryWriteOptions): Uint8Array; +/** + * Parse a stream of size-delimited messages. + * + * A size-delimited message is a varint size in bytes, followed by exactly + * that many bytes of a message serialized with the binary format. + * + * This size-delimited format is compatible with other implementations. + * For details, see https://github.com/protocolbuffers/protobuf/issues/10229 + */ +export declare function sizeDelimitedDecodeStream(messageDesc: Desc, iterable: AsyncIterable, options?: BinaryReadOptions): AsyncIterableIterator>; +/** + * Decodes the size from the given size-delimited message, which may be + * incomplete. + * + * Returns an object with the following properties: + * - size: The size of the delimited message in bytes + * - offset: The offset in the given byte array where the message starts + * - eof: true + * + * If the size-delimited data does not include all bytes of the varint size, + * the following object is returned: + * - size: null + * - offset: null + * - eof: false + * + * This function can be used to implement parsing of size-delimited messages + * from a stream. + */ +export declare function sizeDelimitedPeek(data: Uint8Array): { + readonly eof: false; + readonly size: number; + readonly offset: number; +} | { + readonly eof: true; + readonly size: null; + readonly offset: null; +}; diff --git a/node_modules/@bufbuild/protobuf/dist/esm/wire/size-delimited.js b/node_modules/@bufbuild/protobuf/dist/esm/wire/size-delimited.js new file mode 100644 index 0000000..88cfc23 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/wire/size-delimited.js @@ -0,0 +1,148 @@ +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +var __asyncValues = (this && this.__asyncValues) || function (o) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var m = o[Symbol.asyncIterator], i; + return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); + function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } + function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } +}; +var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); } +var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var g = generator.apply(thisArg, _arguments || []), i, q = []; + return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i; + function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; } + function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } + function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } +}; +import { toBinary } from "../to-binary.js"; +import { BinaryReader, BinaryWriter } from "./binary-encoding.js"; +import { fromBinary } from "../from-binary.js"; +/** + * Serialize a message, prefixing it with its size. + * + * A size-delimited message is a varint size in bytes, followed by exactly + * that many bytes of a message serialized with the binary format. + * + * This size-delimited format is compatible with other implementations. + * For details, see https://github.com/protocolbuffers/protobuf/issues/10229 + */ +export function sizeDelimitedEncode(messageDesc, message, options) { + const writer = new BinaryWriter(); + writer.bytes(toBinary(messageDesc, message, options)); + return writer.finish(); +} +/** + * Parse a stream of size-delimited messages. + * + * A size-delimited message is a varint size in bytes, followed by exactly + * that many bytes of a message serialized with the binary format. + * + * This size-delimited format is compatible with other implementations. + * For details, see https://github.com/protocolbuffers/protobuf/issues/10229 + */ +export function sizeDelimitedDecodeStream(messageDesc, iterable, options) { + return __asyncGenerator(this, arguments, function* sizeDelimitedDecodeStream_1() { + var _a, e_1, _b, _c; + // append chunk to buffer, returning updated buffer + function append(buffer, chunk) { + const n = new Uint8Array(buffer.byteLength + chunk.byteLength); + n.set(buffer); + n.set(chunk, buffer.length); + return n; + } + let buffer = new Uint8Array(0); + try { + for (var _d = true, iterable_1 = __asyncValues(iterable), iterable_1_1; iterable_1_1 = yield __await(iterable_1.next()), _a = iterable_1_1.done, !_a; _d = true) { + _c = iterable_1_1.value; + _d = false; + const chunk = _c; + buffer = append(buffer, chunk); + for (;;) { + const size = sizeDelimitedPeek(buffer); + if (size.eof) { + // size is incomplete, buffer more data + break; + } + if (size.offset + size.size > buffer.byteLength) { + // message is incomplete, buffer more data + break; + } + yield yield __await(fromBinary(messageDesc, buffer.subarray(size.offset, size.offset + size.size), options)); + buffer = buffer.subarray(size.offset + size.size); + } + } + } + catch (e_1_1) { e_1 = { error: e_1_1 }; } + finally { + try { + if (!_d && !_a && (_b = iterable_1.return)) yield __await(_b.call(iterable_1)); + } + finally { if (e_1) throw e_1.error; } + } + if (buffer.byteLength > 0) { + throw new Error("incomplete data"); + } + }); +} +/** + * Decodes the size from the given size-delimited message, which may be + * incomplete. + * + * Returns an object with the following properties: + * - size: The size of the delimited message in bytes + * - offset: The offset in the given byte array where the message starts + * - eof: true + * + * If the size-delimited data does not include all bytes of the varint size, + * the following object is returned: + * - size: null + * - offset: null + * - eof: false + * + * This function can be used to implement parsing of size-delimited messages + * from a stream. + */ +export function sizeDelimitedPeek(data) { + const sizeEof = { eof: true, size: null, offset: null }; + for (let i = 0; i < 10; i++) { + if (i > data.byteLength) { + return sizeEof; + } + if ((data[i] & 0x80) == 0) { + const reader = new BinaryReader(data); + let size; + try { + size = reader.uint32(); + } + catch (e) { + if (e instanceof RangeError) { + return sizeEof; + } + throw e; + } + return { + eof: false, + size, + offset: reader.pos, + }; + } + } + throw new Error("invalid varint"); +} diff --git a/node_modules/@bufbuild/protobuf/dist/esm/wire/text-encoding.d.ts b/node_modules/@bufbuild/protobuf/dist/esm/wire/text-encoding.d.ts new file mode 100644 index 0000000..947f046 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/wire/text-encoding.d.ts @@ -0,0 +1,28 @@ +interface TextEncoding { + /** + * Verify that the given text is valid UTF-8. + */ + checkUtf8: (text: string) => boolean; + /** + * Encode UTF-8 text to binary. + */ + encodeUtf8: (text: string) => Uint8Array; + /** + * Decode UTF-8 text from binary. If `strict` is true, throw on invalid byte + * sequences instead of silently substituting U+FFFD. Implementations that + * do not support strict decoding may ignore the flag. + */ + decodeUtf8: (bytes: Uint8Array, strict?: boolean) => string; +} +/** + * Protobuf-ES requires the Text Encoding API to convert UTF-8 from and to + * binary. This WHATWG API is widely available, but it is not part of the + * ECMAScript standard. On runtimes where it is not available, use this + * function to provide your own implementation. + * + * Note that the Text Encoding API does not provide a way to validate UTF-8. + * Our implementation falls back to use encodeURIComponent(). + */ +export declare function configureTextEncoding(textEncoding: TextEncoding): void; +export declare function getTextEncoding(): TextEncoding; +export {}; diff --git a/node_modules/@bufbuild/protobuf/dist/esm/wire/text-encoding.js b/node_modules/@bufbuild/protobuf/dist/esm/wire/text-encoding.js new file mode 100644 index 0000000..5ac7dd6 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/wire/text-encoding.js @@ -0,0 +1,57 @@ +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +const symbol = Symbol.for("@bufbuild/protobuf/text-encoding"); +/** + * Protobuf-ES requires the Text Encoding API to convert UTF-8 from and to + * binary. This WHATWG API is widely available, but it is not part of the + * ECMAScript standard. On runtimes where it is not available, use this + * function to provide your own implementation. + * + * Note that the Text Encoding API does not provide a way to validate UTF-8. + * Our implementation falls back to use encodeURIComponent(). + */ +export function configureTextEncoding(textEncoding) { + globalThis[symbol] = textEncoding; +} +export function getTextEncoding() { + if (globalThis[symbol] == undefined) { + const te = new globalThis.TextEncoder(); + const td = new globalThis.TextDecoder(); + let tdStrict; + globalThis[symbol] = { + encodeUtf8(text) { + return te.encode(text); + }, + decodeUtf8(bytes, strict) { + if (strict) { + if (tdStrict === undefined) { + tdStrict = new globalThis.TextDecoder("utf-8", { fatal: true }); + } + return tdStrict.decode(bytes); + } + return td.decode(bytes); + }, + checkUtf8(text) { + try { + encodeURIComponent(text); + return true; + } + catch (_) { + return false; + } + }, + }; + } + return globalThis[symbol]; +} diff --git a/node_modules/@bufbuild/protobuf/dist/esm/wire/text-format.d.ts b/node_modules/@bufbuild/protobuf/dist/esm/wire/text-format.d.ts new file mode 100644 index 0000000..06bdbdd --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/wire/text-format.d.ts @@ -0,0 +1,13 @@ +import { type DescEnum, ScalarType } from "../descriptors.js"; +/** + * Parse an enum value from the Protobuf text format. + * + * @private + */ +export declare function parseTextFormatEnumValue(descEnum: DescEnum, value: string): number; +/** + * Parse a scalar value from the Protobuf text format. + * + * @private + */ +export declare function parseTextFormatScalarValue(type: ScalarType, value: string): number | boolean | string | bigint | Uint8Array; diff --git a/node_modules/@bufbuild/protobuf/dist/esm/wire/text-format.js b/node_modules/@bufbuild/protobuf/dist/esm/wire/text-format.js new file mode 100644 index 0000000..7bb7d52 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/wire/text-format.js @@ -0,0 +1,195 @@ +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +import { ScalarType } from "../descriptors.js"; +import { protoInt64 } from "../proto-int64.js"; +/** + * Parse an enum value from the Protobuf text format. + * + * @private + */ +export function parseTextFormatEnumValue(descEnum, value) { + const enumValue = descEnum.values.find((v) => v.name === value); + if (!enumValue) { + throw new Error(`cannot parse ${descEnum} default value: ${value}`); + } + return enumValue.number; +} +/** + * Parse a scalar value from the Protobuf text format. + * + * @private + */ +export function parseTextFormatScalarValue(type, value) { + switch (type) { + case ScalarType.STRING: + return value; + case ScalarType.BYTES: { + const u = unescapeBytesDefaultValue(value); + if (u === false) { + throw new Error(`cannot parse ${ScalarType[type]} default value: ${value}`); + } + return u; + } + case ScalarType.INT64: + case ScalarType.SFIXED64: + case ScalarType.SINT64: + return protoInt64.parse(value); + case ScalarType.UINT64: + case ScalarType.FIXED64: + return protoInt64.uParse(value); + case ScalarType.DOUBLE: + case ScalarType.FLOAT: + switch (value) { + case "inf": + return Number.POSITIVE_INFINITY; + case "-inf": + return Number.NEGATIVE_INFINITY; + case "nan": + return Number.NaN; + default: + return parseFloat(value); + } + case ScalarType.BOOL: + return value === "true"; + case ScalarType.INT32: + case ScalarType.UINT32: + case ScalarType.SINT32: + case ScalarType.FIXED32: + case ScalarType.SFIXED32: + return parseInt(value, 10); + } +} +/** + * Parses a text-encoded default value (proto2) of a BYTES field. + */ +function unescapeBytesDefaultValue(str) { + const b = []; + const input = { + tail: str, + c: "", + next() { + if (this.tail.length == 0) { + return false; + } + this.c = this.tail[0]; + this.tail = this.tail.substring(1); + return true; + }, + take(n) { + if (this.tail.length >= n) { + const r = this.tail.substring(0, n); + this.tail = this.tail.substring(n); + return r; + } + return false; + }, + }; + while (input.next()) { + switch (input.c) { + case "\\": + if (input.next()) { + switch (input.c) { + case "\\": + b.push(input.c.charCodeAt(0)); + break; + case "b": + b.push(0x08); + break; + case "f": + b.push(0x0c); + break; + case "n": + b.push(0x0a); + break; + case "r": + b.push(0x0d); + break; + case "t": + b.push(0x09); + break; + case "v": + b.push(0x0b); + break; + case "0": + case "1": + case "2": + case "3": + case "4": + case "5": + case "6": + case "7": { + const s = input.c; + const t = input.take(2); + if (t === false) { + return false; + } + const n = parseInt(s + t, 8); + if (Number.isNaN(n)) { + return false; + } + b.push(n); + break; + } + case "x": { + const s = input.c; + const t = input.take(2); + if (t === false) { + return false; + } + const n = parseInt(s + t, 16); + if (Number.isNaN(n)) { + return false; + } + b.push(n); + break; + } + case "u": { + const s = input.c; + const t = input.take(4); + if (t === false) { + return false; + } + const n = parseInt(s + t, 16); + if (Number.isNaN(n)) { + return false; + } + const chunk = new Uint8Array(4); + const view = new DataView(chunk.buffer); + view.setInt32(0, n, true); + b.push(chunk[0], chunk[1], chunk[2], chunk[3]); + break; + } + case "U": { + const s = input.c; + const t = input.take(8); + if (t === false) { + return false; + } + const tc = protoInt64.uEnc(s + t); + const chunk = new Uint8Array(8); + const view = new DataView(chunk.buffer); + view.setInt32(0, tc.lo, true); + view.setInt32(4, tc.hi, true); + b.push(chunk[0], chunk[1], chunk[2], chunk[3], chunk[4], chunk[5], chunk[6], chunk[7]); + break; + } + } + } + break; + default: + b.push(input.c.charCodeAt(0)); + } + } + return new Uint8Array(b); +} diff --git a/node_modules/@bufbuild/protobuf/dist/esm/wire/varint.d.ts b/node_modules/@bufbuild/protobuf/dist/esm/wire/varint.d.ts new file mode 100644 index 0000000..b45ef94 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/wire/varint.d.ts @@ -0,0 +1,70 @@ +/** + * Read a 64 bit varint as two JS numbers. + * + * Returns tuple: + * [0]: low bits + * [1]: high bits + * + * Copyright 2008 Google Inc. All rights reserved. + * + * See https://github.com/protocolbuffers/protobuf/blob/8a71927d74a4ce34efe2d8769fda198f52d20d12/js/experimental/runtime/kernel/buffer_decoder.js#L175 + */ +export declare function varint64read(this: T): [number, number]; +/** + * Write a 64 bit varint, given as two JS numbers, to the given bytes array. + * + * Copyright 2008 Google Inc. All rights reserved. + * + * See https://github.com/protocolbuffers/protobuf/blob/8a71927d74a4ce34efe2d8769fda198f52d20d12/js/experimental/runtime/kernel/writer.js#L344 + */ +export declare function varint64write(lo: number, hi: number, bytes: number[]): void; +/** + * Parse decimal string of 64 bit integer value as two JS numbers. + * + * Copyright 2008 Google Inc. All rights reserved. + * + * See https://github.com/protocolbuffers/protobuf-javascript/blob/a428c58273abad07c66071d9753bc4d1289de426/experimental/runtime/int64.js#L10 + */ +export declare function int64FromString(dec: string): { + lo: number; + hi: number; +}; +/** + * Losslessly converts a 64-bit signed integer in 32:32 split representation + * into a decimal string. + * + * Copyright 2008 Google Inc. All rights reserved. + * + * See https://github.com/protocolbuffers/protobuf-javascript/blob/a428c58273abad07c66071d9753bc4d1289de426/experimental/runtime/int64.js#L10 + */ +export declare function int64ToString(lo: number, hi: number): string; +/** + * Losslessly converts a 64-bit unsigned integer in 32:32 split representation + * into a decimal string. + * + * Copyright 2008 Google Inc. All rights reserved. + * + * See https://github.com/protocolbuffers/protobuf-javascript/blob/a428c58273abad07c66071d9753bc4d1289de426/experimental/runtime/int64.js#L10 + */ +export declare function uInt64ToString(lo: number, hi: number): string; +/** + * Write a 32 bit varint, signed or unsigned. Same as `varint64write(0, value, bytes)` + * + * Copyright 2008 Google Inc. All rights reserved. + * + * See https://github.com/protocolbuffers/protobuf/blob/1b18833f4f2a2f681f4e4a25cdf3b0a43115ec26/js/binary/encoder.js#L144 + */ +export declare function varint32write(value: number, bytes: number[]): void; +/** + * Read an unsigned 32 bit varint. + * + * See https://github.com/protocolbuffers/protobuf/blob/8a71927d74a4ce34efe2d8769fda198f52d20d12/js/experimental/runtime/kernel/buffer_decoder.js#L220 + */ +export declare function varint32read(this: T): number; +type ReaderLike = { + buf: Uint8Array; + pos: number; + len: number; + assertBounds(): void; +}; +export {}; diff --git a/node_modules/@bufbuild/protobuf/dist/esm/wire/varint.js b/node_modules/@bufbuild/protobuf/dist/esm/wire/varint.js new file mode 100644 index 0000000..a333bc8 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/wire/varint.js @@ -0,0 +1,313 @@ +// Copyright 2008 Google Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Code generated by the Protocol Buffer compiler is owned by the owner +// of the input file used when generating it. This code is not +// standalone and requires a support library to be linked with it. This +// support library is itself covered by the above license. +/** + * Read a 64 bit varint as two JS numbers. + * + * Returns tuple: + * [0]: low bits + * [1]: high bits + * + * Copyright 2008 Google Inc. All rights reserved. + * + * See https://github.com/protocolbuffers/protobuf/blob/8a71927d74a4ce34efe2d8769fda198f52d20d12/js/experimental/runtime/kernel/buffer_decoder.js#L175 + */ +export function varint64read() { + let lowBits = 0; + let highBits = 0; + for (let shift = 0; shift < 28; shift += 7) { + let b = this.buf[this.pos++]; + lowBits |= (b & 0x7f) << shift; + if ((b & 0x80) == 0) { + this.assertBounds(); + return [lowBits, highBits]; + } + } + let middleByte = this.buf[this.pos++]; + // last four bits of the first 32 bit number + lowBits |= (middleByte & 0x0f) << 28; + // 3 upper bits are part of the next 32 bit number + highBits = (middleByte & 0x70) >> 4; + if ((middleByte & 0x80) == 0) { + this.assertBounds(); + return [lowBits, highBits]; + } + for (let shift = 3; shift <= 31; shift += 7) { + let b = this.buf[this.pos++]; + highBits |= (b & 0x7f) << shift; + if ((b & 0x80) == 0) { + this.assertBounds(); + return [lowBits, highBits]; + } + } + throw new Error("invalid varint"); +} +/** + * Write a 64 bit varint, given as two JS numbers, to the given bytes array. + * + * Copyright 2008 Google Inc. All rights reserved. + * + * See https://github.com/protocolbuffers/protobuf/blob/8a71927d74a4ce34efe2d8769fda198f52d20d12/js/experimental/runtime/kernel/writer.js#L344 + */ +export function varint64write(lo, hi, bytes) { + for (let i = 0; i < 28; i = i + 7) { + const shift = lo >>> i; + const hasNext = !(shift >>> 7 == 0 && hi == 0); + const byte = (hasNext ? shift | 0x80 : shift) & 0xff; + bytes.push(byte); + if (!hasNext) { + return; + } + } + const splitBits = ((lo >>> 28) & 0x0f) | ((hi & 0x07) << 4); + const hasMoreBits = !(hi >> 3 == 0); + bytes.push((hasMoreBits ? splitBits | 0x80 : splitBits) & 0xff); + if (!hasMoreBits) { + return; + } + for (let i = 3; i < 31; i = i + 7) { + const shift = hi >>> i; + const hasNext = !(shift >>> 7 == 0); + const byte = (hasNext ? shift | 0x80 : shift) & 0xff; + bytes.push(byte); + if (!hasNext) { + return; + } + } + bytes.push((hi >>> 31) & 0x01); +} +// constants for binary math +const TWO_PWR_32_DBL = 0x100000000; +/** + * Parse decimal string of 64 bit integer value as two JS numbers. + * + * Copyright 2008 Google Inc. All rights reserved. + * + * See https://github.com/protocolbuffers/protobuf-javascript/blob/a428c58273abad07c66071d9753bc4d1289de426/experimental/runtime/int64.js#L10 + */ +export function int64FromString(dec) { + // Check for minus sign. + const minus = dec[0] === "-"; + if (minus) { + dec = dec.slice(1); + } + // Work 6 decimal digits at a time, acting like we're converting base 1e6 + // digits to binary. This is safe to do with floating point math because + // Number.isSafeInteger(ALL_32_BITS * 1e6) == true. + const base = 1e6; + let lowBits = 0; + let highBits = 0; + function add1e6digit(begin, end) { + // Note: Number('') is 0. + const digit1e6 = Number(dec.slice(begin, end)); + highBits *= base; + lowBits = lowBits * base + digit1e6; + // Carry bits from lowBits to + if (lowBits >= TWO_PWR_32_DBL) { + highBits = highBits + ((lowBits / TWO_PWR_32_DBL) | 0); + lowBits = lowBits % TWO_PWR_32_DBL; + } + } + add1e6digit(-24, -18); + add1e6digit(-18, -12); + add1e6digit(-12, -6); + add1e6digit(-6); + return minus ? negate(lowBits, highBits) : newBits(lowBits, highBits); +} +/** + * Losslessly converts a 64-bit signed integer in 32:32 split representation + * into a decimal string. + * + * Copyright 2008 Google Inc. All rights reserved. + * + * See https://github.com/protocolbuffers/protobuf-javascript/blob/a428c58273abad07c66071d9753bc4d1289de426/experimental/runtime/int64.js#L10 + */ +export function int64ToString(lo, hi) { + let bits = newBits(lo, hi); + // If we're treating the input as a signed value and the high bit is set, do + // a manual two's complement conversion before the decimal conversion. + const negative = bits.hi & 0x80000000; + if (negative) { + bits = negate(bits.lo, bits.hi); + } + const result = uInt64ToString(bits.lo, bits.hi); + return negative ? "-" + result : result; +} +/** + * Losslessly converts a 64-bit unsigned integer in 32:32 split representation + * into a decimal string. + * + * Copyright 2008 Google Inc. All rights reserved. + * + * See https://github.com/protocolbuffers/protobuf-javascript/blob/a428c58273abad07c66071d9753bc4d1289de426/experimental/runtime/int64.js#L10 + */ +export function uInt64ToString(lo, hi) { + ({ lo, hi } = toUnsigned(lo, hi)); + // Skip the expensive conversion if the number is small enough to use the + // built-in conversions. + // Number.MAX_SAFE_INTEGER = 0x001FFFFF FFFFFFFF, thus any number with + // highBits <= 0x1FFFFF can be safely expressed with a double and retain + // integer precision. + // Proven by: Number.isSafeInteger(0x1FFFFF * 2**32 + 0xFFFFFFFF) == true. + if (hi <= 0x1fffff) { + return String(TWO_PWR_32_DBL * hi + lo); + } + // What this code is doing is essentially converting the input number from + // base-2 to base-1e7, which allows us to represent the 64-bit range with + // only 3 (very large) digits. Those digits are then trivial to convert to + // a base-10 string. + // The magic numbers used here are - + // 2^24 = 16777216 = (1,6777216) in base-1e7. + // 2^48 = 281474976710656 = (2,8147497,6710656) in base-1e7. + // Split 32:32 representation into 16:24:24 representation so our + // intermediate digits don't overflow. + const low = lo & 0xffffff; + const mid = ((lo >>> 24) | (hi << 8)) & 0xffffff; + const high = (hi >> 16) & 0xffff; + // Assemble our three base-1e7 digits, ignoring carries. The maximum + // value in a digit at this step is representable as a 48-bit integer, which + // can be stored in a 64-bit floating point number. + let digitA = low + mid * 6777216 + high * 6710656; + let digitB = mid + high * 8147497; + let digitC = high * 2; + // Apply carries from A to B and from B to C. + const base = 10000000; + if (digitA >= base) { + digitB += Math.floor(digitA / base); + digitA %= base; + } + if (digitB >= base) { + digitC += Math.floor(digitB / base); + digitB %= base; + } + // If digitC is 0, then we should have returned in the trivial code path + // at the top for non-safe integers. Given this, we can assume both digitB + // and digitA need leading zeros. + return (digitC.toString() + + decimalFrom1e7WithLeadingZeros(digitB) + + decimalFrom1e7WithLeadingZeros(digitA)); +} +function toUnsigned(lo, hi) { + return { lo: lo >>> 0, hi: hi >>> 0 }; +} +function newBits(lo, hi) { + return { lo: lo | 0, hi: hi | 0 }; +} +/** + * Returns two's compliment negation of input. + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Bitwise_Operators#Signed_32-bit_integers + */ +function negate(lowBits, highBits) { + highBits = ~highBits; + if (lowBits) { + lowBits = ~lowBits + 1; + } + else { + // If lowBits is 0, then bitwise-not is 0xFFFFFFFF, + // adding 1 to that, results in 0x100000000, which leaves + // the low bits 0x0 and simply adds one to the high bits. + highBits += 1; + } + return newBits(lowBits, highBits); +} +/** + * Returns decimal representation of digit1e7 with leading zeros. + */ +const decimalFrom1e7WithLeadingZeros = (digit1e7) => { + const partial = String(digit1e7); + return "0000000".slice(partial.length) + partial; +}; +/** + * Write a 32 bit varint, signed or unsigned. Same as `varint64write(0, value, bytes)` + * + * Copyright 2008 Google Inc. All rights reserved. + * + * See https://github.com/protocolbuffers/protobuf/blob/1b18833f4f2a2f681f4e4a25cdf3b0a43115ec26/js/binary/encoder.js#L144 + */ +export function varint32write(value, bytes) { + if (value >= 0) { + // write value as varint 32 + while (value > 0x7f) { + bytes.push((value & 0x7f) | 0x80); + value = value >>> 7; + } + bytes.push(value); + } + else { + for (let i = 0; i < 9; i++) { + bytes.push((value & 127) | 128); + value = value >> 7; + } + bytes.push(1); + } +} +/** + * Read an unsigned 32 bit varint. + * + * See https://github.com/protocolbuffers/protobuf/blob/8a71927d74a4ce34efe2d8769fda198f52d20d12/js/experimental/runtime/kernel/buffer_decoder.js#L220 + */ +export function varint32read() { + let b = this.buf[this.pos++]; + let result = b & 0x7f; + if ((b & 0x80) == 0) { + this.assertBounds(); + return result; + } + b = this.buf[this.pos++]; + result |= (b & 0x7f) << 7; + if ((b & 0x80) == 0) { + this.assertBounds(); + return result; + } + b = this.buf[this.pos++]; + result |= (b & 0x7f) << 14; + if ((b & 0x80) == 0) { + this.assertBounds(); + return result; + } + b = this.buf[this.pos++]; + result |= (b & 0x7f) << 21; + if ((b & 0x80) == 0) { + this.assertBounds(); + return result; + } + // Extract only last 4 bits + b = this.buf[this.pos++]; + result |= (b & 0x0f) << 28; + for (let readBytes = 5; (b & 0x80) !== 0 && readBytes < 10; readBytes++) + b = this.buf[this.pos++]; + if ((b & 0x80) != 0) + throw new Error("invalid varint"); + this.assertBounds(); + // Result can have 32 bits, convert it to unsigned + return result >>> 0; +} diff --git a/node_modules/@bufbuild/protobuf/dist/esm/wkt/any.d.ts b/node_modules/@bufbuild/protobuf/dist/esm/wkt/any.d.ts new file mode 100644 index 0000000..5d41781 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/wkt/any.d.ts @@ -0,0 +1,38 @@ +import type { Message, MessageShape } from "../types.js"; +import type { Any } from "./gen/google/protobuf/any_pb.js"; +import type { DescMessage } from "../descriptors.js"; +import type { Registry } from "../registry.js"; +/** + * Creates a `google.protobuf.Any` from a message. + */ +export declare function anyPack(schema: Desc, message: MessageShape): Any; +/** + * Packs the message into the given any. + */ +export declare function anyPack(schema: Desc, message: MessageShape, into: Any): void; +/** + * Returns true if the Any contains the type given by schema. + */ +export declare function anyIs(any: Any, schema: DescMessage): boolean; +/** + * Returns true if the Any contains a message with the given typeName. + */ +export declare function anyIs(any: Any, typeName: string): boolean; +/** + * Unpacks the message the Any represents. + * + * Returns undefined if the Any is empty, or if packed type is not included + * in the given registry. + */ +export declare function anyUnpack(any: Any, registry: Registry): Message | undefined; +/** + * Unpacks the message the Any represents. + * + * Returns undefined if the Any is empty, or if it does not contain the type + * given by schema. + */ +export declare function anyUnpack(any: Any, schema: Desc): MessageShape | undefined; +/** + * Same as anyUnpack but unpacks into the target message. + */ +export declare function anyUnpackTo(any: Any, schema: Desc, message: MessageShape): MessageShape | undefined; diff --git a/node_modules/@bufbuild/protobuf/dist/esm/wkt/any.js b/node_modules/@bufbuild/protobuf/dist/esm/wkt/any.js new file mode 100644 index 0000000..175bc9a --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/wkt/any.js @@ -0,0 +1,69 @@ +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +import { AnySchema } from "./gen/google/protobuf/any_pb.js"; +import { create } from "../create.js"; +import { toBinary } from "../to-binary.js"; +import { fromBinary, mergeFromBinary } from "../from-binary.js"; +export function anyPack(schema, message, into) { + let ret = false; + if (!into) { + into = create(AnySchema); + ret = true; + } + into.value = toBinary(schema, message); + into.typeUrl = typeNameToUrl(message.$typeName); + return ret ? into : undefined; +} +export function anyIs(any, descOrTypeName) { + if (any.typeUrl === "") { + return false; + } + const want = typeof descOrTypeName == "string" + ? descOrTypeName + : descOrTypeName.typeName; + const got = typeUrlToName(any.typeUrl); + return want === got; +} +export function anyUnpack(any, registryOrMessageDesc) { + if (any.typeUrl === "") { + return undefined; + } + const desc = registryOrMessageDesc.kind == "message" + ? registryOrMessageDesc + : registryOrMessageDesc.getMessage(typeUrlToName(any.typeUrl)); + if (!desc || !anyIs(any, desc)) { + return undefined; + } + return fromBinary(desc, any.value); +} +/** + * Same as anyUnpack but unpacks into the target message. + */ +export function anyUnpackTo(any, schema, message) { + if (!anyIs(any, schema)) { + return undefined; + } + return mergeFromBinary(schema, message, any.value); +} +function typeNameToUrl(name) { + return `type.googleapis.com/${name}`; +} +function typeUrlToName(url) { + const slash = url.lastIndexOf("/"); + const name = slash >= 0 ? url.substring(slash + 1) : url; + if (!name.length) { + throw new Error(`invalid type url: ${url}`); + } + return name; +} diff --git a/node_modules/@bufbuild/protobuf/dist/esm/wkt/duration.d.ts b/node_modules/@bufbuild/protobuf/dist/esm/wkt/duration.d.ts new file mode 100644 index 0000000..4605342 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/wkt/duration.d.ts @@ -0,0 +1,9 @@ +import type { Duration } from "./gen/google/protobuf/duration_pb.js"; +/** + * Create a google.protobuf.Duration message from a Unix timestamp in milliseconds. + */ +export declare function durationFromMs(durationMs: number): Duration; +/** + * Convert a google.protobuf.Duration to a Unix timestamp in milliseconds. + */ +export declare function durationMs(duration: Duration): number; diff --git a/node_modules/@bufbuild/protobuf/dist/esm/wkt/duration.js b/node_modules/@bufbuild/protobuf/dist/esm/wkt/duration.js new file mode 100644 index 0000000..e61a5e5 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/wkt/duration.js @@ -0,0 +1,35 @@ +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +import { DurationSchema } from "./gen/google/protobuf/duration_pb.js"; +import { create } from "../create.js"; +import { protoInt64 } from "../proto-int64.js"; +/** + * Create a google.protobuf.Duration message from a Unix timestamp in milliseconds. + */ +export function durationFromMs(durationMs) { + const sign = durationMs < 0 ? -1 : 1; + const absDurationMs = Math.abs(durationMs); + const absSeconds = Math.floor(absDurationMs / 1000); + const absNanos = (absDurationMs - absSeconds * 1000) * 1000000; + return create(DurationSchema, { + seconds: protoInt64.parse(absSeconds * sign), + nanos: absNanos === 0 ? 0 : absNanos * sign, // deliberately avoid signed 0 - it does not serialize + }); +} +/** + * Convert a google.protobuf.Duration to a Unix timestamp in milliseconds. + */ +export function durationMs(duration) { + return Number(duration.seconds) * 1000 + Math.round(duration.nanos / 1000000); +} diff --git a/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/any_pb.d.ts b/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/any_pb.d.ts new file mode 100644 index 0000000..a61678f --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/any_pb.d.ts @@ -0,0 +1,238 @@ +import type { GenFile, GenMessage } from "../../../../codegenv2/types.js"; +import type { Message } from "../../../../types.js"; +/** + * Describes the file google/protobuf/any.proto. + */ +export declare const file_google_protobuf_any: GenFile; +/** + * `Any` contains an arbitrary serialized protocol buffer message along with a + * URL that describes the type of the serialized message. + * + * Protobuf library provides support to pack/unpack Any values in the form + * of utility functions or additional generated methods of the Any type. + * + * Example 1: Pack and unpack a message in C++. + * + * Foo foo = ...; + * Any any; + * any.PackFrom(foo); + * ... + * if (any.UnpackTo(&foo)) { + * ... + * } + * + * Example 2: Pack and unpack a message in Java. + * + * Foo foo = ...; + * Any any = Any.pack(foo); + * ... + * if (any.is(Foo.class)) { + * foo = any.unpack(Foo.class); + * } + * // or ... + * if (any.isSameTypeAs(Foo.getDefaultInstance())) { + * foo = any.unpack(Foo.getDefaultInstance()); + * } + * + * Example 3: Pack and unpack a message in Python. + * + * foo = Foo(...) + * any = Any() + * any.Pack(foo) + * ... + * if any.Is(Foo.DESCRIPTOR): + * any.Unpack(foo) + * ... + * + * Example 4: Pack and unpack a message in Go + * + * foo := &pb.Foo{...} + * any, err := anypb.New(foo) + * if err != nil { + * ... + * } + * ... + * foo := &pb.Foo{} + * if err := any.UnmarshalTo(foo); err != nil { + * ... + * } + * + * The pack methods provided by protobuf library will by default use + * 'type.googleapis.com/full.type.name' as the type URL and the unpack + * methods only use the fully qualified type name after the last '/' + * in the type URL, for example "foo.bar.com/x/y.z" will yield type + * name "y.z". + * + * JSON + * ==== + * The JSON representation of an `Any` value uses the regular + * representation of the deserialized, embedded message, with an + * additional field `@type` which contains the type URL. Example: + * + * package google.profile; + * message Person { + * string first_name = 1; + * string last_name = 2; + * } + * + * { + * "@type": "type.googleapis.com/google.profile.Person", + * "firstName": , + * "lastName": + * } + * + * If the embedded message type is well-known and has a custom JSON + * representation, that representation will be embedded adding a field + * `value` which holds the custom JSON in addition to the `@type` + * field. Example (for message [google.protobuf.Duration][]): + * + * { + * "@type": "type.googleapis.com/google.protobuf.Duration", + * "value": "1.212s" + * } + * + * + * @generated from message google.protobuf.Any + */ +export type Any = Message<"google.protobuf.Any"> & { + /** + * A URL/resource name that uniquely identifies the type of the serialized + * protocol buffer message. This string must contain at least + * one "/" character. The last segment of the URL's path must represent + * the fully qualified name of the type (as in + * `path/google.protobuf.Duration`). The name should be in a canonical form + * (e.g., leading "." is not accepted). + * + * In practice, teams usually precompile into the binary all types that they + * expect it to use in the context of Any. However, for URLs which use the + * scheme `http`, `https`, or no scheme, one can optionally set up a type + * server that maps type URLs to message definitions as follows: + * + * * If no scheme is provided, `https` is assumed. + * * An HTTP GET on the URL must yield a [google.protobuf.Type][] + * value in binary format, or produce an error. + * * Applications are allowed to cache lookup results based on the + * URL, or have them precompiled into a binary to avoid any + * lookup. Therefore, binary compatibility needs to be preserved + * on changes to types. (Use versioned type names to manage + * breaking changes.) + * + * Note: this functionality is not currently available in the official + * protobuf release, and it is not used for type URLs beginning with + * type.googleapis.com. As of May 2023, there are no widely used type server + * implementations and no plans to implement one. + * + * Schemes other than `http`, `https` (or the empty scheme) might be + * used with implementation specific semantics. + * + * + * @generated from field: string type_url = 1; + */ + typeUrl: string; + /** + * Must be a valid serialized protocol buffer of the above specified type. + * + * @generated from field: bytes value = 2; + */ + value: Uint8Array; +}; +/** + * `Any` contains an arbitrary serialized protocol buffer message along with a + * URL that describes the type of the serialized message. + * + * Protobuf library provides support to pack/unpack Any values in the form + * of utility functions or additional generated methods of the Any type. + * + * Example 1: Pack and unpack a message in C++. + * + * Foo foo = ...; + * Any any; + * any.PackFrom(foo); + * ... + * if (any.UnpackTo(&foo)) { + * ... + * } + * + * Example 2: Pack and unpack a message in Java. + * + * Foo foo = ...; + * Any any = Any.pack(foo); + * ... + * if (any.is(Foo.class)) { + * foo = any.unpack(Foo.class); + * } + * // or ... + * if (any.isSameTypeAs(Foo.getDefaultInstance())) { + * foo = any.unpack(Foo.getDefaultInstance()); + * } + * + * Example 3: Pack and unpack a message in Python. + * + * foo = Foo(...) + * any = Any() + * any.Pack(foo) + * ... + * if any.Is(Foo.DESCRIPTOR): + * any.Unpack(foo) + * ... + * + * Example 4: Pack and unpack a message in Go + * + * foo := &pb.Foo{...} + * any, err := anypb.New(foo) + * if err != nil { + * ... + * } + * ... + * foo := &pb.Foo{} + * if err := any.UnmarshalTo(foo); err != nil { + * ... + * } + * + * The pack methods provided by protobuf library will by default use + * 'type.googleapis.com/full.type.name' as the type URL and the unpack + * methods only use the fully qualified type name after the last '/' + * in the type URL, for example "foo.bar.com/x/y.z" will yield type + * name "y.z". + * + * JSON + * ==== + * The JSON representation of an `Any` value uses the regular + * representation of the deserialized, embedded message, with an + * additional field `@type` which contains the type URL. Example: + * + * package google.profile; + * message Person { + * string first_name = 1; + * string last_name = 2; + * } + * + * { + * "@type": "type.googleapis.com/google.profile.Person", + * "firstName": , + * "lastName": + * } + * + * If the embedded message type is well-known and has a custom JSON + * representation, that representation will be embedded adding a field + * `value` which holds the custom JSON in addition to the `@type` + * field. Example (for message [google.protobuf.Duration][]): + * + * { + * "@type": "type.googleapis.com/google.protobuf.Duration", + * "value": "1.212s" + * } + * + * + * @generated from message google.protobuf.Any + */ +export type AnyJson = { + "@type"?: string; +}; +/** + * Describes the message google.protobuf.Any. + * Use `create(AnySchema)` to create a new message. + */ +export declare const AnySchema: GenMessage; diff --git a/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/any_pb.js b/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/any_pb.js new file mode 100644 index 0000000..7aaa19e --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/any_pb.js @@ -0,0 +1,24 @@ +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +import { fileDesc } from "../../../../codegenv2/file.js"; +import { messageDesc } from "../../../../codegenv2/message.js"; +/** + * Describes the file google/protobuf/any.proto. + */ +export const file_google_protobuf_any = /*@__PURE__*/ fileDesc("Chlnb29nbGUvcHJvdG9idWYvYW55LnByb3RvEg9nb29nbGUucHJvdG9idWYiJgoDQW55EhAKCHR5cGVfdXJsGAEgASgJEg0KBXZhbHVlGAIgASgMQnYKE2NvbS5nb29nbGUucHJvdG9idWZCCEFueVByb3RvUAFaLGdvb2dsZS5nb2xhbmcub3JnL3Byb3RvYnVmL3R5cGVzL2tub3duL2FueXBiogIDR1BCqgIeR29vZ2xlLlByb3RvYnVmLldlbGxLbm93blR5cGVzYgZwcm90bzM"); +/** + * Describes the message google.protobuf.Any. + * Use `create(AnySchema)` to create a new message. + */ +export const AnySchema = /*@__PURE__*/ messageDesc(file_google_protobuf_any, 0); diff --git a/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/api_pb.d.ts b/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/api_pb.d.ts new file mode 100644 index 0000000..4269e32 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/api_pb.d.ts @@ -0,0 +1,537 @@ +import type { GenFile, GenMessage } from "../../../../codegenv2/types.js"; +import type { SourceContext, SourceContextJson } from "./source_context_pb.js"; +import type { Option, OptionJson, Syntax, SyntaxJson } from "./type_pb.js"; +import type { Message } from "../../../../types.js"; +/** + * Describes the file google/protobuf/api.proto. + */ +export declare const file_google_protobuf_api: GenFile; +/** + * Api is a light-weight descriptor for an API Interface. + * + * Interfaces are also described as "protocol buffer services" in some contexts, + * such as by the "service" keyword in a .proto file, but they are different + * from API Services, which represent a concrete implementation of an interface + * as opposed to simply a description of methods and bindings. They are also + * sometimes simply referred to as "APIs" in other contexts, such as the name of + * this message itself. See https://cloud.google.com/apis/design/glossary for + * detailed terminology. + * + * New usages of this message as an alternative to ServiceDescriptorProto are + * strongly discouraged. This message does not reliability preserve all + * information necessary to model the schema and preserve semantics. Instead + * make use of FileDescriptorSet which preserves the necessary information. + * + * @generated from message google.protobuf.Api + */ +export type Api = Message<"google.protobuf.Api"> & { + /** + * The fully qualified name of this interface, including package name + * followed by the interface's simple name. + * + * @generated from field: string name = 1; + */ + name: string; + /** + * The methods of this interface, in unspecified order. + * + * @generated from field: repeated google.protobuf.Method methods = 2; + */ + methods: Method[]; + /** + * Any metadata attached to the interface. + * + * @generated from field: repeated google.protobuf.Option options = 3; + */ + options: Option[]; + /** + * A version string for this interface. If specified, must have the form + * `major-version.minor-version`, as in `1.10`. If the minor version is + * omitted, it defaults to zero. If the entire version field is empty, the + * major version is derived from the package name, as outlined below. If the + * field is not empty, the version in the package name will be verified to be + * consistent with what is provided here. + * + * The versioning schema uses [semantic + * versioning](http://semver.org) where the major version number + * indicates a breaking change and the minor version an additive, + * non-breaking change. Both version numbers are signals to users + * what to expect from different versions, and should be carefully + * chosen based on the product plan. + * + * The major version is also reflected in the package name of the + * interface, which must end in `v`, as in + * `google.feature.v1`. For major versions 0 and 1, the suffix can + * be omitted. Zero major versions must only be used for + * experimental, non-GA interfaces. + * + * + * @generated from field: string version = 4; + */ + version: string; + /** + * Source context for the protocol buffer service represented by this + * message. + * + * @generated from field: google.protobuf.SourceContext source_context = 5; + */ + sourceContext?: SourceContext | undefined; + /** + * Included interfaces. See [Mixin][]. + * + * @generated from field: repeated google.protobuf.Mixin mixins = 6; + */ + mixins: Mixin[]; + /** + * The source syntax of the service. + * + * @generated from field: google.protobuf.Syntax syntax = 7; + */ + syntax: Syntax; + /** + * The source edition string, only valid when syntax is SYNTAX_EDITIONS. + * + * @generated from field: string edition = 8; + */ + edition: string; +}; +/** + * Api is a light-weight descriptor for an API Interface. + * + * Interfaces are also described as "protocol buffer services" in some contexts, + * such as by the "service" keyword in a .proto file, but they are different + * from API Services, which represent a concrete implementation of an interface + * as opposed to simply a description of methods and bindings. They are also + * sometimes simply referred to as "APIs" in other contexts, such as the name of + * this message itself. See https://cloud.google.com/apis/design/glossary for + * detailed terminology. + * + * New usages of this message as an alternative to ServiceDescriptorProto are + * strongly discouraged. This message does not reliability preserve all + * information necessary to model the schema and preserve semantics. Instead + * make use of FileDescriptorSet which preserves the necessary information. + * + * @generated from message google.protobuf.Api + */ +export type ApiJson = { + /** + * The fully qualified name of this interface, including package name + * followed by the interface's simple name. + * + * @generated from field: string name = 1; + */ + name?: string; + /** + * The methods of this interface, in unspecified order. + * + * @generated from field: repeated google.protobuf.Method methods = 2; + */ + methods?: MethodJson[]; + /** + * Any metadata attached to the interface. + * + * @generated from field: repeated google.protobuf.Option options = 3; + */ + options?: OptionJson[]; + /** + * A version string for this interface. If specified, must have the form + * `major-version.minor-version`, as in `1.10`. If the minor version is + * omitted, it defaults to zero. If the entire version field is empty, the + * major version is derived from the package name, as outlined below. If the + * field is not empty, the version in the package name will be verified to be + * consistent with what is provided here. + * + * The versioning schema uses [semantic + * versioning](http://semver.org) where the major version number + * indicates a breaking change and the minor version an additive, + * non-breaking change. Both version numbers are signals to users + * what to expect from different versions, and should be carefully + * chosen based on the product plan. + * + * The major version is also reflected in the package name of the + * interface, which must end in `v`, as in + * `google.feature.v1`. For major versions 0 and 1, the suffix can + * be omitted. Zero major versions must only be used for + * experimental, non-GA interfaces. + * + * + * @generated from field: string version = 4; + */ + version?: string; + /** + * Source context for the protocol buffer service represented by this + * message. + * + * @generated from field: google.protobuf.SourceContext source_context = 5; + */ + sourceContext?: SourceContextJson; + /** + * Included interfaces. See [Mixin][]. + * + * @generated from field: repeated google.protobuf.Mixin mixins = 6; + */ + mixins?: MixinJson[]; + /** + * The source syntax of the service. + * + * @generated from field: google.protobuf.Syntax syntax = 7; + */ + syntax?: SyntaxJson; + /** + * The source edition string, only valid when syntax is SYNTAX_EDITIONS. + * + * @generated from field: string edition = 8; + */ + edition?: string; +}; +/** + * Describes the message google.protobuf.Api. + * Use `create(ApiSchema)` to create a new message. + */ +export declare const ApiSchema: GenMessage; +/** + * Method represents a method of an API interface. + * + * New usages of this message as an alternative to MethodDescriptorProto are + * strongly discouraged. This message does not reliability preserve all + * information necessary to model the schema and preserve semantics. Instead + * make use of FileDescriptorSet which preserves the necessary information. + * + * @generated from message google.protobuf.Method + */ +export type Method = Message<"google.protobuf.Method"> & { + /** + * The simple name of this method. + * + * @generated from field: string name = 1; + */ + name: string; + /** + * A URL of the input message type. + * + * @generated from field: string request_type_url = 2; + */ + requestTypeUrl: string; + /** + * If true, the request is streamed. + * + * @generated from field: bool request_streaming = 3; + */ + requestStreaming: boolean; + /** + * The URL of the output message type. + * + * @generated from field: string response_type_url = 4; + */ + responseTypeUrl: string; + /** + * If true, the response is streamed. + * + * @generated from field: bool response_streaming = 5; + */ + responseStreaming: boolean; + /** + * Any metadata attached to the method. + * + * @generated from field: repeated google.protobuf.Option options = 6; + */ + options: Option[]; + /** + * The source syntax of this method. + * + * This field should be ignored, instead the syntax should be inherited from + * Api. This is similar to Field and EnumValue. + * + * @generated from field: google.protobuf.Syntax syntax = 7 [deprecated = true]; + * @deprecated + */ + syntax: Syntax; + /** + * The source edition string, only valid when syntax is SYNTAX_EDITIONS. + * + * This field should be ignored, instead the edition should be inherited from + * Api. This is similar to Field and EnumValue. + * + * @generated from field: string edition = 8 [deprecated = true]; + * @deprecated + */ + edition: string; +}; +/** + * Method represents a method of an API interface. + * + * New usages of this message as an alternative to MethodDescriptorProto are + * strongly discouraged. This message does not reliability preserve all + * information necessary to model the schema and preserve semantics. Instead + * make use of FileDescriptorSet which preserves the necessary information. + * + * @generated from message google.protobuf.Method + */ +export type MethodJson = { + /** + * The simple name of this method. + * + * @generated from field: string name = 1; + */ + name?: string; + /** + * A URL of the input message type. + * + * @generated from field: string request_type_url = 2; + */ + requestTypeUrl?: string; + /** + * If true, the request is streamed. + * + * @generated from field: bool request_streaming = 3; + */ + requestStreaming?: boolean; + /** + * The URL of the output message type. + * + * @generated from field: string response_type_url = 4; + */ + responseTypeUrl?: string; + /** + * If true, the response is streamed. + * + * @generated from field: bool response_streaming = 5; + */ + responseStreaming?: boolean; + /** + * Any metadata attached to the method. + * + * @generated from field: repeated google.protobuf.Option options = 6; + */ + options?: OptionJson[]; + /** + * The source syntax of this method. + * + * This field should be ignored, instead the syntax should be inherited from + * Api. This is similar to Field and EnumValue. + * + * @generated from field: google.protobuf.Syntax syntax = 7 [deprecated = true]; + * @deprecated + */ + syntax?: SyntaxJson; + /** + * The source edition string, only valid when syntax is SYNTAX_EDITIONS. + * + * This field should be ignored, instead the edition should be inherited from + * Api. This is similar to Field and EnumValue. + * + * @generated from field: string edition = 8 [deprecated = true]; + * @deprecated + */ + edition?: string; +}; +/** + * Describes the message google.protobuf.Method. + * Use `create(MethodSchema)` to create a new message. + */ +export declare const MethodSchema: GenMessage; +/** + * Declares an API Interface to be included in this interface. The including + * interface must redeclare all the methods from the included interface, but + * documentation and options are inherited as follows: + * + * - If after comment and whitespace stripping, the documentation + * string of the redeclared method is empty, it will be inherited + * from the original method. + * + * - Each annotation belonging to the service config (http, + * visibility) which is not set in the redeclared method will be + * inherited. + * + * - If an http annotation is inherited, the path pattern will be + * modified as follows. Any version prefix will be replaced by the + * version of the including interface plus the [root][] path if + * specified. + * + * Example of a simple mixin: + * + * package google.acl.v1; + * service AccessControl { + * // Get the underlying ACL object. + * rpc GetAcl(GetAclRequest) returns (Acl) { + * option (google.api.http).get = "/v1/{resource=**}:getAcl"; + * } + * } + * + * package google.storage.v2; + * service Storage { + * rpc GetAcl(GetAclRequest) returns (Acl); + * + * // Get a data record. + * rpc GetData(GetDataRequest) returns (Data) { + * option (google.api.http).get = "/v2/{resource=**}"; + * } + * } + * + * Example of a mixin configuration: + * + * apis: + * - name: google.storage.v2.Storage + * mixins: + * - name: google.acl.v1.AccessControl + * + * The mixin construct implies that all methods in `AccessControl` are + * also declared with same name and request/response types in + * `Storage`. A documentation generator or annotation processor will + * see the effective `Storage.GetAcl` method after inheriting + * documentation and annotations as follows: + * + * service Storage { + * // Get the underlying ACL object. + * rpc GetAcl(GetAclRequest) returns (Acl) { + * option (google.api.http).get = "/v2/{resource=**}:getAcl"; + * } + * ... + * } + * + * Note how the version in the path pattern changed from `v1` to `v2`. + * + * If the `root` field in the mixin is specified, it should be a + * relative path under which inherited HTTP paths are placed. Example: + * + * apis: + * - name: google.storage.v2.Storage + * mixins: + * - name: google.acl.v1.AccessControl + * root: acls + * + * This implies the following inherited HTTP annotation: + * + * service Storage { + * // Get the underlying ACL object. + * rpc GetAcl(GetAclRequest) returns (Acl) { + * option (google.api.http).get = "/v2/acls/{resource=**}:getAcl"; + * } + * ... + * } + * + * @generated from message google.protobuf.Mixin + */ +export type Mixin = Message<"google.protobuf.Mixin"> & { + /** + * The fully qualified name of the interface which is included. + * + * @generated from field: string name = 1; + */ + name: string; + /** + * If non-empty specifies a path under which inherited HTTP paths + * are rooted. + * + * @generated from field: string root = 2; + */ + root: string; +}; +/** + * Declares an API Interface to be included in this interface. The including + * interface must redeclare all the methods from the included interface, but + * documentation and options are inherited as follows: + * + * - If after comment and whitespace stripping, the documentation + * string of the redeclared method is empty, it will be inherited + * from the original method. + * + * - Each annotation belonging to the service config (http, + * visibility) which is not set in the redeclared method will be + * inherited. + * + * - If an http annotation is inherited, the path pattern will be + * modified as follows. Any version prefix will be replaced by the + * version of the including interface plus the [root][] path if + * specified. + * + * Example of a simple mixin: + * + * package google.acl.v1; + * service AccessControl { + * // Get the underlying ACL object. + * rpc GetAcl(GetAclRequest) returns (Acl) { + * option (google.api.http).get = "/v1/{resource=**}:getAcl"; + * } + * } + * + * package google.storage.v2; + * service Storage { + * rpc GetAcl(GetAclRequest) returns (Acl); + * + * // Get a data record. + * rpc GetData(GetDataRequest) returns (Data) { + * option (google.api.http).get = "/v2/{resource=**}"; + * } + * } + * + * Example of a mixin configuration: + * + * apis: + * - name: google.storage.v2.Storage + * mixins: + * - name: google.acl.v1.AccessControl + * + * The mixin construct implies that all methods in `AccessControl` are + * also declared with same name and request/response types in + * `Storage`. A documentation generator or annotation processor will + * see the effective `Storage.GetAcl` method after inheriting + * documentation and annotations as follows: + * + * service Storage { + * // Get the underlying ACL object. + * rpc GetAcl(GetAclRequest) returns (Acl) { + * option (google.api.http).get = "/v2/{resource=**}:getAcl"; + * } + * ... + * } + * + * Note how the version in the path pattern changed from `v1` to `v2`. + * + * If the `root` field in the mixin is specified, it should be a + * relative path under which inherited HTTP paths are placed. Example: + * + * apis: + * - name: google.storage.v2.Storage + * mixins: + * - name: google.acl.v1.AccessControl + * root: acls + * + * This implies the following inherited HTTP annotation: + * + * service Storage { + * // Get the underlying ACL object. + * rpc GetAcl(GetAclRequest) returns (Acl) { + * option (google.api.http).get = "/v2/acls/{resource=**}:getAcl"; + * } + * ... + * } + * + * @generated from message google.protobuf.Mixin + */ +export type MixinJson = { + /** + * The fully qualified name of the interface which is included. + * + * @generated from field: string name = 1; + */ + name?: string; + /** + * If non-empty specifies a path under which inherited HTTP paths + * are rooted. + * + * @generated from field: string root = 2; + */ + root?: string; +}; +/** + * Describes the message google.protobuf.Mixin. + * Use `create(MixinSchema)` to create a new message. + */ +export declare const MixinSchema: GenMessage; diff --git a/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/api_pb.js b/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/api_pb.js new file mode 100644 index 0000000..4924ea8 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/api_pb.js @@ -0,0 +1,36 @@ +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +import { fileDesc } from "../../../../codegenv2/file.js"; +import { file_google_protobuf_source_context } from "./source_context_pb.js"; +import { file_google_protobuf_type } from "./type_pb.js"; +import { messageDesc } from "../../../../codegenv2/message.js"; +/** + * Describes the file google/protobuf/api.proto. + */ +export const file_google_protobuf_api = /*@__PURE__*/ fileDesc("Chlnb29nbGUvcHJvdG9idWYvYXBpLnByb3RvEg9nb29nbGUucHJvdG9idWYikgIKA0FwaRIMCgRuYW1lGAEgASgJEigKB21ldGhvZHMYAiADKAsyFy5nb29nbGUucHJvdG9idWYuTWV0aG9kEigKB29wdGlvbnMYAyADKAsyFy5nb29nbGUucHJvdG9idWYuT3B0aW9uEg8KB3ZlcnNpb24YBCABKAkSNgoOc291cmNlX2NvbnRleHQYBSABKAsyHi5nb29nbGUucHJvdG9idWYuU291cmNlQ29udGV4dBImCgZtaXhpbnMYBiADKAsyFi5nb29nbGUucHJvdG9idWYuTWl4aW4SJwoGc3ludGF4GAcgASgOMhcuZ29vZ2xlLnByb3RvYnVmLlN5bnRheBIPCgdlZGl0aW9uGAggASgJIu4BCgZNZXRob2QSDAoEbmFtZRgBIAEoCRIYChByZXF1ZXN0X3R5cGVfdXJsGAIgASgJEhkKEXJlcXVlc3Rfc3RyZWFtaW5nGAMgASgIEhkKEXJlc3BvbnNlX3R5cGVfdXJsGAQgASgJEhoKEnJlc3BvbnNlX3N0cmVhbWluZxgFIAEoCBIoCgdvcHRpb25zGAYgAygLMhcuZ29vZ2xlLnByb3RvYnVmLk9wdGlvbhIrCgZzeW50YXgYByABKA4yFy5nb29nbGUucHJvdG9idWYuU3ludGF4QgIYARITCgdlZGl0aW9uGAggASgJQgIYASIjCgVNaXhpbhIMCgRuYW1lGAEgASgJEgwKBHJvb3QYAiABKAlCdgoTY29tLmdvb2dsZS5wcm90b2J1ZkIIQXBpUHJvdG9QAVosZ29vZ2xlLmdvbGFuZy5vcmcvcHJvdG9idWYvdHlwZXMva25vd24vYXBpcGKiAgNHUEKqAh5Hb29nbGUuUHJvdG9idWYuV2VsbEtub3duVHlwZXNiBnByb3RvMw", [file_google_protobuf_source_context, file_google_protobuf_type]); +/** + * Describes the message google.protobuf.Api. + * Use `create(ApiSchema)` to create a new message. + */ +export const ApiSchema = /*@__PURE__*/ messageDesc(file_google_protobuf_api, 0); +/** + * Describes the message google.protobuf.Method. + * Use `create(MethodSchema)` to create a new message. + */ +export const MethodSchema = /*@__PURE__*/ messageDesc(file_google_protobuf_api, 1); +/** + * Describes the message google.protobuf.Mixin. + * Use `create(MixinSchema)` to create a new message. + */ +export const MixinSchema = /*@__PURE__*/ messageDesc(file_google_protobuf_api, 2); diff --git a/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/compiler/plugin_pb.d.ts b/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/compiler/plugin_pb.d.ts new file mode 100644 index 0000000..843cde5 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/compiler/plugin_pb.d.ts @@ -0,0 +1,490 @@ +import type { GenEnum, GenFile, GenMessage } from "../../../../../codegenv2/types.js"; +import type { FileDescriptorProto, FileDescriptorProtoJson, GeneratedCodeInfo, GeneratedCodeInfoJson } from "../descriptor_pb.js"; +import type { Message } from "../../../../../types.js"; +/** + * Describes the file google/protobuf/compiler/plugin.proto. + */ +export declare const file_google_protobuf_compiler_plugin: GenFile; +/** + * The version number of protocol compiler. + * + * @generated from message google.protobuf.compiler.Version + */ +export type Version = Message<"google.protobuf.compiler.Version"> & { + /** + * @generated from field: optional int32 major = 1; + */ + major: number; + /** + * @generated from field: optional int32 minor = 2; + */ + minor: number; + /** + * @generated from field: optional int32 patch = 3; + */ + patch: number; + /** + * A suffix for alpha, beta or rc release, e.g., "alpha-1", "rc2". It should + * be empty for mainline stable releases. + * + * @generated from field: optional string suffix = 4; + */ + suffix: string; +}; +/** + * The version number of protocol compiler. + * + * @generated from message google.protobuf.compiler.Version + */ +export type VersionJson = { + /** + * @generated from field: optional int32 major = 1; + */ + major?: number; + /** + * @generated from field: optional int32 minor = 2; + */ + minor?: number; + /** + * @generated from field: optional int32 patch = 3; + */ + patch?: number; + /** + * A suffix for alpha, beta or rc release, e.g., "alpha-1", "rc2". It should + * be empty for mainline stable releases. + * + * @generated from field: optional string suffix = 4; + */ + suffix?: string; +}; +/** + * Describes the message google.protobuf.compiler.Version. + * Use `create(VersionSchema)` to create a new message. + */ +export declare const VersionSchema: GenMessage; +/** + * An encoded CodeGeneratorRequest is written to the plugin's stdin. + * + * @generated from message google.protobuf.compiler.CodeGeneratorRequest + */ +export type CodeGeneratorRequest = Message<"google.protobuf.compiler.CodeGeneratorRequest"> & { + /** + * The .proto files that were explicitly listed on the command-line. The + * code generator should generate code only for these files. Each file's + * descriptor will be included in proto_file, below. + * + * @generated from field: repeated string file_to_generate = 1; + */ + fileToGenerate: string[]; + /** + * The generator parameter passed on the command-line. + * + * @generated from field: optional string parameter = 2; + */ + parameter: string; + /** + * FileDescriptorProtos for all files in files_to_generate and everything + * they import. The files will appear in topological order, so each file + * appears before any file that imports it. + * + * Note: the files listed in files_to_generate will include runtime-retention + * options only, but all other files will include source-retention options. + * The source_file_descriptors field below is available in case you need + * source-retention options for files_to_generate. + * + * protoc guarantees that all proto_files will be written after + * the fields above, even though this is not technically guaranteed by the + * protobuf wire format. This theoretically could allow a plugin to stream + * in the FileDescriptorProtos and handle them one by one rather than read + * the entire set into memory at once. However, as of this writing, this + * is not similarly optimized on protoc's end -- it will store all fields in + * memory at once before sending them to the plugin. + * + * Type names of fields and extensions in the FileDescriptorProto are always + * fully qualified. + * + * @generated from field: repeated google.protobuf.FileDescriptorProto proto_file = 15; + */ + protoFile: FileDescriptorProto[]; + /** + * File descriptors with all options, including source-retention options. + * These descriptors are only provided for the files listed in + * files_to_generate. + * + * @generated from field: repeated google.protobuf.FileDescriptorProto source_file_descriptors = 17; + */ + sourceFileDescriptors: FileDescriptorProto[]; + /** + * The version number of protocol compiler. + * + * @generated from field: optional google.protobuf.compiler.Version compiler_version = 3; + */ + compilerVersion?: Version | undefined; +}; +/** + * An encoded CodeGeneratorRequest is written to the plugin's stdin. + * + * @generated from message google.protobuf.compiler.CodeGeneratorRequest + */ +export type CodeGeneratorRequestJson = { + /** + * The .proto files that were explicitly listed on the command-line. The + * code generator should generate code only for these files. Each file's + * descriptor will be included in proto_file, below. + * + * @generated from field: repeated string file_to_generate = 1; + */ + fileToGenerate?: string[]; + /** + * The generator parameter passed on the command-line. + * + * @generated from field: optional string parameter = 2; + */ + parameter?: string; + /** + * FileDescriptorProtos for all files in files_to_generate and everything + * they import. The files will appear in topological order, so each file + * appears before any file that imports it. + * + * Note: the files listed in files_to_generate will include runtime-retention + * options only, but all other files will include source-retention options. + * The source_file_descriptors field below is available in case you need + * source-retention options for files_to_generate. + * + * protoc guarantees that all proto_files will be written after + * the fields above, even though this is not technically guaranteed by the + * protobuf wire format. This theoretically could allow a plugin to stream + * in the FileDescriptorProtos and handle them one by one rather than read + * the entire set into memory at once. However, as of this writing, this + * is not similarly optimized on protoc's end -- it will store all fields in + * memory at once before sending them to the plugin. + * + * Type names of fields and extensions in the FileDescriptorProto are always + * fully qualified. + * + * @generated from field: repeated google.protobuf.FileDescriptorProto proto_file = 15; + */ + protoFile?: FileDescriptorProtoJson[]; + /** + * File descriptors with all options, including source-retention options. + * These descriptors are only provided for the files listed in + * files_to_generate. + * + * @generated from field: repeated google.protobuf.FileDescriptorProto source_file_descriptors = 17; + */ + sourceFileDescriptors?: FileDescriptorProtoJson[]; + /** + * The version number of protocol compiler. + * + * @generated from field: optional google.protobuf.compiler.Version compiler_version = 3; + */ + compilerVersion?: VersionJson; +}; +/** + * Describes the message google.protobuf.compiler.CodeGeneratorRequest. + * Use `create(CodeGeneratorRequestSchema)` to create a new message. + */ +export declare const CodeGeneratorRequestSchema: GenMessage; +/** + * The plugin writes an encoded CodeGeneratorResponse to stdout. + * + * @generated from message google.protobuf.compiler.CodeGeneratorResponse + */ +export type CodeGeneratorResponse = Message<"google.protobuf.compiler.CodeGeneratorResponse"> & { + /** + * Error message. If non-empty, code generation failed. The plugin process + * should exit with status code zero even if it reports an error in this way. + * + * This should be used to indicate errors in .proto files which prevent the + * code generator from generating correct code. Errors which indicate a + * problem in protoc itself -- such as the input CodeGeneratorRequest being + * unparseable -- should be reported by writing a message to stderr and + * exiting with a non-zero status code. + * + * @generated from field: optional string error = 1; + */ + error: string; + /** + * A bitmask of supported features that the code generator supports. + * This is a bitwise "or" of values from the Feature enum. + * + * @generated from field: optional uint64 supported_features = 2; + */ + supportedFeatures: bigint; + /** + * The minimum edition this plugin supports. This will be treated as an + * Edition enum, but we want to allow unknown values. It should be specified + * according the edition enum value, *not* the edition number. Only takes + * effect for plugins that have FEATURE_SUPPORTS_EDITIONS set. + * + * @generated from field: optional int32 minimum_edition = 3; + */ + minimumEdition: number; + /** + * The maximum edition this plugin supports. This will be treated as an + * Edition enum, but we want to allow unknown values. It should be specified + * according the edition enum value, *not* the edition number. Only takes + * effect for plugins that have FEATURE_SUPPORTS_EDITIONS set. + * + * @generated from field: optional int32 maximum_edition = 4; + */ + maximumEdition: number; + /** + * @generated from field: repeated google.protobuf.compiler.CodeGeneratorResponse.File file = 15; + */ + file: CodeGeneratorResponse_File[]; +}; +/** + * The plugin writes an encoded CodeGeneratorResponse to stdout. + * + * @generated from message google.protobuf.compiler.CodeGeneratorResponse + */ +export type CodeGeneratorResponseJson = { + /** + * Error message. If non-empty, code generation failed. The plugin process + * should exit with status code zero even if it reports an error in this way. + * + * This should be used to indicate errors in .proto files which prevent the + * code generator from generating correct code. Errors which indicate a + * problem in protoc itself -- such as the input CodeGeneratorRequest being + * unparseable -- should be reported by writing a message to stderr and + * exiting with a non-zero status code. + * + * @generated from field: optional string error = 1; + */ + error?: string; + /** + * A bitmask of supported features that the code generator supports. + * This is a bitwise "or" of values from the Feature enum. + * + * @generated from field: optional uint64 supported_features = 2; + */ + supportedFeatures?: string; + /** + * The minimum edition this plugin supports. This will be treated as an + * Edition enum, but we want to allow unknown values. It should be specified + * according the edition enum value, *not* the edition number. Only takes + * effect for plugins that have FEATURE_SUPPORTS_EDITIONS set. + * + * @generated from field: optional int32 minimum_edition = 3; + */ + minimumEdition?: number; + /** + * The maximum edition this plugin supports. This will be treated as an + * Edition enum, but we want to allow unknown values. It should be specified + * according the edition enum value, *not* the edition number. Only takes + * effect for plugins that have FEATURE_SUPPORTS_EDITIONS set. + * + * @generated from field: optional int32 maximum_edition = 4; + */ + maximumEdition?: number; + /** + * @generated from field: repeated google.protobuf.compiler.CodeGeneratorResponse.File file = 15; + */ + file?: CodeGeneratorResponse_FileJson[]; +}; +/** + * Describes the message google.protobuf.compiler.CodeGeneratorResponse. + * Use `create(CodeGeneratorResponseSchema)` to create a new message. + */ +export declare const CodeGeneratorResponseSchema: GenMessage; +/** + * Represents a single generated file. + * + * @generated from message google.protobuf.compiler.CodeGeneratorResponse.File + */ +export type CodeGeneratorResponse_File = Message<"google.protobuf.compiler.CodeGeneratorResponse.File"> & { + /** + * The file name, relative to the output directory. The name must not + * contain "." or ".." components and must be relative, not be absolute (so, + * the file cannot lie outside the output directory). "/" must be used as + * the path separator, not "\". + * + * If the name is omitted, the content will be appended to the previous + * file. This allows the generator to break large files into small chunks, + * and allows the generated text to be streamed back to protoc so that large + * files need not reside completely in memory at one time. Note that as of + * this writing protoc does not optimize for this -- it will read the entire + * CodeGeneratorResponse before writing files to disk. + * + * @generated from field: optional string name = 1; + */ + name: string; + /** + * If non-empty, indicates that the named file should already exist, and the + * content here is to be inserted into that file at a defined insertion + * point. This feature allows a code generator to extend the output + * produced by another code generator. The original generator may provide + * insertion points by placing special annotations in the file that look + * like: + * @@protoc_insertion_point(NAME) + * The annotation can have arbitrary text before and after it on the line, + * which allows it to be placed in a comment. NAME should be replaced with + * an identifier naming the point -- this is what other generators will use + * as the insertion_point. Code inserted at this point will be placed + * immediately above the line containing the insertion point (thus multiple + * insertions to the same point will come out in the order they were added). + * The double-@ is intended to make it unlikely that the generated code + * could contain things that look like insertion points by accident. + * + * For example, the C++ code generator places the following line in the + * .pb.h files that it generates: + * // @@protoc_insertion_point(namespace_scope) + * This line appears within the scope of the file's package namespace, but + * outside of any particular class. Another plugin can then specify the + * insertion_point "namespace_scope" to generate additional classes or + * other declarations that should be placed in this scope. + * + * Note that if the line containing the insertion point begins with + * whitespace, the same whitespace will be added to every line of the + * inserted text. This is useful for languages like Python, where + * indentation matters. In these languages, the insertion point comment + * should be indented the same amount as any inserted code will need to be + * in order to work correctly in that context. + * + * The code generator that generates the initial file and the one which + * inserts into it must both run as part of a single invocation of protoc. + * Code generators are executed in the order in which they appear on the + * command line. + * + * If |insertion_point| is present, |name| must also be present. + * + * @generated from field: optional string insertion_point = 2; + */ + insertionPoint: string; + /** + * The file contents. + * + * @generated from field: optional string content = 15; + */ + content: string; + /** + * Information describing the file content being inserted. If an insertion + * point is used, this information will be appropriately offset and inserted + * into the code generation metadata for the generated files. + * + * @generated from field: optional google.protobuf.GeneratedCodeInfo generated_code_info = 16; + */ + generatedCodeInfo?: GeneratedCodeInfo | undefined; +}; +/** + * Represents a single generated file. + * + * @generated from message google.protobuf.compiler.CodeGeneratorResponse.File + */ +export type CodeGeneratorResponse_FileJson = { + /** + * The file name, relative to the output directory. The name must not + * contain "." or ".." components and must be relative, not be absolute (so, + * the file cannot lie outside the output directory). "/" must be used as + * the path separator, not "\". + * + * If the name is omitted, the content will be appended to the previous + * file. This allows the generator to break large files into small chunks, + * and allows the generated text to be streamed back to protoc so that large + * files need not reside completely in memory at one time. Note that as of + * this writing protoc does not optimize for this -- it will read the entire + * CodeGeneratorResponse before writing files to disk. + * + * @generated from field: optional string name = 1; + */ + name?: string; + /** + * If non-empty, indicates that the named file should already exist, and the + * content here is to be inserted into that file at a defined insertion + * point. This feature allows a code generator to extend the output + * produced by another code generator. The original generator may provide + * insertion points by placing special annotations in the file that look + * like: + * @@protoc_insertion_point(NAME) + * The annotation can have arbitrary text before and after it on the line, + * which allows it to be placed in a comment. NAME should be replaced with + * an identifier naming the point -- this is what other generators will use + * as the insertion_point. Code inserted at this point will be placed + * immediately above the line containing the insertion point (thus multiple + * insertions to the same point will come out in the order they were added). + * The double-@ is intended to make it unlikely that the generated code + * could contain things that look like insertion points by accident. + * + * For example, the C++ code generator places the following line in the + * .pb.h files that it generates: + * // @@protoc_insertion_point(namespace_scope) + * This line appears within the scope of the file's package namespace, but + * outside of any particular class. Another plugin can then specify the + * insertion_point "namespace_scope" to generate additional classes or + * other declarations that should be placed in this scope. + * + * Note that if the line containing the insertion point begins with + * whitespace, the same whitespace will be added to every line of the + * inserted text. This is useful for languages like Python, where + * indentation matters. In these languages, the insertion point comment + * should be indented the same amount as any inserted code will need to be + * in order to work correctly in that context. + * + * The code generator that generates the initial file and the one which + * inserts into it must both run as part of a single invocation of protoc. + * Code generators are executed in the order in which they appear on the + * command line. + * + * If |insertion_point| is present, |name| must also be present. + * + * @generated from field: optional string insertion_point = 2; + */ + insertionPoint?: string; + /** + * The file contents. + * + * @generated from field: optional string content = 15; + */ + content?: string; + /** + * Information describing the file content being inserted. If an insertion + * point is used, this information will be appropriately offset and inserted + * into the code generation metadata for the generated files. + * + * @generated from field: optional google.protobuf.GeneratedCodeInfo generated_code_info = 16; + */ + generatedCodeInfo?: GeneratedCodeInfoJson; +}; +/** + * Describes the message google.protobuf.compiler.CodeGeneratorResponse.File. + * Use `create(CodeGeneratorResponse_FileSchema)` to create a new message. + */ +export declare const CodeGeneratorResponse_FileSchema: GenMessage; +/** + * Sync with code_generator.h. + * + * @generated from enum google.protobuf.compiler.CodeGeneratorResponse.Feature + */ +export declare enum CodeGeneratorResponse_Feature { + /** + * @generated from enum value: FEATURE_NONE = 0; + */ + NONE = 0, + /** + * @generated from enum value: FEATURE_PROTO3_OPTIONAL = 1; + */ + PROTO3_OPTIONAL = 1, + /** + * @generated from enum value: FEATURE_SUPPORTS_EDITIONS = 2; + */ + SUPPORTS_EDITIONS = 2 +} +/** + * Sync with code_generator.h. + * + * @generated from enum google.protobuf.compiler.CodeGeneratorResponse.Feature + */ +export type CodeGeneratorResponse_FeatureJson = "FEATURE_NONE" | "FEATURE_PROTO3_OPTIONAL" | "FEATURE_SUPPORTS_EDITIONS"; +/** + * Describes the enum google.protobuf.compiler.CodeGeneratorResponse.Feature. + */ +export declare const CodeGeneratorResponse_FeatureSchema: GenEnum; diff --git a/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/compiler/plugin_pb.js b/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/compiler/plugin_pb.js new file mode 100644 index 0000000..e61f108 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/compiler/plugin_pb.js @@ -0,0 +1,65 @@ +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +import { fileDesc } from "../../../../../codegenv2/file.js"; +import { file_google_protobuf_descriptor } from "../descriptor_pb.js"; +import { messageDesc } from "../../../../../codegenv2/message.js"; +import { enumDesc } from "../../../../../codegenv2/enum.js"; +/** + * Describes the file google/protobuf/compiler/plugin.proto. + */ +export const file_google_protobuf_compiler_plugin = /*@__PURE__*/ fileDesc("CiVnb29nbGUvcHJvdG9idWYvY29tcGlsZXIvcGx1Z2luLnByb3RvEhhnb29nbGUucHJvdG9idWYuY29tcGlsZXIiRgoHVmVyc2lvbhINCgVtYWpvchgBIAEoBRINCgVtaW5vchgCIAEoBRINCgVwYXRjaBgDIAEoBRIOCgZzdWZmaXgYBCABKAkigQIKFENvZGVHZW5lcmF0b3JSZXF1ZXN0EhgKEGZpbGVfdG9fZ2VuZXJhdGUYASADKAkSEQoJcGFyYW1ldGVyGAIgASgJEjgKCnByb3RvX2ZpbGUYDyADKAsyJC5nb29nbGUucHJvdG9idWYuRmlsZURlc2NyaXB0b3JQcm90bxJFChdzb3VyY2VfZmlsZV9kZXNjcmlwdG9ycxgRIAMoCzIkLmdvb2dsZS5wcm90b2J1Zi5GaWxlRGVzY3JpcHRvclByb3RvEjsKEGNvbXBpbGVyX3ZlcnNpb24YAyABKAsyIS5nb29nbGUucHJvdG9idWYuY29tcGlsZXIuVmVyc2lvbiKSAwoVQ29kZUdlbmVyYXRvclJlc3BvbnNlEg0KBWVycm9yGAEgASgJEhoKEnN1cHBvcnRlZF9mZWF0dXJlcxgCIAEoBBIXCg9taW5pbXVtX2VkaXRpb24YAyABKAUSFwoPbWF4aW11bV9lZGl0aW9uGAQgASgFEkIKBGZpbGUYDyADKAsyNC5nb29nbGUucHJvdG9idWYuY29tcGlsZXIuQ29kZUdlbmVyYXRvclJlc3BvbnNlLkZpbGUafwoERmlsZRIMCgRuYW1lGAEgASgJEhcKD2luc2VydGlvbl9wb2ludBgCIAEoCRIPCgdjb250ZW50GA8gASgJEj8KE2dlbmVyYXRlZF9jb2RlX2luZm8YECABKAsyIi5nb29nbGUucHJvdG9idWYuR2VuZXJhdGVkQ29kZUluZm8iVwoHRmVhdHVyZRIQCgxGRUFUVVJFX05PTkUQABIbChdGRUFUVVJFX1BST1RPM19PUFRJT05BTBABEh0KGUZFQVRVUkVfU1VQUE9SVFNfRURJVElPTlMQAkJyChxjb20uZ29vZ2xlLnByb3RvYnVmLmNvbXBpbGVyQgxQbHVnaW5Qcm90b3NaKWdvb2dsZS5nb2xhbmcub3JnL3Byb3RvYnVmL3R5cGVzL3BsdWdpbnBiqgIYR29vZ2xlLlByb3RvYnVmLkNvbXBpbGVy", [file_google_protobuf_descriptor]); +/** + * Describes the message google.protobuf.compiler.Version. + * Use `create(VersionSchema)` to create a new message. + */ +export const VersionSchema = /*@__PURE__*/ messageDesc(file_google_protobuf_compiler_plugin, 0); +/** + * Describes the message google.protobuf.compiler.CodeGeneratorRequest. + * Use `create(CodeGeneratorRequestSchema)` to create a new message. + */ +export const CodeGeneratorRequestSchema = /*@__PURE__*/ messageDesc(file_google_protobuf_compiler_plugin, 1); +/** + * Describes the message google.protobuf.compiler.CodeGeneratorResponse. + * Use `create(CodeGeneratorResponseSchema)` to create a new message. + */ +export const CodeGeneratorResponseSchema = /*@__PURE__*/ messageDesc(file_google_protobuf_compiler_plugin, 2); +/** + * Describes the message google.protobuf.compiler.CodeGeneratorResponse.File. + * Use `create(CodeGeneratorResponse_FileSchema)` to create a new message. + */ +export const CodeGeneratorResponse_FileSchema = /*@__PURE__*/ messageDesc(file_google_protobuf_compiler_plugin, 2, 0); +/** + * Sync with code_generator.h. + * + * @generated from enum google.protobuf.compiler.CodeGeneratorResponse.Feature + */ +export var CodeGeneratorResponse_Feature; +(function (CodeGeneratorResponse_Feature) { + /** + * @generated from enum value: FEATURE_NONE = 0; + */ + CodeGeneratorResponse_Feature[CodeGeneratorResponse_Feature["NONE"] = 0] = "NONE"; + /** + * @generated from enum value: FEATURE_PROTO3_OPTIONAL = 1; + */ + CodeGeneratorResponse_Feature[CodeGeneratorResponse_Feature["PROTO3_OPTIONAL"] = 1] = "PROTO3_OPTIONAL"; + /** + * @generated from enum value: FEATURE_SUPPORTS_EDITIONS = 2; + */ + CodeGeneratorResponse_Feature[CodeGeneratorResponse_Feature["SUPPORTS_EDITIONS"] = 2] = "SUPPORTS_EDITIONS"; +})(CodeGeneratorResponse_Feature || (CodeGeneratorResponse_Feature = {})); +/** + * Describes the enum google.protobuf.compiler.CodeGeneratorResponse.Feature. + */ +export const CodeGeneratorResponse_FeatureSchema = /*@__PURE__*/ enumDesc(file_google_protobuf_compiler_plugin, 2, 0); diff --git a/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/cpp_features_pb.d.ts b/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/cpp_features_pb.d.ts new file mode 100644 index 0000000..7da3c6d --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/cpp_features_pb.d.ts @@ -0,0 +1,91 @@ +import type { GenEnum, GenExtension, GenFile, GenMessage } from "../../../../codegenv2/types.js"; +import type { FeatureSet } from "./descriptor_pb.js"; +import type { Message } from "../../../../types.js"; +/** + * Describes the file google/protobuf/cpp_features.proto. + */ +export declare const file_google_protobuf_cpp_features: GenFile; +/** + * @generated from message pb.CppFeatures + */ +export type CppFeatures = Message<"pb.CppFeatures"> & { + /** + * Whether or not to treat an enum field as closed. This option is only + * applicable to enum fields, and will be removed in the future. It is + * consistent with the legacy behavior of using proto3 enum types for proto2 + * fields. + * + * @generated from field: optional bool legacy_closed_enum = 1; + */ + legacyClosedEnum: boolean; + /** + * @generated from field: optional pb.CppFeatures.StringType string_type = 2; + */ + stringType: CppFeatures_StringType; + /** + * @generated from field: optional bool enum_name_uses_string_view = 3; + */ + enumNameUsesStringView: boolean; +}; +/** + * @generated from message pb.CppFeatures + */ +export type CppFeaturesJson = { + /** + * Whether or not to treat an enum field as closed. This option is only + * applicable to enum fields, and will be removed in the future. It is + * consistent with the legacy behavior of using proto3 enum types for proto2 + * fields. + * + * @generated from field: optional bool legacy_closed_enum = 1; + */ + legacyClosedEnum?: boolean; + /** + * @generated from field: optional pb.CppFeatures.StringType string_type = 2; + */ + stringType?: CppFeatures_StringTypeJson; + /** + * @generated from field: optional bool enum_name_uses_string_view = 3; + */ + enumNameUsesStringView?: boolean; +}; +/** + * Describes the message pb.CppFeatures. + * Use `create(CppFeaturesSchema)` to create a new message. + */ +export declare const CppFeaturesSchema: GenMessage; +/** + * @generated from enum pb.CppFeatures.StringType + */ +export declare enum CppFeatures_StringType { + /** + * @generated from enum value: STRING_TYPE_UNKNOWN = 0; + */ + STRING_TYPE_UNKNOWN = 0, + /** + * @generated from enum value: VIEW = 1; + */ + VIEW = 1, + /** + * @generated from enum value: CORD = 2; + */ + CORD = 2, + /** + * @generated from enum value: STRING = 3; + */ + STRING = 3 +} +/** + * @generated from enum pb.CppFeatures.StringType + */ +export type CppFeatures_StringTypeJson = "STRING_TYPE_UNKNOWN" | "VIEW" | "CORD" | "STRING"; +/** + * Describes the enum pb.CppFeatures.StringType. + */ +export declare const CppFeatures_StringTypeSchema: GenEnum; +/** + * @generated from extension: optional pb.CppFeatures cpp = 1000; + */ +export declare const cpp: GenExtension; diff --git a/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/cpp_features_pb.js b/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/cpp_features_pb.js new file mode 100644 index 0000000..d5ad720 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/cpp_features_pb.js @@ -0,0 +1,57 @@ +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +import { fileDesc } from "../../../../codegenv2/file.js"; +import { file_google_protobuf_descriptor } from "./descriptor_pb.js"; +import { messageDesc } from "../../../../codegenv2/message.js"; +import { enumDesc } from "../../../../codegenv2/enum.js"; +import { extDesc } from "../../../../codegenv2/extension.js"; +/** + * Describes the file google/protobuf/cpp_features.proto. + */ +export const file_google_protobuf_cpp_features = /*@__PURE__*/ fileDesc("CiJnb29nbGUvcHJvdG9idWYvY3BwX2ZlYXR1cmVzLnByb3RvEgJwYiL8AwoLQ3BwRmVhdHVyZXMS+wEKEmxlZ2FjeV9jbG9zZWRfZW51bRgBIAEoCELeAYgBAZgBBJgBAaIBCRIEdHJ1ZRiEB6IBChIFZmFsc2UY5weyAbgBCOgHEOgHGq8BVGhlIGxlZ2FjeSBjbG9zZWQgZW51bSBiZWhhdmlvciBpbiBDKysgaXMgZGVwcmVjYXRlZCBhbmQgaXMgc2NoZWR1bGVkIHRvIGJlIHJlbW92ZWQgaW4gZWRpdGlvbiAyMDI1LiAgU2VlIGh0dHA6Ly9wcm90b2J1Zi5kZXYvcHJvZ3JhbW1pbmctZ3VpZGVzL2VudW0vI2NwcCBmb3IgbW9yZSBpbmZvcm1hdGlvbhJaCgtzdHJpbmdfdHlwZRgCIAEoDjIaLnBiLkNwcEZlYXR1cmVzLlN0cmluZ1R5cGVCKYgBAZgBBJgBAaIBCxIGU1RSSU5HGIQHogEJEgRWSUVXGOkHsgEDCOgHEkwKGmVudW1fbmFtZV91c2VzX3N0cmluZ192aWV3GAMgASgIQiiIAQGYAQaYAQGiAQoSBWZhbHNlGIQHogEJEgR0cnVlGOkHsgEDCOkHIkUKClN0cmluZ1R5cGUSFwoTU1RSSU5HX1RZUEVfVU5LTk9XThAAEggKBFZJRVcQARIICgRDT1JEEAISCgoGU1RSSU5HEAM6PwoDY3BwEhsuZ29vZ2xlLnByb3RvYnVmLkZlYXR1cmVTZXQY6AcgASgLMg8ucGIuQ3BwRmVhdHVyZXNSA2NwcA", [file_google_protobuf_descriptor]); +/** + * Describes the message pb.CppFeatures. + * Use `create(CppFeaturesSchema)` to create a new message. + */ +export const CppFeaturesSchema = /*@__PURE__*/ messageDesc(file_google_protobuf_cpp_features, 0); +/** + * @generated from enum pb.CppFeatures.StringType + */ +export var CppFeatures_StringType; +(function (CppFeatures_StringType) { + /** + * @generated from enum value: STRING_TYPE_UNKNOWN = 0; + */ + CppFeatures_StringType[CppFeatures_StringType["STRING_TYPE_UNKNOWN"] = 0] = "STRING_TYPE_UNKNOWN"; + /** + * @generated from enum value: VIEW = 1; + */ + CppFeatures_StringType[CppFeatures_StringType["VIEW"] = 1] = "VIEW"; + /** + * @generated from enum value: CORD = 2; + */ + CppFeatures_StringType[CppFeatures_StringType["CORD"] = 2] = "CORD"; + /** + * @generated from enum value: STRING = 3; + */ + CppFeatures_StringType[CppFeatures_StringType["STRING"] = 3] = "STRING"; +})(CppFeatures_StringType || (CppFeatures_StringType = {})); +/** + * Describes the enum pb.CppFeatures.StringType. + */ +export const CppFeatures_StringTypeSchema = /*@__PURE__*/ enumDesc(file_google_protobuf_cpp_features, 0, 0); +/** + * @generated from extension: optional pb.CppFeatures cpp = 1000; + */ +export const cpp = /*@__PURE__*/ extDesc(file_google_protobuf_cpp_features, 0); diff --git a/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/descriptor_pb.d.ts b/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/descriptor_pb.d.ts new file mode 100644 index 0000000..a45650f --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/descriptor_pb.d.ts @@ -0,0 +1,4143 @@ +import type { GenEnum, GenFile, GenMessage } from "../../../../codegenv2/types.js"; +import type { Message } from "../../../../types.js"; +/** + * Describes the file google/protobuf/descriptor.proto. + */ +export declare const file_google_protobuf_descriptor: GenFile; +/** + * The protocol compiler can output a FileDescriptorSet containing the .proto + * files it parses. + * + * @generated from message google.protobuf.FileDescriptorSet + */ +export type FileDescriptorSet = Message<"google.protobuf.FileDescriptorSet"> & { + /** + * @generated from field: repeated google.protobuf.FileDescriptorProto file = 1; + */ + file: FileDescriptorProto[]; +}; +/** + * The protocol compiler can output a FileDescriptorSet containing the .proto + * files it parses. + * + * @generated from message google.protobuf.FileDescriptorSet + */ +export type FileDescriptorSetJson = { + /** + * @generated from field: repeated google.protobuf.FileDescriptorProto file = 1; + */ + file?: FileDescriptorProtoJson[]; +}; +/** + * Describes the message google.protobuf.FileDescriptorSet. + * Use `create(FileDescriptorSetSchema)` to create a new message. + */ +export declare const FileDescriptorSetSchema: GenMessage; +/** + * Describes a complete .proto file. + * + * @generated from message google.protobuf.FileDescriptorProto + */ +export type FileDescriptorProto = Message<"google.protobuf.FileDescriptorProto"> & { + /** + * file name, relative to root of source tree + * + * @generated from field: optional string name = 1; + */ + name: string; + /** + * e.g. "foo", "foo.bar", etc. + * + * @generated from field: optional string package = 2; + */ + package: string; + /** + * Names of files imported by this file. + * + * @generated from field: repeated string dependency = 3; + */ + dependency: string[]; + /** + * Indexes of the public imported files in the dependency list above. + * + * @generated from field: repeated int32 public_dependency = 10; + */ + publicDependency: number[]; + /** + * Indexes of the weak imported files in the dependency list. + * For Google-internal migration only. Do not use. + * + * @generated from field: repeated int32 weak_dependency = 11; + */ + weakDependency: number[]; + /** + * Names of files imported by this file purely for the purpose of providing + * option extensions. These are excluded from the dependency list above. + * + * @generated from field: repeated string option_dependency = 15; + */ + optionDependency: string[]; + /** + * All top-level definitions in this file. + * + * @generated from field: repeated google.protobuf.DescriptorProto message_type = 4; + */ + messageType: DescriptorProto[]; + /** + * @generated from field: repeated google.protobuf.EnumDescriptorProto enum_type = 5; + */ + enumType: EnumDescriptorProto[]; + /** + * @generated from field: repeated google.protobuf.ServiceDescriptorProto service = 6; + */ + service: ServiceDescriptorProto[]; + /** + * @generated from field: repeated google.protobuf.FieldDescriptorProto extension = 7; + */ + extension: FieldDescriptorProto[]; + /** + * @generated from field: optional google.protobuf.FileOptions options = 8; + */ + options?: FileOptions | undefined; + /** + * This field contains optional information about the original source code. + * You may safely remove this entire field without harming runtime + * functionality of the descriptors -- the information is needed only by + * development tools. + * + * @generated from field: optional google.protobuf.SourceCodeInfo source_code_info = 9; + */ + sourceCodeInfo?: SourceCodeInfo | undefined; + /** + * The syntax of the proto file. + * The supported values are "proto2", "proto3", and "editions". + * + * If `edition` is present, this value must be "editions". + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * @generated from field: optional string syntax = 12; + */ + syntax: string; + /** + * The edition of the proto file. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * @generated from field: optional google.protobuf.Edition edition = 14; + */ + edition: Edition; +}; +/** + * Describes a complete .proto file. + * + * @generated from message google.protobuf.FileDescriptorProto + */ +export type FileDescriptorProtoJson = { + /** + * file name, relative to root of source tree + * + * @generated from field: optional string name = 1; + */ + name?: string; + /** + * e.g. "foo", "foo.bar", etc. + * + * @generated from field: optional string package = 2; + */ + package?: string; + /** + * Names of files imported by this file. + * + * @generated from field: repeated string dependency = 3; + */ + dependency?: string[]; + /** + * Indexes of the public imported files in the dependency list above. + * + * @generated from field: repeated int32 public_dependency = 10; + */ + publicDependency?: number[]; + /** + * Indexes of the weak imported files in the dependency list. + * For Google-internal migration only. Do not use. + * + * @generated from field: repeated int32 weak_dependency = 11; + */ + weakDependency?: number[]; + /** + * Names of files imported by this file purely for the purpose of providing + * option extensions. These are excluded from the dependency list above. + * + * @generated from field: repeated string option_dependency = 15; + */ + optionDependency?: string[]; + /** + * All top-level definitions in this file. + * + * @generated from field: repeated google.protobuf.DescriptorProto message_type = 4; + */ + messageType?: DescriptorProtoJson[]; + /** + * @generated from field: repeated google.protobuf.EnumDescriptorProto enum_type = 5; + */ + enumType?: EnumDescriptorProtoJson[]; + /** + * @generated from field: repeated google.protobuf.ServiceDescriptorProto service = 6; + */ + service?: ServiceDescriptorProtoJson[]; + /** + * @generated from field: repeated google.protobuf.FieldDescriptorProto extension = 7; + */ + extension?: FieldDescriptorProtoJson[]; + /** + * @generated from field: optional google.protobuf.FileOptions options = 8; + */ + options?: FileOptionsJson; + /** + * This field contains optional information about the original source code. + * You may safely remove this entire field without harming runtime + * functionality of the descriptors -- the information is needed only by + * development tools. + * + * @generated from field: optional google.protobuf.SourceCodeInfo source_code_info = 9; + */ + sourceCodeInfo?: SourceCodeInfoJson; + /** + * The syntax of the proto file. + * The supported values are "proto2", "proto3", and "editions". + * + * If `edition` is present, this value must be "editions". + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * @generated from field: optional string syntax = 12; + */ + syntax?: string; + /** + * The edition of the proto file. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * @generated from field: optional google.protobuf.Edition edition = 14; + */ + edition?: EditionJson; +}; +/** + * Describes the message google.protobuf.FileDescriptorProto. + * Use `create(FileDescriptorProtoSchema)` to create a new message. + */ +export declare const FileDescriptorProtoSchema: GenMessage; +/** + * Describes a message type. + * + * @generated from message google.protobuf.DescriptorProto + */ +export type DescriptorProto = Message<"google.protobuf.DescriptorProto"> & { + /** + * @generated from field: optional string name = 1; + */ + name: string; + /** + * @generated from field: repeated google.protobuf.FieldDescriptorProto field = 2; + */ + field: FieldDescriptorProto[]; + /** + * @generated from field: repeated google.protobuf.FieldDescriptorProto extension = 6; + */ + extension: FieldDescriptorProto[]; + /** + * @generated from field: repeated google.protobuf.DescriptorProto nested_type = 3; + */ + nestedType: DescriptorProto[]; + /** + * @generated from field: repeated google.protobuf.EnumDescriptorProto enum_type = 4; + */ + enumType: EnumDescriptorProto[]; + /** + * @generated from field: repeated google.protobuf.DescriptorProto.ExtensionRange extension_range = 5; + */ + extensionRange: DescriptorProto_ExtensionRange[]; + /** + * @generated from field: repeated google.protobuf.OneofDescriptorProto oneof_decl = 8; + */ + oneofDecl: OneofDescriptorProto[]; + /** + * @generated from field: optional google.protobuf.MessageOptions options = 7; + */ + options?: MessageOptions | undefined; + /** + * @generated from field: repeated google.protobuf.DescriptorProto.ReservedRange reserved_range = 9; + */ + reservedRange: DescriptorProto_ReservedRange[]; + /** + * Reserved field names, which may not be used by fields in the same message. + * A given name may only be reserved once. + * + * @generated from field: repeated string reserved_name = 10; + */ + reservedName: string[]; + /** + * Support for `export` and `local` keywords on enums. + * + * @generated from field: optional google.protobuf.SymbolVisibility visibility = 11; + */ + visibility: SymbolVisibility; +}; +/** + * Describes a message type. + * + * @generated from message google.protobuf.DescriptorProto + */ +export type DescriptorProtoJson = { + /** + * @generated from field: optional string name = 1; + */ + name?: string; + /** + * @generated from field: repeated google.protobuf.FieldDescriptorProto field = 2; + */ + field?: FieldDescriptorProtoJson[]; + /** + * @generated from field: repeated google.protobuf.FieldDescriptorProto extension = 6; + */ + extension?: FieldDescriptorProtoJson[]; + /** + * @generated from field: repeated google.protobuf.DescriptorProto nested_type = 3; + */ + nestedType?: DescriptorProtoJson[]; + /** + * @generated from field: repeated google.protobuf.EnumDescriptorProto enum_type = 4; + */ + enumType?: EnumDescriptorProtoJson[]; + /** + * @generated from field: repeated google.protobuf.DescriptorProto.ExtensionRange extension_range = 5; + */ + extensionRange?: DescriptorProto_ExtensionRangeJson[]; + /** + * @generated from field: repeated google.protobuf.OneofDescriptorProto oneof_decl = 8; + */ + oneofDecl?: OneofDescriptorProtoJson[]; + /** + * @generated from field: optional google.protobuf.MessageOptions options = 7; + */ + options?: MessageOptionsJson; + /** + * @generated from field: repeated google.protobuf.DescriptorProto.ReservedRange reserved_range = 9; + */ + reservedRange?: DescriptorProto_ReservedRangeJson[]; + /** + * Reserved field names, which may not be used by fields in the same message. + * A given name may only be reserved once. + * + * @generated from field: repeated string reserved_name = 10; + */ + reservedName?: string[]; + /** + * Support for `export` and `local` keywords on enums. + * + * @generated from field: optional google.protobuf.SymbolVisibility visibility = 11; + */ + visibility?: SymbolVisibilityJson; +}; +/** + * Describes the message google.protobuf.DescriptorProto. + * Use `create(DescriptorProtoSchema)` to create a new message. + */ +export declare const DescriptorProtoSchema: GenMessage; +/** + * @generated from message google.protobuf.DescriptorProto.ExtensionRange + */ +export type DescriptorProto_ExtensionRange = Message<"google.protobuf.DescriptorProto.ExtensionRange"> & { + /** + * Inclusive. + * + * @generated from field: optional int32 start = 1; + */ + start: number; + /** + * Exclusive. + * + * @generated from field: optional int32 end = 2; + */ + end: number; + /** + * @generated from field: optional google.protobuf.ExtensionRangeOptions options = 3; + */ + options?: ExtensionRangeOptions | undefined; +}; +/** + * @generated from message google.protobuf.DescriptorProto.ExtensionRange + */ +export type DescriptorProto_ExtensionRangeJson = { + /** + * Inclusive. + * + * @generated from field: optional int32 start = 1; + */ + start?: number; + /** + * Exclusive. + * + * @generated from field: optional int32 end = 2; + */ + end?: number; + /** + * @generated from field: optional google.protobuf.ExtensionRangeOptions options = 3; + */ + options?: ExtensionRangeOptionsJson; +}; +/** + * Describes the message google.protobuf.DescriptorProto.ExtensionRange. + * Use `create(DescriptorProto_ExtensionRangeSchema)` to create a new message. + */ +export declare const DescriptorProto_ExtensionRangeSchema: GenMessage; +/** + * Range of reserved tag numbers. Reserved tag numbers may not be used by + * fields or extension ranges in the same message. Reserved ranges may + * not overlap. + * + * @generated from message google.protobuf.DescriptorProto.ReservedRange + */ +export type DescriptorProto_ReservedRange = Message<"google.protobuf.DescriptorProto.ReservedRange"> & { + /** + * Inclusive. + * + * @generated from field: optional int32 start = 1; + */ + start: number; + /** + * Exclusive. + * + * @generated from field: optional int32 end = 2; + */ + end: number; +}; +/** + * Range of reserved tag numbers. Reserved tag numbers may not be used by + * fields or extension ranges in the same message. Reserved ranges may + * not overlap. + * + * @generated from message google.protobuf.DescriptorProto.ReservedRange + */ +export type DescriptorProto_ReservedRangeJson = { + /** + * Inclusive. + * + * @generated from field: optional int32 start = 1; + */ + start?: number; + /** + * Exclusive. + * + * @generated from field: optional int32 end = 2; + */ + end?: number; +}; +/** + * Describes the message google.protobuf.DescriptorProto.ReservedRange. + * Use `create(DescriptorProto_ReservedRangeSchema)` to create a new message. + */ +export declare const DescriptorProto_ReservedRangeSchema: GenMessage; +/** + * @generated from message google.protobuf.ExtensionRangeOptions + */ +export type ExtensionRangeOptions = Message<"google.protobuf.ExtensionRangeOptions"> & { + /** + * The parser stores options it doesn't recognize here. See above. + * + * @generated from field: repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; + */ + uninterpretedOption: UninterpretedOption[]; + /** + * For external users: DO NOT USE. We are in the process of open sourcing + * extension declaration and executing internal cleanups before it can be + * used externally. + * + * @generated from field: repeated google.protobuf.ExtensionRangeOptions.Declaration declaration = 2; + */ + declaration: ExtensionRangeOptions_Declaration[]; + /** + * Any features defined in the specific edition. + * + * @generated from field: optional google.protobuf.FeatureSet features = 50; + */ + features?: FeatureSet | undefined; + /** + * The verification state of the range. + * TODO: flip the default to DECLARATION once all empty ranges + * are marked as UNVERIFIED. + * + * @generated from field: optional google.protobuf.ExtensionRangeOptions.VerificationState verification = 3 [default = UNVERIFIED]; + */ + verification: ExtensionRangeOptions_VerificationState; +}; +/** + * @generated from message google.protobuf.ExtensionRangeOptions + */ +export type ExtensionRangeOptionsJson = { + /** + * The parser stores options it doesn't recognize here. See above. + * + * @generated from field: repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; + */ + uninterpretedOption?: UninterpretedOptionJson[]; + /** + * For external users: DO NOT USE. We are in the process of open sourcing + * extension declaration and executing internal cleanups before it can be + * used externally. + * + * @generated from field: repeated google.protobuf.ExtensionRangeOptions.Declaration declaration = 2; + */ + declaration?: ExtensionRangeOptions_DeclarationJson[]; + /** + * Any features defined in the specific edition. + * + * @generated from field: optional google.protobuf.FeatureSet features = 50; + */ + features?: FeatureSetJson; + /** + * The verification state of the range. + * TODO: flip the default to DECLARATION once all empty ranges + * are marked as UNVERIFIED. + * + * @generated from field: optional google.protobuf.ExtensionRangeOptions.VerificationState verification = 3 [default = UNVERIFIED]; + */ + verification?: ExtensionRangeOptions_VerificationStateJson; +}; +/** + * Describes the message google.protobuf.ExtensionRangeOptions. + * Use `create(ExtensionRangeOptionsSchema)` to create a new message. + */ +export declare const ExtensionRangeOptionsSchema: GenMessage; +/** + * @generated from message google.protobuf.ExtensionRangeOptions.Declaration + */ +export type ExtensionRangeOptions_Declaration = Message<"google.protobuf.ExtensionRangeOptions.Declaration"> & { + /** + * The extension number declared within the extension range. + * + * @generated from field: optional int32 number = 1; + */ + number: number; + /** + * The fully-qualified name of the extension field. There must be a leading + * dot in front of the full name. + * + * @generated from field: optional string full_name = 2; + */ + fullName: string; + /** + * The fully-qualified type name of the extension field. Unlike + * Metadata.type, Declaration.type must have a leading dot for messages + * and enums. + * + * @generated from field: optional string type = 3; + */ + type: string; + /** + * If true, indicates that the number is reserved in the extension range, + * and any extension field with the number will fail to compile. Set this + * when a declared extension field is deleted. + * + * @generated from field: optional bool reserved = 5; + */ + reserved: boolean; + /** + * If true, indicates that the extension must be defined as repeated. + * Otherwise the extension must be defined as optional. + * + * @generated from field: optional bool repeated = 6; + */ + repeated: boolean; +}; +/** + * @generated from message google.protobuf.ExtensionRangeOptions.Declaration + */ +export type ExtensionRangeOptions_DeclarationJson = { + /** + * The extension number declared within the extension range. + * + * @generated from field: optional int32 number = 1; + */ + number?: number; + /** + * The fully-qualified name of the extension field. There must be a leading + * dot in front of the full name. + * + * @generated from field: optional string full_name = 2; + */ + fullName?: string; + /** + * The fully-qualified type name of the extension field. Unlike + * Metadata.type, Declaration.type must have a leading dot for messages + * and enums. + * + * @generated from field: optional string type = 3; + */ + type?: string; + /** + * If true, indicates that the number is reserved in the extension range, + * and any extension field with the number will fail to compile. Set this + * when a declared extension field is deleted. + * + * @generated from field: optional bool reserved = 5; + */ + reserved?: boolean; + /** + * If true, indicates that the extension must be defined as repeated. + * Otherwise the extension must be defined as optional. + * + * @generated from field: optional bool repeated = 6; + */ + repeated?: boolean; +}; +/** + * Describes the message google.protobuf.ExtensionRangeOptions.Declaration. + * Use `create(ExtensionRangeOptions_DeclarationSchema)` to create a new message. + */ +export declare const ExtensionRangeOptions_DeclarationSchema: GenMessage; +/** + * The verification state of the extension range. + * + * @generated from enum google.protobuf.ExtensionRangeOptions.VerificationState + */ +export declare enum ExtensionRangeOptions_VerificationState { + /** + * All the extensions of the range must be declared. + * + * @generated from enum value: DECLARATION = 0; + */ + DECLARATION = 0, + /** + * @generated from enum value: UNVERIFIED = 1; + */ + UNVERIFIED = 1 +} +/** + * The verification state of the extension range. + * + * @generated from enum google.protobuf.ExtensionRangeOptions.VerificationState + */ +export type ExtensionRangeOptions_VerificationStateJson = "DECLARATION" | "UNVERIFIED"; +/** + * Describes the enum google.protobuf.ExtensionRangeOptions.VerificationState. + */ +export declare const ExtensionRangeOptions_VerificationStateSchema: GenEnum; +/** + * Describes a field within a message. + * + * @generated from message google.protobuf.FieldDescriptorProto + */ +export type FieldDescriptorProto = Message<"google.protobuf.FieldDescriptorProto"> & { + /** + * @generated from field: optional string name = 1; + */ + name: string; + /** + * @generated from field: optional int32 number = 3; + */ + number: number; + /** + * @generated from field: optional google.protobuf.FieldDescriptorProto.Label label = 4; + */ + label: FieldDescriptorProto_Label; + /** + * If type_name is set, this need not be set. If both this and type_name + * are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP. + * + * @generated from field: optional google.protobuf.FieldDescriptorProto.Type type = 5; + */ + type: FieldDescriptorProto_Type; + /** + * For message and enum types, this is the name of the type. If the name + * starts with a '.', it is fully-qualified. Otherwise, C++-like scoping + * rules are used to find the type (i.e. first the nested types within this + * message are searched, then within the parent, on up to the root + * namespace). + * + * @generated from field: optional string type_name = 6; + */ + typeName: string; + /** + * For extensions, this is the name of the type being extended. It is + * resolved in the same manner as type_name. + * + * @generated from field: optional string extendee = 2; + */ + extendee: string; + /** + * For numeric types, contains the original text representation of the value. + * For booleans, "true" or "false". + * For strings, contains the default text contents (not escaped in any way). + * For bytes, contains the C escaped value. All bytes >= 128 are escaped. + * + * @generated from field: optional string default_value = 7; + */ + defaultValue: string; + /** + * If set, gives the index of a oneof in the containing type's oneof_decl + * list. This field is a member of that oneof. + * + * @generated from field: optional int32 oneof_index = 9; + */ + oneofIndex: number; + /** + * JSON name of this field. The value is set by protocol compiler. If the + * user has set a "json_name" option on this field, that option's value + * will be used. Otherwise, it's deduced from the field's name by converting + * it to camelCase. + * + * @generated from field: optional string json_name = 10; + */ + jsonName: string; + /** + * @generated from field: optional google.protobuf.FieldOptions options = 8; + */ + options?: FieldOptions | undefined; + /** + * If true, this is a proto3 "optional". When a proto3 field is optional, it + * tracks presence regardless of field type. + * + * When proto3_optional is true, this field must belong to a oneof to signal + * to old proto3 clients that presence is tracked for this field. This oneof + * is known as a "synthetic" oneof, and this field must be its sole member + * (each proto3 optional field gets its own synthetic oneof). Synthetic oneofs + * exist in the descriptor only, and do not generate any API. Synthetic oneofs + * must be ordered after all "real" oneofs. + * + * For message fields, proto3_optional doesn't create any semantic change, + * since non-repeated message fields always track presence. However it still + * indicates the semantic detail of whether the user wrote "optional" or not. + * This can be useful for round-tripping the .proto file. For consistency we + * give message fields a synthetic oneof also, even though it is not required + * to track presence. This is especially important because the parser can't + * tell if a field is a message or an enum, so it must always create a + * synthetic oneof. + * + * Proto2 optional fields do not set this flag, because they already indicate + * optional with `LABEL_OPTIONAL`. + * + * @generated from field: optional bool proto3_optional = 17; + */ + proto3Optional: boolean; +}; +/** + * Describes a field within a message. + * + * @generated from message google.protobuf.FieldDescriptorProto + */ +export type FieldDescriptorProtoJson = { + /** + * @generated from field: optional string name = 1; + */ + name?: string; + /** + * @generated from field: optional int32 number = 3; + */ + number?: number; + /** + * @generated from field: optional google.protobuf.FieldDescriptorProto.Label label = 4; + */ + label?: FieldDescriptorProto_LabelJson; + /** + * If type_name is set, this need not be set. If both this and type_name + * are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP. + * + * @generated from field: optional google.protobuf.FieldDescriptorProto.Type type = 5; + */ + type?: FieldDescriptorProto_TypeJson; + /** + * For message and enum types, this is the name of the type. If the name + * starts with a '.', it is fully-qualified. Otherwise, C++-like scoping + * rules are used to find the type (i.e. first the nested types within this + * message are searched, then within the parent, on up to the root + * namespace). + * + * @generated from field: optional string type_name = 6; + */ + typeName?: string; + /** + * For extensions, this is the name of the type being extended. It is + * resolved in the same manner as type_name. + * + * @generated from field: optional string extendee = 2; + */ + extendee?: string; + /** + * For numeric types, contains the original text representation of the value. + * For booleans, "true" or "false". + * For strings, contains the default text contents (not escaped in any way). + * For bytes, contains the C escaped value. All bytes >= 128 are escaped. + * + * @generated from field: optional string default_value = 7; + */ + defaultValue?: string; + /** + * If set, gives the index of a oneof in the containing type's oneof_decl + * list. This field is a member of that oneof. + * + * @generated from field: optional int32 oneof_index = 9; + */ + oneofIndex?: number; + /** + * JSON name of this field. The value is set by protocol compiler. If the + * user has set a "json_name" option on this field, that option's value + * will be used. Otherwise, it's deduced from the field's name by converting + * it to camelCase. + * + * @generated from field: optional string json_name = 10; + */ + jsonName?: string; + /** + * @generated from field: optional google.protobuf.FieldOptions options = 8; + */ + options?: FieldOptionsJson; + /** + * If true, this is a proto3 "optional". When a proto3 field is optional, it + * tracks presence regardless of field type. + * + * When proto3_optional is true, this field must belong to a oneof to signal + * to old proto3 clients that presence is tracked for this field. This oneof + * is known as a "synthetic" oneof, and this field must be its sole member + * (each proto3 optional field gets its own synthetic oneof). Synthetic oneofs + * exist in the descriptor only, and do not generate any API. Synthetic oneofs + * must be ordered after all "real" oneofs. + * + * For message fields, proto3_optional doesn't create any semantic change, + * since non-repeated message fields always track presence. However it still + * indicates the semantic detail of whether the user wrote "optional" or not. + * This can be useful for round-tripping the .proto file. For consistency we + * give message fields a synthetic oneof also, even though it is not required + * to track presence. This is especially important because the parser can't + * tell if a field is a message or an enum, so it must always create a + * synthetic oneof. + * + * Proto2 optional fields do not set this flag, because they already indicate + * optional with `LABEL_OPTIONAL`. + * + * @generated from field: optional bool proto3_optional = 17; + */ + proto3Optional?: boolean; +}; +/** + * Describes the message google.protobuf.FieldDescriptorProto. + * Use `create(FieldDescriptorProtoSchema)` to create a new message. + */ +export declare const FieldDescriptorProtoSchema: GenMessage; +/** + * @generated from enum google.protobuf.FieldDescriptorProto.Type + */ +export declare enum FieldDescriptorProto_Type { + /** + * 0 is reserved for errors. + * Order is weird for historical reasons. + * + * @generated from enum value: TYPE_DOUBLE = 1; + */ + DOUBLE = 1, + /** + * @generated from enum value: TYPE_FLOAT = 2; + */ + FLOAT = 2, + /** + * Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if + * negative values are likely. + * + * @generated from enum value: TYPE_INT64 = 3; + */ + INT64 = 3, + /** + * @generated from enum value: TYPE_UINT64 = 4; + */ + UINT64 = 4, + /** + * Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if + * negative values are likely. + * + * @generated from enum value: TYPE_INT32 = 5; + */ + INT32 = 5, + /** + * @generated from enum value: TYPE_FIXED64 = 6; + */ + FIXED64 = 6, + /** + * @generated from enum value: TYPE_FIXED32 = 7; + */ + FIXED32 = 7, + /** + * @generated from enum value: TYPE_BOOL = 8; + */ + BOOL = 8, + /** + * @generated from enum value: TYPE_STRING = 9; + */ + STRING = 9, + /** + * Tag-delimited aggregate. + * Group type is deprecated and not supported after google.protobuf. However, Proto3 + * implementations should still be able to parse the group wire format and + * treat group fields as unknown fields. In Editions, the group wire format + * can be enabled via the `message_encoding` feature. + * + * @generated from enum value: TYPE_GROUP = 10; + */ + GROUP = 10, + /** + * Length-delimited aggregate. + * + * @generated from enum value: TYPE_MESSAGE = 11; + */ + MESSAGE = 11, + /** + * New in version 2. + * + * @generated from enum value: TYPE_BYTES = 12; + */ + BYTES = 12, + /** + * @generated from enum value: TYPE_UINT32 = 13; + */ + UINT32 = 13, + /** + * @generated from enum value: TYPE_ENUM = 14; + */ + ENUM = 14, + /** + * @generated from enum value: TYPE_SFIXED32 = 15; + */ + SFIXED32 = 15, + /** + * @generated from enum value: TYPE_SFIXED64 = 16; + */ + SFIXED64 = 16, + /** + * Uses ZigZag encoding. + * + * @generated from enum value: TYPE_SINT32 = 17; + */ + SINT32 = 17, + /** + * Uses ZigZag encoding. + * + * @generated from enum value: TYPE_SINT64 = 18; + */ + SINT64 = 18 +} +/** + * @generated from enum google.protobuf.FieldDescriptorProto.Type + */ +export type FieldDescriptorProto_TypeJson = "TYPE_DOUBLE" | "TYPE_FLOAT" | "TYPE_INT64" | "TYPE_UINT64" | "TYPE_INT32" | "TYPE_FIXED64" | "TYPE_FIXED32" | "TYPE_BOOL" | "TYPE_STRING" | "TYPE_GROUP" | "TYPE_MESSAGE" | "TYPE_BYTES" | "TYPE_UINT32" | "TYPE_ENUM" | "TYPE_SFIXED32" | "TYPE_SFIXED64" | "TYPE_SINT32" | "TYPE_SINT64"; +/** + * Describes the enum google.protobuf.FieldDescriptorProto.Type. + */ +export declare const FieldDescriptorProto_TypeSchema: GenEnum; +/** + * @generated from enum google.protobuf.FieldDescriptorProto.Label + */ +export declare enum FieldDescriptorProto_Label { + /** + * 0 is reserved for errors + * + * @generated from enum value: LABEL_OPTIONAL = 1; + */ + OPTIONAL = 1, + /** + * @generated from enum value: LABEL_REPEATED = 3; + */ + REPEATED = 3, + /** + * The required label is only allowed in google.protobuf. In proto3 and Editions + * it's explicitly prohibited. In Editions, the `field_presence` feature + * can be used to get this behavior. + * + * @generated from enum value: LABEL_REQUIRED = 2; + */ + REQUIRED = 2 +} +/** + * @generated from enum google.protobuf.FieldDescriptorProto.Label + */ +export type FieldDescriptorProto_LabelJson = "LABEL_OPTIONAL" | "LABEL_REPEATED" | "LABEL_REQUIRED"; +/** + * Describes the enum google.protobuf.FieldDescriptorProto.Label. + */ +export declare const FieldDescriptorProto_LabelSchema: GenEnum; +/** + * Describes a oneof. + * + * @generated from message google.protobuf.OneofDescriptorProto + */ +export type OneofDescriptorProto = Message<"google.protobuf.OneofDescriptorProto"> & { + /** + * @generated from field: optional string name = 1; + */ + name: string; + /** + * @generated from field: optional google.protobuf.OneofOptions options = 2; + */ + options?: OneofOptions | undefined; +}; +/** + * Describes a oneof. + * + * @generated from message google.protobuf.OneofDescriptorProto + */ +export type OneofDescriptorProtoJson = { + /** + * @generated from field: optional string name = 1; + */ + name?: string; + /** + * @generated from field: optional google.protobuf.OneofOptions options = 2; + */ + options?: OneofOptionsJson; +}; +/** + * Describes the message google.protobuf.OneofDescriptorProto. + * Use `create(OneofDescriptorProtoSchema)` to create a new message. + */ +export declare const OneofDescriptorProtoSchema: GenMessage; +/** + * Describes an enum type. + * + * @generated from message google.protobuf.EnumDescriptorProto + */ +export type EnumDescriptorProto = Message<"google.protobuf.EnumDescriptorProto"> & { + /** + * @generated from field: optional string name = 1; + */ + name: string; + /** + * @generated from field: repeated google.protobuf.EnumValueDescriptorProto value = 2; + */ + value: EnumValueDescriptorProto[]; + /** + * @generated from field: optional google.protobuf.EnumOptions options = 3; + */ + options?: EnumOptions | undefined; + /** + * Range of reserved numeric values. Reserved numeric values may not be used + * by enum values in the same enum declaration. Reserved ranges may not + * overlap. + * + * @generated from field: repeated google.protobuf.EnumDescriptorProto.EnumReservedRange reserved_range = 4; + */ + reservedRange: EnumDescriptorProto_EnumReservedRange[]; + /** + * Reserved enum value names, which may not be reused. A given name may only + * be reserved once. + * + * @generated from field: repeated string reserved_name = 5; + */ + reservedName: string[]; + /** + * Support for `export` and `local` keywords on enums. + * + * @generated from field: optional google.protobuf.SymbolVisibility visibility = 6; + */ + visibility: SymbolVisibility; +}; +/** + * Describes an enum type. + * + * @generated from message google.protobuf.EnumDescriptorProto + */ +export type EnumDescriptorProtoJson = { + /** + * @generated from field: optional string name = 1; + */ + name?: string; + /** + * @generated from field: repeated google.protobuf.EnumValueDescriptorProto value = 2; + */ + value?: EnumValueDescriptorProtoJson[]; + /** + * @generated from field: optional google.protobuf.EnumOptions options = 3; + */ + options?: EnumOptionsJson; + /** + * Range of reserved numeric values. Reserved numeric values may not be used + * by enum values in the same enum declaration. Reserved ranges may not + * overlap. + * + * @generated from field: repeated google.protobuf.EnumDescriptorProto.EnumReservedRange reserved_range = 4; + */ + reservedRange?: EnumDescriptorProto_EnumReservedRangeJson[]; + /** + * Reserved enum value names, which may not be reused. A given name may only + * be reserved once. + * + * @generated from field: repeated string reserved_name = 5; + */ + reservedName?: string[]; + /** + * Support for `export` and `local` keywords on enums. + * + * @generated from field: optional google.protobuf.SymbolVisibility visibility = 6; + */ + visibility?: SymbolVisibilityJson; +}; +/** + * Describes the message google.protobuf.EnumDescriptorProto. + * Use `create(EnumDescriptorProtoSchema)` to create a new message. + */ +export declare const EnumDescriptorProtoSchema: GenMessage; +/** + * Range of reserved numeric values. Reserved values may not be used by + * entries in the same enum. Reserved ranges may not overlap. + * + * Note that this is distinct from DescriptorProto.ReservedRange in that it + * is inclusive such that it can appropriately represent the entire int32 + * domain. + * + * @generated from message google.protobuf.EnumDescriptorProto.EnumReservedRange + */ +export type EnumDescriptorProto_EnumReservedRange = Message<"google.protobuf.EnumDescriptorProto.EnumReservedRange"> & { + /** + * Inclusive. + * + * @generated from field: optional int32 start = 1; + */ + start: number; + /** + * Inclusive. + * + * @generated from field: optional int32 end = 2; + */ + end: number; +}; +/** + * Range of reserved numeric values. Reserved values may not be used by + * entries in the same enum. Reserved ranges may not overlap. + * + * Note that this is distinct from DescriptorProto.ReservedRange in that it + * is inclusive such that it can appropriately represent the entire int32 + * domain. + * + * @generated from message google.protobuf.EnumDescriptorProto.EnumReservedRange + */ +export type EnumDescriptorProto_EnumReservedRangeJson = { + /** + * Inclusive. + * + * @generated from field: optional int32 start = 1; + */ + start?: number; + /** + * Inclusive. + * + * @generated from field: optional int32 end = 2; + */ + end?: number; +}; +/** + * Describes the message google.protobuf.EnumDescriptorProto.EnumReservedRange. + * Use `create(EnumDescriptorProto_EnumReservedRangeSchema)` to create a new message. + */ +export declare const EnumDescriptorProto_EnumReservedRangeSchema: GenMessage; +/** + * Describes a value within an enum. + * + * @generated from message google.protobuf.EnumValueDescriptorProto + */ +export type EnumValueDescriptorProto = Message<"google.protobuf.EnumValueDescriptorProto"> & { + /** + * @generated from field: optional string name = 1; + */ + name: string; + /** + * @generated from field: optional int32 number = 2; + */ + number: number; + /** + * @generated from field: optional google.protobuf.EnumValueOptions options = 3; + */ + options?: EnumValueOptions | undefined; +}; +/** + * Describes a value within an enum. + * + * @generated from message google.protobuf.EnumValueDescriptorProto + */ +export type EnumValueDescriptorProtoJson = { + /** + * @generated from field: optional string name = 1; + */ + name?: string; + /** + * @generated from field: optional int32 number = 2; + */ + number?: number; + /** + * @generated from field: optional google.protobuf.EnumValueOptions options = 3; + */ + options?: EnumValueOptionsJson; +}; +/** + * Describes the message google.protobuf.EnumValueDescriptorProto. + * Use `create(EnumValueDescriptorProtoSchema)` to create a new message. + */ +export declare const EnumValueDescriptorProtoSchema: GenMessage; +/** + * Describes a service. + * + * @generated from message google.protobuf.ServiceDescriptorProto + */ +export type ServiceDescriptorProto = Message<"google.protobuf.ServiceDescriptorProto"> & { + /** + * @generated from field: optional string name = 1; + */ + name: string; + /** + * @generated from field: repeated google.protobuf.MethodDescriptorProto method = 2; + */ + method: MethodDescriptorProto[]; + /** + * @generated from field: optional google.protobuf.ServiceOptions options = 3; + */ + options?: ServiceOptions | undefined; +}; +/** + * Describes a service. + * + * @generated from message google.protobuf.ServiceDescriptorProto + */ +export type ServiceDescriptorProtoJson = { + /** + * @generated from field: optional string name = 1; + */ + name?: string; + /** + * @generated from field: repeated google.protobuf.MethodDescriptorProto method = 2; + */ + method?: MethodDescriptorProtoJson[]; + /** + * @generated from field: optional google.protobuf.ServiceOptions options = 3; + */ + options?: ServiceOptionsJson; +}; +/** + * Describes the message google.protobuf.ServiceDescriptorProto. + * Use `create(ServiceDescriptorProtoSchema)` to create a new message. + */ +export declare const ServiceDescriptorProtoSchema: GenMessage; +/** + * Describes a method of a service. + * + * @generated from message google.protobuf.MethodDescriptorProto + */ +export type MethodDescriptorProto = Message<"google.protobuf.MethodDescriptorProto"> & { + /** + * @generated from field: optional string name = 1; + */ + name: string; + /** + * Input and output type names. These are resolved in the same way as + * FieldDescriptorProto.type_name, but must refer to a message type. + * + * @generated from field: optional string input_type = 2; + */ + inputType: string; + /** + * @generated from field: optional string output_type = 3; + */ + outputType: string; + /** + * @generated from field: optional google.protobuf.MethodOptions options = 4; + */ + options?: MethodOptions | undefined; + /** + * Identifies if client streams multiple client messages + * + * @generated from field: optional bool client_streaming = 5 [default = false]; + */ + clientStreaming: boolean; + /** + * Identifies if server streams multiple server messages + * + * @generated from field: optional bool server_streaming = 6 [default = false]; + */ + serverStreaming: boolean; +}; +/** + * Describes a method of a service. + * + * @generated from message google.protobuf.MethodDescriptorProto + */ +export type MethodDescriptorProtoJson = { + /** + * @generated from field: optional string name = 1; + */ + name?: string; + /** + * Input and output type names. These are resolved in the same way as + * FieldDescriptorProto.type_name, but must refer to a message type. + * + * @generated from field: optional string input_type = 2; + */ + inputType?: string; + /** + * @generated from field: optional string output_type = 3; + */ + outputType?: string; + /** + * @generated from field: optional google.protobuf.MethodOptions options = 4; + */ + options?: MethodOptionsJson; + /** + * Identifies if client streams multiple client messages + * + * @generated from field: optional bool client_streaming = 5 [default = false]; + */ + clientStreaming?: boolean; + /** + * Identifies if server streams multiple server messages + * + * @generated from field: optional bool server_streaming = 6 [default = false]; + */ + serverStreaming?: boolean; +}; +/** + * Describes the message google.protobuf.MethodDescriptorProto. + * Use `create(MethodDescriptorProtoSchema)` to create a new message. + */ +export declare const MethodDescriptorProtoSchema: GenMessage; +/** + * @generated from message google.protobuf.FileOptions + */ +export type FileOptions = Message<"google.protobuf.FileOptions"> & { + /** + * Sets the Java package where classes generated from this .proto will be + * placed. By default, the proto package is used, but this is often + * inappropriate because proto packages do not normally start with backwards + * domain names. + * + * @generated from field: optional string java_package = 1; + */ + javaPackage: string; + /** + * Controls the name of the wrapper Java class generated for the .proto file. + * That class will always contain the .proto file's getDescriptor() method as + * well as any top-level extensions defined in the .proto file. + * If java_multiple_files is disabled, then all the other classes from the + * .proto file will be nested inside the single wrapper outer class. + * + * @generated from field: optional string java_outer_classname = 8; + */ + javaOuterClassname: string; + /** + * If enabled, then the Java code generator will generate a separate .java + * file for each top-level message, enum, and service defined in the .proto + * file. Thus, these types will *not* be nested inside the wrapper class + * named by java_outer_classname. However, the wrapper class will still be + * generated to contain the file's getDescriptor() method as well as any + * top-level extensions defined in the file. + * + * @generated from field: optional bool java_multiple_files = 10 [default = false]; + */ + javaMultipleFiles: boolean; + /** + * This option does nothing. + * + * @generated from field: optional bool java_generate_equals_and_hash = 20 [deprecated = true]; + * @deprecated + */ + javaGenerateEqualsAndHash: boolean; + /** + * A proto2 file can set this to true to opt in to UTF-8 checking for Java, + * which will throw an exception if invalid UTF-8 is parsed from the wire or + * assigned to a string field. + * + * TODO: clarify exactly what kinds of field types this option + * applies to, and update these docs accordingly. + * + * Proto3 files already perform these checks. Setting the option explicitly to + * false has no effect: it cannot be used to opt proto3 files out of UTF-8 + * checks. + * + * @generated from field: optional bool java_string_check_utf8 = 27 [default = false]; + */ + javaStringCheckUtf8: boolean; + /** + * @generated from field: optional google.protobuf.FileOptions.OptimizeMode optimize_for = 9 [default = SPEED]; + */ + optimizeFor: FileOptions_OptimizeMode; + /** + * Sets the Go package where structs generated from this .proto will be + * placed. If omitted, the Go package will be derived from the following: + * - The basename of the package import path, if provided. + * - Otherwise, the package statement in the .proto file, if present. + * - Otherwise, the basename of the .proto file, without extension. + * + * @generated from field: optional string go_package = 11; + */ + goPackage: string; + /** + * Should generic services be generated in each language? "Generic" services + * are not specific to any particular RPC system. They are generated by the + * main code generators in each language (without additional plugins). + * Generic services were the only kind of service generation supported by + * early versions of google.protobuf. + * + * Generic services are now considered deprecated in favor of using plugins + * that generate code specific to your particular RPC system. Therefore, + * these default to false. Old code which depends on generic services should + * explicitly set them to true. + * + * @generated from field: optional bool cc_generic_services = 16 [default = false]; + */ + ccGenericServices: boolean; + /** + * @generated from field: optional bool java_generic_services = 17 [default = false]; + */ + javaGenericServices: boolean; + /** + * @generated from field: optional bool py_generic_services = 18 [default = false]; + */ + pyGenericServices: boolean; + /** + * Is this file deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for everything in the file, or it will be completely ignored; in the very + * least, this is a formalization for deprecating files. + * + * @generated from field: optional bool deprecated = 23 [default = false]; + */ + deprecated: boolean; + /** + * Enables the use of arenas for the proto messages in this file. This applies + * only to generated classes for C++. + * + * @generated from field: optional bool cc_enable_arenas = 31 [default = true]; + */ + ccEnableArenas: boolean; + /** + * Sets the objective c class prefix which is prepended to all objective c + * generated classes from this .proto. There is no default. + * + * @generated from field: optional string objc_class_prefix = 36; + */ + objcClassPrefix: string; + /** + * Namespace for generated classes; defaults to the package. + * + * @generated from field: optional string csharp_namespace = 37; + */ + csharpNamespace: string; + /** + * By default Swift generators will take the proto package and CamelCase it + * replacing '.' with underscore and use that to prefix the types/symbols + * defined. When this options is provided, they will use this value instead + * to prefix the types/symbols defined. + * + * @generated from field: optional string swift_prefix = 39; + */ + swiftPrefix: string; + /** + * Sets the php class prefix which is prepended to all php generated classes + * from this .proto. Default is empty. + * + * @generated from field: optional string php_class_prefix = 40; + */ + phpClassPrefix: string; + /** + * Use this option to change the namespace of php generated classes. Default + * is empty. When this option is empty, the package name will be used for + * determining the namespace. + * + * @generated from field: optional string php_namespace = 41; + */ + phpNamespace: string; + /** + * Use this option to change the namespace of php generated metadata classes. + * Default is empty. When this option is empty, the proto file name will be + * used for determining the namespace. + * + * @generated from field: optional string php_metadata_namespace = 44; + */ + phpMetadataNamespace: string; + /** + * Use this option to change the package of ruby generated classes. Default + * is empty. When this option is not set, the package name will be used for + * determining the ruby package. + * + * @generated from field: optional string ruby_package = 45; + */ + rubyPackage: string; + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * @generated from field: optional google.protobuf.FeatureSet features = 50; + */ + features?: FeatureSet | undefined; + /** + * The parser stores options it doesn't recognize here. + * See the documentation for the "Options" section above. + * + * @generated from field: repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; + */ + uninterpretedOption: UninterpretedOption[]; +}; +/** + * @generated from message google.protobuf.FileOptions + */ +export type FileOptionsJson = { + /** + * Sets the Java package where classes generated from this .proto will be + * placed. By default, the proto package is used, but this is often + * inappropriate because proto packages do not normally start with backwards + * domain names. + * + * @generated from field: optional string java_package = 1; + */ + javaPackage?: string; + /** + * Controls the name of the wrapper Java class generated for the .proto file. + * That class will always contain the .proto file's getDescriptor() method as + * well as any top-level extensions defined in the .proto file. + * If java_multiple_files is disabled, then all the other classes from the + * .proto file will be nested inside the single wrapper outer class. + * + * @generated from field: optional string java_outer_classname = 8; + */ + javaOuterClassname?: string; + /** + * If enabled, then the Java code generator will generate a separate .java + * file for each top-level message, enum, and service defined in the .proto + * file. Thus, these types will *not* be nested inside the wrapper class + * named by java_outer_classname. However, the wrapper class will still be + * generated to contain the file's getDescriptor() method as well as any + * top-level extensions defined in the file. + * + * @generated from field: optional bool java_multiple_files = 10 [default = false]; + */ + javaMultipleFiles?: boolean; + /** + * This option does nothing. + * + * @generated from field: optional bool java_generate_equals_and_hash = 20 [deprecated = true]; + * @deprecated + */ + javaGenerateEqualsAndHash?: boolean; + /** + * A proto2 file can set this to true to opt in to UTF-8 checking for Java, + * which will throw an exception if invalid UTF-8 is parsed from the wire or + * assigned to a string field. + * + * TODO: clarify exactly what kinds of field types this option + * applies to, and update these docs accordingly. + * + * Proto3 files already perform these checks. Setting the option explicitly to + * false has no effect: it cannot be used to opt proto3 files out of UTF-8 + * checks. + * + * @generated from field: optional bool java_string_check_utf8 = 27 [default = false]; + */ + javaStringCheckUtf8?: boolean; + /** + * @generated from field: optional google.protobuf.FileOptions.OptimizeMode optimize_for = 9 [default = SPEED]; + */ + optimizeFor?: FileOptions_OptimizeModeJson; + /** + * Sets the Go package where structs generated from this .proto will be + * placed. If omitted, the Go package will be derived from the following: + * - The basename of the package import path, if provided. + * - Otherwise, the package statement in the .proto file, if present. + * - Otherwise, the basename of the .proto file, without extension. + * + * @generated from field: optional string go_package = 11; + */ + goPackage?: string; + /** + * Should generic services be generated in each language? "Generic" services + * are not specific to any particular RPC system. They are generated by the + * main code generators in each language (without additional plugins). + * Generic services were the only kind of service generation supported by + * early versions of google.protobuf. + * + * Generic services are now considered deprecated in favor of using plugins + * that generate code specific to your particular RPC system. Therefore, + * these default to false. Old code which depends on generic services should + * explicitly set them to true. + * + * @generated from field: optional bool cc_generic_services = 16 [default = false]; + */ + ccGenericServices?: boolean; + /** + * @generated from field: optional bool java_generic_services = 17 [default = false]; + */ + javaGenericServices?: boolean; + /** + * @generated from field: optional bool py_generic_services = 18 [default = false]; + */ + pyGenericServices?: boolean; + /** + * Is this file deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for everything in the file, or it will be completely ignored; in the very + * least, this is a formalization for deprecating files. + * + * @generated from field: optional bool deprecated = 23 [default = false]; + */ + deprecated?: boolean; + /** + * Enables the use of arenas for the proto messages in this file. This applies + * only to generated classes for C++. + * + * @generated from field: optional bool cc_enable_arenas = 31 [default = true]; + */ + ccEnableArenas?: boolean; + /** + * Sets the objective c class prefix which is prepended to all objective c + * generated classes from this .proto. There is no default. + * + * @generated from field: optional string objc_class_prefix = 36; + */ + objcClassPrefix?: string; + /** + * Namespace for generated classes; defaults to the package. + * + * @generated from field: optional string csharp_namespace = 37; + */ + csharpNamespace?: string; + /** + * By default Swift generators will take the proto package and CamelCase it + * replacing '.' with underscore and use that to prefix the types/symbols + * defined. When this options is provided, they will use this value instead + * to prefix the types/symbols defined. + * + * @generated from field: optional string swift_prefix = 39; + */ + swiftPrefix?: string; + /** + * Sets the php class prefix which is prepended to all php generated classes + * from this .proto. Default is empty. + * + * @generated from field: optional string php_class_prefix = 40; + */ + phpClassPrefix?: string; + /** + * Use this option to change the namespace of php generated classes. Default + * is empty. When this option is empty, the package name will be used for + * determining the namespace. + * + * @generated from field: optional string php_namespace = 41; + */ + phpNamespace?: string; + /** + * Use this option to change the namespace of php generated metadata classes. + * Default is empty. When this option is empty, the proto file name will be + * used for determining the namespace. + * + * @generated from field: optional string php_metadata_namespace = 44; + */ + phpMetadataNamespace?: string; + /** + * Use this option to change the package of ruby generated classes. Default + * is empty. When this option is not set, the package name will be used for + * determining the ruby package. + * + * @generated from field: optional string ruby_package = 45; + */ + rubyPackage?: string; + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * @generated from field: optional google.protobuf.FeatureSet features = 50; + */ + features?: FeatureSetJson; + /** + * The parser stores options it doesn't recognize here. + * See the documentation for the "Options" section above. + * + * @generated from field: repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; + */ + uninterpretedOption?: UninterpretedOptionJson[]; +}; +/** + * Describes the message google.protobuf.FileOptions. + * Use `create(FileOptionsSchema)` to create a new message. + */ +export declare const FileOptionsSchema: GenMessage; +/** + * Generated classes can be optimized for speed or code size. + * + * @generated from enum google.protobuf.FileOptions.OptimizeMode + */ +export declare enum FileOptions_OptimizeMode { + /** + * Generate complete code for parsing, serialization, + * + * @generated from enum value: SPEED = 1; + */ + SPEED = 1, + /** + * etc. + * + * Use ReflectionOps to implement these methods. + * + * @generated from enum value: CODE_SIZE = 2; + */ + CODE_SIZE = 2, + /** + * Generate code using MessageLite and the lite runtime. + * + * @generated from enum value: LITE_RUNTIME = 3; + */ + LITE_RUNTIME = 3 +} +/** + * Generated classes can be optimized for speed or code size. + * + * @generated from enum google.protobuf.FileOptions.OptimizeMode + */ +export type FileOptions_OptimizeModeJson = "SPEED" | "CODE_SIZE" | "LITE_RUNTIME"; +/** + * Describes the enum google.protobuf.FileOptions.OptimizeMode. + */ +export declare const FileOptions_OptimizeModeSchema: GenEnum; +/** + * @generated from message google.protobuf.MessageOptions + */ +export type MessageOptions = Message<"google.protobuf.MessageOptions"> & { + /** + * Set true to use the old proto1 MessageSet wire format for extensions. + * This is provided for backwards-compatibility with the MessageSet wire + * format. You should not use this for any other reason: It's less + * efficient, has fewer features, and is more complicated. + * + * The message must be defined exactly as follows: + * message Foo { + * option message_set_wire_format = true; + * extensions 4 to max; + * } + * Note that the message cannot have any defined fields; MessageSets only + * have extensions. + * + * All extensions of your type must be singular messages; e.g. they cannot + * be int32s, enums, or repeated messages. + * + * Because this is an option, the above two restrictions are not enforced by + * the protocol compiler. + * + * @generated from field: optional bool message_set_wire_format = 1 [default = false]; + */ + messageSetWireFormat: boolean; + /** + * Disables the generation of the standard "descriptor()" accessor, which can + * conflict with a field of the same name. This is meant to make migration + * from proto1 easier; new code should avoid fields named "descriptor". + * + * @generated from field: optional bool no_standard_descriptor_accessor = 2 [default = false]; + */ + noStandardDescriptorAccessor: boolean; + /** + * Is this message deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the message, or it will be completely ignored; in the very least, + * this is a formalization for deprecating messages. + * + * @generated from field: optional bool deprecated = 3 [default = false]; + */ + deprecated: boolean; + /** + * Whether the message is an automatically generated map entry type for the + * maps field. + * + * For maps fields: + * map map_field = 1; + * The parsed descriptor looks like: + * message MapFieldEntry { + * option map_entry = true; + * optional KeyType key = 1; + * optional ValueType value = 2; + * } + * repeated MapFieldEntry map_field = 1; + * + * Implementations may choose not to generate the map_entry=true message, but + * use a native map in the target language to hold the keys and values. + * The reflection APIs in such implementations still need to work as + * if the field is a repeated message field. + * + * NOTE: Do not set the option in .proto files. Always use the maps syntax + * instead. The option should only be implicitly set by the proto compiler + * parser. + * + * @generated from field: optional bool map_entry = 7; + */ + mapEntry: boolean; + /** + * Enable the legacy handling of JSON field name conflicts. This lowercases + * and strips underscored from the fields before comparison in proto3 only. + * The new behavior takes `json_name` into account and applies to proto2 as + * well. + * + * This should only be used as a temporary measure against broken builds due + * to the change in behavior for JSON field name conflicts. + * + * TODO This is legacy behavior we plan to remove once downstream + * teams have had time to migrate. + * + * @generated from field: optional bool deprecated_legacy_json_field_conflicts = 11 [deprecated = true]; + * @deprecated + */ + deprecatedLegacyJsonFieldConflicts: boolean; + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * @generated from field: optional google.protobuf.FeatureSet features = 12; + */ + features?: FeatureSet | undefined; + /** + * The parser stores options it doesn't recognize here. See above. + * + * @generated from field: repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; + */ + uninterpretedOption: UninterpretedOption[]; +}; +/** + * @generated from message google.protobuf.MessageOptions + */ +export type MessageOptionsJson = { + /** + * Set true to use the old proto1 MessageSet wire format for extensions. + * This is provided for backwards-compatibility with the MessageSet wire + * format. You should not use this for any other reason: It's less + * efficient, has fewer features, and is more complicated. + * + * The message must be defined exactly as follows: + * message Foo { + * option message_set_wire_format = true; + * extensions 4 to max; + * } + * Note that the message cannot have any defined fields; MessageSets only + * have extensions. + * + * All extensions of your type must be singular messages; e.g. they cannot + * be int32s, enums, or repeated messages. + * + * Because this is an option, the above two restrictions are not enforced by + * the protocol compiler. + * + * @generated from field: optional bool message_set_wire_format = 1 [default = false]; + */ + messageSetWireFormat?: boolean; + /** + * Disables the generation of the standard "descriptor()" accessor, which can + * conflict with a field of the same name. This is meant to make migration + * from proto1 easier; new code should avoid fields named "descriptor". + * + * @generated from field: optional bool no_standard_descriptor_accessor = 2 [default = false]; + */ + noStandardDescriptorAccessor?: boolean; + /** + * Is this message deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the message, or it will be completely ignored; in the very least, + * this is a formalization for deprecating messages. + * + * @generated from field: optional bool deprecated = 3 [default = false]; + */ + deprecated?: boolean; + /** + * Whether the message is an automatically generated map entry type for the + * maps field. + * + * For maps fields: + * map map_field = 1; + * The parsed descriptor looks like: + * message MapFieldEntry { + * option map_entry = true; + * optional KeyType key = 1; + * optional ValueType value = 2; + * } + * repeated MapFieldEntry map_field = 1; + * + * Implementations may choose not to generate the map_entry=true message, but + * use a native map in the target language to hold the keys and values. + * The reflection APIs in such implementations still need to work as + * if the field is a repeated message field. + * + * NOTE: Do not set the option in .proto files. Always use the maps syntax + * instead. The option should only be implicitly set by the proto compiler + * parser. + * + * @generated from field: optional bool map_entry = 7; + */ + mapEntry?: boolean; + /** + * Enable the legacy handling of JSON field name conflicts. This lowercases + * and strips underscored from the fields before comparison in proto3 only. + * The new behavior takes `json_name` into account and applies to proto2 as + * well. + * + * This should only be used as a temporary measure against broken builds due + * to the change in behavior for JSON field name conflicts. + * + * TODO This is legacy behavior we plan to remove once downstream + * teams have had time to migrate. + * + * @generated from field: optional bool deprecated_legacy_json_field_conflicts = 11 [deprecated = true]; + * @deprecated + */ + deprecatedLegacyJsonFieldConflicts?: boolean; + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * @generated from field: optional google.protobuf.FeatureSet features = 12; + */ + features?: FeatureSetJson; + /** + * The parser stores options it doesn't recognize here. See above. + * + * @generated from field: repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; + */ + uninterpretedOption?: UninterpretedOptionJson[]; +}; +/** + * Describes the message google.protobuf.MessageOptions. + * Use `create(MessageOptionsSchema)` to create a new message. + */ +export declare const MessageOptionsSchema: GenMessage; +/** + * @generated from message google.protobuf.FieldOptions + */ +export type FieldOptions = Message<"google.protobuf.FieldOptions"> & { + /** + * NOTE: ctype is deprecated. Use `features.(pb.cpp).string_type` instead. + * The ctype option instructs the C++ code generator to use a different + * representation of the field than it normally would. See the specific + * options below. This option is only implemented to support use of + * [ctype=CORD] and [ctype=STRING] (the default) on non-repeated fields of + * type "bytes" in the open source release. + * TODO: make ctype actually deprecated. + * + * @generated from field: optional google.protobuf.FieldOptions.CType ctype = 1 [default = STRING]; + */ + ctype: FieldOptions_CType; + /** + * The packed option can be enabled for repeated primitive fields to enable + * a more efficient representation on the wire. Rather than repeatedly + * writing the tag and type for each element, the entire array is encoded as + * a single length-delimited blob. In proto3, only explicit setting it to + * false will avoid using packed encoding. This option is prohibited in + * Editions, but the `repeated_field_encoding` feature can be used to control + * the behavior. + * + * @generated from field: optional bool packed = 2; + */ + packed: boolean; + /** + * The jstype option determines the JavaScript type used for values of the + * field. The option is permitted only for 64 bit integral and fixed types + * (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING + * is represented as JavaScript string, which avoids loss of precision that + * can happen when a large value is converted to a floating point JavaScript. + * Specifying JS_NUMBER for the jstype causes the generated JavaScript code to + * use the JavaScript "number" type. The behavior of the default option + * JS_NORMAL is implementation dependent. + * + * This option is an enum to permit additional types to be added, e.g. + * goog.math.Integer. + * + * @generated from field: optional google.protobuf.FieldOptions.JSType jstype = 6 [default = JS_NORMAL]; + */ + jstype: FieldOptions_JSType; + /** + * Should this field be parsed lazily? Lazy applies only to message-type + * fields. It means that when the outer message is initially parsed, the + * inner message's contents will not be parsed but instead stored in encoded + * form. The inner message will actually be parsed when it is first accessed. + * + * This is only a hint. Implementations are free to choose whether to use + * eager or lazy parsing regardless of the value of this option. However, + * setting this option true suggests that the protocol author believes that + * using lazy parsing on this field is worth the additional bookkeeping + * overhead typically needed to implement it. + * + * This option does not affect the public interface of any generated code; + * all method signatures remain the same. Furthermore, thread-safety of the + * interface is not affected by this option; const methods remain safe to + * call from multiple threads concurrently, while non-const methods continue + * to require exclusive access. + * + * Note that lazy message fields are still eagerly verified to check + * ill-formed wireformat or missing required fields. Calling IsInitialized() + * on the outer message would fail if the inner message has missing required + * fields. Failed verification would result in parsing failure (except when + * uninitialized messages are acceptable). + * + * @generated from field: optional bool lazy = 5 [default = false]; + */ + lazy: boolean; + /** + * unverified_lazy does no correctness checks on the byte stream. This should + * only be used where lazy with verification is prohibitive for performance + * reasons. + * + * @generated from field: optional bool unverified_lazy = 15 [default = false]; + */ + unverifiedLazy: boolean; + /** + * Is this field deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for accessors, or it will be completely ignored; in the very least, this + * is a formalization for deprecating fields. + * + * @generated from field: optional bool deprecated = 3 [default = false]; + */ + deprecated: boolean; + /** + * DEPRECATED. DO NOT USE! + * For Google-internal migration only. Do not use. + * + * @generated from field: optional bool weak = 10 [default = false, deprecated = true]; + * @deprecated + */ + weak: boolean; + /** + * Indicate that the field value should not be printed out when using debug + * formats, e.g. when the field contains sensitive credentials. + * + * @generated from field: optional bool debug_redact = 16 [default = false]; + */ + debugRedact: boolean; + /** + * @generated from field: optional google.protobuf.FieldOptions.OptionRetention retention = 17; + */ + retention: FieldOptions_OptionRetention; + /** + * @generated from field: repeated google.protobuf.FieldOptions.OptionTargetType targets = 19; + */ + targets: FieldOptions_OptionTargetType[]; + /** + * @generated from field: repeated google.protobuf.FieldOptions.EditionDefault edition_defaults = 20; + */ + editionDefaults: FieldOptions_EditionDefault[]; + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * @generated from field: optional google.protobuf.FeatureSet features = 21; + */ + features?: FeatureSet | undefined; + /** + * @generated from field: optional google.protobuf.FieldOptions.FeatureSupport feature_support = 22; + */ + featureSupport?: FieldOptions_FeatureSupport | undefined; + /** + * The parser stores options it doesn't recognize here. See above. + * + * @generated from field: repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; + */ + uninterpretedOption: UninterpretedOption[]; +}; +/** + * @generated from message google.protobuf.FieldOptions + */ +export type FieldOptionsJson = { + /** + * NOTE: ctype is deprecated. Use `features.(pb.cpp).string_type` instead. + * The ctype option instructs the C++ code generator to use a different + * representation of the field than it normally would. See the specific + * options below. This option is only implemented to support use of + * [ctype=CORD] and [ctype=STRING] (the default) on non-repeated fields of + * type "bytes" in the open source release. + * TODO: make ctype actually deprecated. + * + * @generated from field: optional google.protobuf.FieldOptions.CType ctype = 1 [default = STRING]; + */ + ctype?: FieldOptions_CTypeJson; + /** + * The packed option can be enabled for repeated primitive fields to enable + * a more efficient representation on the wire. Rather than repeatedly + * writing the tag and type for each element, the entire array is encoded as + * a single length-delimited blob. In proto3, only explicit setting it to + * false will avoid using packed encoding. This option is prohibited in + * Editions, but the `repeated_field_encoding` feature can be used to control + * the behavior. + * + * @generated from field: optional bool packed = 2; + */ + packed?: boolean; + /** + * The jstype option determines the JavaScript type used for values of the + * field. The option is permitted only for 64 bit integral and fixed types + * (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING + * is represented as JavaScript string, which avoids loss of precision that + * can happen when a large value is converted to a floating point JavaScript. + * Specifying JS_NUMBER for the jstype causes the generated JavaScript code to + * use the JavaScript "number" type. The behavior of the default option + * JS_NORMAL is implementation dependent. + * + * This option is an enum to permit additional types to be added, e.g. + * goog.math.Integer. + * + * @generated from field: optional google.protobuf.FieldOptions.JSType jstype = 6 [default = JS_NORMAL]; + */ + jstype?: FieldOptions_JSTypeJson; + /** + * Should this field be parsed lazily? Lazy applies only to message-type + * fields. It means that when the outer message is initially parsed, the + * inner message's contents will not be parsed but instead stored in encoded + * form. The inner message will actually be parsed when it is first accessed. + * + * This is only a hint. Implementations are free to choose whether to use + * eager or lazy parsing regardless of the value of this option. However, + * setting this option true suggests that the protocol author believes that + * using lazy parsing on this field is worth the additional bookkeeping + * overhead typically needed to implement it. + * + * This option does not affect the public interface of any generated code; + * all method signatures remain the same. Furthermore, thread-safety of the + * interface is not affected by this option; const methods remain safe to + * call from multiple threads concurrently, while non-const methods continue + * to require exclusive access. + * + * Note that lazy message fields are still eagerly verified to check + * ill-formed wireformat or missing required fields. Calling IsInitialized() + * on the outer message would fail if the inner message has missing required + * fields. Failed verification would result in parsing failure (except when + * uninitialized messages are acceptable). + * + * @generated from field: optional bool lazy = 5 [default = false]; + */ + lazy?: boolean; + /** + * unverified_lazy does no correctness checks on the byte stream. This should + * only be used where lazy with verification is prohibitive for performance + * reasons. + * + * @generated from field: optional bool unverified_lazy = 15 [default = false]; + */ + unverifiedLazy?: boolean; + /** + * Is this field deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for accessors, or it will be completely ignored; in the very least, this + * is a formalization for deprecating fields. + * + * @generated from field: optional bool deprecated = 3 [default = false]; + */ + deprecated?: boolean; + /** + * DEPRECATED. DO NOT USE! + * For Google-internal migration only. Do not use. + * + * @generated from field: optional bool weak = 10 [default = false, deprecated = true]; + * @deprecated + */ + weak?: boolean; + /** + * Indicate that the field value should not be printed out when using debug + * formats, e.g. when the field contains sensitive credentials. + * + * @generated from field: optional bool debug_redact = 16 [default = false]; + */ + debugRedact?: boolean; + /** + * @generated from field: optional google.protobuf.FieldOptions.OptionRetention retention = 17; + */ + retention?: FieldOptions_OptionRetentionJson; + /** + * @generated from field: repeated google.protobuf.FieldOptions.OptionTargetType targets = 19; + */ + targets?: FieldOptions_OptionTargetTypeJson[]; + /** + * @generated from field: repeated google.protobuf.FieldOptions.EditionDefault edition_defaults = 20; + */ + editionDefaults?: FieldOptions_EditionDefaultJson[]; + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * @generated from field: optional google.protobuf.FeatureSet features = 21; + */ + features?: FeatureSetJson; + /** + * @generated from field: optional google.protobuf.FieldOptions.FeatureSupport feature_support = 22; + */ + featureSupport?: FieldOptions_FeatureSupportJson; + /** + * The parser stores options it doesn't recognize here. See above. + * + * @generated from field: repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; + */ + uninterpretedOption?: UninterpretedOptionJson[]; +}; +/** + * Describes the message google.protobuf.FieldOptions. + * Use `create(FieldOptionsSchema)` to create a new message. + */ +export declare const FieldOptionsSchema: GenMessage; +/** + * @generated from message google.protobuf.FieldOptions.EditionDefault + */ +export type FieldOptions_EditionDefault = Message<"google.protobuf.FieldOptions.EditionDefault"> & { + /** + * @generated from field: optional google.protobuf.Edition edition = 3; + */ + edition: Edition; + /** + * Textproto value. + * + * @generated from field: optional string value = 2; + */ + value: string; +}; +/** + * @generated from message google.protobuf.FieldOptions.EditionDefault + */ +export type FieldOptions_EditionDefaultJson = { + /** + * @generated from field: optional google.protobuf.Edition edition = 3; + */ + edition?: EditionJson; + /** + * Textproto value. + * + * @generated from field: optional string value = 2; + */ + value?: string; +}; +/** + * Describes the message google.protobuf.FieldOptions.EditionDefault. + * Use `create(FieldOptions_EditionDefaultSchema)` to create a new message. + */ +export declare const FieldOptions_EditionDefaultSchema: GenMessage; +/** + * Information about the support window of a feature. + * + * @generated from message google.protobuf.FieldOptions.FeatureSupport + */ +export type FieldOptions_FeatureSupport = Message<"google.protobuf.FieldOptions.FeatureSupport"> & { + /** + * The edition that this feature was first available in. In editions + * earlier than this one, the default assigned to EDITION_LEGACY will be + * used, and proto files will not be able to override it. + * + * @generated from field: optional google.protobuf.Edition edition_introduced = 1; + */ + editionIntroduced: Edition; + /** + * The edition this feature becomes deprecated in. Using this after this + * edition may trigger warnings. + * + * @generated from field: optional google.protobuf.Edition edition_deprecated = 2; + */ + editionDeprecated: Edition; + /** + * The deprecation warning text if this feature is used after the edition it + * was marked deprecated in. + * + * @generated from field: optional string deprecation_warning = 3; + */ + deprecationWarning: string; + /** + * The edition this feature is no longer available in. In editions after + * this one, the last default assigned will be used, and proto files will + * not be able to override it. + * + * @generated from field: optional google.protobuf.Edition edition_removed = 4; + */ + editionRemoved: Edition; + /** + * The removal error text if this feature is used after the edition it was + * removed in. + * + * @generated from field: optional string removal_error = 5; + */ + removalError: string; +}; +/** + * Information about the support window of a feature. + * + * @generated from message google.protobuf.FieldOptions.FeatureSupport + */ +export type FieldOptions_FeatureSupportJson = { + /** + * The edition that this feature was first available in. In editions + * earlier than this one, the default assigned to EDITION_LEGACY will be + * used, and proto files will not be able to override it. + * + * @generated from field: optional google.protobuf.Edition edition_introduced = 1; + */ + editionIntroduced?: EditionJson; + /** + * The edition this feature becomes deprecated in. Using this after this + * edition may trigger warnings. + * + * @generated from field: optional google.protobuf.Edition edition_deprecated = 2; + */ + editionDeprecated?: EditionJson; + /** + * The deprecation warning text if this feature is used after the edition it + * was marked deprecated in. + * + * @generated from field: optional string deprecation_warning = 3; + */ + deprecationWarning?: string; + /** + * The edition this feature is no longer available in. In editions after + * this one, the last default assigned will be used, and proto files will + * not be able to override it. + * + * @generated from field: optional google.protobuf.Edition edition_removed = 4; + */ + editionRemoved?: EditionJson; + /** + * The removal error text if this feature is used after the edition it was + * removed in. + * + * @generated from field: optional string removal_error = 5; + */ + removalError?: string; +}; +/** + * Describes the message google.protobuf.FieldOptions.FeatureSupport. + * Use `create(FieldOptions_FeatureSupportSchema)` to create a new message. + */ +export declare const FieldOptions_FeatureSupportSchema: GenMessage; +/** + * @generated from enum google.protobuf.FieldOptions.CType + */ +export declare enum FieldOptions_CType { + /** + * Default mode. + * + * @generated from enum value: STRING = 0; + */ + STRING = 0, + /** + * The option [ctype=CORD] may be applied to a non-repeated field of type + * "bytes". It indicates that in C++, the data should be stored in a Cord + * instead of a string. For very large strings, this may reduce memory + * fragmentation. It may also allow better performance when parsing from a + * Cord, or when parsing with aliasing enabled, as the parsed Cord may then + * alias the original buffer. + * + * @generated from enum value: CORD = 1; + */ + CORD = 1, + /** + * @generated from enum value: STRING_PIECE = 2; + */ + STRING_PIECE = 2 +} +/** + * @generated from enum google.protobuf.FieldOptions.CType + */ +export type FieldOptions_CTypeJson = "STRING" | "CORD" | "STRING_PIECE"; +/** + * Describes the enum google.protobuf.FieldOptions.CType. + */ +export declare const FieldOptions_CTypeSchema: GenEnum; +/** + * @generated from enum google.protobuf.FieldOptions.JSType + */ +export declare enum FieldOptions_JSType { + /** + * Use the default type. + * + * @generated from enum value: JS_NORMAL = 0; + */ + JS_NORMAL = 0, + /** + * Use JavaScript strings. + * + * @generated from enum value: JS_STRING = 1; + */ + JS_STRING = 1, + /** + * Use JavaScript numbers. + * + * @generated from enum value: JS_NUMBER = 2; + */ + JS_NUMBER = 2 +} +/** + * @generated from enum google.protobuf.FieldOptions.JSType + */ +export type FieldOptions_JSTypeJson = "JS_NORMAL" | "JS_STRING" | "JS_NUMBER"; +/** + * Describes the enum google.protobuf.FieldOptions.JSType. + */ +export declare const FieldOptions_JSTypeSchema: GenEnum; +/** + * If set to RETENTION_SOURCE, the option will be omitted from the binary. + * + * @generated from enum google.protobuf.FieldOptions.OptionRetention + */ +export declare enum FieldOptions_OptionRetention { + /** + * @generated from enum value: RETENTION_UNKNOWN = 0; + */ + RETENTION_UNKNOWN = 0, + /** + * @generated from enum value: RETENTION_RUNTIME = 1; + */ + RETENTION_RUNTIME = 1, + /** + * @generated from enum value: RETENTION_SOURCE = 2; + */ + RETENTION_SOURCE = 2 +} +/** + * If set to RETENTION_SOURCE, the option will be omitted from the binary. + * + * @generated from enum google.protobuf.FieldOptions.OptionRetention + */ +export type FieldOptions_OptionRetentionJson = "RETENTION_UNKNOWN" | "RETENTION_RUNTIME" | "RETENTION_SOURCE"; +/** + * Describes the enum google.protobuf.FieldOptions.OptionRetention. + */ +export declare const FieldOptions_OptionRetentionSchema: GenEnum; +/** + * This indicates the types of entities that the field may apply to when used + * as an option. If it is unset, then the field may be freely used as an + * option on any kind of entity. + * + * @generated from enum google.protobuf.FieldOptions.OptionTargetType + */ +export declare enum FieldOptions_OptionTargetType { + /** + * @generated from enum value: TARGET_TYPE_UNKNOWN = 0; + */ + TARGET_TYPE_UNKNOWN = 0, + /** + * @generated from enum value: TARGET_TYPE_FILE = 1; + */ + TARGET_TYPE_FILE = 1, + /** + * @generated from enum value: TARGET_TYPE_EXTENSION_RANGE = 2; + */ + TARGET_TYPE_EXTENSION_RANGE = 2, + /** + * @generated from enum value: TARGET_TYPE_MESSAGE = 3; + */ + TARGET_TYPE_MESSAGE = 3, + /** + * @generated from enum value: TARGET_TYPE_FIELD = 4; + */ + TARGET_TYPE_FIELD = 4, + /** + * @generated from enum value: TARGET_TYPE_ONEOF = 5; + */ + TARGET_TYPE_ONEOF = 5, + /** + * @generated from enum value: TARGET_TYPE_ENUM = 6; + */ + TARGET_TYPE_ENUM = 6, + /** + * @generated from enum value: TARGET_TYPE_ENUM_ENTRY = 7; + */ + TARGET_TYPE_ENUM_ENTRY = 7, + /** + * @generated from enum value: TARGET_TYPE_SERVICE = 8; + */ + TARGET_TYPE_SERVICE = 8, + /** + * @generated from enum value: TARGET_TYPE_METHOD = 9; + */ + TARGET_TYPE_METHOD = 9 +} +/** + * This indicates the types of entities that the field may apply to when used + * as an option. If it is unset, then the field may be freely used as an + * option on any kind of entity. + * + * @generated from enum google.protobuf.FieldOptions.OptionTargetType + */ +export type FieldOptions_OptionTargetTypeJson = "TARGET_TYPE_UNKNOWN" | "TARGET_TYPE_FILE" | "TARGET_TYPE_EXTENSION_RANGE" | "TARGET_TYPE_MESSAGE" | "TARGET_TYPE_FIELD" | "TARGET_TYPE_ONEOF" | "TARGET_TYPE_ENUM" | "TARGET_TYPE_ENUM_ENTRY" | "TARGET_TYPE_SERVICE" | "TARGET_TYPE_METHOD"; +/** + * Describes the enum google.protobuf.FieldOptions.OptionTargetType. + */ +export declare const FieldOptions_OptionTargetTypeSchema: GenEnum; +/** + * @generated from message google.protobuf.OneofOptions + */ +export type OneofOptions = Message<"google.protobuf.OneofOptions"> & { + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * @generated from field: optional google.protobuf.FeatureSet features = 1; + */ + features?: FeatureSet | undefined; + /** + * The parser stores options it doesn't recognize here. See above. + * + * @generated from field: repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; + */ + uninterpretedOption: UninterpretedOption[]; +}; +/** + * @generated from message google.protobuf.OneofOptions + */ +export type OneofOptionsJson = { + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * @generated from field: optional google.protobuf.FeatureSet features = 1; + */ + features?: FeatureSetJson; + /** + * The parser stores options it doesn't recognize here. See above. + * + * @generated from field: repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; + */ + uninterpretedOption?: UninterpretedOptionJson[]; +}; +/** + * Describes the message google.protobuf.OneofOptions. + * Use `create(OneofOptionsSchema)` to create a new message. + */ +export declare const OneofOptionsSchema: GenMessage; +/** + * @generated from message google.protobuf.EnumOptions + */ +export type EnumOptions = Message<"google.protobuf.EnumOptions"> & { + /** + * Set this option to true to allow mapping different tag names to the same + * value. + * + * @generated from field: optional bool allow_alias = 2; + */ + allowAlias: boolean; + /** + * Is this enum deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the enum, or it will be completely ignored; in the very least, this + * is a formalization for deprecating enums. + * + * @generated from field: optional bool deprecated = 3 [default = false]; + */ + deprecated: boolean; + /** + * Enable the legacy handling of JSON field name conflicts. This lowercases + * and strips underscored from the fields before comparison in proto3 only. + * The new behavior takes `json_name` into account and applies to proto2 as + * well. + * TODO Remove this legacy behavior once downstream teams have + * had time to migrate. + * + * @generated from field: optional bool deprecated_legacy_json_field_conflicts = 6 [deprecated = true]; + * @deprecated + */ + deprecatedLegacyJsonFieldConflicts: boolean; + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * @generated from field: optional google.protobuf.FeatureSet features = 7; + */ + features?: FeatureSet | undefined; + /** + * The parser stores options it doesn't recognize here. See above. + * + * @generated from field: repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; + */ + uninterpretedOption: UninterpretedOption[]; +}; +/** + * @generated from message google.protobuf.EnumOptions + */ +export type EnumOptionsJson = { + /** + * Set this option to true to allow mapping different tag names to the same + * value. + * + * @generated from field: optional bool allow_alias = 2; + */ + allowAlias?: boolean; + /** + * Is this enum deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the enum, or it will be completely ignored; in the very least, this + * is a formalization for deprecating enums. + * + * @generated from field: optional bool deprecated = 3 [default = false]; + */ + deprecated?: boolean; + /** + * Enable the legacy handling of JSON field name conflicts. This lowercases + * and strips underscored from the fields before comparison in proto3 only. + * The new behavior takes `json_name` into account and applies to proto2 as + * well. + * TODO Remove this legacy behavior once downstream teams have + * had time to migrate. + * + * @generated from field: optional bool deprecated_legacy_json_field_conflicts = 6 [deprecated = true]; + * @deprecated + */ + deprecatedLegacyJsonFieldConflicts?: boolean; + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * @generated from field: optional google.protobuf.FeatureSet features = 7; + */ + features?: FeatureSetJson; + /** + * The parser stores options it doesn't recognize here. See above. + * + * @generated from field: repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; + */ + uninterpretedOption?: UninterpretedOptionJson[]; +}; +/** + * Describes the message google.protobuf.EnumOptions. + * Use `create(EnumOptionsSchema)` to create a new message. + */ +export declare const EnumOptionsSchema: GenMessage; +/** + * @generated from message google.protobuf.EnumValueOptions + */ +export type EnumValueOptions = Message<"google.protobuf.EnumValueOptions"> & { + /** + * Is this enum value deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the enum value, or it will be completely ignored; in the very least, + * this is a formalization for deprecating enum values. + * + * @generated from field: optional bool deprecated = 1 [default = false]; + */ + deprecated: boolean; + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * @generated from field: optional google.protobuf.FeatureSet features = 2; + */ + features?: FeatureSet | undefined; + /** + * Indicate that fields annotated with this enum value should not be printed + * out when using debug formats, e.g. when the field contains sensitive + * credentials. + * + * @generated from field: optional bool debug_redact = 3 [default = false]; + */ + debugRedact: boolean; + /** + * Information about the support window of a feature value. + * + * @generated from field: optional google.protobuf.FieldOptions.FeatureSupport feature_support = 4; + */ + featureSupport?: FieldOptions_FeatureSupport | undefined; + /** + * The parser stores options it doesn't recognize here. See above. + * + * @generated from field: repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; + */ + uninterpretedOption: UninterpretedOption[]; +}; +/** + * @generated from message google.protobuf.EnumValueOptions + */ +export type EnumValueOptionsJson = { + /** + * Is this enum value deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the enum value, or it will be completely ignored; in the very least, + * this is a formalization for deprecating enum values. + * + * @generated from field: optional bool deprecated = 1 [default = false]; + */ + deprecated?: boolean; + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * @generated from field: optional google.protobuf.FeatureSet features = 2; + */ + features?: FeatureSetJson; + /** + * Indicate that fields annotated with this enum value should not be printed + * out when using debug formats, e.g. when the field contains sensitive + * credentials. + * + * @generated from field: optional bool debug_redact = 3 [default = false]; + */ + debugRedact?: boolean; + /** + * Information about the support window of a feature value. + * + * @generated from field: optional google.protobuf.FieldOptions.FeatureSupport feature_support = 4; + */ + featureSupport?: FieldOptions_FeatureSupportJson; + /** + * The parser stores options it doesn't recognize here. See above. + * + * @generated from field: repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; + */ + uninterpretedOption?: UninterpretedOptionJson[]; +}; +/** + * Describes the message google.protobuf.EnumValueOptions. + * Use `create(EnumValueOptionsSchema)` to create a new message. + */ +export declare const EnumValueOptionsSchema: GenMessage; +/** + * @generated from message google.protobuf.ServiceOptions + */ +export type ServiceOptions = Message<"google.protobuf.ServiceOptions"> & { + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * @generated from field: optional google.protobuf.FeatureSet features = 34; + */ + features?: FeatureSet | undefined; + /** + * Is this service deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the service, or it will be completely ignored; in the very least, + * this is a formalization for deprecating services. + * + * @generated from field: optional bool deprecated = 33 [default = false]; + */ + deprecated: boolean; + /** + * The parser stores options it doesn't recognize here. See above. + * + * @generated from field: repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; + */ + uninterpretedOption: UninterpretedOption[]; +}; +/** + * @generated from message google.protobuf.ServiceOptions + */ +export type ServiceOptionsJson = { + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * @generated from field: optional google.protobuf.FeatureSet features = 34; + */ + features?: FeatureSetJson; + /** + * Is this service deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the service, or it will be completely ignored; in the very least, + * this is a formalization for deprecating services. + * + * @generated from field: optional bool deprecated = 33 [default = false]; + */ + deprecated?: boolean; + /** + * The parser stores options it doesn't recognize here. See above. + * + * @generated from field: repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; + */ + uninterpretedOption?: UninterpretedOptionJson[]; +}; +/** + * Describes the message google.protobuf.ServiceOptions. + * Use `create(ServiceOptionsSchema)` to create a new message. + */ +export declare const ServiceOptionsSchema: GenMessage; +/** + * @generated from message google.protobuf.MethodOptions + */ +export type MethodOptions = Message<"google.protobuf.MethodOptions"> & { + /** + * Is this method deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the method, or it will be completely ignored; in the very least, + * this is a formalization for deprecating methods. + * + * @generated from field: optional bool deprecated = 33 [default = false]; + */ + deprecated: boolean; + /** + * @generated from field: optional google.protobuf.MethodOptions.IdempotencyLevel idempotency_level = 34 [default = IDEMPOTENCY_UNKNOWN]; + */ + idempotencyLevel: MethodOptions_IdempotencyLevel; + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * @generated from field: optional google.protobuf.FeatureSet features = 35; + */ + features?: FeatureSet | undefined; + /** + * The parser stores options it doesn't recognize here. See above. + * + * @generated from field: repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; + */ + uninterpretedOption: UninterpretedOption[]; +}; +/** + * @generated from message google.protobuf.MethodOptions + */ +export type MethodOptionsJson = { + /** + * Is this method deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the method, or it will be completely ignored; in the very least, + * this is a formalization for deprecating methods. + * + * @generated from field: optional bool deprecated = 33 [default = false]; + */ + deprecated?: boolean; + /** + * @generated from field: optional google.protobuf.MethodOptions.IdempotencyLevel idempotency_level = 34 [default = IDEMPOTENCY_UNKNOWN]; + */ + idempotencyLevel?: MethodOptions_IdempotencyLevelJson; + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * @generated from field: optional google.protobuf.FeatureSet features = 35; + */ + features?: FeatureSetJson; + /** + * The parser stores options it doesn't recognize here. See above. + * + * @generated from field: repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; + */ + uninterpretedOption?: UninterpretedOptionJson[]; +}; +/** + * Describes the message google.protobuf.MethodOptions. + * Use `create(MethodOptionsSchema)` to create a new message. + */ +export declare const MethodOptionsSchema: GenMessage; +/** + * Is this method side-effect-free (or safe in HTTP parlance), or idempotent, + * or neither? HTTP based RPC implementation may choose GET verb for safe + * methods, and PUT verb for idempotent methods instead of the default POST. + * + * @generated from enum google.protobuf.MethodOptions.IdempotencyLevel + */ +export declare enum MethodOptions_IdempotencyLevel { + /** + * @generated from enum value: IDEMPOTENCY_UNKNOWN = 0; + */ + IDEMPOTENCY_UNKNOWN = 0, + /** + * implies idempotent + * + * @generated from enum value: NO_SIDE_EFFECTS = 1; + */ + NO_SIDE_EFFECTS = 1, + /** + * idempotent, but may have side effects + * + * @generated from enum value: IDEMPOTENT = 2; + */ + IDEMPOTENT = 2 +} +/** + * Is this method side-effect-free (or safe in HTTP parlance), or idempotent, + * or neither? HTTP based RPC implementation may choose GET verb for safe + * methods, and PUT verb for idempotent methods instead of the default POST. + * + * @generated from enum google.protobuf.MethodOptions.IdempotencyLevel + */ +export type MethodOptions_IdempotencyLevelJson = "IDEMPOTENCY_UNKNOWN" | "NO_SIDE_EFFECTS" | "IDEMPOTENT"; +/** + * Describes the enum google.protobuf.MethodOptions.IdempotencyLevel. + */ +export declare const MethodOptions_IdempotencyLevelSchema: GenEnum; +/** + * A message representing a option the parser does not recognize. This only + * appears in options protos created by the compiler::Parser class. + * DescriptorPool resolves these when building Descriptor objects. Therefore, + * options protos in descriptor objects (e.g. returned by Descriptor::options(), + * or produced by Descriptor::CopyTo()) will never have UninterpretedOptions + * in them. + * + * @generated from message google.protobuf.UninterpretedOption + */ +export type UninterpretedOption = Message<"google.protobuf.UninterpretedOption"> & { + /** + * @generated from field: repeated google.protobuf.UninterpretedOption.NamePart name = 2; + */ + name: UninterpretedOption_NamePart[]; + /** + * The value of the uninterpreted option, in whatever type the tokenizer + * identified it as during parsing. Exactly one of these should be set. + * + * @generated from field: optional string identifier_value = 3; + */ + identifierValue: string; + /** + * @generated from field: optional uint64 positive_int_value = 4; + */ + positiveIntValue: bigint; + /** + * @generated from field: optional int64 negative_int_value = 5; + */ + negativeIntValue: bigint; + /** + * @generated from field: optional double double_value = 6; + */ + doubleValue: number; + /** + * @generated from field: optional bytes string_value = 7; + */ + stringValue: Uint8Array; + /** + * @generated from field: optional string aggregate_value = 8; + */ + aggregateValue: string; +}; +/** + * A message representing a option the parser does not recognize. This only + * appears in options protos created by the compiler::Parser class. + * DescriptorPool resolves these when building Descriptor objects. Therefore, + * options protos in descriptor objects (e.g. returned by Descriptor::options(), + * or produced by Descriptor::CopyTo()) will never have UninterpretedOptions + * in them. + * + * @generated from message google.protobuf.UninterpretedOption + */ +export type UninterpretedOptionJson = { + /** + * @generated from field: repeated google.protobuf.UninterpretedOption.NamePart name = 2; + */ + name?: UninterpretedOption_NamePartJson[]; + /** + * The value of the uninterpreted option, in whatever type the tokenizer + * identified it as during parsing. Exactly one of these should be set. + * + * @generated from field: optional string identifier_value = 3; + */ + identifierValue?: string; + /** + * @generated from field: optional uint64 positive_int_value = 4; + */ + positiveIntValue?: string; + /** + * @generated from field: optional int64 negative_int_value = 5; + */ + negativeIntValue?: string; + /** + * @generated from field: optional double double_value = 6; + */ + doubleValue?: number | "NaN" | "Infinity" | "-Infinity"; + /** + * @generated from field: optional bytes string_value = 7; + */ + stringValue?: string; + /** + * @generated from field: optional string aggregate_value = 8; + */ + aggregateValue?: string; +}; +/** + * Describes the message google.protobuf.UninterpretedOption. + * Use `create(UninterpretedOptionSchema)` to create a new message. + */ +export declare const UninterpretedOptionSchema: GenMessage; +/** + * The name of the uninterpreted option. Each string represents a segment in + * a dot-separated name. is_extension is true iff a segment represents an + * extension (denoted with parentheses in options specs in .proto files). + * E.g.,{ ["foo", false], ["bar.baz", true], ["moo", false] } represents + * "foo.(bar.baz).moo". + * + * @generated from message google.protobuf.UninterpretedOption.NamePart + */ +export type UninterpretedOption_NamePart = Message<"google.protobuf.UninterpretedOption.NamePart"> & { + /** + * @generated from field: required string name_part = 1; + */ + namePart: string; + /** + * @generated from field: required bool is_extension = 2; + */ + isExtension: boolean; +}; +/** + * The name of the uninterpreted option. Each string represents a segment in + * a dot-separated name. is_extension is true iff a segment represents an + * extension (denoted with parentheses in options specs in .proto files). + * E.g.,{ ["foo", false], ["bar.baz", true], ["moo", false] } represents + * "foo.(bar.baz).moo". + * + * @generated from message google.protobuf.UninterpretedOption.NamePart + */ +export type UninterpretedOption_NamePartJson = { + /** + * @generated from field: required string name_part = 1; + */ + namePart?: string; + /** + * @generated from field: required bool is_extension = 2; + */ + isExtension?: boolean; +}; +/** + * Describes the message google.protobuf.UninterpretedOption.NamePart. + * Use `create(UninterpretedOption_NamePartSchema)` to create a new message. + */ +export declare const UninterpretedOption_NamePartSchema: GenMessage; +/** + * TODO Enums in C++ gencode (and potentially other languages) are + * not well scoped. This means that each of the feature enums below can clash + * with each other. The short names we've chosen maximize call-site + * readability, but leave us very open to this scenario. A future feature will + * be designed and implemented to handle this, hopefully before we ever hit a + * conflict here. + * + * @generated from message google.protobuf.FeatureSet + */ +export type FeatureSet = Message<"google.protobuf.FeatureSet"> & { + /** + * @generated from field: optional google.protobuf.FeatureSet.FieldPresence field_presence = 1; + */ + fieldPresence: FeatureSet_FieldPresence; + /** + * @generated from field: optional google.protobuf.FeatureSet.EnumType enum_type = 2; + */ + enumType: FeatureSet_EnumType; + /** + * @generated from field: optional google.protobuf.FeatureSet.RepeatedFieldEncoding repeated_field_encoding = 3; + */ + repeatedFieldEncoding: FeatureSet_RepeatedFieldEncoding; + /** + * @generated from field: optional google.protobuf.FeatureSet.Utf8Validation utf8_validation = 4; + */ + utf8Validation: FeatureSet_Utf8Validation; + /** + * @generated from field: optional google.protobuf.FeatureSet.MessageEncoding message_encoding = 5; + */ + messageEncoding: FeatureSet_MessageEncoding; + /** + * @generated from field: optional google.protobuf.FeatureSet.JsonFormat json_format = 6; + */ + jsonFormat: FeatureSet_JsonFormat; + /** + * @generated from field: optional google.protobuf.FeatureSet.EnforceNamingStyle enforce_naming_style = 7; + */ + enforceNamingStyle: FeatureSet_EnforceNamingStyle; + /** + * @generated from field: optional google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility default_symbol_visibility = 8; + */ + defaultSymbolVisibility: FeatureSet_VisibilityFeature_DefaultSymbolVisibility; +}; +/** + * TODO Enums in C++ gencode (and potentially other languages) are + * not well scoped. This means that each of the feature enums below can clash + * with each other. The short names we've chosen maximize call-site + * readability, but leave us very open to this scenario. A future feature will + * be designed and implemented to handle this, hopefully before we ever hit a + * conflict here. + * + * @generated from message google.protobuf.FeatureSet + */ +export type FeatureSetJson = { + /** + * @generated from field: optional google.protobuf.FeatureSet.FieldPresence field_presence = 1; + */ + fieldPresence?: FeatureSet_FieldPresenceJson; + /** + * @generated from field: optional google.protobuf.FeatureSet.EnumType enum_type = 2; + */ + enumType?: FeatureSet_EnumTypeJson; + /** + * @generated from field: optional google.protobuf.FeatureSet.RepeatedFieldEncoding repeated_field_encoding = 3; + */ + repeatedFieldEncoding?: FeatureSet_RepeatedFieldEncodingJson; + /** + * @generated from field: optional google.protobuf.FeatureSet.Utf8Validation utf8_validation = 4; + */ + utf8Validation?: FeatureSet_Utf8ValidationJson; + /** + * @generated from field: optional google.protobuf.FeatureSet.MessageEncoding message_encoding = 5; + */ + messageEncoding?: FeatureSet_MessageEncodingJson; + /** + * @generated from field: optional google.protobuf.FeatureSet.JsonFormat json_format = 6; + */ + jsonFormat?: FeatureSet_JsonFormatJson; + /** + * @generated from field: optional google.protobuf.FeatureSet.EnforceNamingStyle enforce_naming_style = 7; + */ + enforceNamingStyle?: FeatureSet_EnforceNamingStyleJson; + /** + * @generated from field: optional google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility default_symbol_visibility = 8; + */ + defaultSymbolVisibility?: FeatureSet_VisibilityFeature_DefaultSymbolVisibilityJson; +}; +/** + * Describes the message google.protobuf.FeatureSet. + * Use `create(FeatureSetSchema)` to create a new message. + */ +export declare const FeatureSetSchema: GenMessage; +/** + * @generated from message google.protobuf.FeatureSet.VisibilityFeature + */ +export type FeatureSet_VisibilityFeature = Message<"google.protobuf.FeatureSet.VisibilityFeature"> & {}; +/** + * @generated from message google.protobuf.FeatureSet.VisibilityFeature + */ +export type FeatureSet_VisibilityFeatureJson = {}; +/** + * Describes the message google.protobuf.FeatureSet.VisibilityFeature. + * Use `create(FeatureSet_VisibilityFeatureSchema)` to create a new message. + */ +export declare const FeatureSet_VisibilityFeatureSchema: GenMessage; +/** + * @generated from enum google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility + */ +export declare enum FeatureSet_VisibilityFeature_DefaultSymbolVisibility { + /** + * @generated from enum value: DEFAULT_SYMBOL_VISIBILITY_UNKNOWN = 0; + */ + DEFAULT_SYMBOL_VISIBILITY_UNKNOWN = 0, + /** + * Default pre-EDITION_2024, all UNSET visibility are export. + * + * @generated from enum value: EXPORT_ALL = 1; + */ + EXPORT_ALL = 1, + /** + * All top-level symbols default to export, nested default to local. + * + * @generated from enum value: EXPORT_TOP_LEVEL = 2; + */ + EXPORT_TOP_LEVEL = 2, + /** + * All symbols default to local. + * + * @generated from enum value: LOCAL_ALL = 3; + */ + LOCAL_ALL = 3, + /** + * All symbols local by default. Nested types cannot be exported. + * With special case caveat for message { enum {} reserved 1 to max; } + * This is the recommended setting for new protos. + * + * @generated from enum value: STRICT = 4; + */ + STRICT = 4 +} +/** + * @generated from enum google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility + */ +export type FeatureSet_VisibilityFeature_DefaultSymbolVisibilityJson = "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN" | "EXPORT_ALL" | "EXPORT_TOP_LEVEL" | "LOCAL_ALL" | "STRICT"; +/** + * Describes the enum google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility. + */ +export declare const FeatureSet_VisibilityFeature_DefaultSymbolVisibilitySchema: GenEnum; +/** + * @generated from enum google.protobuf.FeatureSet.FieldPresence + */ +export declare enum FeatureSet_FieldPresence { + /** + * @generated from enum value: FIELD_PRESENCE_UNKNOWN = 0; + */ + FIELD_PRESENCE_UNKNOWN = 0, + /** + * @generated from enum value: EXPLICIT = 1; + */ + EXPLICIT = 1, + /** + * @generated from enum value: IMPLICIT = 2; + */ + IMPLICIT = 2, + /** + * @generated from enum value: LEGACY_REQUIRED = 3; + */ + LEGACY_REQUIRED = 3 +} +/** + * @generated from enum google.protobuf.FeatureSet.FieldPresence + */ +export type FeatureSet_FieldPresenceJson = "FIELD_PRESENCE_UNKNOWN" | "EXPLICIT" | "IMPLICIT" | "LEGACY_REQUIRED"; +/** + * Describes the enum google.protobuf.FeatureSet.FieldPresence. + */ +export declare const FeatureSet_FieldPresenceSchema: GenEnum; +/** + * @generated from enum google.protobuf.FeatureSet.EnumType + */ +export declare enum FeatureSet_EnumType { + /** + * @generated from enum value: ENUM_TYPE_UNKNOWN = 0; + */ + ENUM_TYPE_UNKNOWN = 0, + /** + * @generated from enum value: OPEN = 1; + */ + OPEN = 1, + /** + * @generated from enum value: CLOSED = 2; + */ + CLOSED = 2 +} +/** + * @generated from enum google.protobuf.FeatureSet.EnumType + */ +export type FeatureSet_EnumTypeJson = "ENUM_TYPE_UNKNOWN" | "OPEN" | "CLOSED"; +/** + * Describes the enum google.protobuf.FeatureSet.EnumType. + */ +export declare const FeatureSet_EnumTypeSchema: GenEnum; +/** + * @generated from enum google.protobuf.FeatureSet.RepeatedFieldEncoding + */ +export declare enum FeatureSet_RepeatedFieldEncoding { + /** + * @generated from enum value: REPEATED_FIELD_ENCODING_UNKNOWN = 0; + */ + REPEATED_FIELD_ENCODING_UNKNOWN = 0, + /** + * @generated from enum value: PACKED = 1; + */ + PACKED = 1, + /** + * @generated from enum value: EXPANDED = 2; + */ + EXPANDED = 2 +} +/** + * @generated from enum google.protobuf.FeatureSet.RepeatedFieldEncoding + */ +export type FeatureSet_RepeatedFieldEncodingJson = "REPEATED_FIELD_ENCODING_UNKNOWN" | "PACKED" | "EXPANDED"; +/** + * Describes the enum google.protobuf.FeatureSet.RepeatedFieldEncoding. + */ +export declare const FeatureSet_RepeatedFieldEncodingSchema: GenEnum; +/** + * @generated from enum google.protobuf.FeatureSet.Utf8Validation + */ +export declare enum FeatureSet_Utf8Validation { + /** + * @generated from enum value: UTF8_VALIDATION_UNKNOWN = 0; + */ + UTF8_VALIDATION_UNKNOWN = 0, + /** + * @generated from enum value: VERIFY = 2; + */ + VERIFY = 2, + /** + * @generated from enum value: NONE = 3; + */ + NONE = 3 +} +/** + * @generated from enum google.protobuf.FeatureSet.Utf8Validation + */ +export type FeatureSet_Utf8ValidationJson = "UTF8_VALIDATION_UNKNOWN" | "VERIFY" | "NONE"; +/** + * Describes the enum google.protobuf.FeatureSet.Utf8Validation. + */ +export declare const FeatureSet_Utf8ValidationSchema: GenEnum; +/** + * @generated from enum google.protobuf.FeatureSet.MessageEncoding + */ +export declare enum FeatureSet_MessageEncoding { + /** + * @generated from enum value: MESSAGE_ENCODING_UNKNOWN = 0; + */ + MESSAGE_ENCODING_UNKNOWN = 0, + /** + * @generated from enum value: LENGTH_PREFIXED = 1; + */ + LENGTH_PREFIXED = 1, + /** + * @generated from enum value: DELIMITED = 2; + */ + DELIMITED = 2 +} +/** + * @generated from enum google.protobuf.FeatureSet.MessageEncoding + */ +export type FeatureSet_MessageEncodingJson = "MESSAGE_ENCODING_UNKNOWN" | "LENGTH_PREFIXED" | "DELIMITED"; +/** + * Describes the enum google.protobuf.FeatureSet.MessageEncoding. + */ +export declare const FeatureSet_MessageEncodingSchema: GenEnum; +/** + * @generated from enum google.protobuf.FeatureSet.JsonFormat + */ +export declare enum FeatureSet_JsonFormat { + /** + * @generated from enum value: JSON_FORMAT_UNKNOWN = 0; + */ + JSON_FORMAT_UNKNOWN = 0, + /** + * @generated from enum value: ALLOW = 1; + */ + ALLOW = 1, + /** + * @generated from enum value: LEGACY_BEST_EFFORT = 2; + */ + LEGACY_BEST_EFFORT = 2 +} +/** + * @generated from enum google.protobuf.FeatureSet.JsonFormat + */ +export type FeatureSet_JsonFormatJson = "JSON_FORMAT_UNKNOWN" | "ALLOW" | "LEGACY_BEST_EFFORT"; +/** + * Describes the enum google.protobuf.FeatureSet.JsonFormat. + */ +export declare const FeatureSet_JsonFormatSchema: GenEnum; +/** + * @generated from enum google.protobuf.FeatureSet.EnforceNamingStyle + */ +export declare enum FeatureSet_EnforceNamingStyle { + /** + * @generated from enum value: ENFORCE_NAMING_STYLE_UNKNOWN = 0; + */ + ENFORCE_NAMING_STYLE_UNKNOWN = 0, + /** + * @generated from enum value: STYLE2024 = 1; + */ + STYLE2024 = 1, + /** + * @generated from enum value: STYLE_LEGACY = 2; + */ + STYLE_LEGACY = 2 +} +/** + * @generated from enum google.protobuf.FeatureSet.EnforceNamingStyle + */ +export type FeatureSet_EnforceNamingStyleJson = "ENFORCE_NAMING_STYLE_UNKNOWN" | "STYLE2024" | "STYLE_LEGACY"; +/** + * Describes the enum google.protobuf.FeatureSet.EnforceNamingStyle. + */ +export declare const FeatureSet_EnforceNamingStyleSchema: GenEnum; +/** + * A compiled specification for the defaults of a set of features. These + * messages are generated from FeatureSet extensions and can be used to seed + * feature resolution. The resolution with this object becomes a simple search + * for the closest matching edition, followed by proto merges. + * + * @generated from message google.protobuf.FeatureSetDefaults + */ +export type FeatureSetDefaults = Message<"google.protobuf.FeatureSetDefaults"> & { + /** + * @generated from field: repeated google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault defaults = 1; + */ + defaults: FeatureSetDefaults_FeatureSetEditionDefault[]; + /** + * The minimum supported edition (inclusive) when this was constructed. + * Editions before this will not have defaults. + * + * @generated from field: optional google.protobuf.Edition minimum_edition = 4; + */ + minimumEdition: Edition; + /** + * The maximum known edition (inclusive) when this was constructed. Editions + * after this will not have reliable defaults. + * + * @generated from field: optional google.protobuf.Edition maximum_edition = 5; + */ + maximumEdition: Edition; +}; +/** + * A compiled specification for the defaults of a set of features. These + * messages are generated from FeatureSet extensions and can be used to seed + * feature resolution. The resolution with this object becomes a simple search + * for the closest matching edition, followed by proto merges. + * + * @generated from message google.protobuf.FeatureSetDefaults + */ +export type FeatureSetDefaultsJson = { + /** + * @generated from field: repeated google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault defaults = 1; + */ + defaults?: FeatureSetDefaults_FeatureSetEditionDefaultJson[]; + /** + * The minimum supported edition (inclusive) when this was constructed. + * Editions before this will not have defaults. + * + * @generated from field: optional google.protobuf.Edition minimum_edition = 4; + */ + minimumEdition?: EditionJson; + /** + * The maximum known edition (inclusive) when this was constructed. Editions + * after this will not have reliable defaults. + * + * @generated from field: optional google.protobuf.Edition maximum_edition = 5; + */ + maximumEdition?: EditionJson; +}; +/** + * Describes the message google.protobuf.FeatureSetDefaults. + * Use `create(FeatureSetDefaultsSchema)` to create a new message. + */ +export declare const FeatureSetDefaultsSchema: GenMessage; +/** + * A map from every known edition with a unique set of defaults to its + * defaults. Not all editions may be contained here. For a given edition, + * the defaults at the closest matching edition ordered at or before it should + * be used. This field must be in strict ascending order by edition. + * + * @generated from message google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + */ +export type FeatureSetDefaults_FeatureSetEditionDefault = Message<"google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault"> & { + /** + * @generated from field: optional google.protobuf.Edition edition = 3; + */ + edition: Edition; + /** + * Defaults of features that can be overridden in this edition. + * + * @generated from field: optional google.protobuf.FeatureSet overridable_features = 4; + */ + overridableFeatures?: FeatureSet | undefined; + /** + * Defaults of features that can't be overridden in this edition. + * + * @generated from field: optional google.protobuf.FeatureSet fixed_features = 5; + */ + fixedFeatures?: FeatureSet | undefined; +}; +/** + * A map from every known edition with a unique set of defaults to its + * defaults. Not all editions may be contained here. For a given edition, + * the defaults at the closest matching edition ordered at or before it should + * be used. This field must be in strict ascending order by edition. + * + * @generated from message google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + */ +export type FeatureSetDefaults_FeatureSetEditionDefaultJson = { + /** + * @generated from field: optional google.protobuf.Edition edition = 3; + */ + edition?: EditionJson; + /** + * Defaults of features that can be overridden in this edition. + * + * @generated from field: optional google.protobuf.FeatureSet overridable_features = 4; + */ + overridableFeatures?: FeatureSetJson; + /** + * Defaults of features that can't be overridden in this edition. + * + * @generated from field: optional google.protobuf.FeatureSet fixed_features = 5; + */ + fixedFeatures?: FeatureSetJson; +}; +/** + * Describes the message google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault. + * Use `create(FeatureSetDefaults_FeatureSetEditionDefaultSchema)` to create a new message. + */ +export declare const FeatureSetDefaults_FeatureSetEditionDefaultSchema: GenMessage; +/** + * Encapsulates information about the original source file from which a + * FileDescriptorProto was generated. + * + * @generated from message google.protobuf.SourceCodeInfo + */ +export type SourceCodeInfo = Message<"google.protobuf.SourceCodeInfo"> & { + /** + * A Location identifies a piece of source code in a .proto file which + * corresponds to a particular definition. This information is intended + * to be useful to IDEs, code indexers, documentation generators, and similar + * tools. + * + * For example, say we have a file like: + * message Foo { + * optional string foo = 1; + * } + * Let's look at just the field definition: + * optional string foo = 1; + * ^ ^^ ^^ ^ ^^^ + * a bc de f ghi + * We have the following locations: + * span path represents + * [a,i) [ 4, 0, 2, 0 ] The whole field definition. + * [a,b) [ 4, 0, 2, 0, 4 ] The label (optional). + * [c,d) [ 4, 0, 2, 0, 5 ] The type (string). + * [e,f) [ 4, 0, 2, 0, 1 ] The name (foo). + * [g,h) [ 4, 0, 2, 0, 3 ] The number (1). + * + * Notes: + * - A location may refer to a repeated field itself (i.e. not to any + * particular index within it). This is used whenever a set of elements are + * logically enclosed in a single code segment. For example, an entire + * extend block (possibly containing multiple extension definitions) will + * have an outer location whose path refers to the "extensions" repeated + * field without an index. + * - Multiple locations may have the same path. This happens when a single + * logical declaration is spread out across multiple places. The most + * obvious example is the "extend" block again -- there may be multiple + * extend blocks in the same scope, each of which will have the same path. + * - A location's span is not always a subset of its parent's span. For + * example, the "extendee" of an extension declaration appears at the + * beginning of the "extend" block and is shared by all extensions within + * the block. + * - Just because a location's span is a subset of some other location's span + * does not mean that it is a descendant. For example, a "group" defines + * both a type and a field in a single declaration. Thus, the locations + * corresponding to the type and field and their components will overlap. + * - Code which tries to interpret locations should probably be designed to + * ignore those that it doesn't understand, as more types of locations could + * be recorded in the future. + * + * @generated from field: repeated google.protobuf.SourceCodeInfo.Location location = 1; + */ + location: SourceCodeInfo_Location[]; +}; +/** + * Encapsulates information about the original source file from which a + * FileDescriptorProto was generated. + * + * @generated from message google.protobuf.SourceCodeInfo + */ +export type SourceCodeInfoJson = { + /** + * A Location identifies a piece of source code in a .proto file which + * corresponds to a particular definition. This information is intended + * to be useful to IDEs, code indexers, documentation generators, and similar + * tools. + * + * For example, say we have a file like: + * message Foo { + * optional string foo = 1; + * } + * Let's look at just the field definition: + * optional string foo = 1; + * ^ ^^ ^^ ^ ^^^ + * a bc de f ghi + * We have the following locations: + * span path represents + * [a,i) [ 4, 0, 2, 0 ] The whole field definition. + * [a,b) [ 4, 0, 2, 0, 4 ] The label (optional). + * [c,d) [ 4, 0, 2, 0, 5 ] The type (string). + * [e,f) [ 4, 0, 2, 0, 1 ] The name (foo). + * [g,h) [ 4, 0, 2, 0, 3 ] The number (1). + * + * Notes: + * - A location may refer to a repeated field itself (i.e. not to any + * particular index within it). This is used whenever a set of elements are + * logically enclosed in a single code segment. For example, an entire + * extend block (possibly containing multiple extension definitions) will + * have an outer location whose path refers to the "extensions" repeated + * field without an index. + * - Multiple locations may have the same path. This happens when a single + * logical declaration is spread out across multiple places. The most + * obvious example is the "extend" block again -- there may be multiple + * extend blocks in the same scope, each of which will have the same path. + * - A location's span is not always a subset of its parent's span. For + * example, the "extendee" of an extension declaration appears at the + * beginning of the "extend" block and is shared by all extensions within + * the block. + * - Just because a location's span is a subset of some other location's span + * does not mean that it is a descendant. For example, a "group" defines + * both a type and a field in a single declaration. Thus, the locations + * corresponding to the type and field and their components will overlap. + * - Code which tries to interpret locations should probably be designed to + * ignore those that it doesn't understand, as more types of locations could + * be recorded in the future. + * + * @generated from field: repeated google.protobuf.SourceCodeInfo.Location location = 1; + */ + location?: SourceCodeInfo_LocationJson[]; +}; +/** + * Describes the message google.protobuf.SourceCodeInfo. + * Use `create(SourceCodeInfoSchema)` to create a new message. + */ +export declare const SourceCodeInfoSchema: GenMessage; +/** + * @generated from message google.protobuf.SourceCodeInfo.Location + */ +export type SourceCodeInfo_Location = Message<"google.protobuf.SourceCodeInfo.Location"> & { + /** + * Identifies which part of the FileDescriptorProto was defined at this + * location. + * + * Each element is a field number or an index. They form a path from + * the root FileDescriptorProto to the place where the definition appears. + * For example, this path: + * [ 4, 3, 2, 7, 1 ] + * refers to: + * file.message_type(3) // 4, 3 + * .field(7) // 2, 7 + * .name() // 1 + * This is because FileDescriptorProto.message_type has field number 4: + * repeated DescriptorProto message_type = 4; + * and DescriptorProto.field has field number 2: + * repeated FieldDescriptorProto field = 2; + * and FieldDescriptorProto.name has field number 1: + * optional string name = 1; + * + * Thus, the above path gives the location of a field name. If we removed + * the last element: + * [ 4, 3, 2, 7 ] + * this path refers to the whole field declaration (from the beginning + * of the label to the terminating semicolon). + * + * @generated from field: repeated int32 path = 1 [packed = true]; + */ + path: number[]; + /** + * Always has exactly three or four elements: start line, start column, + * end line (optional, otherwise assumed same as start line), end column. + * These are packed into a single field for efficiency. Note that line + * and column numbers are zero-based -- typically you will want to add + * 1 to each before displaying to a user. + * + * @generated from field: repeated int32 span = 2 [packed = true]; + */ + span: number[]; + /** + * If this SourceCodeInfo represents a complete declaration, these are any + * comments appearing before and after the declaration which appear to be + * attached to the declaration. + * + * A series of line comments appearing on consecutive lines, with no other + * tokens appearing on those lines, will be treated as a single comment. + * + * leading_detached_comments will keep paragraphs of comments that appear + * before (but not connected to) the current element. Each paragraph, + * separated by empty lines, will be one comment element in the repeated + * field. + * + * Only the comment content is provided; comment markers (e.g. //) are + * stripped out. For block comments, leading whitespace and an asterisk + * will be stripped from the beginning of each line other than the first. + * Newlines are included in the output. + * + * Examples: + * + * optional int32 foo = 1; // Comment attached to foo. + * // Comment attached to bar. + * optional int32 bar = 2; + * + * optional string baz = 3; + * // Comment attached to baz. + * // Another line attached to baz. + * + * // Comment attached to moo. + * // + * // Another line attached to moo. + * optional double moo = 4; + * + * // Detached comment for corge. This is not leading or trailing comments + * // to moo or corge because there are blank lines separating it from + * // both. + * + * // Detached comment for corge paragraph 2. + * + * optional string corge = 5; + * /* Block comment attached + * * to corge. Leading asterisks + * * will be removed. *\/ + * /* Block comment attached to + * * grault. *\/ + * optional int32 grault = 6; + * + * // ignored detached comments. + * + * @generated from field: optional string leading_comments = 3; + */ + leadingComments: string; + /** + * @generated from field: optional string trailing_comments = 4; + */ + trailingComments: string; + /** + * @generated from field: repeated string leading_detached_comments = 6; + */ + leadingDetachedComments: string[]; +}; +/** + * @generated from message google.protobuf.SourceCodeInfo.Location + */ +export type SourceCodeInfo_LocationJson = { + /** + * Identifies which part of the FileDescriptorProto was defined at this + * location. + * + * Each element is a field number or an index. They form a path from + * the root FileDescriptorProto to the place where the definition appears. + * For example, this path: + * [ 4, 3, 2, 7, 1 ] + * refers to: + * file.message_type(3) // 4, 3 + * .field(7) // 2, 7 + * .name() // 1 + * This is because FileDescriptorProto.message_type has field number 4: + * repeated DescriptorProto message_type = 4; + * and DescriptorProto.field has field number 2: + * repeated FieldDescriptorProto field = 2; + * and FieldDescriptorProto.name has field number 1: + * optional string name = 1; + * + * Thus, the above path gives the location of a field name. If we removed + * the last element: + * [ 4, 3, 2, 7 ] + * this path refers to the whole field declaration (from the beginning + * of the label to the terminating semicolon). + * + * @generated from field: repeated int32 path = 1 [packed = true]; + */ + path?: number[]; + /** + * Always has exactly three or four elements: start line, start column, + * end line (optional, otherwise assumed same as start line), end column. + * These are packed into a single field for efficiency. Note that line + * and column numbers are zero-based -- typically you will want to add + * 1 to each before displaying to a user. + * + * @generated from field: repeated int32 span = 2 [packed = true]; + */ + span?: number[]; + /** + * If this SourceCodeInfo represents a complete declaration, these are any + * comments appearing before and after the declaration which appear to be + * attached to the declaration. + * + * A series of line comments appearing on consecutive lines, with no other + * tokens appearing on those lines, will be treated as a single comment. + * + * leading_detached_comments will keep paragraphs of comments that appear + * before (but not connected to) the current element. Each paragraph, + * separated by empty lines, will be one comment element in the repeated + * field. + * + * Only the comment content is provided; comment markers (e.g. //) are + * stripped out. For block comments, leading whitespace and an asterisk + * will be stripped from the beginning of each line other than the first. + * Newlines are included in the output. + * + * Examples: + * + * optional int32 foo = 1; // Comment attached to foo. + * // Comment attached to bar. + * optional int32 bar = 2; + * + * optional string baz = 3; + * // Comment attached to baz. + * // Another line attached to baz. + * + * // Comment attached to moo. + * // + * // Another line attached to moo. + * optional double moo = 4; + * + * // Detached comment for corge. This is not leading or trailing comments + * // to moo or corge because there are blank lines separating it from + * // both. + * + * // Detached comment for corge paragraph 2. + * + * optional string corge = 5; + * /* Block comment attached + * * to corge. Leading asterisks + * * will be removed. *\/ + * /* Block comment attached to + * * grault. *\/ + * optional int32 grault = 6; + * + * // ignored detached comments. + * + * @generated from field: optional string leading_comments = 3; + */ + leadingComments?: string; + /** + * @generated from field: optional string trailing_comments = 4; + */ + trailingComments?: string; + /** + * @generated from field: repeated string leading_detached_comments = 6; + */ + leadingDetachedComments?: string[]; +}; +/** + * Describes the message google.protobuf.SourceCodeInfo.Location. + * Use `create(SourceCodeInfo_LocationSchema)` to create a new message. + */ +export declare const SourceCodeInfo_LocationSchema: GenMessage; +/** + * Describes the relationship between generated code and its original source + * file. A GeneratedCodeInfo message is associated with only one generated + * source file, but may contain references to different source .proto files. + * + * @generated from message google.protobuf.GeneratedCodeInfo + */ +export type GeneratedCodeInfo = Message<"google.protobuf.GeneratedCodeInfo"> & { + /** + * An Annotation connects some span of text in generated code to an element + * of its generating .proto file. + * + * @generated from field: repeated google.protobuf.GeneratedCodeInfo.Annotation annotation = 1; + */ + annotation: GeneratedCodeInfo_Annotation[]; +}; +/** + * Describes the relationship between generated code and its original source + * file. A GeneratedCodeInfo message is associated with only one generated + * source file, but may contain references to different source .proto files. + * + * @generated from message google.protobuf.GeneratedCodeInfo + */ +export type GeneratedCodeInfoJson = { + /** + * An Annotation connects some span of text in generated code to an element + * of its generating .proto file. + * + * @generated from field: repeated google.protobuf.GeneratedCodeInfo.Annotation annotation = 1; + */ + annotation?: GeneratedCodeInfo_AnnotationJson[]; +}; +/** + * Describes the message google.protobuf.GeneratedCodeInfo. + * Use `create(GeneratedCodeInfoSchema)` to create a new message. + */ +export declare const GeneratedCodeInfoSchema: GenMessage; +/** + * @generated from message google.protobuf.GeneratedCodeInfo.Annotation + */ +export type GeneratedCodeInfo_Annotation = Message<"google.protobuf.GeneratedCodeInfo.Annotation"> & { + /** + * Identifies the element in the original source .proto file. This field + * is formatted the same as SourceCodeInfo.Location.path. + * + * @generated from field: repeated int32 path = 1 [packed = true]; + */ + path: number[]; + /** + * Identifies the filesystem path to the original source .proto. + * + * @generated from field: optional string source_file = 2; + */ + sourceFile: string; + /** + * Identifies the starting offset in bytes in the generated code + * that relates to the identified object. + * + * @generated from field: optional int32 begin = 3; + */ + begin: number; + /** + * Identifies the ending offset in bytes in the generated code that + * relates to the identified object. The end offset should be one past + * the last relevant byte (so the length of the text = end - begin). + * + * @generated from field: optional int32 end = 4; + */ + end: number; + /** + * @generated from field: optional google.protobuf.GeneratedCodeInfo.Annotation.Semantic semantic = 5; + */ + semantic: GeneratedCodeInfo_Annotation_Semantic; +}; +/** + * @generated from message google.protobuf.GeneratedCodeInfo.Annotation + */ +export type GeneratedCodeInfo_AnnotationJson = { + /** + * Identifies the element in the original source .proto file. This field + * is formatted the same as SourceCodeInfo.Location.path. + * + * @generated from field: repeated int32 path = 1 [packed = true]; + */ + path?: number[]; + /** + * Identifies the filesystem path to the original source .proto. + * + * @generated from field: optional string source_file = 2; + */ + sourceFile?: string; + /** + * Identifies the starting offset in bytes in the generated code + * that relates to the identified object. + * + * @generated from field: optional int32 begin = 3; + */ + begin?: number; + /** + * Identifies the ending offset in bytes in the generated code that + * relates to the identified object. The end offset should be one past + * the last relevant byte (so the length of the text = end - begin). + * + * @generated from field: optional int32 end = 4; + */ + end?: number; + /** + * @generated from field: optional google.protobuf.GeneratedCodeInfo.Annotation.Semantic semantic = 5; + */ + semantic?: GeneratedCodeInfo_Annotation_SemanticJson; +}; +/** + * Describes the message google.protobuf.GeneratedCodeInfo.Annotation. + * Use `create(GeneratedCodeInfo_AnnotationSchema)` to create a new message. + */ +export declare const GeneratedCodeInfo_AnnotationSchema: GenMessage; +/** + * Represents the identified object's effect on the element in the original + * .proto file. + * + * @generated from enum google.protobuf.GeneratedCodeInfo.Annotation.Semantic + */ +export declare enum GeneratedCodeInfo_Annotation_Semantic { + /** + * There is no effect or the effect is indescribable. + * + * @generated from enum value: NONE = 0; + */ + NONE = 0, + /** + * The element is set or otherwise mutated. + * + * @generated from enum value: SET = 1; + */ + SET = 1, + /** + * An alias to the element is returned. + * + * @generated from enum value: ALIAS = 2; + */ + ALIAS = 2 +} +/** + * Represents the identified object's effect on the element in the original + * .proto file. + * + * @generated from enum google.protobuf.GeneratedCodeInfo.Annotation.Semantic + */ +export type GeneratedCodeInfo_Annotation_SemanticJson = "NONE" | "SET" | "ALIAS"; +/** + * Describes the enum google.protobuf.GeneratedCodeInfo.Annotation.Semantic. + */ +export declare const GeneratedCodeInfo_Annotation_SemanticSchema: GenEnum; +/** + * The full set of known editions. + * + * @generated from enum google.protobuf.Edition + */ +export declare enum Edition { + /** + * A placeholder for an unknown edition value. + * + * @generated from enum value: EDITION_UNKNOWN = 0; + */ + EDITION_UNKNOWN = 0, + /** + * A placeholder edition for specifying default behaviors *before* a feature + * was first introduced. This is effectively an "infinite past". + * + * @generated from enum value: EDITION_LEGACY = 900; + */ + EDITION_LEGACY = 900, + /** + * Legacy syntax "editions". These pre-date editions, but behave much like + * distinct editions. These can't be used to specify the edition of proto + * files, but feature definitions must supply proto2/proto3 defaults for + * backwards compatibility. + * + * @generated from enum value: EDITION_PROTO2 = 998; + */ + EDITION_PROTO2 = 998, + /** + * @generated from enum value: EDITION_PROTO3 = 999; + */ + EDITION_PROTO3 = 999, + /** + * Editions that have been released. The specific values are arbitrary and + * should not be depended on, but they will always be time-ordered for easy + * comparison. + * + * @generated from enum value: EDITION_2023 = 1000; + */ + EDITION_2023 = 1000, + /** + * @generated from enum value: EDITION_2024 = 1001; + */ + EDITION_2024 = 1001, + /** + * A placeholder edition for developing and testing unscheduled features. + * + * @generated from enum value: EDITION_UNSTABLE = 9999; + */ + EDITION_UNSTABLE = 9999, + /** + * Placeholder editions for testing feature resolution. These should not be + * used or relied on outside of tests. + * + * @generated from enum value: EDITION_1_TEST_ONLY = 1; + */ + EDITION_1_TEST_ONLY = 1, + /** + * @generated from enum value: EDITION_2_TEST_ONLY = 2; + */ + EDITION_2_TEST_ONLY = 2, + /** + * @generated from enum value: EDITION_99997_TEST_ONLY = 99997; + */ + EDITION_99997_TEST_ONLY = 99997, + /** + * @generated from enum value: EDITION_99998_TEST_ONLY = 99998; + */ + EDITION_99998_TEST_ONLY = 99998, + /** + * @generated from enum value: EDITION_99999_TEST_ONLY = 99999; + */ + EDITION_99999_TEST_ONLY = 99999, + /** + * Placeholder for specifying unbounded edition support. This should only + * ever be used by plugins that can expect to never require any changes to + * support a new edition. + * + * @generated from enum value: EDITION_MAX = 2147483647; + */ + EDITION_MAX = 2147483647 +} +/** + * The full set of known editions. + * + * @generated from enum google.protobuf.Edition + */ +export type EditionJson = "EDITION_UNKNOWN" | "EDITION_LEGACY" | "EDITION_PROTO2" | "EDITION_PROTO3" | "EDITION_2023" | "EDITION_2024" | "EDITION_UNSTABLE" | "EDITION_1_TEST_ONLY" | "EDITION_2_TEST_ONLY" | "EDITION_99997_TEST_ONLY" | "EDITION_99998_TEST_ONLY" | "EDITION_99999_TEST_ONLY" | "EDITION_MAX"; +/** + * Describes the enum google.protobuf.Edition. + */ +export declare const EditionSchema: GenEnum; +/** + * Describes the 'visibility' of a symbol with respect to the proto import + * system. Symbols can only be imported when the visibility rules do not prevent + * it (ex: local symbols cannot be imported). Visibility modifiers can only set + * on `message` and `enum` as they are the only types available to be referenced + * from other files. + * + * @generated from enum google.protobuf.SymbolVisibility + */ +export declare enum SymbolVisibility { + /** + * @generated from enum value: VISIBILITY_UNSET = 0; + */ + VISIBILITY_UNSET = 0, + /** + * @generated from enum value: VISIBILITY_LOCAL = 1; + */ + VISIBILITY_LOCAL = 1, + /** + * @generated from enum value: VISIBILITY_EXPORT = 2; + */ + VISIBILITY_EXPORT = 2 +} +/** + * Describes the 'visibility' of a symbol with respect to the proto import + * system. Symbols can only be imported when the visibility rules do not prevent + * it (ex: local symbols cannot be imported). Visibility modifiers can only set + * on `message` and `enum` as they are the only types available to be referenced + * from other files. + * + * @generated from enum google.protobuf.SymbolVisibility + */ +export type SymbolVisibilityJson = "VISIBILITY_UNSET" | "VISIBILITY_LOCAL" | "VISIBILITY_EXPORT"; +/** + * Describes the enum google.protobuf.SymbolVisibility. + */ +export declare const SymbolVisibilitySchema: GenEnum; diff --git a/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/descriptor_pb.js b/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/descriptor_pb.js new file mode 100644 index 0000000..0826d6e --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/descriptor_pb.js @@ -0,0 +1,888 @@ +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +import { boot } from "../../../../codegenv2/boot.js"; +import { messageDesc } from "../../../../codegenv2/message.js"; +import { enumDesc } from "../../../../codegenv2/enum.js"; +/** + * Describes the file google/protobuf/descriptor.proto. + */ +export const file_google_protobuf_descriptor = /*@__PURE__*/ boot({ "name": "google/protobuf/descriptor.proto", "package": "google.protobuf", "messageType": [{ "name": "FileDescriptorSet", "field": [{ "name": "file", "number": 1, "type": 11, "label": 3, "typeName": ".google.protobuf.FileDescriptorProto" }], "extensionRange": [{ "start": 536000000, "end": 536000001 }] }, { "name": "FileDescriptorProto", "field": [{ "name": "name", "number": 1, "type": 9, "label": 1 }, { "name": "package", "number": 2, "type": 9, "label": 1 }, { "name": "dependency", "number": 3, "type": 9, "label": 3 }, { "name": "public_dependency", "number": 10, "type": 5, "label": 3 }, { "name": "weak_dependency", "number": 11, "type": 5, "label": 3 }, { "name": "option_dependency", "number": 15, "type": 9, "label": 3 }, { "name": "message_type", "number": 4, "type": 11, "label": 3, "typeName": ".google.protobuf.DescriptorProto" }, { "name": "enum_type", "number": 5, "type": 11, "label": 3, "typeName": ".google.protobuf.EnumDescriptorProto" }, { "name": "service", "number": 6, "type": 11, "label": 3, "typeName": ".google.protobuf.ServiceDescriptorProto" }, { "name": "extension", "number": 7, "type": 11, "label": 3, "typeName": ".google.protobuf.FieldDescriptorProto" }, { "name": "options", "number": 8, "type": 11, "label": 1, "typeName": ".google.protobuf.FileOptions" }, { "name": "source_code_info", "number": 9, "type": 11, "label": 1, "typeName": ".google.protobuf.SourceCodeInfo" }, { "name": "syntax", "number": 12, "type": 9, "label": 1 }, { "name": "edition", "number": 14, "type": 14, "label": 1, "typeName": ".google.protobuf.Edition" }] }, { "name": "DescriptorProto", "field": [{ "name": "name", "number": 1, "type": 9, "label": 1 }, { "name": "field", "number": 2, "type": 11, "label": 3, "typeName": ".google.protobuf.FieldDescriptorProto" }, { "name": "extension", "number": 6, "type": 11, "label": 3, "typeName": ".google.protobuf.FieldDescriptorProto" }, { "name": "nested_type", "number": 3, "type": 11, "label": 3, "typeName": ".google.protobuf.DescriptorProto" }, { "name": "enum_type", "number": 4, "type": 11, "label": 3, "typeName": ".google.protobuf.EnumDescriptorProto" }, { "name": "extension_range", "number": 5, "type": 11, "label": 3, "typeName": ".google.protobuf.DescriptorProto.ExtensionRange" }, { "name": "oneof_decl", "number": 8, "type": 11, "label": 3, "typeName": ".google.protobuf.OneofDescriptorProto" }, { "name": "options", "number": 7, "type": 11, "label": 1, "typeName": ".google.protobuf.MessageOptions" }, { "name": "reserved_range", "number": 9, "type": 11, "label": 3, "typeName": ".google.protobuf.DescriptorProto.ReservedRange" }, { "name": "reserved_name", "number": 10, "type": 9, "label": 3 }, { "name": "visibility", "number": 11, "type": 14, "label": 1, "typeName": ".google.protobuf.SymbolVisibility" }], "nestedType": [{ "name": "ExtensionRange", "field": [{ "name": "start", "number": 1, "type": 5, "label": 1 }, { "name": "end", "number": 2, "type": 5, "label": 1 }, { "name": "options", "number": 3, "type": 11, "label": 1, "typeName": ".google.protobuf.ExtensionRangeOptions" }] }, { "name": "ReservedRange", "field": [{ "name": "start", "number": 1, "type": 5, "label": 1 }, { "name": "end", "number": 2, "type": 5, "label": 1 }] }] }, { "name": "ExtensionRangeOptions", "field": [{ "name": "uninterpreted_option", "number": 999, "type": 11, "label": 3, "typeName": ".google.protobuf.UninterpretedOption" }, { "name": "declaration", "number": 2, "type": 11, "label": 3, "typeName": ".google.protobuf.ExtensionRangeOptions.Declaration", "options": { "retention": 2 } }, { "name": "features", "number": 50, "type": 11, "label": 1, "typeName": ".google.protobuf.FeatureSet" }, { "name": "verification", "number": 3, "type": 14, "label": 1, "typeName": ".google.protobuf.ExtensionRangeOptions.VerificationState", "defaultValue": "UNVERIFIED", "options": { "retention": 2 } }], "nestedType": [{ "name": "Declaration", "field": [{ "name": "number", "number": 1, "type": 5, "label": 1 }, { "name": "full_name", "number": 2, "type": 9, "label": 1 }, { "name": "type", "number": 3, "type": 9, "label": 1 }, { "name": "reserved", "number": 5, "type": 8, "label": 1 }, { "name": "repeated", "number": 6, "type": 8, "label": 1 }] }], "enumType": [{ "name": "VerificationState", "value": [{ "name": "DECLARATION", "number": 0 }, { "name": "UNVERIFIED", "number": 1 }] }], "extensionRange": [{ "start": 1000, "end": 536870912 }] }, { "name": "FieldDescriptorProto", "field": [{ "name": "name", "number": 1, "type": 9, "label": 1 }, { "name": "number", "number": 3, "type": 5, "label": 1 }, { "name": "label", "number": 4, "type": 14, "label": 1, "typeName": ".google.protobuf.FieldDescriptorProto.Label" }, { "name": "type", "number": 5, "type": 14, "label": 1, "typeName": ".google.protobuf.FieldDescriptorProto.Type" }, { "name": "type_name", "number": 6, "type": 9, "label": 1 }, { "name": "extendee", "number": 2, "type": 9, "label": 1 }, { "name": "default_value", "number": 7, "type": 9, "label": 1 }, { "name": "oneof_index", "number": 9, "type": 5, "label": 1 }, { "name": "json_name", "number": 10, "type": 9, "label": 1 }, { "name": "options", "number": 8, "type": 11, "label": 1, "typeName": ".google.protobuf.FieldOptions" }, { "name": "proto3_optional", "number": 17, "type": 8, "label": 1 }], "enumType": [{ "name": "Type", "value": [{ "name": "TYPE_DOUBLE", "number": 1 }, { "name": "TYPE_FLOAT", "number": 2 }, { "name": "TYPE_INT64", "number": 3 }, { "name": "TYPE_UINT64", "number": 4 }, { "name": "TYPE_INT32", "number": 5 }, { "name": "TYPE_FIXED64", "number": 6 }, { "name": "TYPE_FIXED32", "number": 7 }, { "name": "TYPE_BOOL", "number": 8 }, { "name": "TYPE_STRING", "number": 9 }, { "name": "TYPE_GROUP", "number": 10 }, { "name": "TYPE_MESSAGE", "number": 11 }, { "name": "TYPE_BYTES", "number": 12 }, { "name": "TYPE_UINT32", "number": 13 }, { "name": "TYPE_ENUM", "number": 14 }, { "name": "TYPE_SFIXED32", "number": 15 }, { "name": "TYPE_SFIXED64", "number": 16 }, { "name": "TYPE_SINT32", "number": 17 }, { "name": "TYPE_SINT64", "number": 18 }] }, { "name": "Label", "value": [{ "name": "LABEL_OPTIONAL", "number": 1 }, { "name": "LABEL_REPEATED", "number": 3 }, { "name": "LABEL_REQUIRED", "number": 2 }] }] }, { "name": "OneofDescriptorProto", "field": [{ "name": "name", "number": 1, "type": 9, "label": 1 }, { "name": "options", "number": 2, "type": 11, "label": 1, "typeName": ".google.protobuf.OneofOptions" }] }, { "name": "EnumDescriptorProto", "field": [{ "name": "name", "number": 1, "type": 9, "label": 1 }, { "name": "value", "number": 2, "type": 11, "label": 3, "typeName": ".google.protobuf.EnumValueDescriptorProto" }, { "name": "options", "number": 3, "type": 11, "label": 1, "typeName": ".google.protobuf.EnumOptions" }, { "name": "reserved_range", "number": 4, "type": 11, "label": 3, "typeName": ".google.protobuf.EnumDescriptorProto.EnumReservedRange" }, { "name": "reserved_name", "number": 5, "type": 9, "label": 3 }, { "name": "visibility", "number": 6, "type": 14, "label": 1, "typeName": ".google.protobuf.SymbolVisibility" }], "nestedType": [{ "name": "EnumReservedRange", "field": [{ "name": "start", "number": 1, "type": 5, "label": 1 }, { "name": "end", "number": 2, "type": 5, "label": 1 }] }] }, { "name": "EnumValueDescriptorProto", "field": [{ "name": "name", "number": 1, "type": 9, "label": 1 }, { "name": "number", "number": 2, "type": 5, "label": 1 }, { "name": "options", "number": 3, "type": 11, "label": 1, "typeName": ".google.protobuf.EnumValueOptions" }] }, { "name": "ServiceDescriptorProto", "field": [{ "name": "name", "number": 1, "type": 9, "label": 1 }, { "name": "method", "number": 2, "type": 11, "label": 3, "typeName": ".google.protobuf.MethodDescriptorProto" }, { "name": "options", "number": 3, "type": 11, "label": 1, "typeName": ".google.protobuf.ServiceOptions" }] }, { "name": "MethodDescriptorProto", "field": [{ "name": "name", "number": 1, "type": 9, "label": 1 }, { "name": "input_type", "number": 2, "type": 9, "label": 1 }, { "name": "output_type", "number": 3, "type": 9, "label": 1 }, { "name": "options", "number": 4, "type": 11, "label": 1, "typeName": ".google.protobuf.MethodOptions" }, { "name": "client_streaming", "number": 5, "type": 8, "label": 1, "defaultValue": "false" }, { "name": "server_streaming", "number": 6, "type": 8, "label": 1, "defaultValue": "false" }] }, { "name": "FileOptions", "field": [{ "name": "java_package", "number": 1, "type": 9, "label": 1 }, { "name": "java_outer_classname", "number": 8, "type": 9, "label": 1 }, { "name": "java_multiple_files", "number": 10, "type": 8, "label": 1, "defaultValue": "false", "options": {} }, { "name": "java_generate_equals_and_hash", "number": 20, "type": 8, "label": 1, "options": { "deprecated": true } }, { "name": "java_string_check_utf8", "number": 27, "type": 8, "label": 1, "defaultValue": "false" }, { "name": "optimize_for", "number": 9, "type": 14, "label": 1, "typeName": ".google.protobuf.FileOptions.OptimizeMode", "defaultValue": "SPEED" }, { "name": "go_package", "number": 11, "type": 9, "label": 1 }, { "name": "cc_generic_services", "number": 16, "type": 8, "label": 1, "defaultValue": "false" }, { "name": "java_generic_services", "number": 17, "type": 8, "label": 1, "defaultValue": "false" }, { "name": "py_generic_services", "number": 18, "type": 8, "label": 1, "defaultValue": "false" }, { "name": "deprecated", "number": 23, "type": 8, "label": 1, "defaultValue": "false" }, { "name": "cc_enable_arenas", "number": 31, "type": 8, "label": 1, "defaultValue": "true" }, { "name": "objc_class_prefix", "number": 36, "type": 9, "label": 1 }, { "name": "csharp_namespace", "number": 37, "type": 9, "label": 1 }, { "name": "swift_prefix", "number": 39, "type": 9, "label": 1 }, { "name": "php_class_prefix", "number": 40, "type": 9, "label": 1 }, { "name": "php_namespace", "number": 41, "type": 9, "label": 1 }, { "name": "php_metadata_namespace", "number": 44, "type": 9, "label": 1 }, { "name": "ruby_package", "number": 45, "type": 9, "label": 1 }, { "name": "features", "number": 50, "type": 11, "label": 1, "typeName": ".google.protobuf.FeatureSet" }, { "name": "uninterpreted_option", "number": 999, "type": 11, "label": 3, "typeName": ".google.protobuf.UninterpretedOption" }], "enumType": [{ "name": "OptimizeMode", "value": [{ "name": "SPEED", "number": 1 }, { "name": "CODE_SIZE", "number": 2 }, { "name": "LITE_RUNTIME", "number": 3 }] }], "extensionRange": [{ "start": 1000, "end": 536870912 }] }, { "name": "MessageOptions", "field": [{ "name": "message_set_wire_format", "number": 1, "type": 8, "label": 1, "defaultValue": "false" }, { "name": "no_standard_descriptor_accessor", "number": 2, "type": 8, "label": 1, "defaultValue": "false" }, { "name": "deprecated", "number": 3, "type": 8, "label": 1, "defaultValue": "false" }, { "name": "map_entry", "number": 7, "type": 8, "label": 1 }, { "name": "deprecated_legacy_json_field_conflicts", "number": 11, "type": 8, "label": 1, "options": { "deprecated": true } }, { "name": "features", "number": 12, "type": 11, "label": 1, "typeName": ".google.protobuf.FeatureSet" }, { "name": "uninterpreted_option", "number": 999, "type": 11, "label": 3, "typeName": ".google.protobuf.UninterpretedOption" }], "extensionRange": [{ "start": 1000, "end": 536870912 }] }, { "name": "FieldOptions", "field": [{ "name": "ctype", "number": 1, "type": 14, "label": 1, "typeName": ".google.protobuf.FieldOptions.CType", "defaultValue": "STRING" }, { "name": "packed", "number": 2, "type": 8, "label": 1 }, { "name": "jstype", "number": 6, "type": 14, "label": 1, "typeName": ".google.protobuf.FieldOptions.JSType", "defaultValue": "JS_NORMAL" }, { "name": "lazy", "number": 5, "type": 8, "label": 1, "defaultValue": "false" }, { "name": "unverified_lazy", "number": 15, "type": 8, "label": 1, "defaultValue": "false" }, { "name": "deprecated", "number": 3, "type": 8, "label": 1, "defaultValue": "false" }, { "name": "weak", "number": 10, "type": 8, "label": 1, "defaultValue": "false", "options": { "deprecated": true } }, { "name": "debug_redact", "number": 16, "type": 8, "label": 1, "defaultValue": "false" }, { "name": "retention", "number": 17, "type": 14, "label": 1, "typeName": ".google.protobuf.FieldOptions.OptionRetention" }, { "name": "targets", "number": 19, "type": 14, "label": 3, "typeName": ".google.protobuf.FieldOptions.OptionTargetType" }, { "name": "edition_defaults", "number": 20, "type": 11, "label": 3, "typeName": ".google.protobuf.FieldOptions.EditionDefault" }, { "name": "features", "number": 21, "type": 11, "label": 1, "typeName": ".google.protobuf.FeatureSet" }, { "name": "feature_support", "number": 22, "type": 11, "label": 1, "typeName": ".google.protobuf.FieldOptions.FeatureSupport" }, { "name": "uninterpreted_option", "number": 999, "type": 11, "label": 3, "typeName": ".google.protobuf.UninterpretedOption" }], "nestedType": [{ "name": "EditionDefault", "field": [{ "name": "edition", "number": 3, "type": 14, "label": 1, "typeName": ".google.protobuf.Edition" }, { "name": "value", "number": 2, "type": 9, "label": 1 }] }, { "name": "FeatureSupport", "field": [{ "name": "edition_introduced", "number": 1, "type": 14, "label": 1, "typeName": ".google.protobuf.Edition" }, { "name": "edition_deprecated", "number": 2, "type": 14, "label": 1, "typeName": ".google.protobuf.Edition" }, { "name": "deprecation_warning", "number": 3, "type": 9, "label": 1 }, { "name": "edition_removed", "number": 4, "type": 14, "label": 1, "typeName": ".google.protobuf.Edition" }, { "name": "removal_error", "number": 5, "type": 9, "label": 1 }] }], "enumType": [{ "name": "CType", "value": [{ "name": "STRING", "number": 0 }, { "name": "CORD", "number": 1 }, { "name": "STRING_PIECE", "number": 2 }] }, { "name": "JSType", "value": [{ "name": "JS_NORMAL", "number": 0 }, { "name": "JS_STRING", "number": 1 }, { "name": "JS_NUMBER", "number": 2 }] }, { "name": "OptionRetention", "value": [{ "name": "RETENTION_UNKNOWN", "number": 0 }, { "name": "RETENTION_RUNTIME", "number": 1 }, { "name": "RETENTION_SOURCE", "number": 2 }] }, { "name": "OptionTargetType", "value": [{ "name": "TARGET_TYPE_UNKNOWN", "number": 0 }, { "name": "TARGET_TYPE_FILE", "number": 1 }, { "name": "TARGET_TYPE_EXTENSION_RANGE", "number": 2 }, { "name": "TARGET_TYPE_MESSAGE", "number": 3 }, { "name": "TARGET_TYPE_FIELD", "number": 4 }, { "name": "TARGET_TYPE_ONEOF", "number": 5 }, { "name": "TARGET_TYPE_ENUM", "number": 6 }, { "name": "TARGET_TYPE_ENUM_ENTRY", "number": 7 }, { "name": "TARGET_TYPE_SERVICE", "number": 8 }, { "name": "TARGET_TYPE_METHOD", "number": 9 }] }], "extensionRange": [{ "start": 1000, "end": 536870912 }] }, { "name": "OneofOptions", "field": [{ "name": "features", "number": 1, "type": 11, "label": 1, "typeName": ".google.protobuf.FeatureSet" }, { "name": "uninterpreted_option", "number": 999, "type": 11, "label": 3, "typeName": ".google.protobuf.UninterpretedOption" }], "extensionRange": [{ "start": 1000, "end": 536870912 }] }, { "name": "EnumOptions", "field": [{ "name": "allow_alias", "number": 2, "type": 8, "label": 1 }, { "name": "deprecated", "number": 3, "type": 8, "label": 1, "defaultValue": "false" }, { "name": "deprecated_legacy_json_field_conflicts", "number": 6, "type": 8, "label": 1, "options": { "deprecated": true } }, { "name": "features", "number": 7, "type": 11, "label": 1, "typeName": ".google.protobuf.FeatureSet" }, { "name": "uninterpreted_option", "number": 999, "type": 11, "label": 3, "typeName": ".google.protobuf.UninterpretedOption" }], "extensionRange": [{ "start": 1000, "end": 536870912 }] }, { "name": "EnumValueOptions", "field": [{ "name": "deprecated", "number": 1, "type": 8, "label": 1, "defaultValue": "false" }, { "name": "features", "number": 2, "type": 11, "label": 1, "typeName": ".google.protobuf.FeatureSet" }, { "name": "debug_redact", "number": 3, "type": 8, "label": 1, "defaultValue": "false" }, { "name": "feature_support", "number": 4, "type": 11, "label": 1, "typeName": ".google.protobuf.FieldOptions.FeatureSupport" }, { "name": "uninterpreted_option", "number": 999, "type": 11, "label": 3, "typeName": ".google.protobuf.UninterpretedOption" }], "extensionRange": [{ "start": 1000, "end": 536870912 }] }, { "name": "ServiceOptions", "field": [{ "name": "features", "number": 34, "type": 11, "label": 1, "typeName": ".google.protobuf.FeatureSet" }, { "name": "deprecated", "number": 33, "type": 8, "label": 1, "defaultValue": "false" }, { "name": "uninterpreted_option", "number": 999, "type": 11, "label": 3, "typeName": ".google.protobuf.UninterpretedOption" }], "extensionRange": [{ "start": 1000, "end": 536870912 }] }, { "name": "MethodOptions", "field": [{ "name": "deprecated", "number": 33, "type": 8, "label": 1, "defaultValue": "false" }, { "name": "idempotency_level", "number": 34, "type": 14, "label": 1, "typeName": ".google.protobuf.MethodOptions.IdempotencyLevel", "defaultValue": "IDEMPOTENCY_UNKNOWN" }, { "name": "features", "number": 35, "type": 11, "label": 1, "typeName": ".google.protobuf.FeatureSet" }, { "name": "uninterpreted_option", "number": 999, "type": 11, "label": 3, "typeName": ".google.protobuf.UninterpretedOption" }], "enumType": [{ "name": "IdempotencyLevel", "value": [{ "name": "IDEMPOTENCY_UNKNOWN", "number": 0 }, { "name": "NO_SIDE_EFFECTS", "number": 1 }, { "name": "IDEMPOTENT", "number": 2 }] }], "extensionRange": [{ "start": 1000, "end": 536870912 }] }, { "name": "UninterpretedOption", "field": [{ "name": "name", "number": 2, "type": 11, "label": 3, "typeName": ".google.protobuf.UninterpretedOption.NamePart" }, { "name": "identifier_value", "number": 3, "type": 9, "label": 1 }, { "name": "positive_int_value", "number": 4, "type": 4, "label": 1 }, { "name": "negative_int_value", "number": 5, "type": 3, "label": 1 }, { "name": "double_value", "number": 6, "type": 1, "label": 1 }, { "name": "string_value", "number": 7, "type": 12, "label": 1 }, { "name": "aggregate_value", "number": 8, "type": 9, "label": 1 }], "nestedType": [{ "name": "NamePart", "field": [{ "name": "name_part", "number": 1, "type": 9, "label": 2 }, { "name": "is_extension", "number": 2, "type": 8, "label": 2 }] }] }, { "name": "FeatureSet", "field": [{ "name": "field_presence", "number": 1, "type": 14, "label": 1, "typeName": ".google.protobuf.FeatureSet.FieldPresence", "options": { "retention": 1, "targets": [4, 1], "editionDefaults": [{ "value": "EXPLICIT", "edition": 900 }, { "value": "IMPLICIT", "edition": 999 }, { "value": "EXPLICIT", "edition": 1000 }] } }, { "name": "enum_type", "number": 2, "type": 14, "label": 1, "typeName": ".google.protobuf.FeatureSet.EnumType", "options": { "retention": 1, "targets": [6, 1], "editionDefaults": [{ "value": "CLOSED", "edition": 900 }, { "value": "OPEN", "edition": 999 }] } }, { "name": "repeated_field_encoding", "number": 3, "type": 14, "label": 1, "typeName": ".google.protobuf.FeatureSet.RepeatedFieldEncoding", "options": { "retention": 1, "targets": [4, 1], "editionDefaults": [{ "value": "EXPANDED", "edition": 900 }, { "value": "PACKED", "edition": 999 }] } }, { "name": "utf8_validation", "number": 4, "type": 14, "label": 1, "typeName": ".google.protobuf.FeatureSet.Utf8Validation", "options": { "retention": 1, "targets": [4, 1], "editionDefaults": [{ "value": "NONE", "edition": 900 }, { "value": "VERIFY", "edition": 999 }] } }, { "name": "message_encoding", "number": 5, "type": 14, "label": 1, "typeName": ".google.protobuf.FeatureSet.MessageEncoding", "options": { "retention": 1, "targets": [4, 1], "editionDefaults": [{ "value": "LENGTH_PREFIXED", "edition": 900 }] } }, { "name": "json_format", "number": 6, "type": 14, "label": 1, "typeName": ".google.protobuf.FeatureSet.JsonFormat", "options": { "retention": 1, "targets": [3, 6, 1], "editionDefaults": [{ "value": "LEGACY_BEST_EFFORT", "edition": 900 }, { "value": "ALLOW", "edition": 999 }] } }, { "name": "enforce_naming_style", "number": 7, "type": 14, "label": 1, "typeName": ".google.protobuf.FeatureSet.EnforceNamingStyle", "options": { "retention": 2, "targets": [1, 2, 3, 4, 5, 6, 7, 8, 9], "editionDefaults": [{ "value": "STYLE_LEGACY", "edition": 900 }, { "value": "STYLE2024", "edition": 1001 }] } }, { "name": "default_symbol_visibility", "number": 8, "type": 14, "label": 1, "typeName": ".google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility", "options": { "retention": 2, "targets": [1], "editionDefaults": [{ "value": "EXPORT_ALL", "edition": 900 }, { "value": "EXPORT_TOP_LEVEL", "edition": 1001 }] } }], "nestedType": [{ "name": "VisibilityFeature", "enumType": [{ "name": "DefaultSymbolVisibility", "value": [{ "name": "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN", "number": 0 }, { "name": "EXPORT_ALL", "number": 1 }, { "name": "EXPORT_TOP_LEVEL", "number": 2 }, { "name": "LOCAL_ALL", "number": 3 }, { "name": "STRICT", "number": 4 }] }] }], "enumType": [{ "name": "FieldPresence", "value": [{ "name": "FIELD_PRESENCE_UNKNOWN", "number": 0 }, { "name": "EXPLICIT", "number": 1 }, { "name": "IMPLICIT", "number": 2 }, { "name": "LEGACY_REQUIRED", "number": 3 }] }, { "name": "EnumType", "value": [{ "name": "ENUM_TYPE_UNKNOWN", "number": 0 }, { "name": "OPEN", "number": 1 }, { "name": "CLOSED", "number": 2 }] }, { "name": "RepeatedFieldEncoding", "value": [{ "name": "REPEATED_FIELD_ENCODING_UNKNOWN", "number": 0 }, { "name": "PACKED", "number": 1 }, { "name": "EXPANDED", "number": 2 }] }, { "name": "Utf8Validation", "value": [{ "name": "UTF8_VALIDATION_UNKNOWN", "number": 0 }, { "name": "VERIFY", "number": 2 }, { "name": "NONE", "number": 3 }] }, { "name": "MessageEncoding", "value": [{ "name": "MESSAGE_ENCODING_UNKNOWN", "number": 0 }, { "name": "LENGTH_PREFIXED", "number": 1 }, { "name": "DELIMITED", "number": 2 }] }, { "name": "JsonFormat", "value": [{ "name": "JSON_FORMAT_UNKNOWN", "number": 0 }, { "name": "ALLOW", "number": 1 }, { "name": "LEGACY_BEST_EFFORT", "number": 2 }] }, { "name": "EnforceNamingStyle", "value": [{ "name": "ENFORCE_NAMING_STYLE_UNKNOWN", "number": 0 }, { "name": "STYLE2024", "number": 1 }, { "name": "STYLE_LEGACY", "number": 2 }] }], "extensionRange": [{ "start": 1000, "end": 9995 }, { "start": 9995, "end": 10000 }, { "start": 10000, "end": 10001 }] }, { "name": "FeatureSetDefaults", "field": [{ "name": "defaults", "number": 1, "type": 11, "label": 3, "typeName": ".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault" }, { "name": "minimum_edition", "number": 4, "type": 14, "label": 1, "typeName": ".google.protobuf.Edition" }, { "name": "maximum_edition", "number": 5, "type": 14, "label": 1, "typeName": ".google.protobuf.Edition" }], "nestedType": [{ "name": "FeatureSetEditionDefault", "field": [{ "name": "edition", "number": 3, "type": 14, "label": 1, "typeName": ".google.protobuf.Edition" }, { "name": "overridable_features", "number": 4, "type": 11, "label": 1, "typeName": ".google.protobuf.FeatureSet" }, { "name": "fixed_features", "number": 5, "type": 11, "label": 1, "typeName": ".google.protobuf.FeatureSet" }] }] }, { "name": "SourceCodeInfo", "field": [{ "name": "location", "number": 1, "type": 11, "label": 3, "typeName": ".google.protobuf.SourceCodeInfo.Location" }], "nestedType": [{ "name": "Location", "field": [{ "name": "path", "number": 1, "type": 5, "label": 3, "options": { "packed": true } }, { "name": "span", "number": 2, "type": 5, "label": 3, "options": { "packed": true } }, { "name": "leading_comments", "number": 3, "type": 9, "label": 1 }, { "name": "trailing_comments", "number": 4, "type": 9, "label": 1 }, { "name": "leading_detached_comments", "number": 6, "type": 9, "label": 3 }] }], "extensionRange": [{ "start": 536000000, "end": 536000001 }] }, { "name": "GeneratedCodeInfo", "field": [{ "name": "annotation", "number": 1, "type": 11, "label": 3, "typeName": ".google.protobuf.GeneratedCodeInfo.Annotation" }], "nestedType": [{ "name": "Annotation", "field": [{ "name": "path", "number": 1, "type": 5, "label": 3, "options": { "packed": true } }, { "name": "source_file", "number": 2, "type": 9, "label": 1 }, { "name": "begin", "number": 3, "type": 5, "label": 1 }, { "name": "end", "number": 4, "type": 5, "label": 1 }, { "name": "semantic", "number": 5, "type": 14, "label": 1, "typeName": ".google.protobuf.GeneratedCodeInfo.Annotation.Semantic" }], "enumType": [{ "name": "Semantic", "value": [{ "name": "NONE", "number": 0 }, { "name": "SET", "number": 1 }, { "name": "ALIAS", "number": 2 }] }] }] }], "enumType": [{ "name": "Edition", "value": [{ "name": "EDITION_UNKNOWN", "number": 0 }, { "name": "EDITION_LEGACY", "number": 900 }, { "name": "EDITION_PROTO2", "number": 998 }, { "name": "EDITION_PROTO3", "number": 999 }, { "name": "EDITION_2023", "number": 1000 }, { "name": "EDITION_2024", "number": 1001 }, { "name": "EDITION_UNSTABLE", "number": 9999 }, { "name": "EDITION_1_TEST_ONLY", "number": 1 }, { "name": "EDITION_2_TEST_ONLY", "number": 2 }, { "name": "EDITION_99997_TEST_ONLY", "number": 99997 }, { "name": "EDITION_99998_TEST_ONLY", "number": 99998 }, { "name": "EDITION_99999_TEST_ONLY", "number": 99999 }, { "name": "EDITION_MAX", "number": 2147483647 }] }, { "name": "SymbolVisibility", "value": [{ "name": "VISIBILITY_UNSET", "number": 0 }, { "name": "VISIBILITY_LOCAL", "number": 1 }, { "name": "VISIBILITY_EXPORT", "number": 2 }] }] }); +/** + * Describes the message google.protobuf.FileDescriptorSet. + * Use `create(FileDescriptorSetSchema)` to create a new message. + */ +export const FileDescriptorSetSchema = /*@__PURE__*/ messageDesc(file_google_protobuf_descriptor, 0); +/** + * Describes the message google.protobuf.FileDescriptorProto. + * Use `create(FileDescriptorProtoSchema)` to create a new message. + */ +export const FileDescriptorProtoSchema = /*@__PURE__*/ messageDesc(file_google_protobuf_descriptor, 1); +/** + * Describes the message google.protobuf.DescriptorProto. + * Use `create(DescriptorProtoSchema)` to create a new message. + */ +export const DescriptorProtoSchema = /*@__PURE__*/ messageDesc(file_google_protobuf_descriptor, 2); +/** + * Describes the message google.protobuf.DescriptorProto.ExtensionRange. + * Use `create(DescriptorProto_ExtensionRangeSchema)` to create a new message. + */ +export const DescriptorProto_ExtensionRangeSchema = /*@__PURE__*/ messageDesc(file_google_protobuf_descriptor, 2, 0); +/** + * Describes the message google.protobuf.DescriptorProto.ReservedRange. + * Use `create(DescriptorProto_ReservedRangeSchema)` to create a new message. + */ +export const DescriptorProto_ReservedRangeSchema = /*@__PURE__*/ messageDesc(file_google_protobuf_descriptor, 2, 1); +/** + * Describes the message google.protobuf.ExtensionRangeOptions. + * Use `create(ExtensionRangeOptionsSchema)` to create a new message. + */ +export const ExtensionRangeOptionsSchema = /*@__PURE__*/ messageDesc(file_google_protobuf_descriptor, 3); +/** + * Describes the message google.protobuf.ExtensionRangeOptions.Declaration. + * Use `create(ExtensionRangeOptions_DeclarationSchema)` to create a new message. + */ +export const ExtensionRangeOptions_DeclarationSchema = /*@__PURE__*/ messageDesc(file_google_protobuf_descriptor, 3, 0); +/** + * The verification state of the extension range. + * + * @generated from enum google.protobuf.ExtensionRangeOptions.VerificationState + */ +export var ExtensionRangeOptions_VerificationState; +(function (ExtensionRangeOptions_VerificationState) { + /** + * All the extensions of the range must be declared. + * + * @generated from enum value: DECLARATION = 0; + */ + ExtensionRangeOptions_VerificationState[ExtensionRangeOptions_VerificationState["DECLARATION"] = 0] = "DECLARATION"; + /** + * @generated from enum value: UNVERIFIED = 1; + */ + ExtensionRangeOptions_VerificationState[ExtensionRangeOptions_VerificationState["UNVERIFIED"] = 1] = "UNVERIFIED"; +})(ExtensionRangeOptions_VerificationState || (ExtensionRangeOptions_VerificationState = {})); +/** + * Describes the enum google.protobuf.ExtensionRangeOptions.VerificationState. + */ +export const ExtensionRangeOptions_VerificationStateSchema = /*@__PURE__*/ enumDesc(file_google_protobuf_descriptor, 3, 0); +/** + * Describes the message google.protobuf.FieldDescriptorProto. + * Use `create(FieldDescriptorProtoSchema)` to create a new message. + */ +export const FieldDescriptorProtoSchema = /*@__PURE__*/ messageDesc(file_google_protobuf_descriptor, 4); +/** + * @generated from enum google.protobuf.FieldDescriptorProto.Type + */ +export var FieldDescriptorProto_Type; +(function (FieldDescriptorProto_Type) { + /** + * 0 is reserved for errors. + * Order is weird for historical reasons. + * + * @generated from enum value: TYPE_DOUBLE = 1; + */ + FieldDescriptorProto_Type[FieldDescriptorProto_Type["DOUBLE"] = 1] = "DOUBLE"; + /** + * @generated from enum value: TYPE_FLOAT = 2; + */ + FieldDescriptorProto_Type[FieldDescriptorProto_Type["FLOAT"] = 2] = "FLOAT"; + /** + * Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if + * negative values are likely. + * + * @generated from enum value: TYPE_INT64 = 3; + */ + FieldDescriptorProto_Type[FieldDescriptorProto_Type["INT64"] = 3] = "INT64"; + /** + * @generated from enum value: TYPE_UINT64 = 4; + */ + FieldDescriptorProto_Type[FieldDescriptorProto_Type["UINT64"] = 4] = "UINT64"; + /** + * Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if + * negative values are likely. + * + * @generated from enum value: TYPE_INT32 = 5; + */ + FieldDescriptorProto_Type[FieldDescriptorProto_Type["INT32"] = 5] = "INT32"; + /** + * @generated from enum value: TYPE_FIXED64 = 6; + */ + FieldDescriptorProto_Type[FieldDescriptorProto_Type["FIXED64"] = 6] = "FIXED64"; + /** + * @generated from enum value: TYPE_FIXED32 = 7; + */ + FieldDescriptorProto_Type[FieldDescriptorProto_Type["FIXED32"] = 7] = "FIXED32"; + /** + * @generated from enum value: TYPE_BOOL = 8; + */ + FieldDescriptorProto_Type[FieldDescriptorProto_Type["BOOL"] = 8] = "BOOL"; + /** + * @generated from enum value: TYPE_STRING = 9; + */ + FieldDescriptorProto_Type[FieldDescriptorProto_Type["STRING"] = 9] = "STRING"; + /** + * Tag-delimited aggregate. + * Group type is deprecated and not supported after google.protobuf. However, Proto3 + * implementations should still be able to parse the group wire format and + * treat group fields as unknown fields. In Editions, the group wire format + * can be enabled via the `message_encoding` feature. + * + * @generated from enum value: TYPE_GROUP = 10; + */ + FieldDescriptorProto_Type[FieldDescriptorProto_Type["GROUP"] = 10] = "GROUP"; + /** + * Length-delimited aggregate. + * + * @generated from enum value: TYPE_MESSAGE = 11; + */ + FieldDescriptorProto_Type[FieldDescriptorProto_Type["MESSAGE"] = 11] = "MESSAGE"; + /** + * New in version 2. + * + * @generated from enum value: TYPE_BYTES = 12; + */ + FieldDescriptorProto_Type[FieldDescriptorProto_Type["BYTES"] = 12] = "BYTES"; + /** + * @generated from enum value: TYPE_UINT32 = 13; + */ + FieldDescriptorProto_Type[FieldDescriptorProto_Type["UINT32"] = 13] = "UINT32"; + /** + * @generated from enum value: TYPE_ENUM = 14; + */ + FieldDescriptorProto_Type[FieldDescriptorProto_Type["ENUM"] = 14] = "ENUM"; + /** + * @generated from enum value: TYPE_SFIXED32 = 15; + */ + FieldDescriptorProto_Type[FieldDescriptorProto_Type["SFIXED32"] = 15] = "SFIXED32"; + /** + * @generated from enum value: TYPE_SFIXED64 = 16; + */ + FieldDescriptorProto_Type[FieldDescriptorProto_Type["SFIXED64"] = 16] = "SFIXED64"; + /** + * Uses ZigZag encoding. + * + * @generated from enum value: TYPE_SINT32 = 17; + */ + FieldDescriptorProto_Type[FieldDescriptorProto_Type["SINT32"] = 17] = "SINT32"; + /** + * Uses ZigZag encoding. + * + * @generated from enum value: TYPE_SINT64 = 18; + */ + FieldDescriptorProto_Type[FieldDescriptorProto_Type["SINT64"] = 18] = "SINT64"; +})(FieldDescriptorProto_Type || (FieldDescriptorProto_Type = {})); +/** + * Describes the enum google.protobuf.FieldDescriptorProto.Type. + */ +export const FieldDescriptorProto_TypeSchema = /*@__PURE__*/ enumDesc(file_google_protobuf_descriptor, 4, 0); +/** + * @generated from enum google.protobuf.FieldDescriptorProto.Label + */ +export var FieldDescriptorProto_Label; +(function (FieldDescriptorProto_Label) { + /** + * 0 is reserved for errors + * + * @generated from enum value: LABEL_OPTIONAL = 1; + */ + FieldDescriptorProto_Label[FieldDescriptorProto_Label["OPTIONAL"] = 1] = "OPTIONAL"; + /** + * @generated from enum value: LABEL_REPEATED = 3; + */ + FieldDescriptorProto_Label[FieldDescriptorProto_Label["REPEATED"] = 3] = "REPEATED"; + /** + * The required label is only allowed in google.protobuf. In proto3 and Editions + * it's explicitly prohibited. In Editions, the `field_presence` feature + * can be used to get this behavior. + * + * @generated from enum value: LABEL_REQUIRED = 2; + */ + FieldDescriptorProto_Label[FieldDescriptorProto_Label["REQUIRED"] = 2] = "REQUIRED"; +})(FieldDescriptorProto_Label || (FieldDescriptorProto_Label = {})); +/** + * Describes the enum google.protobuf.FieldDescriptorProto.Label. + */ +export const FieldDescriptorProto_LabelSchema = /*@__PURE__*/ enumDesc(file_google_protobuf_descriptor, 4, 1); +/** + * Describes the message google.protobuf.OneofDescriptorProto. + * Use `create(OneofDescriptorProtoSchema)` to create a new message. + */ +export const OneofDescriptorProtoSchema = /*@__PURE__*/ messageDesc(file_google_protobuf_descriptor, 5); +/** + * Describes the message google.protobuf.EnumDescriptorProto. + * Use `create(EnumDescriptorProtoSchema)` to create a new message. + */ +export const EnumDescriptorProtoSchema = /*@__PURE__*/ messageDesc(file_google_protobuf_descriptor, 6); +/** + * Describes the message google.protobuf.EnumDescriptorProto.EnumReservedRange. + * Use `create(EnumDescriptorProto_EnumReservedRangeSchema)` to create a new message. + */ +export const EnumDescriptorProto_EnumReservedRangeSchema = /*@__PURE__*/ messageDesc(file_google_protobuf_descriptor, 6, 0); +/** + * Describes the message google.protobuf.EnumValueDescriptorProto. + * Use `create(EnumValueDescriptorProtoSchema)` to create a new message. + */ +export const EnumValueDescriptorProtoSchema = /*@__PURE__*/ messageDesc(file_google_protobuf_descriptor, 7); +/** + * Describes the message google.protobuf.ServiceDescriptorProto. + * Use `create(ServiceDescriptorProtoSchema)` to create a new message. + */ +export const ServiceDescriptorProtoSchema = /*@__PURE__*/ messageDesc(file_google_protobuf_descriptor, 8); +/** + * Describes the message google.protobuf.MethodDescriptorProto. + * Use `create(MethodDescriptorProtoSchema)` to create a new message. + */ +export const MethodDescriptorProtoSchema = /*@__PURE__*/ messageDesc(file_google_protobuf_descriptor, 9); +/** + * Describes the message google.protobuf.FileOptions. + * Use `create(FileOptionsSchema)` to create a new message. + */ +export const FileOptionsSchema = /*@__PURE__*/ messageDesc(file_google_protobuf_descriptor, 10); +/** + * Generated classes can be optimized for speed or code size. + * + * @generated from enum google.protobuf.FileOptions.OptimizeMode + */ +export var FileOptions_OptimizeMode; +(function (FileOptions_OptimizeMode) { + /** + * Generate complete code for parsing, serialization, + * + * @generated from enum value: SPEED = 1; + */ + FileOptions_OptimizeMode[FileOptions_OptimizeMode["SPEED"] = 1] = "SPEED"; + /** + * etc. + * + * Use ReflectionOps to implement these methods. + * + * @generated from enum value: CODE_SIZE = 2; + */ + FileOptions_OptimizeMode[FileOptions_OptimizeMode["CODE_SIZE"] = 2] = "CODE_SIZE"; + /** + * Generate code using MessageLite and the lite runtime. + * + * @generated from enum value: LITE_RUNTIME = 3; + */ + FileOptions_OptimizeMode[FileOptions_OptimizeMode["LITE_RUNTIME"] = 3] = "LITE_RUNTIME"; +})(FileOptions_OptimizeMode || (FileOptions_OptimizeMode = {})); +/** + * Describes the enum google.protobuf.FileOptions.OptimizeMode. + */ +export const FileOptions_OptimizeModeSchema = /*@__PURE__*/ enumDesc(file_google_protobuf_descriptor, 10, 0); +/** + * Describes the message google.protobuf.MessageOptions. + * Use `create(MessageOptionsSchema)` to create a new message. + */ +export const MessageOptionsSchema = /*@__PURE__*/ messageDesc(file_google_protobuf_descriptor, 11); +/** + * Describes the message google.protobuf.FieldOptions. + * Use `create(FieldOptionsSchema)` to create a new message. + */ +export const FieldOptionsSchema = /*@__PURE__*/ messageDesc(file_google_protobuf_descriptor, 12); +/** + * Describes the message google.protobuf.FieldOptions.EditionDefault. + * Use `create(FieldOptions_EditionDefaultSchema)` to create a new message. + */ +export const FieldOptions_EditionDefaultSchema = /*@__PURE__*/ messageDesc(file_google_protobuf_descriptor, 12, 0); +/** + * Describes the message google.protobuf.FieldOptions.FeatureSupport. + * Use `create(FieldOptions_FeatureSupportSchema)` to create a new message. + */ +export const FieldOptions_FeatureSupportSchema = /*@__PURE__*/ messageDesc(file_google_protobuf_descriptor, 12, 1); +/** + * @generated from enum google.protobuf.FieldOptions.CType + */ +export var FieldOptions_CType; +(function (FieldOptions_CType) { + /** + * Default mode. + * + * @generated from enum value: STRING = 0; + */ + FieldOptions_CType[FieldOptions_CType["STRING"] = 0] = "STRING"; + /** + * The option [ctype=CORD] may be applied to a non-repeated field of type + * "bytes". It indicates that in C++, the data should be stored in a Cord + * instead of a string. For very large strings, this may reduce memory + * fragmentation. It may also allow better performance when parsing from a + * Cord, or when parsing with aliasing enabled, as the parsed Cord may then + * alias the original buffer. + * + * @generated from enum value: CORD = 1; + */ + FieldOptions_CType[FieldOptions_CType["CORD"] = 1] = "CORD"; + /** + * @generated from enum value: STRING_PIECE = 2; + */ + FieldOptions_CType[FieldOptions_CType["STRING_PIECE"] = 2] = "STRING_PIECE"; +})(FieldOptions_CType || (FieldOptions_CType = {})); +/** + * Describes the enum google.protobuf.FieldOptions.CType. + */ +export const FieldOptions_CTypeSchema = /*@__PURE__*/ enumDesc(file_google_protobuf_descriptor, 12, 0); +/** + * @generated from enum google.protobuf.FieldOptions.JSType + */ +export var FieldOptions_JSType; +(function (FieldOptions_JSType) { + /** + * Use the default type. + * + * @generated from enum value: JS_NORMAL = 0; + */ + FieldOptions_JSType[FieldOptions_JSType["JS_NORMAL"] = 0] = "JS_NORMAL"; + /** + * Use JavaScript strings. + * + * @generated from enum value: JS_STRING = 1; + */ + FieldOptions_JSType[FieldOptions_JSType["JS_STRING"] = 1] = "JS_STRING"; + /** + * Use JavaScript numbers. + * + * @generated from enum value: JS_NUMBER = 2; + */ + FieldOptions_JSType[FieldOptions_JSType["JS_NUMBER"] = 2] = "JS_NUMBER"; +})(FieldOptions_JSType || (FieldOptions_JSType = {})); +/** + * Describes the enum google.protobuf.FieldOptions.JSType. + */ +export const FieldOptions_JSTypeSchema = /*@__PURE__*/ enumDesc(file_google_protobuf_descriptor, 12, 1); +/** + * If set to RETENTION_SOURCE, the option will be omitted from the binary. + * + * @generated from enum google.protobuf.FieldOptions.OptionRetention + */ +export var FieldOptions_OptionRetention; +(function (FieldOptions_OptionRetention) { + /** + * @generated from enum value: RETENTION_UNKNOWN = 0; + */ + FieldOptions_OptionRetention[FieldOptions_OptionRetention["RETENTION_UNKNOWN"] = 0] = "RETENTION_UNKNOWN"; + /** + * @generated from enum value: RETENTION_RUNTIME = 1; + */ + FieldOptions_OptionRetention[FieldOptions_OptionRetention["RETENTION_RUNTIME"] = 1] = "RETENTION_RUNTIME"; + /** + * @generated from enum value: RETENTION_SOURCE = 2; + */ + FieldOptions_OptionRetention[FieldOptions_OptionRetention["RETENTION_SOURCE"] = 2] = "RETENTION_SOURCE"; +})(FieldOptions_OptionRetention || (FieldOptions_OptionRetention = {})); +/** + * Describes the enum google.protobuf.FieldOptions.OptionRetention. + */ +export const FieldOptions_OptionRetentionSchema = /*@__PURE__*/ enumDesc(file_google_protobuf_descriptor, 12, 2); +/** + * This indicates the types of entities that the field may apply to when used + * as an option. If it is unset, then the field may be freely used as an + * option on any kind of entity. + * + * @generated from enum google.protobuf.FieldOptions.OptionTargetType + */ +export var FieldOptions_OptionTargetType; +(function (FieldOptions_OptionTargetType) { + /** + * @generated from enum value: TARGET_TYPE_UNKNOWN = 0; + */ + FieldOptions_OptionTargetType[FieldOptions_OptionTargetType["TARGET_TYPE_UNKNOWN"] = 0] = "TARGET_TYPE_UNKNOWN"; + /** + * @generated from enum value: TARGET_TYPE_FILE = 1; + */ + FieldOptions_OptionTargetType[FieldOptions_OptionTargetType["TARGET_TYPE_FILE"] = 1] = "TARGET_TYPE_FILE"; + /** + * @generated from enum value: TARGET_TYPE_EXTENSION_RANGE = 2; + */ + FieldOptions_OptionTargetType[FieldOptions_OptionTargetType["TARGET_TYPE_EXTENSION_RANGE"] = 2] = "TARGET_TYPE_EXTENSION_RANGE"; + /** + * @generated from enum value: TARGET_TYPE_MESSAGE = 3; + */ + FieldOptions_OptionTargetType[FieldOptions_OptionTargetType["TARGET_TYPE_MESSAGE"] = 3] = "TARGET_TYPE_MESSAGE"; + /** + * @generated from enum value: TARGET_TYPE_FIELD = 4; + */ + FieldOptions_OptionTargetType[FieldOptions_OptionTargetType["TARGET_TYPE_FIELD"] = 4] = "TARGET_TYPE_FIELD"; + /** + * @generated from enum value: TARGET_TYPE_ONEOF = 5; + */ + FieldOptions_OptionTargetType[FieldOptions_OptionTargetType["TARGET_TYPE_ONEOF"] = 5] = "TARGET_TYPE_ONEOF"; + /** + * @generated from enum value: TARGET_TYPE_ENUM = 6; + */ + FieldOptions_OptionTargetType[FieldOptions_OptionTargetType["TARGET_TYPE_ENUM"] = 6] = "TARGET_TYPE_ENUM"; + /** + * @generated from enum value: TARGET_TYPE_ENUM_ENTRY = 7; + */ + FieldOptions_OptionTargetType[FieldOptions_OptionTargetType["TARGET_TYPE_ENUM_ENTRY"] = 7] = "TARGET_TYPE_ENUM_ENTRY"; + /** + * @generated from enum value: TARGET_TYPE_SERVICE = 8; + */ + FieldOptions_OptionTargetType[FieldOptions_OptionTargetType["TARGET_TYPE_SERVICE"] = 8] = "TARGET_TYPE_SERVICE"; + /** + * @generated from enum value: TARGET_TYPE_METHOD = 9; + */ + FieldOptions_OptionTargetType[FieldOptions_OptionTargetType["TARGET_TYPE_METHOD"] = 9] = "TARGET_TYPE_METHOD"; +})(FieldOptions_OptionTargetType || (FieldOptions_OptionTargetType = {})); +/** + * Describes the enum google.protobuf.FieldOptions.OptionTargetType. + */ +export const FieldOptions_OptionTargetTypeSchema = /*@__PURE__*/ enumDesc(file_google_protobuf_descriptor, 12, 3); +/** + * Describes the message google.protobuf.OneofOptions. + * Use `create(OneofOptionsSchema)` to create a new message. + */ +export const OneofOptionsSchema = /*@__PURE__*/ messageDesc(file_google_protobuf_descriptor, 13); +/** + * Describes the message google.protobuf.EnumOptions. + * Use `create(EnumOptionsSchema)` to create a new message. + */ +export const EnumOptionsSchema = /*@__PURE__*/ messageDesc(file_google_protobuf_descriptor, 14); +/** + * Describes the message google.protobuf.EnumValueOptions. + * Use `create(EnumValueOptionsSchema)` to create a new message. + */ +export const EnumValueOptionsSchema = /*@__PURE__*/ messageDesc(file_google_protobuf_descriptor, 15); +/** + * Describes the message google.protobuf.ServiceOptions. + * Use `create(ServiceOptionsSchema)` to create a new message. + */ +export const ServiceOptionsSchema = /*@__PURE__*/ messageDesc(file_google_protobuf_descriptor, 16); +/** + * Describes the message google.protobuf.MethodOptions. + * Use `create(MethodOptionsSchema)` to create a new message. + */ +export const MethodOptionsSchema = /*@__PURE__*/ messageDesc(file_google_protobuf_descriptor, 17); +/** + * Is this method side-effect-free (or safe in HTTP parlance), or idempotent, + * or neither? HTTP based RPC implementation may choose GET verb for safe + * methods, and PUT verb for idempotent methods instead of the default POST. + * + * @generated from enum google.protobuf.MethodOptions.IdempotencyLevel + */ +export var MethodOptions_IdempotencyLevel; +(function (MethodOptions_IdempotencyLevel) { + /** + * @generated from enum value: IDEMPOTENCY_UNKNOWN = 0; + */ + MethodOptions_IdempotencyLevel[MethodOptions_IdempotencyLevel["IDEMPOTENCY_UNKNOWN"] = 0] = "IDEMPOTENCY_UNKNOWN"; + /** + * implies idempotent + * + * @generated from enum value: NO_SIDE_EFFECTS = 1; + */ + MethodOptions_IdempotencyLevel[MethodOptions_IdempotencyLevel["NO_SIDE_EFFECTS"] = 1] = "NO_SIDE_EFFECTS"; + /** + * idempotent, but may have side effects + * + * @generated from enum value: IDEMPOTENT = 2; + */ + MethodOptions_IdempotencyLevel[MethodOptions_IdempotencyLevel["IDEMPOTENT"] = 2] = "IDEMPOTENT"; +})(MethodOptions_IdempotencyLevel || (MethodOptions_IdempotencyLevel = {})); +/** + * Describes the enum google.protobuf.MethodOptions.IdempotencyLevel. + */ +export const MethodOptions_IdempotencyLevelSchema = /*@__PURE__*/ enumDesc(file_google_protobuf_descriptor, 17, 0); +/** + * Describes the message google.protobuf.UninterpretedOption. + * Use `create(UninterpretedOptionSchema)` to create a new message. + */ +export const UninterpretedOptionSchema = /*@__PURE__*/ messageDesc(file_google_protobuf_descriptor, 18); +/** + * Describes the message google.protobuf.UninterpretedOption.NamePart. + * Use `create(UninterpretedOption_NamePartSchema)` to create a new message. + */ +export const UninterpretedOption_NamePartSchema = /*@__PURE__*/ messageDesc(file_google_protobuf_descriptor, 18, 0); +/** + * Describes the message google.protobuf.FeatureSet. + * Use `create(FeatureSetSchema)` to create a new message. + */ +export const FeatureSetSchema = /*@__PURE__*/ messageDesc(file_google_protobuf_descriptor, 19); +/** + * Describes the message google.protobuf.FeatureSet.VisibilityFeature. + * Use `create(FeatureSet_VisibilityFeatureSchema)` to create a new message. + */ +export const FeatureSet_VisibilityFeatureSchema = /*@__PURE__*/ messageDesc(file_google_protobuf_descriptor, 19, 0); +/** + * @generated from enum google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility + */ +export var FeatureSet_VisibilityFeature_DefaultSymbolVisibility; +(function (FeatureSet_VisibilityFeature_DefaultSymbolVisibility) { + /** + * @generated from enum value: DEFAULT_SYMBOL_VISIBILITY_UNKNOWN = 0; + */ + FeatureSet_VisibilityFeature_DefaultSymbolVisibility[FeatureSet_VisibilityFeature_DefaultSymbolVisibility["DEFAULT_SYMBOL_VISIBILITY_UNKNOWN"] = 0] = "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN"; + /** + * Default pre-EDITION_2024, all UNSET visibility are export. + * + * @generated from enum value: EXPORT_ALL = 1; + */ + FeatureSet_VisibilityFeature_DefaultSymbolVisibility[FeatureSet_VisibilityFeature_DefaultSymbolVisibility["EXPORT_ALL"] = 1] = "EXPORT_ALL"; + /** + * All top-level symbols default to export, nested default to local. + * + * @generated from enum value: EXPORT_TOP_LEVEL = 2; + */ + FeatureSet_VisibilityFeature_DefaultSymbolVisibility[FeatureSet_VisibilityFeature_DefaultSymbolVisibility["EXPORT_TOP_LEVEL"] = 2] = "EXPORT_TOP_LEVEL"; + /** + * All symbols default to local. + * + * @generated from enum value: LOCAL_ALL = 3; + */ + FeatureSet_VisibilityFeature_DefaultSymbolVisibility[FeatureSet_VisibilityFeature_DefaultSymbolVisibility["LOCAL_ALL"] = 3] = "LOCAL_ALL"; + /** + * All symbols local by default. Nested types cannot be exported. + * With special case caveat for message { enum {} reserved 1 to max; } + * This is the recommended setting for new protos. + * + * @generated from enum value: STRICT = 4; + */ + FeatureSet_VisibilityFeature_DefaultSymbolVisibility[FeatureSet_VisibilityFeature_DefaultSymbolVisibility["STRICT"] = 4] = "STRICT"; +})(FeatureSet_VisibilityFeature_DefaultSymbolVisibility || (FeatureSet_VisibilityFeature_DefaultSymbolVisibility = {})); +/** + * Describes the enum google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility. + */ +export const FeatureSet_VisibilityFeature_DefaultSymbolVisibilitySchema = /*@__PURE__*/ enumDesc(file_google_protobuf_descriptor, 19, 0, 0); +/** + * @generated from enum google.protobuf.FeatureSet.FieldPresence + */ +export var FeatureSet_FieldPresence; +(function (FeatureSet_FieldPresence) { + /** + * @generated from enum value: FIELD_PRESENCE_UNKNOWN = 0; + */ + FeatureSet_FieldPresence[FeatureSet_FieldPresence["FIELD_PRESENCE_UNKNOWN"] = 0] = "FIELD_PRESENCE_UNKNOWN"; + /** + * @generated from enum value: EXPLICIT = 1; + */ + FeatureSet_FieldPresence[FeatureSet_FieldPresence["EXPLICIT"] = 1] = "EXPLICIT"; + /** + * @generated from enum value: IMPLICIT = 2; + */ + FeatureSet_FieldPresence[FeatureSet_FieldPresence["IMPLICIT"] = 2] = "IMPLICIT"; + /** + * @generated from enum value: LEGACY_REQUIRED = 3; + */ + FeatureSet_FieldPresence[FeatureSet_FieldPresence["LEGACY_REQUIRED"] = 3] = "LEGACY_REQUIRED"; +})(FeatureSet_FieldPresence || (FeatureSet_FieldPresence = {})); +/** + * Describes the enum google.protobuf.FeatureSet.FieldPresence. + */ +export const FeatureSet_FieldPresenceSchema = /*@__PURE__*/ enumDesc(file_google_protobuf_descriptor, 19, 0); +/** + * @generated from enum google.protobuf.FeatureSet.EnumType + */ +export var FeatureSet_EnumType; +(function (FeatureSet_EnumType) { + /** + * @generated from enum value: ENUM_TYPE_UNKNOWN = 0; + */ + FeatureSet_EnumType[FeatureSet_EnumType["ENUM_TYPE_UNKNOWN"] = 0] = "ENUM_TYPE_UNKNOWN"; + /** + * @generated from enum value: OPEN = 1; + */ + FeatureSet_EnumType[FeatureSet_EnumType["OPEN"] = 1] = "OPEN"; + /** + * @generated from enum value: CLOSED = 2; + */ + FeatureSet_EnumType[FeatureSet_EnumType["CLOSED"] = 2] = "CLOSED"; +})(FeatureSet_EnumType || (FeatureSet_EnumType = {})); +/** + * Describes the enum google.protobuf.FeatureSet.EnumType. + */ +export const FeatureSet_EnumTypeSchema = /*@__PURE__*/ enumDesc(file_google_protobuf_descriptor, 19, 1); +/** + * @generated from enum google.protobuf.FeatureSet.RepeatedFieldEncoding + */ +export var FeatureSet_RepeatedFieldEncoding; +(function (FeatureSet_RepeatedFieldEncoding) { + /** + * @generated from enum value: REPEATED_FIELD_ENCODING_UNKNOWN = 0; + */ + FeatureSet_RepeatedFieldEncoding[FeatureSet_RepeatedFieldEncoding["REPEATED_FIELD_ENCODING_UNKNOWN"] = 0] = "REPEATED_FIELD_ENCODING_UNKNOWN"; + /** + * @generated from enum value: PACKED = 1; + */ + FeatureSet_RepeatedFieldEncoding[FeatureSet_RepeatedFieldEncoding["PACKED"] = 1] = "PACKED"; + /** + * @generated from enum value: EXPANDED = 2; + */ + FeatureSet_RepeatedFieldEncoding[FeatureSet_RepeatedFieldEncoding["EXPANDED"] = 2] = "EXPANDED"; +})(FeatureSet_RepeatedFieldEncoding || (FeatureSet_RepeatedFieldEncoding = {})); +/** + * Describes the enum google.protobuf.FeatureSet.RepeatedFieldEncoding. + */ +export const FeatureSet_RepeatedFieldEncodingSchema = /*@__PURE__*/ enumDesc(file_google_protobuf_descriptor, 19, 2); +/** + * @generated from enum google.protobuf.FeatureSet.Utf8Validation + */ +export var FeatureSet_Utf8Validation; +(function (FeatureSet_Utf8Validation) { + /** + * @generated from enum value: UTF8_VALIDATION_UNKNOWN = 0; + */ + FeatureSet_Utf8Validation[FeatureSet_Utf8Validation["UTF8_VALIDATION_UNKNOWN"] = 0] = "UTF8_VALIDATION_UNKNOWN"; + /** + * @generated from enum value: VERIFY = 2; + */ + FeatureSet_Utf8Validation[FeatureSet_Utf8Validation["VERIFY"] = 2] = "VERIFY"; + /** + * @generated from enum value: NONE = 3; + */ + FeatureSet_Utf8Validation[FeatureSet_Utf8Validation["NONE"] = 3] = "NONE"; +})(FeatureSet_Utf8Validation || (FeatureSet_Utf8Validation = {})); +/** + * Describes the enum google.protobuf.FeatureSet.Utf8Validation. + */ +export const FeatureSet_Utf8ValidationSchema = /*@__PURE__*/ enumDesc(file_google_protobuf_descriptor, 19, 3); +/** + * @generated from enum google.protobuf.FeatureSet.MessageEncoding + */ +export var FeatureSet_MessageEncoding; +(function (FeatureSet_MessageEncoding) { + /** + * @generated from enum value: MESSAGE_ENCODING_UNKNOWN = 0; + */ + FeatureSet_MessageEncoding[FeatureSet_MessageEncoding["MESSAGE_ENCODING_UNKNOWN"] = 0] = "MESSAGE_ENCODING_UNKNOWN"; + /** + * @generated from enum value: LENGTH_PREFIXED = 1; + */ + FeatureSet_MessageEncoding[FeatureSet_MessageEncoding["LENGTH_PREFIXED"] = 1] = "LENGTH_PREFIXED"; + /** + * @generated from enum value: DELIMITED = 2; + */ + FeatureSet_MessageEncoding[FeatureSet_MessageEncoding["DELIMITED"] = 2] = "DELIMITED"; +})(FeatureSet_MessageEncoding || (FeatureSet_MessageEncoding = {})); +/** + * Describes the enum google.protobuf.FeatureSet.MessageEncoding. + */ +export const FeatureSet_MessageEncodingSchema = /*@__PURE__*/ enumDesc(file_google_protobuf_descriptor, 19, 4); +/** + * @generated from enum google.protobuf.FeatureSet.JsonFormat + */ +export var FeatureSet_JsonFormat; +(function (FeatureSet_JsonFormat) { + /** + * @generated from enum value: JSON_FORMAT_UNKNOWN = 0; + */ + FeatureSet_JsonFormat[FeatureSet_JsonFormat["JSON_FORMAT_UNKNOWN"] = 0] = "JSON_FORMAT_UNKNOWN"; + /** + * @generated from enum value: ALLOW = 1; + */ + FeatureSet_JsonFormat[FeatureSet_JsonFormat["ALLOW"] = 1] = "ALLOW"; + /** + * @generated from enum value: LEGACY_BEST_EFFORT = 2; + */ + FeatureSet_JsonFormat[FeatureSet_JsonFormat["LEGACY_BEST_EFFORT"] = 2] = "LEGACY_BEST_EFFORT"; +})(FeatureSet_JsonFormat || (FeatureSet_JsonFormat = {})); +/** + * Describes the enum google.protobuf.FeatureSet.JsonFormat. + */ +export const FeatureSet_JsonFormatSchema = /*@__PURE__*/ enumDesc(file_google_protobuf_descriptor, 19, 5); +/** + * @generated from enum google.protobuf.FeatureSet.EnforceNamingStyle + */ +export var FeatureSet_EnforceNamingStyle; +(function (FeatureSet_EnforceNamingStyle) { + /** + * @generated from enum value: ENFORCE_NAMING_STYLE_UNKNOWN = 0; + */ + FeatureSet_EnforceNamingStyle[FeatureSet_EnforceNamingStyle["ENFORCE_NAMING_STYLE_UNKNOWN"] = 0] = "ENFORCE_NAMING_STYLE_UNKNOWN"; + /** + * @generated from enum value: STYLE2024 = 1; + */ + FeatureSet_EnforceNamingStyle[FeatureSet_EnforceNamingStyle["STYLE2024"] = 1] = "STYLE2024"; + /** + * @generated from enum value: STYLE_LEGACY = 2; + */ + FeatureSet_EnforceNamingStyle[FeatureSet_EnforceNamingStyle["STYLE_LEGACY"] = 2] = "STYLE_LEGACY"; +})(FeatureSet_EnforceNamingStyle || (FeatureSet_EnforceNamingStyle = {})); +/** + * Describes the enum google.protobuf.FeatureSet.EnforceNamingStyle. + */ +export const FeatureSet_EnforceNamingStyleSchema = /*@__PURE__*/ enumDesc(file_google_protobuf_descriptor, 19, 6); +/** + * Describes the message google.protobuf.FeatureSetDefaults. + * Use `create(FeatureSetDefaultsSchema)` to create a new message. + */ +export const FeatureSetDefaultsSchema = /*@__PURE__*/ messageDesc(file_google_protobuf_descriptor, 20); +/** + * Describes the message google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault. + * Use `create(FeatureSetDefaults_FeatureSetEditionDefaultSchema)` to create a new message. + */ +export const FeatureSetDefaults_FeatureSetEditionDefaultSchema = /*@__PURE__*/ messageDesc(file_google_protobuf_descriptor, 20, 0); +/** + * Describes the message google.protobuf.SourceCodeInfo. + * Use `create(SourceCodeInfoSchema)` to create a new message. + */ +export const SourceCodeInfoSchema = /*@__PURE__*/ messageDesc(file_google_protobuf_descriptor, 21); +/** + * Describes the message google.protobuf.SourceCodeInfo.Location. + * Use `create(SourceCodeInfo_LocationSchema)` to create a new message. + */ +export const SourceCodeInfo_LocationSchema = /*@__PURE__*/ messageDesc(file_google_protobuf_descriptor, 21, 0); +/** + * Describes the message google.protobuf.GeneratedCodeInfo. + * Use `create(GeneratedCodeInfoSchema)` to create a new message. + */ +export const GeneratedCodeInfoSchema = /*@__PURE__*/ messageDesc(file_google_protobuf_descriptor, 22); +/** + * Describes the message google.protobuf.GeneratedCodeInfo.Annotation. + * Use `create(GeneratedCodeInfo_AnnotationSchema)` to create a new message. + */ +export const GeneratedCodeInfo_AnnotationSchema = /*@__PURE__*/ messageDesc(file_google_protobuf_descriptor, 22, 0); +/** + * Represents the identified object's effect on the element in the original + * .proto file. + * + * @generated from enum google.protobuf.GeneratedCodeInfo.Annotation.Semantic + */ +export var GeneratedCodeInfo_Annotation_Semantic; +(function (GeneratedCodeInfo_Annotation_Semantic) { + /** + * There is no effect or the effect is indescribable. + * + * @generated from enum value: NONE = 0; + */ + GeneratedCodeInfo_Annotation_Semantic[GeneratedCodeInfo_Annotation_Semantic["NONE"] = 0] = "NONE"; + /** + * The element is set or otherwise mutated. + * + * @generated from enum value: SET = 1; + */ + GeneratedCodeInfo_Annotation_Semantic[GeneratedCodeInfo_Annotation_Semantic["SET"] = 1] = "SET"; + /** + * An alias to the element is returned. + * + * @generated from enum value: ALIAS = 2; + */ + GeneratedCodeInfo_Annotation_Semantic[GeneratedCodeInfo_Annotation_Semantic["ALIAS"] = 2] = "ALIAS"; +})(GeneratedCodeInfo_Annotation_Semantic || (GeneratedCodeInfo_Annotation_Semantic = {})); +/** + * Describes the enum google.protobuf.GeneratedCodeInfo.Annotation.Semantic. + */ +export const GeneratedCodeInfo_Annotation_SemanticSchema = /*@__PURE__*/ enumDesc(file_google_protobuf_descriptor, 22, 0, 0); +/** + * The full set of known editions. + * + * @generated from enum google.protobuf.Edition + */ +export var Edition; +(function (Edition) { + /** + * A placeholder for an unknown edition value. + * + * @generated from enum value: EDITION_UNKNOWN = 0; + */ + Edition[Edition["EDITION_UNKNOWN"] = 0] = "EDITION_UNKNOWN"; + /** + * A placeholder edition for specifying default behaviors *before* a feature + * was first introduced. This is effectively an "infinite past". + * + * @generated from enum value: EDITION_LEGACY = 900; + */ + Edition[Edition["EDITION_LEGACY"] = 900] = "EDITION_LEGACY"; + /** + * Legacy syntax "editions". These pre-date editions, but behave much like + * distinct editions. These can't be used to specify the edition of proto + * files, but feature definitions must supply proto2/proto3 defaults for + * backwards compatibility. + * + * @generated from enum value: EDITION_PROTO2 = 998; + */ + Edition[Edition["EDITION_PROTO2"] = 998] = "EDITION_PROTO2"; + /** + * @generated from enum value: EDITION_PROTO3 = 999; + */ + Edition[Edition["EDITION_PROTO3"] = 999] = "EDITION_PROTO3"; + /** + * Editions that have been released. The specific values are arbitrary and + * should not be depended on, but they will always be time-ordered for easy + * comparison. + * + * @generated from enum value: EDITION_2023 = 1000; + */ + Edition[Edition["EDITION_2023"] = 1000] = "EDITION_2023"; + /** + * @generated from enum value: EDITION_2024 = 1001; + */ + Edition[Edition["EDITION_2024"] = 1001] = "EDITION_2024"; + /** + * A placeholder edition for developing and testing unscheduled features. + * + * @generated from enum value: EDITION_UNSTABLE = 9999; + */ + Edition[Edition["EDITION_UNSTABLE"] = 9999] = "EDITION_UNSTABLE"; + /** + * Placeholder editions for testing feature resolution. These should not be + * used or relied on outside of tests. + * + * @generated from enum value: EDITION_1_TEST_ONLY = 1; + */ + Edition[Edition["EDITION_1_TEST_ONLY"] = 1] = "EDITION_1_TEST_ONLY"; + /** + * @generated from enum value: EDITION_2_TEST_ONLY = 2; + */ + Edition[Edition["EDITION_2_TEST_ONLY"] = 2] = "EDITION_2_TEST_ONLY"; + /** + * @generated from enum value: EDITION_99997_TEST_ONLY = 99997; + */ + Edition[Edition["EDITION_99997_TEST_ONLY"] = 99997] = "EDITION_99997_TEST_ONLY"; + /** + * @generated from enum value: EDITION_99998_TEST_ONLY = 99998; + */ + Edition[Edition["EDITION_99998_TEST_ONLY"] = 99998] = "EDITION_99998_TEST_ONLY"; + /** + * @generated from enum value: EDITION_99999_TEST_ONLY = 99999; + */ + Edition[Edition["EDITION_99999_TEST_ONLY"] = 99999] = "EDITION_99999_TEST_ONLY"; + /** + * Placeholder for specifying unbounded edition support. This should only + * ever be used by plugins that can expect to never require any changes to + * support a new edition. + * + * @generated from enum value: EDITION_MAX = 2147483647; + */ + Edition[Edition["EDITION_MAX"] = 2147483647] = "EDITION_MAX"; +})(Edition || (Edition = {})); +/** + * Describes the enum google.protobuf.Edition. + */ +export const EditionSchema = /*@__PURE__*/ enumDesc(file_google_protobuf_descriptor, 0); +/** + * Describes the 'visibility' of a symbol with respect to the proto import + * system. Symbols can only be imported when the visibility rules do not prevent + * it (ex: local symbols cannot be imported). Visibility modifiers can only set + * on `message` and `enum` as they are the only types available to be referenced + * from other files. + * + * @generated from enum google.protobuf.SymbolVisibility + */ +export var SymbolVisibility; +(function (SymbolVisibility) { + /** + * @generated from enum value: VISIBILITY_UNSET = 0; + */ + SymbolVisibility[SymbolVisibility["VISIBILITY_UNSET"] = 0] = "VISIBILITY_UNSET"; + /** + * @generated from enum value: VISIBILITY_LOCAL = 1; + */ + SymbolVisibility[SymbolVisibility["VISIBILITY_LOCAL"] = 1] = "VISIBILITY_LOCAL"; + /** + * @generated from enum value: VISIBILITY_EXPORT = 2; + */ + SymbolVisibility[SymbolVisibility["VISIBILITY_EXPORT"] = 2] = "VISIBILITY_EXPORT"; +})(SymbolVisibility || (SymbolVisibility = {})); +/** + * Describes the enum google.protobuf.SymbolVisibility. + */ +export const SymbolVisibilitySchema = /*@__PURE__*/ enumDesc(file_google_protobuf_descriptor, 1); diff --git a/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/duration_pb.d.ts b/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/duration_pb.d.ts new file mode 100644 index 0000000..a779ebf --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/duration_pb.d.ts @@ -0,0 +1,161 @@ +import type { GenFile, GenMessage } from "../../../../codegenv2/types.js"; +import type { Message } from "../../../../types.js"; +/** + * Describes the file google/protobuf/duration.proto. + */ +export declare const file_google_protobuf_duration: GenFile; +/** + * A Duration represents a signed, fixed-length span of time represented + * as a count of seconds and fractions of seconds at nanosecond + * resolution. It is independent of any calendar and concepts like "day" + * or "month". It is related to Timestamp in that the difference between + * two Timestamp values is a Duration and it can be added or subtracted + * from a Timestamp. Range is approximately +-10,000 years. + * + * # Examples + * + * Example 1: Compute Duration from two Timestamps in pseudo code. + * + * Timestamp start = ...; + * Timestamp end = ...; + * Duration duration = ...; + * + * duration.seconds = end.seconds - start.seconds; + * duration.nanos = end.nanos - start.nanos; + * + * if (duration.seconds < 0 && duration.nanos > 0) { + * duration.seconds += 1; + * duration.nanos -= 1000000000; + * } else if (duration.seconds > 0 && duration.nanos < 0) { + * duration.seconds -= 1; + * duration.nanos += 1000000000; + * } + * + * Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + * + * Timestamp start = ...; + * Duration duration = ...; + * Timestamp end = ...; + * + * end.seconds = start.seconds + duration.seconds; + * end.nanos = start.nanos + duration.nanos; + * + * if (end.nanos < 0) { + * end.seconds -= 1; + * end.nanos += 1000000000; + * } else if (end.nanos >= 1000000000) { + * end.seconds += 1; + * end.nanos -= 1000000000; + * } + * + * Example 3: Compute Duration from datetime.timedelta in Python. + * + * td = datetime.timedelta(days=3, minutes=10) + * duration = Duration() + * duration.FromTimedelta(td) + * + * # JSON Mapping + * + * In JSON format, the Duration type is encoded as a string rather than an + * object, where the string ends in the suffix "s" (indicating seconds) and + * is preceded by the number of seconds, with nanoseconds expressed as + * fractional seconds. For example, 3 seconds with 0 nanoseconds should be + * encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + * be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + * microsecond should be expressed in JSON format as "3.000001s". + * + * + * @generated from message google.protobuf.Duration + */ +export type Duration = Message<"google.protobuf.Duration"> & { + /** + * Signed seconds of the span of time. Must be from -315,576,000,000 + * to +315,576,000,000 inclusive. Note: these bounds are computed from: + * 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + * + * @generated from field: int64 seconds = 1; + */ + seconds: bigint; + /** + * Signed fractions of a second at nanosecond resolution of the span + * of time. Durations less than one second are represented with a 0 + * `seconds` field and a positive or negative `nanos` field. For durations + * of one second or more, a non-zero value for the `nanos` field must be + * of the same sign as the `seconds` field. Must be from -999,999,999 + * to +999,999,999 inclusive. + * + * @generated from field: int32 nanos = 2; + */ + nanos: number; +}; +/** + * A Duration represents a signed, fixed-length span of time represented + * as a count of seconds and fractions of seconds at nanosecond + * resolution. It is independent of any calendar and concepts like "day" + * or "month". It is related to Timestamp in that the difference between + * two Timestamp values is a Duration and it can be added or subtracted + * from a Timestamp. Range is approximately +-10,000 years. + * + * # Examples + * + * Example 1: Compute Duration from two Timestamps in pseudo code. + * + * Timestamp start = ...; + * Timestamp end = ...; + * Duration duration = ...; + * + * duration.seconds = end.seconds - start.seconds; + * duration.nanos = end.nanos - start.nanos; + * + * if (duration.seconds < 0 && duration.nanos > 0) { + * duration.seconds += 1; + * duration.nanos -= 1000000000; + * } else if (duration.seconds > 0 && duration.nanos < 0) { + * duration.seconds -= 1; + * duration.nanos += 1000000000; + * } + * + * Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + * + * Timestamp start = ...; + * Duration duration = ...; + * Timestamp end = ...; + * + * end.seconds = start.seconds + duration.seconds; + * end.nanos = start.nanos + duration.nanos; + * + * if (end.nanos < 0) { + * end.seconds -= 1; + * end.nanos += 1000000000; + * } else if (end.nanos >= 1000000000) { + * end.seconds += 1; + * end.nanos -= 1000000000; + * } + * + * Example 3: Compute Duration from datetime.timedelta in Python. + * + * td = datetime.timedelta(days=3, minutes=10) + * duration = Duration() + * duration.FromTimedelta(td) + * + * # JSON Mapping + * + * In JSON format, the Duration type is encoded as a string rather than an + * object, where the string ends in the suffix "s" (indicating seconds) and + * is preceded by the number of seconds, with nanoseconds expressed as + * fractional seconds. For example, 3 seconds with 0 nanoseconds should be + * encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + * be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + * microsecond should be expressed in JSON format as "3.000001s". + * + * + * @generated from message google.protobuf.Duration + */ +export type DurationJson = string; +/** + * Describes the message google.protobuf.Duration. + * Use `create(DurationSchema)` to create a new message. + */ +export declare const DurationSchema: GenMessage; diff --git a/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/duration_pb.js b/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/duration_pb.js new file mode 100644 index 0000000..3ec5dff --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/duration_pb.js @@ -0,0 +1,24 @@ +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +import { fileDesc } from "../../../../codegenv2/file.js"; +import { messageDesc } from "../../../../codegenv2/message.js"; +/** + * Describes the file google/protobuf/duration.proto. + */ +export const file_google_protobuf_duration = /*@__PURE__*/ fileDesc("Ch5nb29nbGUvcHJvdG9idWYvZHVyYXRpb24ucHJvdG8SD2dvb2dsZS5wcm90b2J1ZiIqCghEdXJhdGlvbhIPCgdzZWNvbmRzGAEgASgDEg0KBW5hbm9zGAIgASgFQoMBChNjb20uZ29vZ2xlLnByb3RvYnVmQg1EdXJhdGlvblByb3RvUAFaMWdvb2dsZS5nb2xhbmcub3JnL3Byb3RvYnVmL3R5cGVzL2tub3duL2R1cmF0aW9ucGL4AQGiAgNHUEKqAh5Hb29nbGUuUHJvdG9idWYuV2VsbEtub3duVHlwZXNiBnByb3RvMw"); +/** + * Describes the message google.protobuf.Duration. + * Use `create(DurationSchema)` to create a new message. + */ +export const DurationSchema = /*@__PURE__*/ messageDesc(file_google_protobuf_duration, 0); diff --git a/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/empty_pb.d.ts b/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/empty_pb.d.ts new file mode 100644 index 0000000..d53d568 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/empty_pb.d.ts @@ -0,0 +1,39 @@ +import type { GenFile, GenMessage } from "../../../../codegenv2/types.js"; +import type { Message } from "../../../../types.js"; +/** + * Describes the file google/protobuf/empty.proto. + */ +export declare const file_google_protobuf_empty: GenFile; +/** + * A generic empty message that you can re-use to avoid defining duplicated + * empty messages in your APIs. A typical example is to use it as the request + * or the response type of an API method. For instance: + * + * service Foo { + * rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); + * } + * + * + * @generated from message google.protobuf.Empty + */ +export type Empty = Message<"google.protobuf.Empty"> & {}; +/** + * A generic empty message that you can re-use to avoid defining duplicated + * empty messages in your APIs. A typical example is to use it as the request + * or the response type of an API method. For instance: + * + * service Foo { + * rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); + * } + * + * + * @generated from message google.protobuf.Empty + */ +export type EmptyJson = Record; +/** + * Describes the message google.protobuf.Empty. + * Use `create(EmptySchema)` to create a new message. + */ +export declare const EmptySchema: GenMessage; diff --git a/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/empty_pb.js b/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/empty_pb.js new file mode 100644 index 0000000..55b9c97 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/empty_pb.js @@ -0,0 +1,24 @@ +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +import { fileDesc } from "../../../../codegenv2/file.js"; +import { messageDesc } from "../../../../codegenv2/message.js"; +/** + * Describes the file google/protobuf/empty.proto. + */ +export const file_google_protobuf_empty = /*@__PURE__*/ fileDesc("Chtnb29nbGUvcHJvdG9idWYvZW1wdHkucHJvdG8SD2dvb2dsZS5wcm90b2J1ZiIHCgVFbXB0eUJ9ChNjb20uZ29vZ2xlLnByb3RvYnVmQgpFbXB0eVByb3RvUAFaLmdvb2dsZS5nb2xhbmcub3JnL3Byb3RvYnVmL3R5cGVzL2tub3duL2VtcHR5cGL4AQGiAgNHUEKqAh5Hb29nbGUuUHJvdG9idWYuV2VsbEtub3duVHlwZXNiBnByb3RvMw"); +/** + * Describes the message google.protobuf.Empty. + * Use `create(EmptySchema)` to create a new message. + */ +export const EmptySchema = /*@__PURE__*/ messageDesc(file_google_protobuf_empty, 0); diff --git a/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/field_mask_pb.d.ts b/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/field_mask_pb.d.ts new file mode 100644 index 0000000..e727833 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/field_mask_pb.d.ts @@ -0,0 +1,424 @@ +import type { GenFile, GenMessage } from "../../../../codegenv2/types.js"; +import type { Message } from "../../../../types.js"; +/** + * Describes the file google/protobuf/field_mask.proto. + */ +export declare const file_google_protobuf_field_mask: GenFile; +/** + * `FieldMask` represents a set of symbolic field paths, for example: + * + * paths: "f.a" + * paths: "f.b.d" + * + * Here `f` represents a field in some root message, `a` and `b` + * fields in the message found in `f`, and `d` a field found in the + * message in `f.b`. + * + * Field masks are used to specify a subset of fields that should be + * returned by a get operation or modified by an update operation. + * Field masks also have a custom JSON encoding (see below). + * + * # Field Masks in Projections + * + * When used in the context of a projection, a response message or + * sub-message is filtered by the API to only contain those fields as + * specified in the mask. For example, if the mask in the previous + * example is applied to a response message as follows: + * + * f { + * a : 22 + * b { + * d : 1 + * x : 2 + * } + * y : 13 + * } + * z: 8 + * + * The result will not contain specific values for fields x,y and z + * (their value will be set to the default, and omitted in proto text + * output): + * + * + * f { + * a : 22 + * b { + * d : 1 + * } + * } + * + * A repeated field is not allowed except at the last position of a + * paths string. + * + * If a FieldMask object is not present in a get operation, the + * operation applies to all fields (as if a FieldMask of all fields + * had been specified). + * + * Note that a field mask does not necessarily apply to the + * top-level response message. In case of a REST get operation, the + * field mask applies directly to the response, but in case of a REST + * list operation, the mask instead applies to each individual message + * in the returned resource list. In case of a REST custom method, + * other definitions may be used. Where the mask applies will be + * clearly documented together with its declaration in the API. In + * any case, the effect on the returned resource/resources is required + * behavior for APIs. + * + * # Field Masks in Update Operations + * + * A field mask in update operations specifies which fields of the + * targeted resource are going to be updated. The API is required + * to only change the values of the fields as specified in the mask + * and leave the others untouched. If a resource is passed in to + * describe the updated values, the API ignores the values of all + * fields not covered by the mask. + * + * If a repeated field is specified for an update operation, new values will + * be appended to the existing repeated field in the target resource. Note that + * a repeated field is only allowed in the last position of a `paths` string. + * + * If a sub-message is specified in the last position of the field mask for an + * update operation, then new value will be merged into the existing sub-message + * in the target resource. + * + * For example, given the target message: + * + * f { + * b { + * d: 1 + * x: 2 + * } + * c: [1] + * } + * + * And an update message: + * + * f { + * b { + * d: 10 + * } + * c: [2] + * } + * + * then if the field mask is: + * + * paths: ["f.b", "f.c"] + * + * then the result will be: + * + * f { + * b { + * d: 10 + * x: 2 + * } + * c: [1, 2] + * } + * + * An implementation may provide options to override this default behavior for + * repeated and message fields. + * + * Note that libraries which implement FieldMask resolution have various + * different behaviors in the face of empty masks or the special "*" mask. + * When implementing a service you should confirm these cases have the + * appropriate behavior in the underlying FieldMask library that you desire, + * and you may need to special case those cases in your application code if + * the underlying field mask library behavior differs from your intended + * service semantics. + * + * Update methods implementing https://google.aip.dev/134 + * - MUST support the special value * meaning "full replace" + * - MUST treat an omitted field mask as "replace fields which are present". + * + * Other methods implementing https://google.aip.dev/157 + * - SHOULD support the special value "*" to mean "get all". + * - MUST treat an omitted field mask to mean "get all", unless otherwise + * documented. + * + * ## Considerations for HTTP REST + * + * The HTTP kind of an update operation which uses a field mask must + * be set to PATCH instead of PUT in order to satisfy HTTP semantics + * (PUT must only be used for full updates). + * + * # JSON Encoding of Field Masks + * + * In JSON, a field mask is encoded as a single string where paths are + * separated by a comma. Fields name in each path are converted + * to/from lower-camel naming conventions. + * + * As an example, consider the following message declarations: + * + * message Profile { + * User user = 1; + * Photo photo = 2; + * } + * message User { + * string display_name = 1; + * string address = 2; + * } + * + * In proto a field mask for `Profile` may look as such: + * + * mask { + * paths: "user.display_name" + * paths: "photo" + * } + * + * In JSON, the same mask is represented as below: + * + * { + * mask: "user.displayName,photo" + * } + * + * # Field Masks and Oneof Fields + * + * Field masks treat fields in oneofs just as regular fields. Consider the + * following message: + * + * message SampleMessage { + * oneof test_oneof { + * string name = 4; + * SubMessage sub_message = 9; + * } + * } + * + * The field mask can be: + * + * mask { + * paths: "name" + * } + * + * Or: + * + * mask { + * paths: "sub_message" + * } + * + * Note that oneof type names ("test_oneof" in this case) cannot be used in + * paths. + * + * ## Field Mask Verification + * + * The implementation of any API method which has a FieldMask type field in the + * request should verify the included field paths, and return an + * `INVALID_ARGUMENT` error if any path is unmappable. + * + * @generated from message google.protobuf.FieldMask + */ +export type FieldMask = Message<"google.protobuf.FieldMask"> & { + /** + * The set of field mask paths. + * + * @generated from field: repeated string paths = 1; + */ + paths: string[]; +}; +/** + * `FieldMask` represents a set of symbolic field paths, for example: + * + * paths: "f.a" + * paths: "f.b.d" + * + * Here `f` represents a field in some root message, `a` and `b` + * fields in the message found in `f`, and `d` a field found in the + * message in `f.b`. + * + * Field masks are used to specify a subset of fields that should be + * returned by a get operation or modified by an update operation. + * Field masks also have a custom JSON encoding (see below). + * + * # Field Masks in Projections + * + * When used in the context of a projection, a response message or + * sub-message is filtered by the API to only contain those fields as + * specified in the mask. For example, if the mask in the previous + * example is applied to a response message as follows: + * + * f { + * a : 22 + * b { + * d : 1 + * x : 2 + * } + * y : 13 + * } + * z: 8 + * + * The result will not contain specific values for fields x,y and z + * (their value will be set to the default, and omitted in proto text + * output): + * + * + * f { + * a : 22 + * b { + * d : 1 + * } + * } + * + * A repeated field is not allowed except at the last position of a + * paths string. + * + * If a FieldMask object is not present in a get operation, the + * operation applies to all fields (as if a FieldMask of all fields + * had been specified). + * + * Note that a field mask does not necessarily apply to the + * top-level response message. In case of a REST get operation, the + * field mask applies directly to the response, but in case of a REST + * list operation, the mask instead applies to each individual message + * in the returned resource list. In case of a REST custom method, + * other definitions may be used. Where the mask applies will be + * clearly documented together with its declaration in the API. In + * any case, the effect on the returned resource/resources is required + * behavior for APIs. + * + * # Field Masks in Update Operations + * + * A field mask in update operations specifies which fields of the + * targeted resource are going to be updated. The API is required + * to only change the values of the fields as specified in the mask + * and leave the others untouched. If a resource is passed in to + * describe the updated values, the API ignores the values of all + * fields not covered by the mask. + * + * If a repeated field is specified for an update operation, new values will + * be appended to the existing repeated field in the target resource. Note that + * a repeated field is only allowed in the last position of a `paths` string. + * + * If a sub-message is specified in the last position of the field mask for an + * update operation, then new value will be merged into the existing sub-message + * in the target resource. + * + * For example, given the target message: + * + * f { + * b { + * d: 1 + * x: 2 + * } + * c: [1] + * } + * + * And an update message: + * + * f { + * b { + * d: 10 + * } + * c: [2] + * } + * + * then if the field mask is: + * + * paths: ["f.b", "f.c"] + * + * then the result will be: + * + * f { + * b { + * d: 10 + * x: 2 + * } + * c: [1, 2] + * } + * + * An implementation may provide options to override this default behavior for + * repeated and message fields. + * + * Note that libraries which implement FieldMask resolution have various + * different behaviors in the face of empty masks or the special "*" mask. + * When implementing a service you should confirm these cases have the + * appropriate behavior in the underlying FieldMask library that you desire, + * and you may need to special case those cases in your application code if + * the underlying field mask library behavior differs from your intended + * service semantics. + * + * Update methods implementing https://google.aip.dev/134 + * - MUST support the special value * meaning "full replace" + * - MUST treat an omitted field mask as "replace fields which are present". + * + * Other methods implementing https://google.aip.dev/157 + * - SHOULD support the special value "*" to mean "get all". + * - MUST treat an omitted field mask to mean "get all", unless otherwise + * documented. + * + * ## Considerations for HTTP REST + * + * The HTTP kind of an update operation which uses a field mask must + * be set to PATCH instead of PUT in order to satisfy HTTP semantics + * (PUT must only be used for full updates). + * + * # JSON Encoding of Field Masks + * + * In JSON, a field mask is encoded as a single string where paths are + * separated by a comma. Fields name in each path are converted + * to/from lower-camel naming conventions. + * + * As an example, consider the following message declarations: + * + * message Profile { + * User user = 1; + * Photo photo = 2; + * } + * message User { + * string display_name = 1; + * string address = 2; + * } + * + * In proto a field mask for `Profile` may look as such: + * + * mask { + * paths: "user.display_name" + * paths: "photo" + * } + * + * In JSON, the same mask is represented as below: + * + * { + * mask: "user.displayName,photo" + * } + * + * # Field Masks and Oneof Fields + * + * Field masks treat fields in oneofs just as regular fields. Consider the + * following message: + * + * message SampleMessage { + * oneof test_oneof { + * string name = 4; + * SubMessage sub_message = 9; + * } + * } + * + * The field mask can be: + * + * mask { + * paths: "name" + * } + * + * Or: + * + * mask { + * paths: "sub_message" + * } + * + * Note that oneof type names ("test_oneof" in this case) cannot be used in + * paths. + * + * ## Field Mask Verification + * + * The implementation of any API method which has a FieldMask type field in the + * request should verify the included field paths, and return an + * `INVALID_ARGUMENT` error if any path is unmappable. + * + * @generated from message google.protobuf.FieldMask + */ +export type FieldMaskJson = string; +/** + * Describes the message google.protobuf.FieldMask. + * Use `create(FieldMaskSchema)` to create a new message. + */ +export declare const FieldMaskSchema: GenMessage; diff --git a/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/field_mask_pb.js b/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/field_mask_pb.js new file mode 100644 index 0000000..fbe8ffc --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/field_mask_pb.js @@ -0,0 +1,24 @@ +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +import { fileDesc } from "../../../../codegenv2/file.js"; +import { messageDesc } from "../../../../codegenv2/message.js"; +/** + * Describes the file google/protobuf/field_mask.proto. + */ +export const file_google_protobuf_field_mask = /*@__PURE__*/ fileDesc("CiBnb29nbGUvcHJvdG9idWYvZmllbGRfbWFzay5wcm90bxIPZ29vZ2xlLnByb3RvYnVmIhoKCUZpZWxkTWFzaxINCgVwYXRocxgBIAMoCUKFAQoTY29tLmdvb2dsZS5wcm90b2J1ZkIORmllbGRNYXNrUHJvdG9QAVoyZ29vZ2xlLmdvbGFuZy5vcmcvcHJvdG9idWYvdHlwZXMva25vd24vZmllbGRtYXNrcGL4AQGiAgNHUEKqAh5Hb29nbGUuUHJvdG9idWYuV2VsbEtub3duVHlwZXNiBnByb3RvMw"); +/** + * Describes the message google.protobuf.FieldMask. + * Use `create(FieldMaskSchema)` to create a new message. + */ +export const FieldMaskSchema = /*@__PURE__*/ messageDesc(file_google_protobuf_field_mask, 0); diff --git a/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/go_features_pb.d.ts b/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/go_features_pb.d.ts new file mode 100644 index 0000000..25bf617 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/go_features_pb.d.ts @@ -0,0 +1,189 @@ +import type { GenEnum, GenExtension, GenFile, GenMessage } from "../../../../codegenv2/types.js"; +import type { FeatureSet } from "./descriptor_pb.js"; +import type { Message } from "../../../../types.js"; +/** + * Describes the file google/protobuf/go_features.proto. + */ +export declare const file_google_protobuf_go_features: GenFile; +/** + * @generated from message pb.GoFeatures + */ +export type GoFeatures = Message<"pb.GoFeatures"> & { + /** + * Whether or not to generate the deprecated UnmarshalJSON method for enums. + * Can only be true for proto using the Open Struct api. + * + * @generated from field: optional bool legacy_unmarshal_json_enum = 1; + */ + legacyUnmarshalJsonEnum: boolean; + /** + * One of OPEN, HYBRID or OPAQUE. + * + * @generated from field: optional pb.GoFeatures.APILevel api_level = 2; + */ + apiLevel: GoFeatures_APILevel; + /** + * @generated from field: optional pb.GoFeatures.StripEnumPrefix strip_enum_prefix = 3; + */ + stripEnumPrefix: GoFeatures_StripEnumPrefix; + /** + * @generated from field: optional pb.GoFeatures.OptimizeModeFeature.OptimizeMode optimize_mode = 4; + */ + optimizeMode: GoFeatures_OptimizeModeFeature_OptimizeMode; +}; +/** + * @generated from message pb.GoFeatures + */ +export type GoFeaturesJson = { + /** + * Whether or not to generate the deprecated UnmarshalJSON method for enums. + * Can only be true for proto using the Open Struct api. + * + * @generated from field: optional bool legacy_unmarshal_json_enum = 1; + */ + legacyUnmarshalJsonEnum?: boolean; + /** + * One of OPEN, HYBRID or OPAQUE. + * + * @generated from field: optional pb.GoFeatures.APILevel api_level = 2; + */ + apiLevel?: GoFeatures_APILevelJson; + /** + * @generated from field: optional pb.GoFeatures.StripEnumPrefix strip_enum_prefix = 3; + */ + stripEnumPrefix?: GoFeatures_StripEnumPrefixJson; + /** + * @generated from field: optional pb.GoFeatures.OptimizeModeFeature.OptimizeMode optimize_mode = 4; + */ + optimizeMode?: GoFeatures_OptimizeModeFeature_OptimizeModeJson; +}; +/** + * Describes the message pb.GoFeatures. + * Use `create(GoFeaturesSchema)` to create a new message. + */ +export declare const GoFeaturesSchema: GenMessage; +/** + * Wrap the OptimizeMode enum in a message for scoping: + * This way, users can type shorter names (SPEED, CODE_SIZE). + * + * @generated from message pb.GoFeatures.OptimizeModeFeature + */ +export type GoFeatures_OptimizeModeFeature = Message<"pb.GoFeatures.OptimizeModeFeature"> & {}; +/** + * Wrap the OptimizeMode enum in a message for scoping: + * This way, users can type shorter names (SPEED, CODE_SIZE). + * + * @generated from message pb.GoFeatures.OptimizeModeFeature + */ +export type GoFeatures_OptimizeModeFeatureJson = {}; +/** + * Describes the message pb.GoFeatures.OptimizeModeFeature. + * Use `create(GoFeatures_OptimizeModeFeatureSchema)` to create a new message. + */ +export declare const GoFeatures_OptimizeModeFeatureSchema: GenMessage; +/** + * The name of this enum matches OptimizeMode in descriptor.proto. + * + * @generated from enum pb.GoFeatures.OptimizeModeFeature.OptimizeMode + */ +export declare enum GoFeatures_OptimizeModeFeature_OptimizeMode { + /** + * OPTIMIZE_MODE_UNSPECIFIED results in falling back to the default + * (optimize for code size), but needs to be a separate value to distinguish + * between an explicitly set optimize mode or a missing optimize mode. + * + * @generated from enum value: OPTIMIZE_MODE_UNSPECIFIED = 0; + */ + OPTIMIZE_MODE_UNSPECIFIED = 0, + /** + * @generated from enum value: SPEED = 1; + */ + SPEED = 1, + /** + * There is no enum entry for LITE_RUNTIME (descriptor.proto), + * because Go Protobuf does not have the concept of a lite runtime. + * + * @generated from enum value: CODE_SIZE = 2; + */ + CODE_SIZE = 2 +} +/** + * The name of this enum matches OptimizeMode in descriptor.proto. + * + * @generated from enum pb.GoFeatures.OptimizeModeFeature.OptimizeMode + */ +export type GoFeatures_OptimizeModeFeature_OptimizeModeJson = "OPTIMIZE_MODE_UNSPECIFIED" | "SPEED" | "CODE_SIZE"; +/** + * Describes the enum pb.GoFeatures.OptimizeModeFeature.OptimizeMode. + */ +export declare const GoFeatures_OptimizeModeFeature_OptimizeModeSchema: GenEnum; +/** + * @generated from enum pb.GoFeatures.APILevel + */ +export declare enum GoFeatures_APILevel { + /** + * API_LEVEL_UNSPECIFIED results in selecting the OPEN API, + * but needs to be a separate value to distinguish between + * an explicitly set api level or a missing api level. + * + * @generated from enum value: API_LEVEL_UNSPECIFIED = 0; + */ + API_LEVEL_UNSPECIFIED = 0, + /** + * @generated from enum value: API_OPEN = 1; + */ + API_OPEN = 1, + /** + * @generated from enum value: API_HYBRID = 2; + */ + API_HYBRID = 2, + /** + * @generated from enum value: API_OPAQUE = 3; + */ + API_OPAQUE = 3 +} +/** + * @generated from enum pb.GoFeatures.APILevel + */ +export type GoFeatures_APILevelJson = "API_LEVEL_UNSPECIFIED" | "API_OPEN" | "API_HYBRID" | "API_OPAQUE"; +/** + * Describes the enum pb.GoFeatures.APILevel. + */ +export declare const GoFeatures_APILevelSchema: GenEnum; +/** + * @generated from enum pb.GoFeatures.StripEnumPrefix + */ +export declare enum GoFeatures_StripEnumPrefix { + /** + * @generated from enum value: STRIP_ENUM_PREFIX_UNSPECIFIED = 0; + */ + UNSPECIFIED = 0, + /** + * @generated from enum value: STRIP_ENUM_PREFIX_KEEP = 1; + */ + KEEP = 1, + /** + * @generated from enum value: STRIP_ENUM_PREFIX_GENERATE_BOTH = 2; + */ + GENERATE_BOTH = 2, + /** + * @generated from enum value: STRIP_ENUM_PREFIX_STRIP = 3; + */ + STRIP = 3 +} +/** + * @generated from enum pb.GoFeatures.StripEnumPrefix + */ +export type GoFeatures_StripEnumPrefixJson = "STRIP_ENUM_PREFIX_UNSPECIFIED" | "STRIP_ENUM_PREFIX_KEEP" | "STRIP_ENUM_PREFIX_GENERATE_BOTH" | "STRIP_ENUM_PREFIX_STRIP"; +/** + * Describes the enum pb.GoFeatures.StripEnumPrefix. + */ +export declare const GoFeatures_StripEnumPrefixSchema: GenEnum; +/** + * @generated from extension: optional pb.GoFeatures go = 1002; + */ +export declare const go: GenExtension; diff --git a/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/go_features_pb.js b/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/go_features_pb.js new file mode 100644 index 0000000..3d297da --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/go_features_pb.js @@ -0,0 +1,123 @@ +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +import { fileDesc } from "../../../../codegenv2/file.js"; +import { file_google_protobuf_descriptor } from "./descriptor_pb.js"; +import { messageDesc } from "../../../../codegenv2/message.js"; +import { enumDesc } from "../../../../codegenv2/enum.js"; +import { extDesc } from "../../../../codegenv2/extension.js"; +/** + * Describes the file google/protobuf/go_features.proto. + */ +export const file_google_protobuf_go_features = /*@__PURE__*/ fileDesc("CiFnb29nbGUvcHJvdG9idWYvZ29fZmVhdHVyZXMucHJvdG8SAnBiItEGCgpHb0ZlYXR1cmVzEqUBChpsZWdhY3lfdW5tYXJzaGFsX2pzb25fZW51bRgBIAEoCEKAAYgBAZgBBpgBAaIBCRIEdHJ1ZRiEB6IBChIFZmFsc2UY5weyAVsI6AcQ6AcaU1RoZSBsZWdhY3kgVW5tYXJzaGFsSlNPTiBBUEkgaXMgZGVwcmVjYXRlZCBhbmQgd2lsbCBiZSByZW1vdmVkIGluIGEgZnV0dXJlIGVkaXRpb24uEmoKCWFwaV9sZXZlbBgCIAEoDjIXLnBiLkdvRmVhdHVyZXMuQVBJTGV2ZWxCPogBAZgBA5gBAaIBGhIVQVBJX0xFVkVMX1VOU1BFQ0lGSUVEGIQHogEPEgpBUElfT1BBUVVFGOkHsgEDCOgHEmsKEXN0cmlwX2VudW1fcHJlZml4GAMgASgOMh4ucGIuR29GZWF0dXJlcy5TdHJpcEVudW1QcmVmaXhCMIgBAZgBBpgBB5gBAaIBGxIWU1RSSVBfRU5VTV9QUkVGSVhfS0VFUBiEB7IBAwjpBxJ4Cg1vcHRpbWl6ZV9tb2RlGAQgASgOMi8ucGIuR29GZWF0dXJlcy5PcHRpbWl6ZU1vZGVGZWF0dXJlLk9wdGltaXplTW9kZUIwiAEBmAEDmAEBogEeEhlPUFRJTUlaRV9NT0RFX1VOU1BFQ0lGSUVEGIQHsgEDCOkHGl4KE09wdGltaXplTW9kZUZlYXR1cmUiRwoMT3B0aW1pemVNb2RlEh0KGU9QVElNSVpFX01PREVfVU5TUEVDSUZJRUQQABIJCgVTUEVFRBABEg0KCUNPREVfU0laRRACIlMKCEFQSUxldmVsEhkKFUFQSV9MRVZFTF9VTlNQRUNJRklFRBAAEgwKCEFQSV9PUEVOEAESDgoKQVBJX0hZQlJJRBACEg4KCkFQSV9PUEFRVUUQAyKSAQoPU3RyaXBFbnVtUHJlZml4EiEKHVNUUklQX0VOVU1fUFJFRklYX1VOU1BFQ0lGSUVEEAASGgoWU1RSSVBfRU5VTV9QUkVGSVhfS0VFUBABEiMKH1NUUklQX0VOVU1fUFJFRklYX0dFTkVSQVRFX0JPVEgQAhIbChdTVFJJUF9FTlVNX1BSRUZJWF9TVFJJUBADOjwKAmdvEhsuZ29vZ2xlLnByb3RvYnVmLkZlYXR1cmVTZXQY6gcgASgLMg4ucGIuR29GZWF0dXJlc1ICZ29CL1otZ29vZ2xlLmdvbGFuZy5vcmcvcHJvdG9idWYvdHlwZXMvZ29mZWF0dXJlc3Bi", [file_google_protobuf_descriptor]); +/** + * Describes the message pb.GoFeatures. + * Use `create(GoFeaturesSchema)` to create a new message. + */ +export const GoFeaturesSchema = /*@__PURE__*/ messageDesc(file_google_protobuf_go_features, 0); +/** + * Describes the message pb.GoFeatures.OptimizeModeFeature. + * Use `create(GoFeatures_OptimizeModeFeatureSchema)` to create a new message. + */ +export const GoFeatures_OptimizeModeFeatureSchema = /*@__PURE__*/ messageDesc(file_google_protobuf_go_features, 0, 0); +/** + * The name of this enum matches OptimizeMode in descriptor.proto. + * + * @generated from enum pb.GoFeatures.OptimizeModeFeature.OptimizeMode + */ +export var GoFeatures_OptimizeModeFeature_OptimizeMode; +(function (GoFeatures_OptimizeModeFeature_OptimizeMode) { + /** + * OPTIMIZE_MODE_UNSPECIFIED results in falling back to the default + * (optimize for code size), but needs to be a separate value to distinguish + * between an explicitly set optimize mode or a missing optimize mode. + * + * @generated from enum value: OPTIMIZE_MODE_UNSPECIFIED = 0; + */ + GoFeatures_OptimizeModeFeature_OptimizeMode[GoFeatures_OptimizeModeFeature_OptimizeMode["OPTIMIZE_MODE_UNSPECIFIED"] = 0] = "OPTIMIZE_MODE_UNSPECIFIED"; + /** + * @generated from enum value: SPEED = 1; + */ + GoFeatures_OptimizeModeFeature_OptimizeMode[GoFeatures_OptimizeModeFeature_OptimizeMode["SPEED"] = 1] = "SPEED"; + /** + * There is no enum entry for LITE_RUNTIME (descriptor.proto), + * because Go Protobuf does not have the concept of a lite runtime. + * + * @generated from enum value: CODE_SIZE = 2; + */ + GoFeatures_OptimizeModeFeature_OptimizeMode[GoFeatures_OptimizeModeFeature_OptimizeMode["CODE_SIZE"] = 2] = "CODE_SIZE"; +})(GoFeatures_OptimizeModeFeature_OptimizeMode || (GoFeatures_OptimizeModeFeature_OptimizeMode = {})); +/** + * Describes the enum pb.GoFeatures.OptimizeModeFeature.OptimizeMode. + */ +export const GoFeatures_OptimizeModeFeature_OptimizeModeSchema = /*@__PURE__*/ enumDesc(file_google_protobuf_go_features, 0, 0, 0); +/** + * @generated from enum pb.GoFeatures.APILevel + */ +export var GoFeatures_APILevel; +(function (GoFeatures_APILevel) { + /** + * API_LEVEL_UNSPECIFIED results in selecting the OPEN API, + * but needs to be a separate value to distinguish between + * an explicitly set api level or a missing api level. + * + * @generated from enum value: API_LEVEL_UNSPECIFIED = 0; + */ + GoFeatures_APILevel[GoFeatures_APILevel["API_LEVEL_UNSPECIFIED"] = 0] = "API_LEVEL_UNSPECIFIED"; + /** + * @generated from enum value: API_OPEN = 1; + */ + GoFeatures_APILevel[GoFeatures_APILevel["API_OPEN"] = 1] = "API_OPEN"; + /** + * @generated from enum value: API_HYBRID = 2; + */ + GoFeatures_APILevel[GoFeatures_APILevel["API_HYBRID"] = 2] = "API_HYBRID"; + /** + * @generated from enum value: API_OPAQUE = 3; + */ + GoFeatures_APILevel[GoFeatures_APILevel["API_OPAQUE"] = 3] = "API_OPAQUE"; +})(GoFeatures_APILevel || (GoFeatures_APILevel = {})); +/** + * Describes the enum pb.GoFeatures.APILevel. + */ +export const GoFeatures_APILevelSchema = /*@__PURE__*/ enumDesc(file_google_protobuf_go_features, 0, 0); +/** + * @generated from enum pb.GoFeatures.StripEnumPrefix + */ +export var GoFeatures_StripEnumPrefix; +(function (GoFeatures_StripEnumPrefix) { + /** + * @generated from enum value: STRIP_ENUM_PREFIX_UNSPECIFIED = 0; + */ + GoFeatures_StripEnumPrefix[GoFeatures_StripEnumPrefix["UNSPECIFIED"] = 0] = "UNSPECIFIED"; + /** + * @generated from enum value: STRIP_ENUM_PREFIX_KEEP = 1; + */ + GoFeatures_StripEnumPrefix[GoFeatures_StripEnumPrefix["KEEP"] = 1] = "KEEP"; + /** + * @generated from enum value: STRIP_ENUM_PREFIX_GENERATE_BOTH = 2; + */ + GoFeatures_StripEnumPrefix[GoFeatures_StripEnumPrefix["GENERATE_BOTH"] = 2] = "GENERATE_BOTH"; + /** + * @generated from enum value: STRIP_ENUM_PREFIX_STRIP = 3; + */ + GoFeatures_StripEnumPrefix[GoFeatures_StripEnumPrefix["STRIP"] = 3] = "STRIP"; +})(GoFeatures_StripEnumPrefix || (GoFeatures_StripEnumPrefix = {})); +/** + * Describes the enum pb.GoFeatures.StripEnumPrefix. + */ +export const GoFeatures_StripEnumPrefixSchema = /*@__PURE__*/ enumDesc(file_google_protobuf_go_features, 0, 1); +/** + * @generated from extension: optional pb.GoFeatures go = 1002; + */ +export const go = /*@__PURE__*/ extDesc(file_google_protobuf_go_features, 0); diff --git a/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/java_features_pb.d.ts b/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/java_features_pb.d.ts new file mode 100644 index 0000000..47f1503 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/java_features_pb.d.ts @@ -0,0 +1,194 @@ +import type { GenEnum, GenExtension, GenFile, GenMessage } from "../../../../codegenv2/types.js"; +import type { FeatureSet } from "./descriptor_pb.js"; +import type { Message } from "../../../../types.js"; +/** + * Describes the file google/protobuf/java_features.proto. + */ +export declare const file_google_protobuf_java_features: GenFile; +/** + * @generated from message pb.JavaFeatures + */ +export type JavaFeatures = Message<"pb.JavaFeatures"> & { + /** + * Whether or not to treat an enum field as closed. This option is only + * applicable to enum fields, and will be removed in the future. It is + * consistent with the legacy behavior of using proto3 enum types for proto2 + * fields. + * + * @generated from field: optional bool legacy_closed_enum = 1; + */ + legacyClosedEnum: boolean; + /** + * @generated from field: optional pb.JavaFeatures.Utf8Validation utf8_validation = 2; + */ + utf8Validation: JavaFeatures_Utf8Validation; + /** + * Allows creation of large Java enums, extending beyond the standard + * constant limits imposed by the Java language. + * + * @generated from field: optional bool large_enum = 3; + */ + largeEnum: boolean; + /** + * Whether to use the old default outer class name scheme, or the new feature + * which adds a "Proto" suffix to the outer class name. + * + * Users will not be able to set this option, because we removed it in the + * same edition that it was introduced. But we use it to determine which + * naming scheme to use for outer class name defaults. + * + * @generated from field: optional bool use_old_outer_classname_default = 4; + */ + useOldOuterClassnameDefault: boolean; + /** + * Whether to nest the generated class in the generated file class. This is + * only applicable to *top-level* messages, enums, and services. + * + * @generated from field: optional pb.JavaFeatures.NestInFileClassFeature.NestInFileClass nest_in_file_class = 5; + */ + nestInFileClass: JavaFeatures_NestInFileClassFeature_NestInFileClass; +}; +/** + * @generated from message pb.JavaFeatures + */ +export type JavaFeaturesJson = { + /** + * Whether or not to treat an enum field as closed. This option is only + * applicable to enum fields, and will be removed in the future. It is + * consistent with the legacy behavior of using proto3 enum types for proto2 + * fields. + * + * @generated from field: optional bool legacy_closed_enum = 1; + */ + legacyClosedEnum?: boolean; + /** + * @generated from field: optional pb.JavaFeatures.Utf8Validation utf8_validation = 2; + */ + utf8Validation?: JavaFeatures_Utf8ValidationJson; + /** + * Allows creation of large Java enums, extending beyond the standard + * constant limits imposed by the Java language. + * + * @generated from field: optional bool large_enum = 3; + */ + largeEnum?: boolean; + /** + * Whether to use the old default outer class name scheme, or the new feature + * which adds a "Proto" suffix to the outer class name. + * + * Users will not be able to set this option, because we removed it in the + * same edition that it was introduced. But we use it to determine which + * naming scheme to use for outer class name defaults. + * + * @generated from field: optional bool use_old_outer_classname_default = 4; + */ + useOldOuterClassnameDefault?: boolean; + /** + * Whether to nest the generated class in the generated file class. This is + * only applicable to *top-level* messages, enums, and services. + * + * @generated from field: optional pb.JavaFeatures.NestInFileClassFeature.NestInFileClass nest_in_file_class = 5; + */ + nestInFileClass?: JavaFeatures_NestInFileClassFeature_NestInFileClassJson; +}; +/** + * Describes the message pb.JavaFeatures. + * Use `create(JavaFeaturesSchema)` to create a new message. + */ +export declare const JavaFeaturesSchema: GenMessage; +/** + * @generated from message pb.JavaFeatures.NestInFileClassFeature + */ +export type JavaFeatures_NestInFileClassFeature = Message<"pb.JavaFeatures.NestInFileClassFeature"> & {}; +/** + * @generated from message pb.JavaFeatures.NestInFileClassFeature + */ +export type JavaFeatures_NestInFileClassFeatureJson = {}; +/** + * Describes the message pb.JavaFeatures.NestInFileClassFeature. + * Use `create(JavaFeatures_NestInFileClassFeatureSchema)` to create a new message. + */ +export declare const JavaFeatures_NestInFileClassFeatureSchema: GenMessage; +/** + * @generated from enum pb.JavaFeatures.NestInFileClassFeature.NestInFileClass + */ +export declare enum JavaFeatures_NestInFileClassFeature_NestInFileClass { + /** + * Invalid default, which should never be used. + * + * @generated from enum value: NEST_IN_FILE_CLASS_UNKNOWN = 0; + */ + NEST_IN_FILE_CLASS_UNKNOWN = 0, + /** + * Do not nest the generated class in the file class. + * + * @generated from enum value: NO = 1; + */ + NO = 1, + /** + * Nest the generated class in the file class. + * + * @generated from enum value: YES = 2; + */ + YES = 2, + /** + * Fall back to the `java_multiple_files` option. Users won't be able to + * set this option. + * + * @generated from enum value: LEGACY = 3; + */ + LEGACY = 3 +} +/** + * @generated from enum pb.JavaFeatures.NestInFileClassFeature.NestInFileClass + */ +export type JavaFeatures_NestInFileClassFeature_NestInFileClassJson = "NEST_IN_FILE_CLASS_UNKNOWN" | "NO" | "YES" | "LEGACY"; +/** + * Describes the enum pb.JavaFeatures.NestInFileClassFeature.NestInFileClass. + */ +export declare const JavaFeatures_NestInFileClassFeature_NestInFileClassSchema: GenEnum; +/** + * The UTF8 validation strategy to use. + * + * @generated from enum pb.JavaFeatures.Utf8Validation + */ +export declare enum JavaFeatures_Utf8Validation { + /** + * Invalid default, which should never be used. + * + * @generated from enum value: UTF8_VALIDATION_UNKNOWN = 0; + */ + UTF8_VALIDATION_UNKNOWN = 0, + /** + * Respect the UTF8 validation behavior specified by the global + * utf8_validation feature. + * + * @generated from enum value: DEFAULT = 1; + */ + DEFAULT = 1, + /** + * Verifies UTF8 validity overriding the global utf8_validation + * feature. This represents the legacy java_string_check_utf8 option. + * + * @generated from enum value: VERIFY = 2; + */ + VERIFY = 2 +} +/** + * The UTF8 validation strategy to use. + * + * @generated from enum pb.JavaFeatures.Utf8Validation + */ +export type JavaFeatures_Utf8ValidationJson = "UTF8_VALIDATION_UNKNOWN" | "DEFAULT" | "VERIFY"; +/** + * Describes the enum pb.JavaFeatures.Utf8Validation. + */ +export declare const JavaFeatures_Utf8ValidationSchema: GenEnum; +/** + * @generated from extension: optional pb.JavaFeatures java = 1001; + */ +export declare const java: GenExtension; diff --git a/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/java_features_pb.js b/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/java_features_pb.js new file mode 100644 index 0000000..029fc67 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/java_features_pb.js @@ -0,0 +1,103 @@ +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +import { fileDesc } from "../../../../codegenv2/file.js"; +import { file_google_protobuf_descriptor } from "./descriptor_pb.js"; +import { messageDesc } from "../../../../codegenv2/message.js"; +import { enumDesc } from "../../../../codegenv2/enum.js"; +import { extDesc } from "../../../../codegenv2/extension.js"; +/** + * Describes the file google/protobuf/java_features.proto. + */ +export const file_google_protobuf_java_features = /*@__PURE__*/ fileDesc("CiNnb29nbGUvcHJvdG9idWYvamF2YV9mZWF0dXJlcy5wcm90bxICcGIigwgKDEphdmFGZWF0dXJlcxL+AQoSbGVnYWN5X2Nsb3NlZF9lbnVtGAEgASgIQuEBiAEBmAEEmAEBogEJEgR0cnVlGIQHogEKEgVmYWxzZRjnB7IBuwEI6AcQ6AcasgFUaGUgbGVnYWN5IGNsb3NlZCBlbnVtIGJlaGF2aW9yIGluIEphdmEgaXMgZGVwcmVjYXRlZCBhbmQgaXMgc2NoZWR1bGVkIHRvIGJlIHJlbW92ZWQgaW4gZWRpdGlvbiAyMDI1LiAgU2VlIGh0dHA6Ly9wcm90b2J1Zi5kZXYvcHJvZ3JhbW1pbmctZ3VpZGVzL2VudW0vI2phdmEgZm9yIG1vcmUgaW5mb3JtYXRpb24uEp8CCg91dGY4X3ZhbGlkYXRpb24YAiABKA4yHy5wYi5KYXZhRmVhdHVyZXMuVXRmOFZhbGlkYXRpb25C5AGIAQGYAQSYAQGiAQwSB0RFRkFVTFQYhAeyAcgBCOgHEOkHGr8BVGhlIEphdmEtc3BlY2lmaWMgdXRmOCB2YWxpZGF0aW9uIGZlYXR1cmUgaXMgZGVwcmVjYXRlZCBhbmQgaXMgc2NoZWR1bGVkIHRvIGJlIHJlbW92ZWQgaW4gZWRpdGlvbiAyMDI1LiAgVXRmOCB2YWxpZGF0aW9uIGJlaGF2aW9yIHNob3VsZCB1c2UgdGhlIGdsb2JhbCBjcm9zcy1sYW5ndWFnZSB1dGY4X3ZhbGlkYXRpb24gZmVhdHVyZS4SMAoKbGFyZ2VfZW51bRgDIAEoCEIciAEBmAEGmAEBogEKEgVmYWxzZRiEB7IBAwjpBxJRCh91c2Vfb2xkX291dGVyX2NsYXNzbmFtZV9kZWZhdWx0GAQgASgIQiiIAQGYAQGiAQkSBHRydWUYhAeiAQoSBWZhbHNlGOkHsgEGCOkHIOkHEn8KEm5lc3RfaW5fZmlsZV9jbGFzcxgFIAEoDjI3LnBiLkphdmFGZWF0dXJlcy5OZXN0SW5GaWxlQ2xhc3NGZWF0dXJlLk5lc3RJbkZpbGVDbGFzc0IqiAEBmAEDmAEGmAEIogELEgZMRUdBQ1kYhAeiAQcSAk5PGOkHsgEDCOkHGnwKFk5lc3RJbkZpbGVDbGFzc0ZlYXR1cmUiWAoPTmVzdEluRmlsZUNsYXNzEh4KGk5FU1RfSU5fRklMRV9DTEFTU19VTktOT1dOEAASBgoCTk8QARIHCgNZRVMQAhIUCgZMRUdBQ1kQAxoIIgYI6Qcg6QdKCAgBEICAgIACIkYKDlV0ZjhWYWxpZGF0aW9uEhsKF1VURjhfVkFMSURBVElPTl9VTktOT1dOEAASCwoHREVGQVVMVBABEgoKBlZFUklGWRACSgQIBhAHOkIKBGphdmESGy5nb29nbGUucHJvdG9idWYuRmVhdHVyZVNldBjpByABKAsyEC5wYi5KYXZhRmVhdHVyZXNSBGphdmFCKAoTY29tLmdvb2dsZS5wcm90b2J1ZkIRSmF2YUZlYXR1cmVzUHJvdG8", [file_google_protobuf_descriptor]); +/** + * Describes the message pb.JavaFeatures. + * Use `create(JavaFeaturesSchema)` to create a new message. + */ +export const JavaFeaturesSchema = /*@__PURE__*/ messageDesc(file_google_protobuf_java_features, 0); +/** + * Describes the message pb.JavaFeatures.NestInFileClassFeature. + * Use `create(JavaFeatures_NestInFileClassFeatureSchema)` to create a new message. + */ +export const JavaFeatures_NestInFileClassFeatureSchema = /*@__PURE__*/ messageDesc(file_google_protobuf_java_features, 0, 0); +/** + * @generated from enum pb.JavaFeatures.NestInFileClassFeature.NestInFileClass + */ +export var JavaFeatures_NestInFileClassFeature_NestInFileClass; +(function (JavaFeatures_NestInFileClassFeature_NestInFileClass) { + /** + * Invalid default, which should never be used. + * + * @generated from enum value: NEST_IN_FILE_CLASS_UNKNOWN = 0; + */ + JavaFeatures_NestInFileClassFeature_NestInFileClass[JavaFeatures_NestInFileClassFeature_NestInFileClass["NEST_IN_FILE_CLASS_UNKNOWN"] = 0] = "NEST_IN_FILE_CLASS_UNKNOWN"; + /** + * Do not nest the generated class in the file class. + * + * @generated from enum value: NO = 1; + */ + JavaFeatures_NestInFileClassFeature_NestInFileClass[JavaFeatures_NestInFileClassFeature_NestInFileClass["NO"] = 1] = "NO"; + /** + * Nest the generated class in the file class. + * + * @generated from enum value: YES = 2; + */ + JavaFeatures_NestInFileClassFeature_NestInFileClass[JavaFeatures_NestInFileClassFeature_NestInFileClass["YES"] = 2] = "YES"; + /** + * Fall back to the `java_multiple_files` option. Users won't be able to + * set this option. + * + * @generated from enum value: LEGACY = 3; + */ + JavaFeatures_NestInFileClassFeature_NestInFileClass[JavaFeatures_NestInFileClassFeature_NestInFileClass["LEGACY"] = 3] = "LEGACY"; +})(JavaFeatures_NestInFileClassFeature_NestInFileClass || (JavaFeatures_NestInFileClassFeature_NestInFileClass = {})); +/** + * Describes the enum pb.JavaFeatures.NestInFileClassFeature.NestInFileClass. + */ +export const JavaFeatures_NestInFileClassFeature_NestInFileClassSchema = /*@__PURE__*/ enumDesc(file_google_protobuf_java_features, 0, 0, 0); +/** + * The UTF8 validation strategy to use. + * + * @generated from enum pb.JavaFeatures.Utf8Validation + */ +export var JavaFeatures_Utf8Validation; +(function (JavaFeatures_Utf8Validation) { + /** + * Invalid default, which should never be used. + * + * @generated from enum value: UTF8_VALIDATION_UNKNOWN = 0; + */ + JavaFeatures_Utf8Validation[JavaFeatures_Utf8Validation["UTF8_VALIDATION_UNKNOWN"] = 0] = "UTF8_VALIDATION_UNKNOWN"; + /** + * Respect the UTF8 validation behavior specified by the global + * utf8_validation feature. + * + * @generated from enum value: DEFAULT = 1; + */ + JavaFeatures_Utf8Validation[JavaFeatures_Utf8Validation["DEFAULT"] = 1] = "DEFAULT"; + /** + * Verifies UTF8 validity overriding the global utf8_validation + * feature. This represents the legacy java_string_check_utf8 option. + * + * @generated from enum value: VERIFY = 2; + */ + JavaFeatures_Utf8Validation[JavaFeatures_Utf8Validation["VERIFY"] = 2] = "VERIFY"; +})(JavaFeatures_Utf8Validation || (JavaFeatures_Utf8Validation = {})); +/** + * Describes the enum pb.JavaFeatures.Utf8Validation. + */ +export const JavaFeatures_Utf8ValidationSchema = /*@__PURE__*/ enumDesc(file_google_protobuf_java_features, 0, 0); +/** + * @generated from extension: optional pb.JavaFeatures java = 1001; + */ +export const java = /*@__PURE__*/ extDesc(file_google_protobuf_java_features, 0); diff --git a/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/source_context_pb.d.ts b/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/source_context_pb.d.ts new file mode 100644 index 0000000..d77cea4 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/source_context_pb.d.ts @@ -0,0 +1,43 @@ +import type { GenFile, GenMessage } from "../../../../codegenv2/types.js"; +import type { Message } from "../../../../types.js"; +/** + * Describes the file google/protobuf/source_context.proto. + */ +export declare const file_google_protobuf_source_context: GenFile; +/** + * `SourceContext` represents information about the source of a + * protobuf element, like the file in which it is defined. + * + * @generated from message google.protobuf.SourceContext + */ +export type SourceContext = Message<"google.protobuf.SourceContext"> & { + /** + * The path-qualified name of the .proto file that contained the associated + * protobuf element. For example: `"google/protobuf/source_context.proto"`. + * + * @generated from field: string file_name = 1; + */ + fileName: string; +}; +/** + * `SourceContext` represents information about the source of a + * protobuf element, like the file in which it is defined. + * + * @generated from message google.protobuf.SourceContext + */ +export type SourceContextJson = { + /** + * The path-qualified name of the .proto file that contained the associated + * protobuf element. For example: `"google/protobuf/source_context.proto"`. + * + * @generated from field: string file_name = 1; + */ + fileName?: string; +}; +/** + * Describes the message google.protobuf.SourceContext. + * Use `create(SourceContextSchema)` to create a new message. + */ +export declare const SourceContextSchema: GenMessage; diff --git a/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/source_context_pb.js b/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/source_context_pb.js new file mode 100644 index 0000000..cf6d390 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/source_context_pb.js @@ -0,0 +1,24 @@ +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +import { fileDesc } from "../../../../codegenv2/file.js"; +import { messageDesc } from "../../../../codegenv2/message.js"; +/** + * Describes the file google/protobuf/source_context.proto. + */ +export const file_google_protobuf_source_context = /*@__PURE__*/ fileDesc("CiRnb29nbGUvcHJvdG9idWYvc291cmNlX2NvbnRleHQucHJvdG8SD2dvb2dsZS5wcm90b2J1ZiIiCg1Tb3VyY2VDb250ZXh0EhEKCWZpbGVfbmFtZRgBIAEoCUKKAQoTY29tLmdvb2dsZS5wcm90b2J1ZkISU291cmNlQ29udGV4dFByb3RvUAFaNmdvb2dsZS5nb2xhbmcub3JnL3Byb3RvYnVmL3R5cGVzL2tub3duL3NvdXJjZWNvbnRleHRwYqICA0dQQqoCHkdvb2dsZS5Qcm90b2J1Zi5XZWxsS25vd25UeXBlc2IGcHJvdG8z"); +/** + * Describes the message google.protobuf.SourceContext. + * Use `create(SourceContextSchema)` to create a new message. + */ +export const SourceContextSchema = /*@__PURE__*/ messageDesc(file_google_protobuf_source_context, 0); diff --git a/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/struct_pb.d.ts b/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/struct_pb.d.ts new file mode 100644 index 0000000..1bb79e7 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/struct_pb.d.ts @@ -0,0 +1,195 @@ +import type { GenEnum, GenFile, GenMessage } from "../../../../codegenv2/types.js"; +import type { Message } from "../../../../types.js"; +import type { JsonObject, JsonValue } from "../../../../json-value.js"; +/** + * Describes the file google/protobuf/struct.proto. + */ +export declare const file_google_protobuf_struct: GenFile; +/** + * `Struct` represents a structured data value, consisting of fields + * which map to dynamically typed values. In some languages, `Struct` + * might be supported by a native representation. For example, in + * scripting languages like JS a struct is represented as an + * object. The details of that representation are described together + * with the proto support for the language. + * + * The JSON representation for `Struct` is JSON object. + * + * @generated from message google.protobuf.Struct + */ +export type Struct = Message<"google.protobuf.Struct"> & { + /** + * Unordered map of dynamically typed values. + * + * @generated from field: map fields = 1; + */ + fields: { + [key: string]: Value; + }; +}; +/** + * `Struct` represents a structured data value, consisting of fields + * which map to dynamically typed values. In some languages, `Struct` + * might be supported by a native representation. For example, in + * scripting languages like JS a struct is represented as an + * object. The details of that representation are described together + * with the proto support for the language. + * + * The JSON representation for `Struct` is JSON object. + * + * @generated from message google.protobuf.Struct + */ +export type StructJson = JsonObject; +/** + * Describes the message google.protobuf.Struct. + * Use `create(StructSchema)` to create a new message. + */ +export declare const StructSchema: GenMessage; +/** + * `Value` represents a dynamically typed value which can be either + * null, a number, a string, a boolean, a recursive struct value, or a + * list of values. A producer of value is expected to set one of these + * variants. Absence of any variant indicates an error. + * + * The JSON representation for `Value` is JSON value. + * + * @generated from message google.protobuf.Value + */ +export type Value = Message<"google.protobuf.Value"> & { + /** + * The kind of value. + * + * @generated from oneof google.protobuf.Value.kind + */ + kind: { + /** + * Represents a null value. + * + * @generated from field: google.protobuf.NullValue null_value = 1; + */ + value: NullValue; + case: "nullValue"; + } | { + /** + * Represents a double value. + * + * @generated from field: double number_value = 2; + */ + value: number; + case: "numberValue"; + } | { + /** + * Represents a string value. + * + * @generated from field: string string_value = 3; + */ + value: string; + case: "stringValue"; + } | { + /** + * Represents a boolean value. + * + * @generated from field: bool bool_value = 4; + */ + value: boolean; + case: "boolValue"; + } | { + /** + * Represents a structured value. + * + * @generated from field: google.protobuf.Struct struct_value = 5; + */ + value: Struct; + case: "structValue"; + } | { + /** + * Represents a repeated `Value`. + * + * @generated from field: google.protobuf.ListValue list_value = 6; + */ + value: ListValue; + case: "listValue"; + } | { + case: undefined; + value?: undefined; + }; +}; +/** + * `Value` represents a dynamically typed value which can be either + * null, a number, a string, a boolean, a recursive struct value, or a + * list of values. A producer of value is expected to set one of these + * variants. Absence of any variant indicates an error. + * + * The JSON representation for `Value` is JSON value. + * + * @generated from message google.protobuf.Value + */ +export type ValueJson = JsonValue; +/** + * Describes the message google.protobuf.Value. + * Use `create(ValueSchema)` to create a new message. + */ +export declare const ValueSchema: GenMessage; +/** + * `ListValue` is a wrapper around a repeated field of values. + * + * The JSON representation for `ListValue` is JSON array. + * + * @generated from message google.protobuf.ListValue + */ +export type ListValue = Message<"google.protobuf.ListValue"> & { + /** + * Repeated field of dynamically typed values. + * + * @generated from field: repeated google.protobuf.Value values = 1; + */ + values: Value[]; +}; +/** + * `ListValue` is a wrapper around a repeated field of values. + * + * The JSON representation for `ListValue` is JSON array. + * + * @generated from message google.protobuf.ListValue + */ +export type ListValueJson = JsonValue[]; +/** + * Describes the message google.protobuf.ListValue. + * Use `create(ListValueSchema)` to create a new message. + */ +export declare const ListValueSchema: GenMessage; +/** + * `NullValue` is a singleton enumeration to represent the null value for the + * `Value` type union. + * + * The JSON representation for `NullValue` is JSON `null`. + * + * @generated from enum google.protobuf.NullValue + */ +export declare enum NullValue { + /** + * Null value. + * + * @generated from enum value: NULL_VALUE = 0; + */ + NULL_VALUE = 0 +} +/** + * `NullValue` is a singleton enumeration to represent the null value for the + * `Value` type union. + * + * The JSON representation for `NullValue` is JSON `null`. + * + * @generated from enum google.protobuf.NullValue + */ +export type NullValueJson = null; +/** + * Describes the enum google.protobuf.NullValue. + */ +export declare const NullValueSchema: GenEnum; diff --git a/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/struct_pb.js b/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/struct_pb.js new file mode 100644 index 0000000..1c9db76 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/struct_pb.js @@ -0,0 +1,56 @@ +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +import { fileDesc } from "../../../../codegenv2/file.js"; +import { messageDesc } from "../../../../codegenv2/message.js"; +import { enumDesc } from "../../../../codegenv2/enum.js"; +/** + * Describes the file google/protobuf/struct.proto. + */ +export const file_google_protobuf_struct = /*@__PURE__*/ fileDesc("Chxnb29nbGUvcHJvdG9idWYvc3RydWN0LnByb3RvEg9nb29nbGUucHJvdG9idWYihAEKBlN0cnVjdBIzCgZmaWVsZHMYASADKAsyIy5nb29nbGUucHJvdG9idWYuU3RydWN0LkZpZWxkc0VudHJ5GkUKC0ZpZWxkc0VudHJ5EgsKA2tleRgBIAEoCRIlCgV2YWx1ZRgCIAEoCzIWLmdvb2dsZS5wcm90b2J1Zi5WYWx1ZToCOAEi6gEKBVZhbHVlEjAKCm51bGxfdmFsdWUYASABKA4yGi5nb29nbGUucHJvdG9idWYuTnVsbFZhbHVlSAASFgoMbnVtYmVyX3ZhbHVlGAIgASgBSAASFgoMc3RyaW5nX3ZhbHVlGAMgASgJSAASFAoKYm9vbF92YWx1ZRgEIAEoCEgAEi8KDHN0cnVjdF92YWx1ZRgFIAEoCzIXLmdvb2dsZS5wcm90b2J1Zi5TdHJ1Y3RIABIwCgpsaXN0X3ZhbHVlGAYgASgLMhouZ29vZ2xlLnByb3RvYnVmLkxpc3RWYWx1ZUgAQgYKBGtpbmQiMwoJTGlzdFZhbHVlEiYKBnZhbHVlcxgBIAMoCzIWLmdvb2dsZS5wcm90b2J1Zi5WYWx1ZSobCglOdWxsVmFsdWUSDgoKTlVMTF9WQUxVRRAAQn8KE2NvbS5nb29nbGUucHJvdG9idWZCC1N0cnVjdFByb3RvUAFaL2dvb2dsZS5nb2xhbmcub3JnL3Byb3RvYnVmL3R5cGVzL2tub3duL3N0cnVjdHBi+AEBogIDR1BCqgIeR29vZ2xlLlByb3RvYnVmLldlbGxLbm93blR5cGVzYgZwcm90bzM"); +/** + * Describes the message google.protobuf.Struct. + * Use `create(StructSchema)` to create a new message. + */ +export const StructSchema = /*@__PURE__*/ messageDesc(file_google_protobuf_struct, 0); +/** + * Describes the message google.protobuf.Value. + * Use `create(ValueSchema)` to create a new message. + */ +export const ValueSchema = /*@__PURE__*/ messageDesc(file_google_protobuf_struct, 1); +/** + * Describes the message google.protobuf.ListValue. + * Use `create(ListValueSchema)` to create a new message. + */ +export const ListValueSchema = /*@__PURE__*/ messageDesc(file_google_protobuf_struct, 2); +/** + * `NullValue` is a singleton enumeration to represent the null value for the + * `Value` type union. + * + * The JSON representation for `NullValue` is JSON `null`. + * + * @generated from enum google.protobuf.NullValue + */ +export var NullValue; +(function (NullValue) { + /** + * Null value. + * + * @generated from enum value: NULL_VALUE = 0; + */ + NullValue[NullValue["NULL_VALUE"] = 0] = "NULL_VALUE"; +})(NullValue || (NullValue = {})); +/** + * Describes the enum google.protobuf.NullValue. + */ +export const NullValueSchema = /*@__PURE__*/ enumDesc(file_google_protobuf_struct, 0); diff --git a/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/timestamp_pb.d.ts b/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/timestamp_pb.d.ts new file mode 100644 index 0000000..131e3fd --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/timestamp_pb.d.ts @@ -0,0 +1,222 @@ +import type { GenFile, GenMessage } from "../../../../codegenv2/types.js"; +import type { Message } from "../../../../types.js"; +/** + * Describes the file google/protobuf/timestamp.proto. + */ +export declare const file_google_protobuf_timestamp: GenFile; +/** + * A Timestamp represents a point in time independent of any time zone or local + * calendar, encoded as a count of seconds and fractions of seconds at + * nanosecond resolution. The count is relative to an epoch at UTC midnight on + * January 1, 1970, in the proleptic Gregorian calendar which extends the + * Gregorian calendar backwards to year one. + * + * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + * second table is needed for interpretation, using a [24-hour linear + * smear](https://developers.google.com/time/smear). + * + * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + * restricting to that range, we ensure that we can convert to and from [RFC + * 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + * + * # Examples + * + * Example 1: Compute Timestamp from POSIX `time()`. + * + * Timestamp timestamp; + * timestamp.set_seconds(time(NULL)); + * timestamp.set_nanos(0); + * + * Example 2: Compute Timestamp from POSIX `gettimeofday()`. + * + * struct timeval tv; + * gettimeofday(&tv, NULL); + * + * Timestamp timestamp; + * timestamp.set_seconds(tv.tv_sec); + * timestamp.set_nanos(tv.tv_usec * 1000); + * + * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + * + * FILETIME ft; + * GetSystemTimeAsFileTime(&ft); + * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + * + * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + * Timestamp timestamp; + * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + * + * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + * + * long millis = System.currentTimeMillis(); + * + * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + * .setNanos((int) ((millis % 1000) * 1000000)).build(); + * + * Example 5: Compute Timestamp from Java `Instant.now()`. + * + * Instant now = Instant.now(); + * + * Timestamp timestamp = + * Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + * .setNanos(now.getNano()).build(); + * + * Example 6: Compute Timestamp from current time in Python. + * + * timestamp = Timestamp() + * timestamp.GetCurrentTime() + * + * # JSON Mapping + * + * In JSON format, the Timestamp type is encoded as a string in the + * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the + * format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" + * where {year} is always expressed using four digits while {month}, {day}, + * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional + * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), + * are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone + * is required. A ProtoJSON serializer should always use UTC (as indicated by + * "Z") when printing the Timestamp type and a ProtoJSON parser should be + * able to accept both UTC and other timezones (as indicated by an offset). + * + * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past + * 01:30 UTC on January 15, 2017. + * + * In JavaScript, one can convert a Date object to this format using the + * standard + * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + * method. In Python, a standard `datetime.datetime` object can be converted + * to this format using + * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with + * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use + * the Joda Time's [`ISODateTimeFormat.dateTime()`]( + * http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() + * ) to obtain a formatter capable of generating timestamps in this format. + * + * + * @generated from message google.protobuf.Timestamp + */ +export type Timestamp = Message<"google.protobuf.Timestamp"> & { + /** + * Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must + * be between -62135596800 and 253402300799 inclusive (which corresponds to + * 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z). + * + * @generated from field: int64 seconds = 1; + */ + seconds: bigint; + /** + * Non-negative fractions of a second at nanosecond resolution. This field is + * the nanosecond portion of the duration, not an alternative to seconds. + * Negative second values with fractions must still have non-negative nanos + * values that count forward in time. Must be between 0 and 999,999,999 + * inclusive. + * + * @generated from field: int32 nanos = 2; + */ + nanos: number; +}; +/** + * A Timestamp represents a point in time independent of any time zone or local + * calendar, encoded as a count of seconds and fractions of seconds at + * nanosecond resolution. The count is relative to an epoch at UTC midnight on + * January 1, 1970, in the proleptic Gregorian calendar which extends the + * Gregorian calendar backwards to year one. + * + * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + * second table is needed for interpretation, using a [24-hour linear + * smear](https://developers.google.com/time/smear). + * + * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + * restricting to that range, we ensure that we can convert to and from [RFC + * 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + * + * # Examples + * + * Example 1: Compute Timestamp from POSIX `time()`. + * + * Timestamp timestamp; + * timestamp.set_seconds(time(NULL)); + * timestamp.set_nanos(0); + * + * Example 2: Compute Timestamp from POSIX `gettimeofday()`. + * + * struct timeval tv; + * gettimeofday(&tv, NULL); + * + * Timestamp timestamp; + * timestamp.set_seconds(tv.tv_sec); + * timestamp.set_nanos(tv.tv_usec * 1000); + * + * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + * + * FILETIME ft; + * GetSystemTimeAsFileTime(&ft); + * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + * + * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + * Timestamp timestamp; + * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + * + * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + * + * long millis = System.currentTimeMillis(); + * + * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + * .setNanos((int) ((millis % 1000) * 1000000)).build(); + * + * Example 5: Compute Timestamp from Java `Instant.now()`. + * + * Instant now = Instant.now(); + * + * Timestamp timestamp = + * Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + * .setNanos(now.getNano()).build(); + * + * Example 6: Compute Timestamp from current time in Python. + * + * timestamp = Timestamp() + * timestamp.GetCurrentTime() + * + * # JSON Mapping + * + * In JSON format, the Timestamp type is encoded as a string in the + * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the + * format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" + * where {year} is always expressed using four digits while {month}, {day}, + * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional + * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), + * are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone + * is required. A ProtoJSON serializer should always use UTC (as indicated by + * "Z") when printing the Timestamp type and a ProtoJSON parser should be + * able to accept both UTC and other timezones (as indicated by an offset). + * + * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past + * 01:30 UTC on January 15, 2017. + * + * In JavaScript, one can convert a Date object to this format using the + * standard + * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + * method. In Python, a standard `datetime.datetime` object can be converted + * to this format using + * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with + * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use + * the Joda Time's [`ISODateTimeFormat.dateTime()`]( + * http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() + * ) to obtain a formatter capable of generating timestamps in this format. + * + * + * @generated from message google.protobuf.Timestamp + */ +export type TimestampJson = string; +/** + * Describes the message google.protobuf.Timestamp. + * Use `create(TimestampSchema)` to create a new message. + */ +export declare const TimestampSchema: GenMessage; diff --git a/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/timestamp_pb.js b/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/timestamp_pb.js new file mode 100644 index 0000000..d56d473 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/timestamp_pb.js @@ -0,0 +1,24 @@ +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +import { fileDesc } from "../../../../codegenv2/file.js"; +import { messageDesc } from "../../../../codegenv2/message.js"; +/** + * Describes the file google/protobuf/timestamp.proto. + */ +export const file_google_protobuf_timestamp = /*@__PURE__*/ fileDesc("Ch9nb29nbGUvcHJvdG9idWYvdGltZXN0YW1wLnByb3RvEg9nb29nbGUucHJvdG9idWYiKwoJVGltZXN0YW1wEg8KB3NlY29uZHMYASABKAMSDQoFbmFub3MYAiABKAVChQEKE2NvbS5nb29nbGUucHJvdG9idWZCDlRpbWVzdGFtcFByb3RvUAFaMmdvb2dsZS5nb2xhbmcub3JnL3Byb3RvYnVmL3R5cGVzL2tub3duL3RpbWVzdGFtcHBi+AEBogIDR1BCqgIeR29vZ2xlLlByb3RvYnVmLldlbGxLbm93blR5cGVzYgZwcm90bzM"); +/** + * Describes the message google.protobuf.Timestamp. + * Use `create(TimestampSchema)` to create a new message. + */ +export const TimestampSchema = /*@__PURE__*/ messageDesc(file_google_protobuf_timestamp, 0); diff --git a/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/type_pb.d.ts b/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/type_pb.d.ts new file mode 100644 index 0000000..db3d096 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/type_pb.d.ts @@ -0,0 +1,722 @@ +import type { GenEnum, GenFile, GenMessage } from "../../../../codegenv2/types.js"; +import type { Any, AnyJson } from "./any_pb.js"; +import type { SourceContext, SourceContextJson } from "./source_context_pb.js"; +import type { Message } from "../../../../types.js"; +/** + * Describes the file google/protobuf/type.proto. + */ +export declare const file_google_protobuf_type: GenFile; +/** + * A protocol buffer message type. + * + * New usages of this message as an alternative to DescriptorProto are strongly + * discouraged. This message does not reliability preserve all information + * necessary to model the schema and preserve semantics. Instead make use of + * FileDescriptorSet which preserves the necessary information. + * + * @generated from message google.protobuf.Type + */ +export type Type = Message<"google.protobuf.Type"> & { + /** + * The fully qualified message name. + * + * @generated from field: string name = 1; + */ + name: string; + /** + * The list of fields. + * + * @generated from field: repeated google.protobuf.Field fields = 2; + */ + fields: Field[]; + /** + * The list of types appearing in `oneof` definitions in this type. + * + * @generated from field: repeated string oneofs = 3; + */ + oneofs: string[]; + /** + * The protocol buffer options. + * + * @generated from field: repeated google.protobuf.Option options = 4; + */ + options: Option[]; + /** + * The source context. + * + * @generated from field: google.protobuf.SourceContext source_context = 5; + */ + sourceContext?: SourceContext | undefined; + /** + * The source syntax. + * + * @generated from field: google.protobuf.Syntax syntax = 6; + */ + syntax: Syntax; + /** + * The source edition string, only valid when syntax is SYNTAX_EDITIONS. + * + * @generated from field: string edition = 7; + */ + edition: string; +}; +/** + * A protocol buffer message type. + * + * New usages of this message as an alternative to DescriptorProto are strongly + * discouraged. This message does not reliability preserve all information + * necessary to model the schema and preserve semantics. Instead make use of + * FileDescriptorSet which preserves the necessary information. + * + * @generated from message google.protobuf.Type + */ +export type TypeJson = { + /** + * The fully qualified message name. + * + * @generated from field: string name = 1; + */ + name?: string; + /** + * The list of fields. + * + * @generated from field: repeated google.protobuf.Field fields = 2; + */ + fields?: FieldJson[]; + /** + * The list of types appearing in `oneof` definitions in this type. + * + * @generated from field: repeated string oneofs = 3; + */ + oneofs?: string[]; + /** + * The protocol buffer options. + * + * @generated from field: repeated google.protobuf.Option options = 4; + */ + options?: OptionJson[]; + /** + * The source context. + * + * @generated from field: google.protobuf.SourceContext source_context = 5; + */ + sourceContext?: SourceContextJson; + /** + * The source syntax. + * + * @generated from field: google.protobuf.Syntax syntax = 6; + */ + syntax?: SyntaxJson; + /** + * The source edition string, only valid when syntax is SYNTAX_EDITIONS. + * + * @generated from field: string edition = 7; + */ + edition?: string; +}; +/** + * Describes the message google.protobuf.Type. + * Use `create(TypeSchema)` to create a new message. + */ +export declare const TypeSchema: GenMessage; +/** + * A single field of a message type. + * + * New usages of this message as an alternative to FieldDescriptorProto are + * strongly discouraged. This message does not reliability preserve all + * information necessary to model the schema and preserve semantics. Instead + * make use of FileDescriptorSet which preserves the necessary information. + * + * @generated from message google.protobuf.Field + */ +export type Field = Message<"google.protobuf.Field"> & { + /** + * The field type. + * + * @generated from field: google.protobuf.Field.Kind kind = 1; + */ + kind: Field_Kind; + /** + * The field cardinality. + * + * @generated from field: google.protobuf.Field.Cardinality cardinality = 2; + */ + cardinality: Field_Cardinality; + /** + * The field number. + * + * @generated from field: int32 number = 3; + */ + number: number; + /** + * The field name. + * + * @generated from field: string name = 4; + */ + name: string; + /** + * The field type URL, without the scheme, for message or enumeration + * types. Example: `"type.googleapis.com/google.protobuf.Timestamp"`. + * + * @generated from field: string type_url = 6; + */ + typeUrl: string; + /** + * The index of the field type in `Type.oneofs`, for message or enumeration + * types. The first type has index 1; zero means the type is not in the list. + * + * @generated from field: int32 oneof_index = 7; + */ + oneofIndex: number; + /** + * Whether to use alternative packed wire representation. + * + * @generated from field: bool packed = 8; + */ + packed: boolean; + /** + * The protocol buffer options. + * + * @generated from field: repeated google.protobuf.Option options = 9; + */ + options: Option[]; + /** + * The field JSON name. + * + * @generated from field: string json_name = 10; + */ + jsonName: string; + /** + * The string value of the default value of this field. Proto2 syntax only. + * + * @generated from field: string default_value = 11; + */ + defaultValue: string; +}; +/** + * A single field of a message type. + * + * New usages of this message as an alternative to FieldDescriptorProto are + * strongly discouraged. This message does not reliability preserve all + * information necessary to model the schema and preserve semantics. Instead + * make use of FileDescriptorSet which preserves the necessary information. + * + * @generated from message google.protobuf.Field + */ +export type FieldJson = { + /** + * The field type. + * + * @generated from field: google.protobuf.Field.Kind kind = 1; + */ + kind?: Field_KindJson; + /** + * The field cardinality. + * + * @generated from field: google.protobuf.Field.Cardinality cardinality = 2; + */ + cardinality?: Field_CardinalityJson; + /** + * The field number. + * + * @generated from field: int32 number = 3; + */ + number?: number; + /** + * The field name. + * + * @generated from field: string name = 4; + */ + name?: string; + /** + * The field type URL, without the scheme, for message or enumeration + * types. Example: `"type.googleapis.com/google.protobuf.Timestamp"`. + * + * @generated from field: string type_url = 6; + */ + typeUrl?: string; + /** + * The index of the field type in `Type.oneofs`, for message or enumeration + * types. The first type has index 1; zero means the type is not in the list. + * + * @generated from field: int32 oneof_index = 7; + */ + oneofIndex?: number; + /** + * Whether to use alternative packed wire representation. + * + * @generated from field: bool packed = 8; + */ + packed?: boolean; + /** + * The protocol buffer options. + * + * @generated from field: repeated google.protobuf.Option options = 9; + */ + options?: OptionJson[]; + /** + * The field JSON name. + * + * @generated from field: string json_name = 10; + */ + jsonName?: string; + /** + * The string value of the default value of this field. Proto2 syntax only. + * + * @generated from field: string default_value = 11; + */ + defaultValue?: string; +}; +/** + * Describes the message google.protobuf.Field. + * Use `create(FieldSchema)` to create a new message. + */ +export declare const FieldSchema: GenMessage; +/** + * Basic field types. + * + * @generated from enum google.protobuf.Field.Kind + */ +export declare enum Field_Kind { + /** + * Field type unknown. + * + * @generated from enum value: TYPE_UNKNOWN = 0; + */ + TYPE_UNKNOWN = 0, + /** + * Field type double. + * + * @generated from enum value: TYPE_DOUBLE = 1; + */ + TYPE_DOUBLE = 1, + /** + * Field type float. + * + * @generated from enum value: TYPE_FLOAT = 2; + */ + TYPE_FLOAT = 2, + /** + * Field type int64. + * + * @generated from enum value: TYPE_INT64 = 3; + */ + TYPE_INT64 = 3, + /** + * Field type uint64. + * + * @generated from enum value: TYPE_UINT64 = 4; + */ + TYPE_UINT64 = 4, + /** + * Field type int32. + * + * @generated from enum value: TYPE_INT32 = 5; + */ + TYPE_INT32 = 5, + /** + * Field type fixed64. + * + * @generated from enum value: TYPE_FIXED64 = 6; + */ + TYPE_FIXED64 = 6, + /** + * Field type fixed32. + * + * @generated from enum value: TYPE_FIXED32 = 7; + */ + TYPE_FIXED32 = 7, + /** + * Field type bool. + * + * @generated from enum value: TYPE_BOOL = 8; + */ + TYPE_BOOL = 8, + /** + * Field type string. + * + * @generated from enum value: TYPE_STRING = 9; + */ + TYPE_STRING = 9, + /** + * Field type group. Proto2 syntax only, and deprecated. + * + * @generated from enum value: TYPE_GROUP = 10; + */ + TYPE_GROUP = 10, + /** + * Field type message. + * + * @generated from enum value: TYPE_MESSAGE = 11; + */ + TYPE_MESSAGE = 11, + /** + * Field type bytes. + * + * @generated from enum value: TYPE_BYTES = 12; + */ + TYPE_BYTES = 12, + /** + * Field type uint32. + * + * @generated from enum value: TYPE_UINT32 = 13; + */ + TYPE_UINT32 = 13, + /** + * Field type enum. + * + * @generated from enum value: TYPE_ENUM = 14; + */ + TYPE_ENUM = 14, + /** + * Field type sfixed32. + * + * @generated from enum value: TYPE_SFIXED32 = 15; + */ + TYPE_SFIXED32 = 15, + /** + * Field type sfixed64. + * + * @generated from enum value: TYPE_SFIXED64 = 16; + */ + TYPE_SFIXED64 = 16, + /** + * Field type sint32. + * + * @generated from enum value: TYPE_SINT32 = 17; + */ + TYPE_SINT32 = 17, + /** + * Field type sint64. + * + * @generated from enum value: TYPE_SINT64 = 18; + */ + TYPE_SINT64 = 18 +} +/** + * Basic field types. + * + * @generated from enum google.protobuf.Field.Kind + */ +export type Field_KindJson = "TYPE_UNKNOWN" | "TYPE_DOUBLE" | "TYPE_FLOAT" | "TYPE_INT64" | "TYPE_UINT64" | "TYPE_INT32" | "TYPE_FIXED64" | "TYPE_FIXED32" | "TYPE_BOOL" | "TYPE_STRING" | "TYPE_GROUP" | "TYPE_MESSAGE" | "TYPE_BYTES" | "TYPE_UINT32" | "TYPE_ENUM" | "TYPE_SFIXED32" | "TYPE_SFIXED64" | "TYPE_SINT32" | "TYPE_SINT64"; +/** + * Describes the enum google.protobuf.Field.Kind. + */ +export declare const Field_KindSchema: GenEnum; +/** + * Whether a field is optional, required, or repeated. + * + * @generated from enum google.protobuf.Field.Cardinality + */ +export declare enum Field_Cardinality { + /** + * For fields with unknown cardinality. + * + * @generated from enum value: CARDINALITY_UNKNOWN = 0; + */ + UNKNOWN = 0, + /** + * For optional fields. + * + * @generated from enum value: CARDINALITY_OPTIONAL = 1; + */ + OPTIONAL = 1, + /** + * For required fields. Proto2 syntax only. + * + * @generated from enum value: CARDINALITY_REQUIRED = 2; + */ + REQUIRED = 2, + /** + * For repeated fields. + * + * @generated from enum value: CARDINALITY_REPEATED = 3; + */ + REPEATED = 3 +} +/** + * Whether a field is optional, required, or repeated. + * + * @generated from enum google.protobuf.Field.Cardinality + */ +export type Field_CardinalityJson = "CARDINALITY_UNKNOWN" | "CARDINALITY_OPTIONAL" | "CARDINALITY_REQUIRED" | "CARDINALITY_REPEATED"; +/** + * Describes the enum google.protobuf.Field.Cardinality. + */ +export declare const Field_CardinalitySchema: GenEnum; +/** + * Enum type definition. + * + * New usages of this message as an alternative to EnumDescriptorProto are + * strongly discouraged. This message does not reliability preserve all + * information necessary to model the schema and preserve semantics. Instead + * make use of FileDescriptorSet which preserves the necessary information. + * + * @generated from message google.protobuf.Enum + */ +export type Enum = Message<"google.protobuf.Enum"> & { + /** + * Enum type name. + * + * @generated from field: string name = 1; + */ + name: string; + /** + * Enum value definitions. + * + * @generated from field: repeated google.protobuf.EnumValue enumvalue = 2; + */ + enumvalue: EnumValue[]; + /** + * Protocol buffer options. + * + * @generated from field: repeated google.protobuf.Option options = 3; + */ + options: Option[]; + /** + * The source context. + * + * @generated from field: google.protobuf.SourceContext source_context = 4; + */ + sourceContext?: SourceContext | undefined; + /** + * The source syntax. + * + * @generated from field: google.protobuf.Syntax syntax = 5; + */ + syntax: Syntax; + /** + * The source edition string, only valid when syntax is SYNTAX_EDITIONS. + * + * @generated from field: string edition = 6; + */ + edition: string; +}; +/** + * Enum type definition. + * + * New usages of this message as an alternative to EnumDescriptorProto are + * strongly discouraged. This message does not reliability preserve all + * information necessary to model the schema and preserve semantics. Instead + * make use of FileDescriptorSet which preserves the necessary information. + * + * @generated from message google.protobuf.Enum + */ +export type EnumJson = { + /** + * Enum type name. + * + * @generated from field: string name = 1; + */ + name?: string; + /** + * Enum value definitions. + * + * @generated from field: repeated google.protobuf.EnumValue enumvalue = 2; + */ + enumvalue?: EnumValueJson[]; + /** + * Protocol buffer options. + * + * @generated from field: repeated google.protobuf.Option options = 3; + */ + options?: OptionJson[]; + /** + * The source context. + * + * @generated from field: google.protobuf.SourceContext source_context = 4; + */ + sourceContext?: SourceContextJson; + /** + * The source syntax. + * + * @generated from field: google.protobuf.Syntax syntax = 5; + */ + syntax?: SyntaxJson; + /** + * The source edition string, only valid when syntax is SYNTAX_EDITIONS. + * + * @generated from field: string edition = 6; + */ + edition?: string; +}; +/** + * Describes the message google.protobuf.Enum. + * Use `create(EnumSchema)` to create a new message. + */ +export declare const EnumSchema: GenMessage; +/** + * Enum value definition. + * + * New usages of this message as an alternative to EnumValueDescriptorProto are + * strongly discouraged. This message does not reliability preserve all + * information necessary to model the schema and preserve semantics. Instead + * make use of FileDescriptorSet which preserves the necessary information. + * + * @generated from message google.protobuf.EnumValue + */ +export type EnumValue = Message<"google.protobuf.EnumValue"> & { + /** + * Enum value name. + * + * @generated from field: string name = 1; + */ + name: string; + /** + * Enum value number. + * + * @generated from field: int32 number = 2; + */ + number: number; + /** + * Protocol buffer options. + * + * @generated from field: repeated google.protobuf.Option options = 3; + */ + options: Option[]; +}; +/** + * Enum value definition. + * + * New usages of this message as an alternative to EnumValueDescriptorProto are + * strongly discouraged. This message does not reliability preserve all + * information necessary to model the schema and preserve semantics. Instead + * make use of FileDescriptorSet which preserves the necessary information. + * + * @generated from message google.protobuf.EnumValue + */ +export type EnumValueJson = { + /** + * Enum value name. + * + * @generated from field: string name = 1; + */ + name?: string; + /** + * Enum value number. + * + * @generated from field: int32 number = 2; + */ + number?: number; + /** + * Protocol buffer options. + * + * @generated from field: repeated google.protobuf.Option options = 3; + */ + options?: OptionJson[]; +}; +/** + * Describes the message google.protobuf.EnumValue. + * Use `create(EnumValueSchema)` to create a new message. + */ +export declare const EnumValueSchema: GenMessage; +/** + * A protocol buffer option, which can be attached to a message, field, + * enumeration, etc. + * + * New usages of this message as an alternative to FileOptions, MessageOptions, + * FieldOptions, EnumOptions, EnumValueOptions, ServiceOptions, or MethodOptions + * are strongly discouraged. + * + * @generated from message google.protobuf.Option + */ +export type Option = Message<"google.protobuf.Option"> & { + /** + * The option's name. For protobuf built-in options (options defined in + * descriptor.proto), this is the short name. For example, `"map_entry"`. + * For custom options, it should be the fully-qualified name. For example, + * `"google.api.http"`. + * + * @generated from field: string name = 1; + */ + name: string; + /** + * The option's value packed in an Any message. If the value is a primitive, + * the corresponding wrapper type defined in google/protobuf/wrappers.proto + * should be used. If the value is an enum, it should be stored as an int32 + * value using the google.protobuf.Int32Value type. + * + * @generated from field: google.protobuf.Any value = 2; + */ + value?: Any | undefined; +}; +/** + * A protocol buffer option, which can be attached to a message, field, + * enumeration, etc. + * + * New usages of this message as an alternative to FileOptions, MessageOptions, + * FieldOptions, EnumOptions, EnumValueOptions, ServiceOptions, or MethodOptions + * are strongly discouraged. + * + * @generated from message google.protobuf.Option + */ +export type OptionJson = { + /** + * The option's name. For protobuf built-in options (options defined in + * descriptor.proto), this is the short name. For example, `"map_entry"`. + * For custom options, it should be the fully-qualified name. For example, + * `"google.api.http"`. + * + * @generated from field: string name = 1; + */ + name?: string; + /** + * The option's value packed in an Any message. If the value is a primitive, + * the corresponding wrapper type defined in google/protobuf/wrappers.proto + * should be used. If the value is an enum, it should be stored as an int32 + * value using the google.protobuf.Int32Value type. + * + * @generated from field: google.protobuf.Any value = 2; + */ + value?: AnyJson; +}; +/** + * Describes the message google.protobuf.Option. + * Use `create(OptionSchema)` to create a new message. + */ +export declare const OptionSchema: GenMessage; +/** + * The syntax in which a protocol buffer element is defined. + * + * @generated from enum google.protobuf.Syntax + */ +export declare enum Syntax { + /** + * Syntax `proto2`. + * + * @generated from enum value: SYNTAX_PROTO2 = 0; + */ + PROTO2 = 0, + /** + * Syntax `proto3`. + * + * @generated from enum value: SYNTAX_PROTO3 = 1; + */ + PROTO3 = 1, + /** + * Syntax `editions`. + * + * @generated from enum value: SYNTAX_EDITIONS = 2; + */ + EDITIONS = 2 +} +/** + * The syntax in which a protocol buffer element is defined. + * + * @generated from enum google.protobuf.Syntax + */ +export type SyntaxJson = "SYNTAX_PROTO2" | "SYNTAX_PROTO3" | "SYNTAX_EDITIONS"; +/** + * Describes the enum google.protobuf.Syntax. + */ +export declare const SyntaxSchema: GenEnum; diff --git a/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/type_pb.js b/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/type_pb.js new file mode 100644 index 0000000..0f0c42b --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/type_pb.js @@ -0,0 +1,239 @@ +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +import { fileDesc } from "../../../../codegenv2/file.js"; +import { file_google_protobuf_any } from "./any_pb.js"; +import { file_google_protobuf_source_context } from "./source_context_pb.js"; +import { messageDesc } from "../../../../codegenv2/message.js"; +import { enumDesc } from "../../../../codegenv2/enum.js"; +/** + * Describes the file google/protobuf/type.proto. + */ +export const file_google_protobuf_type = /*@__PURE__*/ fileDesc("Chpnb29nbGUvcHJvdG9idWYvdHlwZS5wcm90bxIPZ29vZ2xlLnByb3RvYnVmIugBCgRUeXBlEgwKBG5hbWUYASABKAkSJgoGZmllbGRzGAIgAygLMhYuZ29vZ2xlLnByb3RvYnVmLkZpZWxkEg4KBm9uZW9mcxgDIAMoCRIoCgdvcHRpb25zGAQgAygLMhcuZ29vZ2xlLnByb3RvYnVmLk9wdGlvbhI2Cg5zb3VyY2VfY29udGV4dBgFIAEoCzIeLmdvb2dsZS5wcm90b2J1Zi5Tb3VyY2VDb250ZXh0EicKBnN5bnRheBgGIAEoDjIXLmdvb2dsZS5wcm90b2J1Zi5TeW50YXgSDwoHZWRpdGlvbhgHIAEoCSLVBQoFRmllbGQSKQoEa2luZBgBIAEoDjIbLmdvb2dsZS5wcm90b2J1Zi5GaWVsZC5LaW5kEjcKC2NhcmRpbmFsaXR5GAIgASgOMiIuZ29vZ2xlLnByb3RvYnVmLkZpZWxkLkNhcmRpbmFsaXR5Eg4KBm51bWJlchgDIAEoBRIMCgRuYW1lGAQgASgJEhAKCHR5cGVfdXJsGAYgASgJEhMKC29uZW9mX2luZGV4GAcgASgFEg4KBnBhY2tlZBgIIAEoCBIoCgdvcHRpb25zGAkgAygLMhcuZ29vZ2xlLnByb3RvYnVmLk9wdGlvbhIRCglqc29uX25hbWUYCiABKAkSFQoNZGVmYXVsdF92YWx1ZRgLIAEoCSLIAgoES2luZBIQCgxUWVBFX1VOS05PV04QABIPCgtUWVBFX0RPVUJMRRABEg4KClRZUEVfRkxPQVQQAhIOCgpUWVBFX0lOVDY0EAMSDwoLVFlQRV9VSU5UNjQQBBIOCgpUWVBFX0lOVDMyEAUSEAoMVFlQRV9GSVhFRDY0EAYSEAoMVFlQRV9GSVhFRDMyEAcSDQoJVFlQRV9CT09MEAgSDwoLVFlQRV9TVFJJTkcQCRIOCgpUWVBFX0dST1VQEAoSEAoMVFlQRV9NRVNTQUdFEAsSDgoKVFlQRV9CWVRFUxAMEg8KC1RZUEVfVUlOVDMyEA0SDQoJVFlQRV9FTlVNEA4SEQoNVFlQRV9TRklYRUQzMhAPEhEKDVRZUEVfU0ZJWEVENjQQEBIPCgtUWVBFX1NJTlQzMhAREg8KC1RZUEVfU0lOVDY0EBIidAoLQ2FyZGluYWxpdHkSFwoTQ0FSRElOQUxJVFlfVU5LTk9XThAAEhgKFENBUkRJTkFMSVRZX09QVElPTkFMEAESGAoUQ0FSRElOQUxJVFlfUkVRVUlSRUQQAhIYChRDQVJESU5BTElUWV9SRVBFQVRFRBADIt8BCgRFbnVtEgwKBG5hbWUYASABKAkSLQoJZW51bXZhbHVlGAIgAygLMhouZ29vZ2xlLnByb3RvYnVmLkVudW1WYWx1ZRIoCgdvcHRpb25zGAMgAygLMhcuZ29vZ2xlLnByb3RvYnVmLk9wdGlvbhI2Cg5zb3VyY2VfY29udGV4dBgEIAEoCzIeLmdvb2dsZS5wcm90b2J1Zi5Tb3VyY2VDb250ZXh0EicKBnN5bnRheBgFIAEoDjIXLmdvb2dsZS5wcm90b2J1Zi5TeW50YXgSDwoHZWRpdGlvbhgGIAEoCSJTCglFbnVtVmFsdWUSDAoEbmFtZRgBIAEoCRIOCgZudW1iZXIYAiABKAUSKAoHb3B0aW9ucxgDIAMoCzIXLmdvb2dsZS5wcm90b2J1Zi5PcHRpb24iOwoGT3B0aW9uEgwKBG5hbWUYASABKAkSIwoFdmFsdWUYAiABKAsyFC5nb29nbGUucHJvdG9idWYuQW55KkMKBlN5bnRheBIRCg1TWU5UQVhfUFJPVE8yEAASEQoNU1lOVEFYX1BST1RPMxABEhMKD1NZTlRBWF9FRElUSU9OUxACQnsKE2NvbS5nb29nbGUucHJvdG9idWZCCVR5cGVQcm90b1ABWi1nb29nbGUuZ29sYW5nLm9yZy9wcm90b2J1Zi90eXBlcy9rbm93bi90eXBlcGL4AQGiAgNHUEKqAh5Hb29nbGUuUHJvdG9idWYuV2VsbEtub3duVHlwZXNiBnByb3RvMw", [file_google_protobuf_any, file_google_protobuf_source_context]); +/** + * Describes the message google.protobuf.Type. + * Use `create(TypeSchema)` to create a new message. + */ +export const TypeSchema = /*@__PURE__*/ messageDesc(file_google_protobuf_type, 0); +/** + * Describes the message google.protobuf.Field. + * Use `create(FieldSchema)` to create a new message. + */ +export const FieldSchema = /*@__PURE__*/ messageDesc(file_google_protobuf_type, 1); +/** + * Basic field types. + * + * @generated from enum google.protobuf.Field.Kind + */ +export var Field_Kind; +(function (Field_Kind) { + /** + * Field type unknown. + * + * @generated from enum value: TYPE_UNKNOWN = 0; + */ + Field_Kind[Field_Kind["TYPE_UNKNOWN"] = 0] = "TYPE_UNKNOWN"; + /** + * Field type double. + * + * @generated from enum value: TYPE_DOUBLE = 1; + */ + Field_Kind[Field_Kind["TYPE_DOUBLE"] = 1] = "TYPE_DOUBLE"; + /** + * Field type float. + * + * @generated from enum value: TYPE_FLOAT = 2; + */ + Field_Kind[Field_Kind["TYPE_FLOAT"] = 2] = "TYPE_FLOAT"; + /** + * Field type int64. + * + * @generated from enum value: TYPE_INT64 = 3; + */ + Field_Kind[Field_Kind["TYPE_INT64"] = 3] = "TYPE_INT64"; + /** + * Field type uint64. + * + * @generated from enum value: TYPE_UINT64 = 4; + */ + Field_Kind[Field_Kind["TYPE_UINT64"] = 4] = "TYPE_UINT64"; + /** + * Field type int32. + * + * @generated from enum value: TYPE_INT32 = 5; + */ + Field_Kind[Field_Kind["TYPE_INT32"] = 5] = "TYPE_INT32"; + /** + * Field type fixed64. + * + * @generated from enum value: TYPE_FIXED64 = 6; + */ + Field_Kind[Field_Kind["TYPE_FIXED64"] = 6] = "TYPE_FIXED64"; + /** + * Field type fixed32. + * + * @generated from enum value: TYPE_FIXED32 = 7; + */ + Field_Kind[Field_Kind["TYPE_FIXED32"] = 7] = "TYPE_FIXED32"; + /** + * Field type bool. + * + * @generated from enum value: TYPE_BOOL = 8; + */ + Field_Kind[Field_Kind["TYPE_BOOL"] = 8] = "TYPE_BOOL"; + /** + * Field type string. + * + * @generated from enum value: TYPE_STRING = 9; + */ + Field_Kind[Field_Kind["TYPE_STRING"] = 9] = "TYPE_STRING"; + /** + * Field type group. Proto2 syntax only, and deprecated. + * + * @generated from enum value: TYPE_GROUP = 10; + */ + Field_Kind[Field_Kind["TYPE_GROUP"] = 10] = "TYPE_GROUP"; + /** + * Field type message. + * + * @generated from enum value: TYPE_MESSAGE = 11; + */ + Field_Kind[Field_Kind["TYPE_MESSAGE"] = 11] = "TYPE_MESSAGE"; + /** + * Field type bytes. + * + * @generated from enum value: TYPE_BYTES = 12; + */ + Field_Kind[Field_Kind["TYPE_BYTES"] = 12] = "TYPE_BYTES"; + /** + * Field type uint32. + * + * @generated from enum value: TYPE_UINT32 = 13; + */ + Field_Kind[Field_Kind["TYPE_UINT32"] = 13] = "TYPE_UINT32"; + /** + * Field type enum. + * + * @generated from enum value: TYPE_ENUM = 14; + */ + Field_Kind[Field_Kind["TYPE_ENUM"] = 14] = "TYPE_ENUM"; + /** + * Field type sfixed32. + * + * @generated from enum value: TYPE_SFIXED32 = 15; + */ + Field_Kind[Field_Kind["TYPE_SFIXED32"] = 15] = "TYPE_SFIXED32"; + /** + * Field type sfixed64. + * + * @generated from enum value: TYPE_SFIXED64 = 16; + */ + Field_Kind[Field_Kind["TYPE_SFIXED64"] = 16] = "TYPE_SFIXED64"; + /** + * Field type sint32. + * + * @generated from enum value: TYPE_SINT32 = 17; + */ + Field_Kind[Field_Kind["TYPE_SINT32"] = 17] = "TYPE_SINT32"; + /** + * Field type sint64. + * + * @generated from enum value: TYPE_SINT64 = 18; + */ + Field_Kind[Field_Kind["TYPE_SINT64"] = 18] = "TYPE_SINT64"; +})(Field_Kind || (Field_Kind = {})); +/** + * Describes the enum google.protobuf.Field.Kind. + */ +export const Field_KindSchema = /*@__PURE__*/ enumDesc(file_google_protobuf_type, 1, 0); +/** + * Whether a field is optional, required, or repeated. + * + * @generated from enum google.protobuf.Field.Cardinality + */ +export var Field_Cardinality; +(function (Field_Cardinality) { + /** + * For fields with unknown cardinality. + * + * @generated from enum value: CARDINALITY_UNKNOWN = 0; + */ + Field_Cardinality[Field_Cardinality["UNKNOWN"] = 0] = "UNKNOWN"; + /** + * For optional fields. + * + * @generated from enum value: CARDINALITY_OPTIONAL = 1; + */ + Field_Cardinality[Field_Cardinality["OPTIONAL"] = 1] = "OPTIONAL"; + /** + * For required fields. Proto2 syntax only. + * + * @generated from enum value: CARDINALITY_REQUIRED = 2; + */ + Field_Cardinality[Field_Cardinality["REQUIRED"] = 2] = "REQUIRED"; + /** + * For repeated fields. + * + * @generated from enum value: CARDINALITY_REPEATED = 3; + */ + Field_Cardinality[Field_Cardinality["REPEATED"] = 3] = "REPEATED"; +})(Field_Cardinality || (Field_Cardinality = {})); +/** + * Describes the enum google.protobuf.Field.Cardinality. + */ +export const Field_CardinalitySchema = /*@__PURE__*/ enumDesc(file_google_protobuf_type, 1, 1); +/** + * Describes the message google.protobuf.Enum. + * Use `create(EnumSchema)` to create a new message. + */ +export const EnumSchema = /*@__PURE__*/ messageDesc(file_google_protobuf_type, 2); +/** + * Describes the message google.protobuf.EnumValue. + * Use `create(EnumValueSchema)` to create a new message. + */ +export const EnumValueSchema = /*@__PURE__*/ messageDesc(file_google_protobuf_type, 3); +/** + * Describes the message google.protobuf.Option. + * Use `create(OptionSchema)` to create a new message. + */ +export const OptionSchema = /*@__PURE__*/ messageDesc(file_google_protobuf_type, 4); +/** + * The syntax in which a protocol buffer element is defined. + * + * @generated from enum google.protobuf.Syntax + */ +export var Syntax; +(function (Syntax) { + /** + * Syntax `proto2`. + * + * @generated from enum value: SYNTAX_PROTO2 = 0; + */ + Syntax[Syntax["PROTO2"] = 0] = "PROTO2"; + /** + * Syntax `proto3`. + * + * @generated from enum value: SYNTAX_PROTO3 = 1; + */ + Syntax[Syntax["PROTO3"] = 1] = "PROTO3"; + /** + * Syntax `editions`. + * + * @generated from enum value: SYNTAX_EDITIONS = 2; + */ + Syntax[Syntax["EDITIONS"] = 2] = "EDITIONS"; +})(Syntax || (Syntax = {})); +/** + * Describes the enum google.protobuf.Syntax. + */ +export const SyntaxSchema = /*@__PURE__*/ enumDesc(file_google_protobuf_type, 0); diff --git a/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/wrappers_pb.d.ts b/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/wrappers_pb.d.ts new file mode 100644 index 0000000..c63820a --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/wrappers_pb.d.ts @@ -0,0 +1,330 @@ +import type { GenFile, GenMessage } from "../../../../codegenv2/types.js"; +import type { Message } from "../../../../types.js"; +/** + * Describes the file google/protobuf/wrappers.proto. + */ +export declare const file_google_protobuf_wrappers: GenFile; +/** + * Wrapper message for `double`. + * + * The JSON representation for `DoubleValue` is JSON number. + * + * Not recommended for use in new APIs, but still useful for legacy APIs and + * has no plan to be removed. + * + * @generated from message google.protobuf.DoubleValue + */ +export type DoubleValue = Message<"google.protobuf.DoubleValue"> & { + /** + * The double value. + * + * @generated from field: double value = 1; + */ + value: number; +}; +/** + * Wrapper message for `double`. + * + * The JSON representation for `DoubleValue` is JSON number. + * + * Not recommended for use in new APIs, but still useful for legacy APIs and + * has no plan to be removed. + * + * @generated from message google.protobuf.DoubleValue + */ +export type DoubleValueJson = number | "NaN" | "Infinity" | "-Infinity"; +/** + * Describes the message google.protobuf.DoubleValue. + * Use `create(DoubleValueSchema)` to create a new message. + */ +export declare const DoubleValueSchema: GenMessage; +/** + * Wrapper message for `float`. + * + * The JSON representation for `FloatValue` is JSON number. + * + * Not recommended for use in new APIs, but still useful for legacy APIs and + * has no plan to be removed. + * + * @generated from message google.protobuf.FloatValue + */ +export type FloatValue = Message<"google.protobuf.FloatValue"> & { + /** + * The float value. + * + * @generated from field: float value = 1; + */ + value: number; +}; +/** + * Wrapper message for `float`. + * + * The JSON representation for `FloatValue` is JSON number. + * + * Not recommended for use in new APIs, but still useful for legacy APIs and + * has no plan to be removed. + * + * @generated from message google.protobuf.FloatValue + */ +export type FloatValueJson = number | "NaN" | "Infinity" | "-Infinity"; +/** + * Describes the message google.protobuf.FloatValue. + * Use `create(FloatValueSchema)` to create a new message. + */ +export declare const FloatValueSchema: GenMessage; +/** + * Wrapper message for `int64`. + * + * The JSON representation for `Int64Value` is JSON string. + * + * Not recommended for use in new APIs, but still useful for legacy APIs and + * has no plan to be removed. + * + * @generated from message google.protobuf.Int64Value + */ +export type Int64Value = Message<"google.protobuf.Int64Value"> & { + /** + * The int64 value. + * + * @generated from field: int64 value = 1; + */ + value: bigint; +}; +/** + * Wrapper message for `int64`. + * + * The JSON representation for `Int64Value` is JSON string. + * + * Not recommended for use in new APIs, but still useful for legacy APIs and + * has no plan to be removed. + * + * @generated from message google.protobuf.Int64Value + */ +export type Int64ValueJson = string; +/** + * Describes the message google.protobuf.Int64Value. + * Use `create(Int64ValueSchema)` to create a new message. + */ +export declare const Int64ValueSchema: GenMessage; +/** + * Wrapper message for `uint64`. + * + * The JSON representation for `UInt64Value` is JSON string. + * + * Not recommended for use in new APIs, but still useful for legacy APIs and + * has no plan to be removed. + * + * @generated from message google.protobuf.UInt64Value + */ +export type UInt64Value = Message<"google.protobuf.UInt64Value"> & { + /** + * The uint64 value. + * + * @generated from field: uint64 value = 1; + */ + value: bigint; +}; +/** + * Wrapper message for `uint64`. + * + * The JSON representation for `UInt64Value` is JSON string. + * + * Not recommended for use in new APIs, but still useful for legacy APIs and + * has no plan to be removed. + * + * @generated from message google.protobuf.UInt64Value + */ +export type UInt64ValueJson = string; +/** + * Describes the message google.protobuf.UInt64Value. + * Use `create(UInt64ValueSchema)` to create a new message. + */ +export declare const UInt64ValueSchema: GenMessage; +/** + * Wrapper message for `int32`. + * + * The JSON representation for `Int32Value` is JSON number. + * + * Not recommended for use in new APIs, but still useful for legacy APIs and + * has no plan to be removed. + * + * @generated from message google.protobuf.Int32Value + */ +export type Int32Value = Message<"google.protobuf.Int32Value"> & { + /** + * The int32 value. + * + * @generated from field: int32 value = 1; + */ + value: number; +}; +/** + * Wrapper message for `int32`. + * + * The JSON representation for `Int32Value` is JSON number. + * + * Not recommended for use in new APIs, but still useful for legacy APIs and + * has no plan to be removed. + * + * @generated from message google.protobuf.Int32Value + */ +export type Int32ValueJson = number; +/** + * Describes the message google.protobuf.Int32Value. + * Use `create(Int32ValueSchema)` to create a new message. + */ +export declare const Int32ValueSchema: GenMessage; +/** + * Wrapper message for `uint32`. + * + * The JSON representation for `UInt32Value` is JSON number. + * + * Not recommended for use in new APIs, but still useful for legacy APIs and + * has no plan to be removed. + * + * @generated from message google.protobuf.UInt32Value + */ +export type UInt32Value = Message<"google.protobuf.UInt32Value"> & { + /** + * The uint32 value. + * + * @generated from field: uint32 value = 1; + */ + value: number; +}; +/** + * Wrapper message for `uint32`. + * + * The JSON representation for `UInt32Value` is JSON number. + * + * Not recommended for use in new APIs, but still useful for legacy APIs and + * has no plan to be removed. + * + * @generated from message google.protobuf.UInt32Value + */ +export type UInt32ValueJson = number; +/** + * Describes the message google.protobuf.UInt32Value. + * Use `create(UInt32ValueSchema)` to create a new message. + */ +export declare const UInt32ValueSchema: GenMessage; +/** + * Wrapper message for `bool`. + * + * The JSON representation for `BoolValue` is JSON `true` and `false`. + * + * Not recommended for use in new APIs, but still useful for legacy APIs and + * has no plan to be removed. + * + * @generated from message google.protobuf.BoolValue + */ +export type BoolValue = Message<"google.protobuf.BoolValue"> & { + /** + * The bool value. + * + * @generated from field: bool value = 1; + */ + value: boolean; +}; +/** + * Wrapper message for `bool`. + * + * The JSON representation for `BoolValue` is JSON `true` and `false`. + * + * Not recommended for use in new APIs, but still useful for legacy APIs and + * has no plan to be removed. + * + * @generated from message google.protobuf.BoolValue + */ +export type BoolValueJson = boolean; +/** + * Describes the message google.protobuf.BoolValue. + * Use `create(BoolValueSchema)` to create a new message. + */ +export declare const BoolValueSchema: GenMessage; +/** + * Wrapper message for `string`. + * + * The JSON representation for `StringValue` is JSON string. + * + * Not recommended for use in new APIs, but still useful for legacy APIs and + * has no plan to be removed. + * + * @generated from message google.protobuf.StringValue + */ +export type StringValue = Message<"google.protobuf.StringValue"> & { + /** + * The string value. + * + * @generated from field: string value = 1; + */ + value: string; +}; +/** + * Wrapper message for `string`. + * + * The JSON representation for `StringValue` is JSON string. + * + * Not recommended for use in new APIs, but still useful for legacy APIs and + * has no plan to be removed. + * + * @generated from message google.protobuf.StringValue + */ +export type StringValueJson = string; +/** + * Describes the message google.protobuf.StringValue. + * Use `create(StringValueSchema)` to create a new message. + */ +export declare const StringValueSchema: GenMessage; +/** + * Wrapper message for `bytes`. + * + * The JSON representation for `BytesValue` is JSON string. + * + * Not recommended for use in new APIs, but still useful for legacy APIs and + * has no plan to be removed. + * + * @generated from message google.protobuf.BytesValue + */ +export type BytesValue = Message<"google.protobuf.BytesValue"> & { + /** + * The bytes value. + * + * @generated from field: bytes value = 1; + */ + value: Uint8Array; +}; +/** + * Wrapper message for `bytes`. + * + * The JSON representation for `BytesValue` is JSON string. + * + * Not recommended for use in new APIs, but still useful for legacy APIs and + * has no plan to be removed. + * + * @generated from message google.protobuf.BytesValue + */ +export type BytesValueJson = string; +/** + * Describes the message google.protobuf.BytesValue. + * Use `create(BytesValueSchema)` to create a new message. + */ +export declare const BytesValueSchema: GenMessage; diff --git a/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/wrappers_pb.js b/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/wrappers_pb.js new file mode 100644 index 0000000..3c8619e --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/wrappers_pb.js @@ -0,0 +1,64 @@ +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +import { fileDesc } from "../../../../codegenv2/file.js"; +import { messageDesc } from "../../../../codegenv2/message.js"; +/** + * Describes the file google/protobuf/wrappers.proto. + */ +export const file_google_protobuf_wrappers = /*@__PURE__*/ fileDesc("Ch5nb29nbGUvcHJvdG9idWYvd3JhcHBlcnMucHJvdG8SD2dvb2dsZS5wcm90b2J1ZiIcCgtEb3VibGVWYWx1ZRINCgV2YWx1ZRgBIAEoASIbCgpGbG9hdFZhbHVlEg0KBXZhbHVlGAEgASgCIhsKCkludDY0VmFsdWUSDQoFdmFsdWUYASABKAMiHAoLVUludDY0VmFsdWUSDQoFdmFsdWUYASABKAQiGwoKSW50MzJWYWx1ZRINCgV2YWx1ZRgBIAEoBSIcCgtVSW50MzJWYWx1ZRINCgV2YWx1ZRgBIAEoDSIaCglCb29sVmFsdWUSDQoFdmFsdWUYASABKAgiHAoLU3RyaW5nVmFsdWUSDQoFdmFsdWUYASABKAkiGwoKQnl0ZXNWYWx1ZRINCgV2YWx1ZRgBIAEoDEKDAQoTY29tLmdvb2dsZS5wcm90b2J1ZkINV3JhcHBlcnNQcm90b1ABWjFnb29nbGUuZ29sYW5nLm9yZy9wcm90b2J1Zi90eXBlcy9rbm93bi93cmFwcGVyc3Bi+AEBogIDR1BCqgIeR29vZ2xlLlByb3RvYnVmLldlbGxLbm93blR5cGVzYgZwcm90bzM"); +/** + * Describes the message google.protobuf.DoubleValue. + * Use `create(DoubleValueSchema)` to create a new message. + */ +export const DoubleValueSchema = /*@__PURE__*/ messageDesc(file_google_protobuf_wrappers, 0); +/** + * Describes the message google.protobuf.FloatValue. + * Use `create(FloatValueSchema)` to create a new message. + */ +export const FloatValueSchema = /*@__PURE__*/ messageDesc(file_google_protobuf_wrappers, 1); +/** + * Describes the message google.protobuf.Int64Value. + * Use `create(Int64ValueSchema)` to create a new message. + */ +export const Int64ValueSchema = /*@__PURE__*/ messageDesc(file_google_protobuf_wrappers, 2); +/** + * Describes the message google.protobuf.UInt64Value. + * Use `create(UInt64ValueSchema)` to create a new message. + */ +export const UInt64ValueSchema = /*@__PURE__*/ messageDesc(file_google_protobuf_wrappers, 3); +/** + * Describes the message google.protobuf.Int32Value. + * Use `create(Int32ValueSchema)` to create a new message. + */ +export const Int32ValueSchema = /*@__PURE__*/ messageDesc(file_google_protobuf_wrappers, 4); +/** + * Describes the message google.protobuf.UInt32Value. + * Use `create(UInt32ValueSchema)` to create a new message. + */ +export const UInt32ValueSchema = /*@__PURE__*/ messageDesc(file_google_protobuf_wrappers, 5); +/** + * Describes the message google.protobuf.BoolValue. + * Use `create(BoolValueSchema)` to create a new message. + */ +export const BoolValueSchema = /*@__PURE__*/ messageDesc(file_google_protobuf_wrappers, 6); +/** + * Describes the message google.protobuf.StringValue. + * Use `create(StringValueSchema)` to create a new message. + */ +export const StringValueSchema = /*@__PURE__*/ messageDesc(file_google_protobuf_wrappers, 7); +/** + * Describes the message google.protobuf.BytesValue. + * Use `create(BytesValueSchema)` to create a new message. + */ +export const BytesValueSchema = /*@__PURE__*/ messageDesc(file_google_protobuf_wrappers, 8); diff --git a/node_modules/@bufbuild/protobuf/dist/esm/wkt/index.d.ts b/node_modules/@bufbuild/protobuf/dist/esm/wkt/index.d.ts new file mode 100644 index 0000000..9218695 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/wkt/index.d.ts @@ -0,0 +1,19 @@ +export * from "./timestamp.js"; +export * from "./duration.js"; +export * from "./any.js"; +export * from "./wrappers.js"; +export * from "./gen/google/protobuf/any_pb.js"; +export * from "./gen/google/protobuf/api_pb.js"; +export * from "./gen/google/protobuf/cpp_features_pb.js"; +export * from "./gen/google/protobuf/descriptor_pb.js"; +export * from "./gen/google/protobuf/duration_pb.js"; +export * from "./gen/google/protobuf/empty_pb.js"; +export * from "./gen/google/protobuf/field_mask_pb.js"; +export * from "./gen/google/protobuf/go_features_pb.js"; +export * from "./gen/google/protobuf/java_features_pb.js"; +export * from "./gen/google/protobuf/source_context_pb.js"; +export * from "./gen/google/protobuf/struct_pb.js"; +export * from "./gen/google/protobuf/timestamp_pb.js"; +export * from "./gen/google/protobuf/type_pb.js"; +export * from "./gen/google/protobuf/wrappers_pb.js"; +export * from "./gen/google/protobuf/compiler/plugin_pb.js"; diff --git a/node_modules/@bufbuild/protobuf/dist/esm/wkt/index.js b/node_modules/@bufbuild/protobuf/dist/esm/wkt/index.js new file mode 100644 index 0000000..f7a7fb7 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/wkt/index.js @@ -0,0 +1,32 @@ +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +export * from "./timestamp.js"; +export * from "./duration.js"; +export * from "./any.js"; +export * from "./wrappers.js"; +export * from "./gen/google/protobuf/any_pb.js"; +export * from "./gen/google/protobuf/api_pb.js"; +export * from "./gen/google/protobuf/cpp_features_pb.js"; +export * from "./gen/google/protobuf/descriptor_pb.js"; +export * from "./gen/google/protobuf/duration_pb.js"; +export * from "./gen/google/protobuf/empty_pb.js"; +export * from "./gen/google/protobuf/field_mask_pb.js"; +export * from "./gen/google/protobuf/go_features_pb.js"; +export * from "./gen/google/protobuf/java_features_pb.js"; +export * from "./gen/google/protobuf/source_context_pb.js"; +export * from "./gen/google/protobuf/struct_pb.js"; +export * from "./gen/google/protobuf/timestamp_pb.js"; +export * from "./gen/google/protobuf/type_pb.js"; +export * from "./gen/google/protobuf/wrappers_pb.js"; +export * from "./gen/google/protobuf/compiler/plugin_pb.js"; diff --git a/node_modules/@bufbuild/protobuf/dist/esm/wkt/timestamp.d.ts b/node_modules/@bufbuild/protobuf/dist/esm/wkt/timestamp.d.ts new file mode 100644 index 0000000..6ae7c19 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/wkt/timestamp.d.ts @@ -0,0 +1,21 @@ +import type { Timestamp } from "./gen/google/protobuf/timestamp_pb.js"; +/** + * Create a google.protobuf.Timestamp for the current time. + */ +export declare function timestampNow(): Timestamp; +/** + * Create a google.protobuf.Timestamp message from an ECMAScript Date. + */ +export declare function timestampFromDate(date: Date): Timestamp; +/** + * Convert a google.protobuf.Timestamp message to an ECMAScript Date. + */ +export declare function timestampDate(timestamp: Timestamp): Date; +/** + * Create a google.protobuf.Timestamp message from a Unix timestamp in milliseconds. + */ +export declare function timestampFromMs(timestampMs: number): Timestamp; +/** + * Convert a google.protobuf.Timestamp to a Unix timestamp in milliseconds. + */ +export declare function timestampMs(timestamp: Timestamp): number; diff --git a/node_modules/@bufbuild/protobuf/dist/esm/wkt/timestamp.js b/node_modules/@bufbuild/protobuf/dist/esm/wkt/timestamp.js new file mode 100644 index 0000000..8993cda --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/wkt/timestamp.js @@ -0,0 +1,50 @@ +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +import { TimestampSchema } from "./gen/google/protobuf/timestamp_pb.js"; +import { create } from "../create.js"; +import { protoInt64 } from "../proto-int64.js"; +/** + * Create a google.protobuf.Timestamp for the current time. + */ +export function timestampNow() { + return timestampFromDate(new Date()); +} +/** + * Create a google.protobuf.Timestamp message from an ECMAScript Date. + */ +export function timestampFromDate(date) { + return timestampFromMs(date.getTime()); +} +/** + * Convert a google.protobuf.Timestamp message to an ECMAScript Date. + */ +export function timestampDate(timestamp) { + return new Date(timestampMs(timestamp)); +} +/** + * Create a google.protobuf.Timestamp message from a Unix timestamp in milliseconds. + */ +export function timestampFromMs(timestampMs) { + const seconds = Math.floor(timestampMs / 1000); + return create(TimestampSchema, { + seconds: protoInt64.parse(seconds), + nanos: (timestampMs - seconds * 1000) * 1000000, + }); +} +/** + * Convert a google.protobuf.Timestamp to a Unix timestamp in milliseconds. + */ +export function timestampMs(timestamp) { + return (Number(timestamp.seconds) * 1000 + Math.round(timestamp.nanos / 1000000)); +} diff --git a/node_modules/@bufbuild/protobuf/dist/esm/wkt/wrappers.d.ts b/node_modules/@bufbuild/protobuf/dist/esm/wkt/wrappers.d.ts new file mode 100644 index 0000000..0bfb6c0 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/wkt/wrappers.d.ts @@ -0,0 +1,25 @@ +import type { Message } from "../types.js"; +import type { BoolValue, BytesValue, DoubleValue, FloatValue, Int32Value, Int64Value, StringValue, UInt32Value, UInt64Value } from "./gen/google/protobuf/wrappers_pb.js"; +import type { DescField, DescMessage } from "../descriptors.js"; +export declare function isWrapper(arg: Message): arg is DoubleValue | FloatValue | Int64Value | UInt64Value | Int32Value | UInt32Value | BoolValue | StringValue | BytesValue; +export type WktWrapperDesc = DescMessage & { + fields: [ + DescField & { + fieldKind: "scalar"; + number: 1; + name: "value"; + oneof: undefined; + } + ]; +}; +export declare function isWrapperDesc(messageDesc: DescMessage): messageDesc is WktWrapperDesc; +/** + * Returns true if the descriptor is a well-known type with a custom JSON + * representation per the protobuf JSON spec. Examples: Timestamp as an + * RFC 3339 string, Duration as "5s", wrappers as the unwrapped scalar. + * + * When packed inside `google.protobuf.Any`, these messages are serialized + * as `{"@type": ..., "value": }`; all other messages embed + * their fields directly. + */ +export declare function hasCustomJsonRepresentation(desc: DescMessage): boolean; diff --git a/node_modules/@bufbuild/protobuf/dist/esm/wkt/wrappers.js b/node_modules/@bufbuild/protobuf/dist/esm/wkt/wrappers.js new file mode 100644 index 0000000..69a4892 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/dist/esm/wkt/wrappers.js @@ -0,0 +1,61 @@ +// Copyright 2021-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +export function isWrapper(arg) { + return isWrapperTypeName(arg.$typeName); +} +export function isWrapperDesc(messageDesc) { + const f = messageDesc.fields[0]; + return (isWrapperTypeName(messageDesc.typeName) && + f !== undefined && + f.fieldKind == "scalar" && + f.name == "value" && + f.number == 1); +} +/** + * Returns true if the descriptor is a well-known type with a custom JSON + * representation per the protobuf JSON spec. Examples: Timestamp as an + * RFC 3339 string, Duration as "5s", wrappers as the unwrapped scalar. + * + * When packed inside `google.protobuf.Any`, these messages are serialized + * as `{"@type": ..., "value": }`; all other messages embed + * their fields directly. + */ +export function hasCustomJsonRepresentation(desc) { + switch (desc.typeName) { + case "google.protobuf.Any": + case "google.protobuf.Timestamp": + case "google.protobuf.Duration": + case "google.protobuf.FieldMask": + case "google.protobuf.Struct": + case "google.protobuf.Value": + case "google.protobuf.ListValue": + return true; + default: + return isWrapperDesc(desc); + } +} +function isWrapperTypeName(name) { + return (name.startsWith("google.protobuf.") && + [ + "DoubleValue", + "FloatValue", + "Int64Value", + "UInt64Value", + "Int32Value", + "UInt32Value", + "BoolValue", + "StringValue", + "BytesValue", + ].includes(name.substring(16))); +} diff --git a/node_modules/@bufbuild/protobuf/package.json b/node_modules/@bufbuild/protobuf/package.json new file mode 100644 index 0000000..ae41c10 --- /dev/null +++ b/node_modules/@bufbuild/protobuf/package.json @@ -0,0 +1,68 @@ +{ + "name": "@bufbuild/protobuf", + "version": "2.12.0", + "license": "(Apache-2.0 AND BSD-3-Clause)", + "description": "A complete implementation of Protocol Buffers in TypeScript, suitable for web browsers and Node.js.", + "keywords": ["protobuf", "schema", "typescript", "ecmascript"], + "repository": { + "type": "git", + "url": "https://github.com/bufbuild/protobuf-es.git", + "directory": "packages/protobuf" + }, + "scripts": { + "prebuild": "rm -rf ./dist/*", + "build": "npm run build:cjs && npm run build:esm", + "build:cjs": "../../node_modules/typescript/bin/tsc --project tsconfig.json --module commonjs --verbatimModuleSyntax false --moduleResolution node10 --outDir ./dist/cjs && echo >./dist/cjs/package.json '{\"type\":\"commonjs\"}'", + "build:esm": "../../node_modules/typescript/bin/tsc --project tsconfig.json --outDir ./dist/esm", + "bootstrap": "npm run bootstrap:inject && npm run bootstrap:wkt", + "bootstrap:inject": "node scripts/bootstrap-inject.mjs src", + "bootstrap:wkt": "protoc --es_out=src/wkt/gen --es_opt=bootstrap_wkt=true,target=ts,import_extension=js,json_types=true --proto_path $(upstream-include wkt) $(upstream-files wkt)", + "postbootstrap:wkt": "license-header src/wkt/gen", + "format": "biome format --write", + "license-header": "license-header --ignore 'src/wire/varint.ts'", + "lint": "biome lint --error-on-warnings", + "attw": "attw --pack" + }, + "type": "module", + "sideEffects": false, + "main": "./dist/cjs/index.js", + "exports": { + ".": { + "import": "./dist/esm/index.js", + "require": "./dist/cjs/index.js" + }, + "./codegenv1": { + "import": "./dist/esm/codegenv1/index.js", + "require": "./dist/cjs/codegenv1/index.js" + }, + "./codegenv2": { + "import": "./dist/esm/codegenv2/index.js", + "require": "./dist/cjs/codegenv2/index.js" + }, + "./reflect": { + "import": "./dist/esm/reflect/index.js", + "require": "./dist/cjs/reflect/index.js" + }, + "./wkt": { + "import": "./dist/esm/wkt/index.js", + "require": "./dist/cjs/wkt/index.js" + }, + "./wire": { + "import": "./dist/esm/wire/index.js", + "require": "./dist/cjs/wire/index.js" + } + }, + "typesVersions": { + "*": { + "codegenv1": ["./dist/cjs/codegenv1/index.d.ts"], + "codegenv2": ["./dist/cjs/codegenv2/index.d.ts"], + "reflect": ["./dist/cjs/reflect/index.d.ts"], + "wkt": ["./dist/cjs/wkt/index.d.ts"], + "wire": ["./dist/cjs/wire/index.d.ts"] + } + }, + "devDependencies": { + "upstream-protobuf": "*" + }, + "files": ["dist/**"] +} diff --git a/node_modules/meriyah/CHANGELOG.md b/node_modules/meriyah/CHANGELOG.md new file mode 100644 index 0000000..3598e3c --- /dev/null +++ b/node_modules/meriyah/CHANGELOG.md @@ -0,0 +1,756 @@ +## [6.1.4](https://github.com/meriyah/meriyah/compare/v6.1.3...v6.1.4) (2025-07-02) + + +### Bug Fixes + +* add missing `AccessorProperty` to `Node` ([#482](https://github.com/meriyah/meriyah/issues/482)) ([e6dcc62](https://github.com/meriyah/meriyah/commit/e6dcc62e3b6436ca626e18c621419e8da9f1f9c9)) +* fix `decodeHTMLStrict()` ([#505](https://github.com/meriyah/meriyah/issues/505)) ([bd3ce8e](https://github.com/meriyah/meriyah/commit/bd3ce8e267f5941044436541e7488bee6ef4d850)) +* **parser:** fix class member range with decorators ([#506](https://github.com/meriyah/meriyah/issues/506)) ([1dfa82c](https://github.com/meriyah/meriyah/commit/1dfa82cc3f6957a6013fee2fa137f6f09e9eb26d)) +* **parser:** stop complaining about named import/export with `{type: "json"}` attribute ([#484](https://github.com/meriyah/meriyah/issues/484)) ([ab8a383](https://github.com/meriyah/meriyah/commit/ab8a3836336f7418b42ea22997141c211b097605)) + + + +## [6.1.3](https://github.com/meriyah/meriyah/compare/v6.1.2...v6.1.3) (2025-06-24) + + +### Bug Fixes + +* **parser:** fix line/column where string literal contains `U+2028` or `U+2029` followed by `\` ([#478](https://github.com/meriyah/meriyah/issues/478)) ([1f054a1](https://github.com/meriyah/meriyah/commit/1f054a1cbc18ca593edc73d1787880134e36aa11)) +* **parser:** fix line/column where string literal contains U+2028 or U+2029 ([#477](https://github.com/meriyah/meriyah/issues/477)) ([6117d2f](https://github.com/meriyah/meriyah/commit/6117d2f424bf2f627ff2cf5fe6f65519f4dac072)) +* **parser:** fix location of `SequenceExpression` as `ForStatement.init` ([#476](https://github.com/meriyah/meriyah/issues/476)) ([b79282b](https://github.com/meriyah/meriyah/commit/b79282b5e833440ef3433b612b856e4b1fec1bd5)) +* **parser:** fix location of object method which is a generator ([#474](https://github.com/meriyah/meriyah/issues/474)) ([c11f9dd](https://github.com/meriyah/meriyah/commit/c11f9dd880571f97daea27d2f580e8d9e952d023)) +* **parser:** fix range of static class property named `accessor`, `get`, `set`, and `async` ([#471](https://github.com/meriyah/meriyah/issues/471)) ([27f224c](https://github.com/meriyah/meriyah/commit/27f224c54748e82f4139a2d29f0278b32bc5b9e1)) + + + +## [6.1.2](https://github.com/meriyah/meriyah/compare/v6.1.1...v6.1.2) (2025-06-21) + + +### Bug Fixes + +* **parser:** fix column of escaped identifier ([#469](https://github.com/meriyah/meriyah/issues/469)) ([98d3983](https://github.com/meriyah/meriyah/commit/98d398314f03c3c850368bee1ce697b88f070c79)) +* **parser:** fix location of `import.meta` ([#461](https://github.com/meriyah/meriyah/issues/461)) ([6a05b0e](https://github.com/meriyah/meriyah/commit/6a05b0e0183f357ced7b26207a2a2f22ca287e80)) + + + +## [6.1.1](https://github.com/meriyah/meriyah/compare/v6.1.0...v6.1.1) (2025-06-17) + + +### Bug Fixes + +* **parser:** `CallExpression.optional` and `MemberExpression.{optional,computed}` is always a boolean ([#439](https://github.com/meriyah/meriyah/issues/439)) ([4bc2599](https://github.com/meriyah/meriyah/commit/4bc2599c054b0e8c932cd03fb8df9222f9e59c3c)) +* **parser:** allow decorators after `export`, forbid decorators appears both before and after `export`/`export default` ([#455](https://github.com/meriyah/meriyah/issues/455)) ([78f49f5](https://github.com/meriyah/meriyah/commit/78f49f50ce0401fdca5b3b15ee2c6e7af5144cd0)) +* **parser:** fix `MemeberExpression` location inside `For{,Of,In}Statement` ([#447](https://github.com/meriyah/meriyah/issues/447)) ([e86318d](https://github.com/meriyah/meriyah/commit/e86318d3f3cda713d58603b9973dbdbd73d839bc)) +* **parser:** fix location of `Decorator.expression` ([#438](https://github.com/meriyah/meriyah/issues/438)) ([4956772](https://github.com/meriyah/meriyah/commit/49567723752bc0017cea304a6c268c8b670bbbbb)) +* **parser:** fix location of `PrivateIdentifier` ([#437](https://github.com/meriyah/meriyah/issues/437)) ([cba2219](https://github.com/meriyah/meriyah/commit/cba22190eaa80a3ebfab40280b57d33960eb4a29)) +* **parser:** fix location of static class property ([#448](https://github.com/meriyah/meriyah/issues/448)) ([1f5c2cc](https://github.com/meriyah/meriyah/commit/1f5c2ccec291446249b1a29bee80bbd49513fd23)) +* **parser:** include decorators in `ClassDeclaration`, `ExportDeclaration`, and `ExportDefaultDeclaration` ([#457](https://github.com/meriyah/meriyah/issues/457)) ([0f0b198](https://github.com/meriyah/meriyah/commit/0f0b198bf8fb03ed6469bcc176a2fbcd26d2b251)) +* **parser:** include decorators in range of `Class{Expression,Declaration}` ([#452](https://github.com/meriyah/meriyah/issues/452)) ([82f2ea4](https://github.com/meriyah/meriyah/commit/82f2ea4cd9bd335119e665cbc259f7e5b9810356)) +* **parser:** include decorators in range of class members ([#450](https://github.com/meriyah/meriyah/issues/450)) ([da156b4](https://github.com/meriyah/meriyah/commit/da156b42dad4f5ca4fcbd0d02411f7243ea61bd1)) + + + +# [6.1.0](https://github.com/meriyah/meriyah/compare/v6.0.6...v6.1.0) (2025-06-13) + + +### Bug Fixes + +* **parser:** `attributes` on `{ExportAll,ExportNamed,Import}Declaration` is now always an array ([#423](https://github.com/meriyah/meriyah/issues/423)) ([30ea976](https://github.com/meriyah/meriyah/commit/30ea9763596050690e342257e19bdc625a0c38c8)) +* **parser:** add missing `generator` property to `ArrowFunctionExpression` ([#424](https://github.com/meriyah/meriyah/issues/424)) ([2fe6b54](https://github.com/meriyah/meriyah/commit/2fe6b54bebe40835d15ac505a210d17cb11dc467)) +* **parser:** fix `bigint` property on `BigintLiteral` ([#422](https://github.com/meriyah/meriyah/issues/422)) ([ad1922d](https://github.com/meriyah/meriyah/commit/ad1922de74ad5f8f2ab63d5e1ee809cce6c0572b)) +* **parser:** fix location of `StaticBlock` ([#434](https://github.com/meriyah/meriyah/issues/434)) ([2b9e923](https://github.com/meriyah/meriyah/commit/2b9e92333088676424234a840ee51ef5f173d959)) +* preserve nested `ParenthesizedExpression` ([#432](https://github.com/meriyah/meriyah/issues/432)) ([ae6cae5](https://github.com/meriyah/meriyah/commit/ae6cae5b1bb049408c4bf87555ad3cecb2841f0c)) +* remove `ESTree` export ([#398](https://github.com/meriyah/meriyah/issues/398)) ([49a96ff](https://github.com/meriyah/meriyah/commit/49a96ffcceda07018c927b81b3025fa3c8ddb16d)) + + +### Features + +* add `module-sync` condition ([#384](https://github.com/meriyah/meriyah/issues/384)) ([dc4a23e](https://github.com/meriyah/meriyah/commit/dc4a23e5f77ca0294eef7da0dc7a70f3858dfc7d)) +* **parser:** move "Import Attributes" out of "next" option ([#430](https://github.com/meriyah/meriyah/issues/430)) ([c5a87fd](https://github.com/meriyah/meriyah/commit/c5a87fdb7987e37531bde77623f8865028db5958)) +* remove location information from `ParseError.description` ([#390](https://github.com/meriyah/meriyah/issues/390)) ([2729651](https://github.com/meriyah/meriyah/commit/2729651f8fd8a740cf3d76eab87a679a4394a5e7)) + + + +## [6.0.6](https://github.com/meriyah/meriyah/compare/v6.0.5...v6.0.6) (2025-04-04) + + +### Bug Fixes + +* **parser:** get/set/from/of are allowed as identifiers ([#377](https://github.com/meriyah/meriyah/issues/377)) ([3ef007f](https://github.com/meriyah/meriyah/commit/3ef007f5952d05a4f82be990282b2d52cfb962f4)) + + + +## [6.0.5](https://github.com/meriyah/meriyah/compare/v6.0.4...v6.0.5) (2025-01-10) + + +### Bug Fixes + +* **parser:** fix JSX attribute name parse ([#363](https://github.com/meriyah/meriyah/issues/363)) ([b113081](https://github.com/meriyah/meriyah/commit/b11308101b265c0f3db43e5ca1ec7bb541d7a2c6)) + + + +## [6.0.4](https://github.com/meriyah/meriyah/compare/v6.0.3...v6.0.4) (2025-01-03) + + +### Bug Fixes + +* **parser:** fix lexical analysis on export of async func ([#361](https://github.com/meriyah/meriyah/issues/361)) ([8ff271e](https://github.com/meriyah/meriyah/commit/8ff271eb0a9d36725a1274c4b39e2a351964fb8e)), closes [#360](https://github.com/meriyah/meriyah/issues/360) + + + +## [6.0.3](https://github.com/meriyah/meriyah/compare/v6.0.2...v6.0.3) (2024-10-28) + + +### Bug Fixes + +* **parser:** fix tagged template parsing when tag has param(s) ([b549ed3](https://github.com/meriyah/meriyah/commit/b549ed39696b694c3c0c2e9220452c3e28538915)), closes [#350](https://github.com/meriyah/meriyah/issues/350) + + + +## [6.0.2](https://github.com/meriyah/meriyah/compare/v6.0.1...v6.0.2) (2024-10-01) + + +### Bug Fixes + +* **parser:** all identifiers can be start of an expression ([7f800c5](https://github.com/meriyah/meriyah/commit/7f800c5fce86d71f80cb15d3a1ead5fc2d70e8ef)), closes [#342](https://github.com/meriyah/meriyah/issues/342) + + + +## [6.0.1](https://github.com/meriyah/meriyah/compare/v6.0.0...v6.0.1) (2024-09-16) + + +### Bug Fixes + +* **scanner:** proper EOF error for unterminated template ([cde6b2f](https://github.com/meriyah/meriyah/commit/cde6b2f7db3768c0fc254e65a68aa6debea62eab)) + + + +# [6.0.0](https://github.com/meriyah/meriyah/compare/v5.0.0...v6.0.0) (2024-09-16) + +### Bug Fixes + +- **lexer:** identifier starts with unicode-escape needs ID_Start check ([e1d5534](https://github.com/meriyah/meriyah/commit/e1d55340eb6b63e9e1e9eaf97f10c6bce9391833)) +- **lexer:** in non-strict mode, future reserved keyword can be used as identifier ([5764ad7](https://github.com/meriyah/meriyah/commit/5764ad7e0dd66a60ed735141c38174d4bb5ffef4)) +- **lexer:** no line break is allowed in regex literal ([773208b](https://github.com/meriyah/meriyah/commit/773208bc5d6ccdc47dd4a7af4c8b380c6f874ba9)) +- **lexer:** private identifier can start with escaped unicode ([85a39e7](https://github.com/meriyah/meriyah/commit/85a39e7f66a13118b0cb1f2d2edab5468b5f5e18)) +- **lexer:** unicode escaped "let" can not be let keyword ([406d72c](https://github.com/meriyah/meriyah/commit/406d72c4dff72eaee23fa068c90bcb65ebb23227)) +- **parser:** "arguments" is not allowed in class property initializer or static block ([c9857c6](https://github.com/meriyah/meriyah/commit/c9857c6f24f64a460cccbbc87249720ee0e8e30d)) +- **parser:** "use strict" directive could be after invalid string ([527ea97](https://github.com/meriyah/meriyah/commit/527ea9755512c3c9adc803799c5f0c00c4215679)), closes [#149](https://github.com/meriyah/meriyah/issues/149) +- **parser:** a newline may not precede the `*` token in a `yield` expression ([e0eeb89](https://github.com/meriyah/meriyah/commit/e0eeb894f78f133954e22d7c5fbede189c4320df)) +- **parser:** add missing import-attributes support in ExportNamedDeclaration ([f7864a6](https://github.com/meriyah/meriyah/commit/f7864a6de51987411063c38c749185fbe25ab78a)), closes [#289](https://github.com/meriyah/meriyah/issues/289) +- **parser:** async function should not skip duplication error ([94d41ae](https://github.com/meriyah/meriyah/commit/94d41aedc87237bb3bc3ed8a08e8e0ec8ff4ab88)), closes [#291](https://github.com/meriyah/meriyah/issues/291) +- **parser:** catch block without catch-binding should have lexical scope ([db7b3ae](https://github.com/meriyah/meriyah/commit/db7b3aefd8e524ec0de8a332ea5bc016a127c1a3)) +- **parser:** class is implicit strict mode, but decorator before class is not ([97f4927](https://github.com/meriyah/meriyah/commit/97f492783a4b78f5abb9645620f4b6611684fcd0)) +- **parser:** class static block disallows "await" as identifier ([4c7f2c3](https://github.com/meriyah/meriyah/commit/4c7f2c388a24f78b4f3b07ea02d08bbe8fbc25ea)) +- **parser:** class static block disallows "yield" as identifier ([1cb0d65](https://github.com/meriyah/meriyah/commit/1cb0d65a3e7c1f5276b83cf172df424407cb2d96)) +- **parser:** class static block has no return statement ([f2b73ee](https://github.com/meriyah/meriyah/commit/f2b73ee4b43b48d49452a5e4f067b58968085659)) +- **parser:** dot property name can be escaped reserved or future reserved ([eedce98](https://github.com/meriyah/meriyah/commit/eedce98913f6a8f8f16df60e73edc6ac231b2a28)) +- **parser:** escaped reserved keyword can be used as class element name ([b8e4b3c](https://github.com/meriyah/meriyah/commit/b8e4b3c231d5fc5b57aff1bd2b8a15e2af20b11c)) +- **parser:** fix an edge case of invalid escape in tagged template ([118fdae](https://github.com/meriyah/meriyah/commit/118fdae97ab0c5640b3ede9cdbc5dc2e0fe05070)) +- **parser:** fix annexB behavior (webcompat) of catch param ([359dcbe](https://github.com/meriyah/meriyah/commit/359dcbe34447a409cf87630188aafb3ce7729abf)) +- **parser:** fix destruct pattern check ([1e5e394](https://github.com/meriyah/meriyah/commit/1e5e3945b3de6e2eed9e700688442f4bf069268f)) +- **parser:** fix duplicated function params check ([d0aeda6](https://github.com/meriyah/meriyah/commit/d0aeda6586a67b0ad85d64bfc525762d812f7064)) +- **parser:** fix duplicated proto check in async() and async() => {} ([66ad497](https://github.com/meriyah/meriyah/commit/66ad4976ae485a6cb4fb880c9fb0fe5334365872)) +- **parser:** fix early error on escaped oct and \8 \9 ([33b68df](https://github.com/meriyah/meriyah/commit/33b68df6fbc0c60217c640d18dbb4f77f7b77e62)) +- **parser:** fix import.meta check, await check and await in static block ([b269996](https://github.com/meriyah/meriyah/commit/b269996c44acec0d2cd2060fe1a3745a1efa05c3)) +- **parser:** fix jsx parsing on '< / >' ([ad71155](https://github.com/meriyah/meriyah/commit/ad7115560f415248f99981da72cd31c9438c3b7d)), closes [#185](https://github.com/meriyah/meriyah/issues/185) +- **parser:** fix jsx with comments in tag ([a2e4767](https://github.com/meriyah/meriyah/commit/a2e4767d57ec2519e85197517975342f89b77ef6)), closes [#185](https://github.com/meriyah/meriyah/issues/185) +- **parser:** fix onToken callback for template and jsx ([407a2ca](https://github.com/meriyah/meriyah/commit/407a2ca5ba2a0d309a5bc0ba362d3ec37afbbaa4)), closes [#215](https://github.com/meriyah/meriyah/issues/215) [#216](https://github.com/meriyah/meriyah/issues/216) +- **parser:** fix scoped analysis for export binding and name ([22509b7](https://github.com/meriyah/meriyah/commit/22509b7384e625df5ebf9689544df984b4811ba7)) +- **parser:** fix simple params list and strict reserved check on func ([635a41b](https://github.com/meriyah/meriyah/commit/635a41b9054e84924e6778bf8c2d1d8a8e7d1f1a)), closes [#295](https://github.com/meriyah/meriyah/issues/295) [#296](https://github.com/meriyah/meriyah/issues/296) +- **parser:** fix unicode identifier value and check ([36a5ef6](https://github.com/meriyah/meriyah/commit/36a5ef66557e853efd1d63c36b313697903b0560)) +- **parser:** generator function should not skip duplication error ([d3c953b](https://github.com/meriyah/meriyah/commit/d3c953b2023d513333c8219a762aede08c454a87)) +- **parser:** in strict mode, escaped future reserved can be used as identifier but not destructible ([762f8c1](https://github.com/meriyah/meriyah/commit/762f8c1fa2282d36985eb068963f9db10533c040)) +- **parser:** iteration/switch cannot across class static block boundary ([c832eb6](https://github.com/meriyah/meriyah/commit/c832eb67e5d36edaced0e96d9f6ecb8ac3b6fe8a)) +- **parser:** new.target is allowed in class static block ([2cec2a9](https://github.com/meriyah/meriyah/commit/2cec2a94868e6e14b80636a542709183c7934463)) +- **parser:** object literal ({a b}) is invalid ([c069662](https://github.com/meriyah/meriyah/commit/c069662755085a0f85174898eacb299a631ea92f)), closes [#73](https://github.com/meriyah/meriyah/issues/73) +- **parser:** oct escape and \8 \9 are not allowed in template string if not tagged ([e12d75d](https://github.com/meriyah/meriyah/commit/e12d75d4845a76e08ac42a087d6142d1ffdbb23c)) +- **parser:** only class static non-private property cannot be named 'prototype' ([03ef7bc](https://github.com/meriyah/meriyah/commit/03ef7bce129d43d1b17d03bc08a606704f1747d6)) +- **parser:** partially fix duplicated proto check in parenthesis ([e998b9c](https://github.com/meriyah/meriyah/commit/e998b9c17933b0b178959cd83f336e81dbe491e9)) +- **parser:** private identifier should work in optional chaining ([f22f7ad](https://github.com/meriyah/meriyah/commit/f22f7ada24bc0755d9717fca4a9f5e95a31a3716)) +- **parser:** fix strict mode check for arrow function ([4ca184a](https://github.com/meriyah/meriyah/commit/4ca184a0e2ee369b959d2d514c9d614278dc7863)) +- **parser:** private identifier cannot be accessed on super ([15d679d](https://github.com/meriyah/meriyah/commit/15d679df1a44de770b42ab872808f79ea95457bd)) +- **scanner:** fix value for huge BigInt ([a09b497](https://github.com/meriyah/meriyah/commit/a09b497d4085bb491515ab50f450f92e4feb6014)) + +### chore + +- drop support of Nodejs < 18 ([829835e](https://github.com/meriyah/meriyah/commit/829835ece5f7cb0ae1e5dc2971405c42277db7f0)) +- reduce dist files to esm, cjs, and umd ([962af5f](https://github.com/meriyah/meriyah/commit/962af5f7c7fd1002668cd7c3c561ec2db5ca279f)) + +### Features + +- **lexer:** support regexp v flag (unicodeSets) ([1d9a1ee](https://github.com/meriyah/meriyah/commit/1d9a1ee3de5d1dd31525f74bc5a117af1924d620)) +- **parser:** expose start/end/range/loc:{start,end} to ParseError ([27691df](https://github.com/meriyah/meriyah/commit/27691dffbaeb09cf9e070d370838793195514f3d)), closes [#156](https://github.com/meriyah/meriyah/issues/156) +- **parser:** implement lexical analysis of private identifiers ([66217a1](https://github.com/meriyah/meriyah/commit/66217a1c44d6be91dd8391774c821a1cfee93afb)), closes [#322](https://github.com/meriyah/meriyah/issues/322) +- **parser:** support arbitrary module namespace names ([e43e93c](https://github.com/meriyah/meriyah/commit/e43e93c37c591e4315b53d4ed443d12adee1600f)), closes [#200](https://github.com/meriyah/meriyah/issues/200) [#214](https://github.com/meriyah/meriyah/issues/214) +- **parser:** support class auto-accessor through next option ([b0d1621](https://github.com/meriyah/meriyah/commit/b0d16211765d85fd8e32d771f20703eb99ef2561)), closes [#327](https://github.com/meriyah/meriyah/issues/327) +- remove option "directives" ([5d941e6](https://github.com/meriyah/meriyah/commit/5d941e6480115dabbb0358142bde7703f47980c1)) +- support unicode 16 ([0514c83](https://github.com/meriyah/meriyah/commit/0514c83e8bfed18ed13a07a5c8d201ac5bb6c181)) + +### BREAKING CHANGES + +- remove option "directives" as directives is in + ECMA spec, and ESTree spec. No point to make it an optional feature. +- **parser:** ParseError is changed from index,loc:{line,column} + to start,end,range:[start,end],loc:{start:{line,column},end:{line,column}} + just like what we have on AST node when options ranges and loc is + turned on. +- drop support of Nodejs < 18 +- only distribute following files: + dist/meriyah.cjs + dist/meriyah.mjs + dist/meriyah.min.mjs + dist/meriyah.umd.js + dist/meriyah.umd.min.js + All transpiled with target: "ES2021" + +# [5.0.0](https://github.com/meriyah/meriyah/compare/v4.5.0...v5.0.0) (2024-07-25) + +### Bug Fixes + +- **parser:** class property definition needs to be separated ([#276](https://github.com/meriyah/meriyah/issues/276)) ([fc252f4](https://github.com/meriyah/meriyah/commit/fc252f486a97811a0cc7857b0be33b9cb75d8016)), closes [#233](https://github.com/meriyah/meriyah/issues/233) + +### Features + +- **parser:** class public/private fields are in ecma spec now ([#278](https://github.com/meriyah/meriyah/issues/278)) ([332b738](https://github.com/meriyah/meriyah/commit/332b7386e8a92ceabac2681123ab26f645c57cbf)) +- **parser:** move hashbang out of "next" option ([e2f28fc](https://github.com/meriyah/meriyah/commit/e2f28fcb90a633f93279d19173ee49053f14cffe)) +- **parser:** support import attributes ([#280](https://github.com/meriyah/meriyah/issues/280)) ([77d3fdc](https://github.com/meriyah/meriyah/commit/77d3fdcb6dd5c0d108117525551e2295e68fb46d)) + +### BREAKING CHANGES + +- **parser:** hashbang now works without "next" option. + +# [4.5.0](https://github.com/meriyah/meriyah/compare/v4.4.4...v4.5.0) (2024-06-06) + +## [4.4.4](https://github.com/meriyah/meriyah/compare/v4.4.3...v4.4.4) (2024-06-06) + +### Bug Fixes + +- **parser:** reject "import from 'foo'" ([bee9e31](https://github.com/meriyah/meriyah/commit/bee9e312a752fcfa021bf491ced8c25481420fab)), closes [#258](https://github.com/meriyah/meriyah/issues/258) + +## [4.4.3](https://github.com/meriyah/meriyah/compare/v4.4.2...v4.4.3) (2024-05-23) + +## [4.4.2](https://github.com/meriyah/meriyah/compare/v4.4.1...v4.4.2) (2024-04-03) + +## [4.4.1](https://github.com/meriyah/meriyah/compare/v4.4.0...v4.4.1) (2024-03-31) + +### Bug Fixes + +- **parser:** fix `import.meta` in sequence ([15ea395](https://github.com/meriyah/meriyah/commit/15ea395a1dc59a253c99d57e4697c3a33147e3a8)) +- **parser:** fix async assignment in comma expression ([9652602](https://github.com/meriyah/meriyah/commit/9652602728cca827ebabcdcf3ed8f240ec125c7f)) +- **parser:** fix async assignment in sequence ([223936e](https://github.com/meriyah/meriyah/commit/223936ec62b3b4f008a351075f25c466ca89e9da)) + +# [4.4.0](https://github.com/meriyah/meriyah/compare/v4.3.9...v4.4.0) (2024-03-05) + +### Features + +- **parser:** add onInsertedSemicolon option ([557a893](https://github.com/meriyah/meriyah/commit/557a89301bab294f77d46e431b5c527d6b8c9011)) + +## [4.3.9](https://github.com/meriyah/meriyah/compare/v4.3.8...v4.3.9) (2023-11-24) + +## [4.3.8](https://github.com/meriyah/meriyah/compare/v4.3.7...v4.3.8) (2023-11-01) + +### Bug Fixes + +- **parser:** assignment as a value for property definition ([5f8f006](https://github.com/meriyah/meriyah/commit/5f8f0061feba7cc46911ef6abd55c7c0ab2bd792)) + +## [4.3.7](https://github.com/meriyah/meriyah/compare/v4.3.6...v4.3.7) (2023-05-12) + +### Bug Fixes + +- **parser:** nested class with constructor should not fail ([c0856b9](https://github.com/meriyah/meriyah/commit/c0856b974dde8c6c5a703186d2847257a64812e2)) + +## [4.3.6](https://github.com/meriyah/meriyah/compare/v4.3.5...v4.3.6) (2023-05-10) + +## [4.3.5](https://github.com/meriyah/meriyah/compare/v4.3.4...v4.3.5) (2023-03-13) + +## [4.3.4](https://github.com/meriyah/meriyah/compare/v4.3.3...v4.3.4) (2023-02-18) + +### Bug Fixes + +- **parser:** "static" can be used as an identifier in ClassElement ([663937a](https://github.com/meriyah/meriyah/commit/663937af80c00978c7aa0b0a5c8a61bf179608af)), closes [#231](https://github.com/meriyah/meriyah/issues/231) +- **parser:** fix loc info for JSXSpreadChild ([4a99416](https://github.com/meriyah/meriyah/commit/4a994161328dbcafb535eeadc01d81cc8600a1b0)), closes [#235](https://github.com/meriyah/meriyah/issues/235) + +## [4.3.3](https://github.com/meriyah/meriyah/compare/v4.3.2...v4.3.3) (2022-11-12) + +### Bug Fixes + +- **parser:** invalid generator setter should have correct error message ([193b3ef](https://github.com/meriyah/meriyah/commit/193b3efedea56c025f14afce7e34f28dc7080501)), closes [#228](https://github.com/meriyah/meriyah/issues/228) + +## [4.3.2](https://github.com/meriyah/meriyah/compare/v4.3.1...v4.3.2) (2022-10-01) + +### Bug Fixes + +- **parser:** ~ (0x7e) is valid stop for Identifier or Keyword ([d702ebd](https://github.com/meriyah/meriyah/commit/d702ebdb6d5020c9a4f8a0f987cb421e50ae136e)), closes [#226](https://github.com/meriyah/meriyah/issues/226) + +## [4.3.1](https://github.com/meriyah/meriyah/compare/v4.3.0...v4.3.1) (2022-09-11) + +### Bug Fixes + +- async is not reserved word, and some fix on reserved words ([427233e](https://github.com/meriyah/meriyah/commit/427233eef1122ac0dcdeffbc238e933eba6ada04)), closes [#221](https://github.com/meriyah/meriyah/issues/221) +- dot property should allow escaped keyword in strict mode ([efaa535](https://github.com/meriyah/meriyah/commit/efaa535b8520ecd9be73253518b575413fcabe2a)), closes [#224](https://github.com/meriyah/meriyah/issues/224) + +# [4.3.0](https://github.com/meriyah/meriyah/compare/v4.2.1...v4.3.0) (2022-08-02) + +### Bug Fixes + +- **parser:** Support for class static initialization block without next flag ([a3b10f0](https://github.com/meriyah/meriyah/commit/a3b10f01651cb1f02e703fde0ef2fac1a3222d65)) +- **parser:** support top level for-await in module context ([69761bf](https://github.com/meriyah/meriyah/commit/69761bf60d30524e7d95251d4219ed8166d97577)), closes [#214](https://github.com/meriyah/meriyah/issues/214) +- use null as regex value in environment missing flag "d" support ([b174ae6](https://github.com/meriyah/meriyah/commit/b174ae69cc45ce1d925c86f6c8eab8cce58057b8)) + +### Features + +- **lexer:** support new RegExp Indices flag "d" ([#217](https://github.com/meriyah/meriyah/issues/217)) ([b98e3bd](https://github.com/meriyah/meriyah/commit/b98e3bd79f7c13bef436976c37b04e128b40cec5)), closes [#214](https://github.com/meriyah/meriyah/issues/214) +- **parser:** Add support for class static initialization block ([1510e36](https://github.com/meriyah/meriyah/commit/1510e36b28e58317be93e59b7caed35985320c68)) + +## [4.2.1](https://github.com/meriyah/meriyah/compare/v4.2.0...v4.2.1) (2022-03-31) + +### Bug Fixes + +- **lexer:** fix wrong error when using regex flag s together with m or y ([d757c6b](https://github.com/meriyah/meriyah/commit/d757c6b20ae4f6f4e55a77179726db36cf2bd50b)), closes [#202](https://github.com/meriyah/meriyah/issues/202) +- **parser:** allow regular expression in JSXExpressionContainer ([a5fcb80](https://github.com/meriyah/meriyah/commit/a5fcb8072084f2961e11e9db24f7b8ac0ecd04a6)), closes [#204](https://github.com/meriyah/meriyah/issues/204) +- **parser:** allow top level await in expressions ([37c6361](https://github.com/meriyah/meriyah/commit/37c63613771e5bc6e23b7da2d92e992c60dafc5a)), closes [#212](https://github.com/meriyah/meriyah/issues/212) +- **parser:** fix wrong starting loc for any non-trivial expression in return statement ([7063af5](https://github.com/meriyah/meriyah/commit/7063af55b2c5d6d370fdf6480b87b70387c707fe)), closes [#207](https://github.com/meriyah/meriyah/issues/207) +- **parser:** super call should be allowed in private method ([6de707a](https://github.com/meriyah/meriyah/commit/6de707a0efb3053767deaa36b1ed6979b0d3f873)), closes [#203](https://github.com/meriyah/meriyah/issues/203) + +# [4.2.0](https://github.com/meriyah/meriyah/compare/v4.1.5...v4.2.0) (2021-07-11) + +### Bug Fixes + +- **parser:** keep InGlobal flag in parenthesized ([023ee0e](https://github.com/meriyah/meriyah/commit/023ee0e36fc28e75d0448739b8343ec801ac887f)) +- **parser:** rejects "await 2\*\*2" ([9a75bf6](https://github.com/meriyah/meriyah/commit/9a75bf67c9a6d22d28accc782665ed614a5a66c1)), closes [#187](https://github.com/meriyah/meriyah/issues/187) + +### Features + +- **parser:** support top-level await ([7b2a5bd](https://github.com/meriyah/meriyah/commit/7b2a5bd5832cfa4c98dac4219f22901c6eb28196)), closes [#186](https://github.com/meriyah/meriyah/issues/186) + +## [4.1.5](https://github.com/meriyah/meriyah/compare/v4.1.4...v4.1.5) (2021-03-05) + +### Bug Fixes + +- **parser:** fix missing rejection on function name ([3327326](https://github.com/meriyah/meriyah/commit/332732676e4a55d8d1c3269d9354a8ed02facd68)), closes [#182](https://github.com/meriyah/meriyah/issues/182) + +## [4.1.4](https://github.com/meriyah/meriyah/compare/v4.1.3...v4.1.4) (2021-02-28) + +## [4.1.3](https://github.com/meriyah/meriyah/compare/v4.1.2...v4.1.3) (2021-02-28) + +## [4.1.2](https://github.com/meriyah/meriyah/compare/v4.1.1...v4.1.2) (2021-02-10) + +## [4.1.1](https://github.com/meriyah/meriyah/compare/v4.1.0...v4.1.1) (2021-02-09) + +### Bug Fixes + +- avoid rollup typescript cache ([d6462be](https://github.com/meriyah/meriyah/commit/d6462be14519dae16f1543918fe752d4bca9514d)), closes [#176](https://github.com/meriyah/meriyah/issues/176) + +# [4.1.0](https://github.com/meriyah/meriyah/compare/v4.0.0...v4.1.0) (2021-02-07) + +### Bug Fixes + +- **jsx:** decode html entities for JSXText value ([f8121f0](https://github.com/meriyah/meriyah/commit/f8121f04dbb000fc74b664496f7cf22d72477e1c)), closes [#133](https://github.com/meriyah/meriyah/issues/133) +- **parser:** fix wrong loc for BinaryExpression ([ab1ab37](https://github.com/meriyah/meriyah/commit/ab1ab37f36c449d7a1247debdd4457f94c62bf1f)), closes [#169](https://github.com/meriyah/meriyah/issues/169) +- **parser:** fix wrong loc for TemplateLiteral ([a893c16](https://github.com/meriyah/meriyah/commit/a893c1664fdc0b403aa8cb482f9443d9d97c7e1d)), closes [#167](https://github.com/meriyah/meriyah/issues/167) + +### Features + +- add support of logical assignment ||=, &&=, and ??= ([2a5f12e](https://github.com/meriyah/meriyah/commit/2a5f12e2566f23ad280077c15dee16ca79e0d9ad)), closes [#168](https://github.com/meriyah/meriyah/issues/168) + +# [4.0.0](https://github.com/meriyah/meriyah/compare/v3.1.6...v4.0.0) (2021-01-14) + +### Bug Fixes + +- **estree:** rename FieldDefinition -> PropertyDefinition, PrivateName -> PrivateIdentifier ([2a588e5](https://github.com/meriyah/meriyah/commit/2a588e5b420da50c81d0feccc82ce8adc9ca165a)), closes [#134](https://github.com/meriyah/meriyah/issues/134) +- **parser:** fixed 'async' as 'IsExpressionStart' ([5b7a592](https://github.com/meriyah/meriyah/commit/5b7a5929169bab10bf4dc31d64f2905414004964)) +- **parser:** fixed issue with 'yield expr' ([5cd7c1d](https://github.com/meriyah/meriyah/commit/5cd7c1d7743dc6d19c323727eb758cadcd3040e0)) + +### chore + +- update deps, add previous missing breaking change note ([286863e](https://github.com/meriyah/meriyah/commit/286863ec5ec212958c39a2c790095cec70315068)) + +### BREAKING CHANGES + +- updated estree node names: FieldDefinition -> PropertyDefinition, PrivateName -> PrivateIdentifier + +## [3.1.6](https://github.com/meriyah/meriyah/compare/v3.1.5...v3.1.6) (2020-11-07) + +### Bug Fixes + +- bypass type def of package.json ([d267336](https://github.com/meriyah/meriyah/commit/d2673360724a541f5789cd003aa952be75dda9a0)), closes [#155](https://github.com/meriyah/meriyah/issues/155) + +## [3.1.5](https://github.com/meriyah/meriyah/compare/v3.1.4...v3.1.5) (2020-11-05) + +### Bug Fixes + +- fix wrong CommentType type definition ([641b6ee](https://github.com/meriyah/meriyah/commit/641b6ee0d2028775b5473af4962c0b7e215e3683)) + +## [3.1.4](https://github.com/meriyah/meriyah/compare/v3.1.3...v3.1.4) (2020-11-05) + +### Bug Fixes + +- fix wrong typescript def file location ([1ffac6e](https://github.com/meriyah/meriyah/commit/1ffac6e7dd475d696de6b726701a41cffc362f72)), closes [#153](https://github.com/meriyah/meriyah/issues/153) + +## [3.1.3](https://github.com/meriyah/meriyah/compare/v3.1.2...v3.1.3) (2020-11-04) + +### Bug Fixes + +- fix wrong ParenthesizedExpression location ([db468c2](https://github.com/meriyah/meriyah/commit/db468c2c6a176afd44935ef94042fb8330dd600c)), closes [#152](https://github.com/meriyah/meriyah/issues/152) + +## [3.1.2](https://github.com/meriyah/meriyah/compare/v3.1.1...v3.1.2) (2020-10-30) + +### Bug Fixes + +- **lexer:** fix line continuation with \r\n ([1423e81](https://github.com/meriyah/meriyah/commit/1423e8100075b66fa80624a9389aaaa12b809836)), closes [#146](https://github.com/meriyah/meriyah/issues/146) + +## [3.1.1](https://github.com/meriyah/meriyah/compare/v3.1.0...v3.1.1) (2020-10-29) + +### Bug Fixes + +- **lexer:** \8 \9 are acceptable in web compatibility mode ([26a19a8](https://github.com/meriyah/meriyah/commit/26a19a86ce36df373c7ed3d3390a2d61570c06a6)), closes [#137](https://github.com/meriyah/meriyah/issues/137) +- bigint is a number literal ([2ad1a27](https://github.com/meriyah/meriyah/commit/2ad1a27c17161b78dc5883950b0b33088e00349a)), closes [#136](https://github.com/meriyah/meriyah/issues/136) +- fix ending loc of empty comment ([d62d0b8](https://github.com/meriyah/meriyah/commit/d62d0b8c158c819749840ed1756c35d90b00e670)), closes [#126](https://github.com/meriyah/meriyah/issues/126) +- fix infinite loop on broken class body ([22eb9f8](https://github.com/meriyah/meriyah/commit/22eb9f8ba4baed88e25f102e2642b79b95dc127a)), closes [#143](https://github.com/meriyah/meriyah/issues/143) +- fix range of ExportDeclaration/ClassDeclaration/ClassExpression after decorators ([81b07fb](https://github.com/meriyah/meriyah/commit/81b07fb92b70319033b44bd4b14c8470adebd4eb)), closes [#124](https://github.com/meriyah/meriyah/issues/124) +- fix wrongly captured directive with two literal expression statements ([9504b6a](https://github.com/meriyah/meriyah/commit/9504b6a0ab5c0ca340b328190bbfa113afd22ce9)), closes [#130](https://github.com/meriyah/meriyah/issues/130) +- **jsx:** fix JSXIdentifier literal value range and loc ([076e454](https://github.com/meriyah/meriyah/commit/076e454c231e788c0ff2778395924551747b4b71)), closes [#127](https://github.com/meriyah/meriyah/issues/127) +- **jsx:** fix missing raw for JSXAttribute.value ([bbd8b8a](https://github.com/meriyah/meriyah/commit/bbd8b8a2541e470b5799dbc78496e865df3b3382)), closes [#128](https://github.com/meriyah/meriyah/issues/128) +- **jsx:** fix wrong range and loc on JSXEmptyExpression ([11765ce](https://github.com/meriyah/meriyah/commit/11765ce5848efc689e3de5077766199cd4996146)), closes [#125](https://github.com/meriyah/meriyah/issues/125) +- **jsx:** JSXText node should have raw ([5ea7bda](https://github.com/meriyah/meriyah/commit/5ea7bdae48efc6afd843206cadb368b48375b5b7)), closes [#129](https://github.com/meriyah/meriyah/issues/129) + +# [3.1.0](https://github.com/meriyah/meriyah/compare/v3.0.5...v3.1.0) (2020-10-27) + +### Bug Fixes + +- fix loc on hashbang comment ([f139dce](https://github.com/meriyah/meriyah/commit/f139dcec6b78690e39d6bc4a446a2a231850bebc)) +- fix range on HTMLClose comment on first line ([c445b90](https://github.com/meriyah/meriyah/commit/c445b90fa0f3c8373bfc4837c7d4b8473b1c80aa)) +- fix wrong loc in template expressions ([aa0e992](https://github.com/meriyah/meriyah/commit/aa0e9924016065800af6b2b52fabeeef634a13c0)), closes [#123](https://github.com/meriyah/meriyah/issues/123) +- properly support loc on HTMLClose comment ([f72dd4f](https://github.com/meriyah/meriyah/commit/f72dd4fdd9a581f5db866682a88475beb4cbd8b0)) + +### Features + +- support loc flag for onComment and onToken ([287b77c](https://github.com/meriyah/meriyah/commit/287b77cd155e3c44d25b694bf47600883e5a0dca)), closes [#95](https://github.com/meriyah/meriyah/issues/95) + +### Performance Improvements + +- **lexer:** improved lexer perf ([bc5e647](https://github.com/meriyah/meriyah/commit/bc5e6473312d2acee991b62a35be37fb24a1e533)) + +## [3.0.5](https://github.com/meriyah/meriyah/compare/v3.0.4...v3.0.5) (2020-10-25) + +### Bug Fixes + +- move optional-chaining out of next ([7504c64](https://github.com/meriyah/meriyah/commit/7504c646e3d9960aed9fd0949110cb8cb65b7b05)), closes [#117](https://github.com/meriyah/meriyah/issues/117) + +## [3.0.4](https://github.com/meriyah/meriyah/compare/v3.0.3...v3.0.4) (2020-10-25) + +### Bug Fixes + +- follow latest decorator proposal ([e27b9d6](https://github.com/meriyah/meriyah/commit/e27b9d6278f572d1e50ebb9804a060d1f5f1990f)), closes [#105](https://github.com/meriyah/meriyah/issues/105) +- ForInOfLoopInitializer only applies in strict mode ([5f6f0d8](https://github.com/meriyah/meriyah/commit/5f6f0d874c8dff69aae5e2cbc8396b18833df085)), closes [#116](https://github.com/meriyah/meriyah/issues/116) +- support decorator before and after "export" keyword ([f3898ff](https://github.com/meriyah/meriyah/commit/f3898fffad601f70148ce147bb0b7710641d2814)) + +## [3.0.3](https://github.com/meriyah/meriyah/compare/v3.0.2...v3.0.3) (2020-10-16) + +### Bug Fixes + +- add missing optional flag on CallExpression ([903c7f5](https://github.com/meriyah/meriyah/commit/903c7f5d8c296a2517d695a1948d52e7b5115238)), closes [#110](https://github.com/meriyah/meriyah/issues/110) +- auto insert semicolon for do-while statement ([faa96bb](https://github.com/meriyah/meriyah/commit/faa96bb299f10bddfb05177ed89b94087eb4e71e)), closes [#102](https://github.com/meriyah/meriyah/issues/102) +- bigint property should exclude the ending 'n' ([e7ed3df](https://github.com/meriyah/meriyah/commit/e7ed3df61d20d185ee7afd955c019354959da10f)), closes [#111](https://github.com/meriyah/meriyah/issues/111) +- export version directly from package.json ([46a7d69](https://github.com/meriyah/meriyah/commit/46a7d6932ad83c431500a67bd967150920ab50af)), closes [#107](https://github.com/meriyah/meriyah/issues/107) +- fix [] and () inside the ChainExpression ([fa72f93](https://github.com/meriyah/meriyah/commit/fa72f933e1ca444a67b5640ab9d40b96b3102c29)) +- fix finally block start, follow other parsers on comment start and end ([fe00a67](https://github.com/meriyah/meriyah/commit/fe00a67ad192ec7d7b81088b3caabca1cef44ebf)), closes [#104](https://github.com/meriyah/meriyah/issues/104) +- fix missing static for computed class property ([bd00159](https://github.com/meriyah/meriyah/commit/bd00159c8f22875937237d2a0f5f7cba09b0150f)), closes [#106](https://github.com/meriyah/meriyah/issues/106) +- fix TemplateElement range and loc ([2a3632c](https://github.com/meriyah/meriyah/commit/2a3632cc2012067b897ffd7776c0bdaa904d20e9)) +- fix wrong cooked value in TemplateElement, fix wrong loc and range in various template nodes ([ff71744](https://github.com/meriyah/meriyah/commit/ff71744d5b20b87c3bfbba6534656d3768215207)), closes [#109](https://github.com/meriyah/meriyah/issues/109) [#108](https://github.com/meriyah/meriyah/issues/108) + +## [3.0.2](https://github.com/meriyah/meriyah/compare/v3.0.0...v3.0.2) (2020-10-06) + +### Bug Fixes + +- **parser:** directive is only for statement consisting entirely of a string literal ([8186dc1](https://github.com/meriyah/meriyah/commit/8186dc122d9cc4f7df9ebf95fbb3206b5df42dc0)), closes [#99](https://github.com/meriyah/meriyah/issues/99) +- **parser:** follow latest estree spec on ExportAllDeclaration ([7a7fc76](https://github.com/meriyah/meriyah/commit/7a7fc76f2b59faf0b5db069094a3b2584bbbe77a)), closes [#97](https://github.com/meriyah/meriyah/issues/97) +- fix wrong ChainExpression wrapper ([a33771c](https://github.com/meriyah/meriyah/commit/a33771c308a47d37deb8c9c452b4cbb896b52379)), closes [#98](https://github.com/meriyah/meriyah/issues/98) + +## [3.0.1](https://github.com/meriyah/meriyah/compare/v3.0.0...v3.0.1) (2020-10-06) + +### Bug Fixes + +- **parser:** directive is only for statement consisting entirely of a string literal ([8186dc1](https://github.com/meriyah/meriyah/commit/8186dc122d9cc4f7df9ebf95fbb3206b5df42dc0)), closes [#99](https://github.com/meriyah/meriyah/issues/99) +- **parser:** follow latest estree spec on ExportAllDeclaration ([7a7fc76](https://github.com/meriyah/meriyah/commit/7a7fc76f2b59faf0b5db069094a3b2584bbbe77a)), closes [#97](https://github.com/meriyah/meriyah/issues/97) +- fix wrong ChainExpression wrapper ([a33771c](https://github.com/meriyah/meriyah/commit/a33771c308a47d37deb8c9c452b4cbb896b52379)), closes [#98](https://github.com/meriyah/meriyah/issues/98) + +# [3.0.0](https://github.com/meriyah/meriyah/compare/v2.1.2...v3.0.0) (2020-09-21) + +## [2.1.2](https://github.com/meriyah/meriyah/compare/v2.1.1...v2.1.2) (2020-09-21) + +### Bug Fixes + +- **estree:** fix the estree interface for BigIntLiteral, cleanup RegExpLiteral ([100c9ad](https://github.com/meriyah/meriyah/commit/100c9ad2b1c10d44f547b87d78626de09faaa2c4)) +- **lexer:** store correct bigint token value ([964e678](https://github.com/meriyah/meriyah/commit/964e678dea3676931409cfb3aec7bb1edd4a94c6)), closes [#93](https://github.com/meriyah/meriyah/issues/93) + +### BREAKING CHANGES + +- **lexer:** upgraded ts target from es2018 to es2020, dropped nodejs v6 and v8 support + +## [2.1.1](https://github.com/meriyah/meriyah/compare/v1.9.6...v2.1.1) (2020-07-24) + +### Bug Fixes + +- **lexer:** fix missed new line char in jsx parser ([f8be7de](https://github.com/meriyah/meriyah/commit/f8be7de10efc1b3235f4d45e6783635ae064398d)), closes [#90](https://github.com/meriyah/meriyah/issues/90) +- **parser:** fix endless loop on broken jsx ([9ee78ac](https://github.com/meriyah/meriyah/commit/9ee78ac84d9c58cb00def0fb32c2ae0f922291d7)), closes [#91](https://github.com/meriyah/meriyah/issues/91) +- rename CoalesceExpression ([2256168](https://github.com/meriyah/meriyah/commit/2256168c1bbe53b6c618764516e721c765eeb79f)) +- **lexer:** fix regexp char class \u{hhhh} which requires the u flag ([1fdffb6](https://github.com/meriyah/meriyah/commit/1fdffb6b17935916e058166b2ac6dee522f24b85)), closes [#79](https://github.com/meriyah/meriyah/issues/79) +- **parser:** fixes [#70](https://github.com/meriyah/meriyah/issues/70) ([2ded017](https://github.com/meriyah/meriyah/commit/2ded017436183eb29dd8e58d1d496c84a00b6853)) +- **scan:** token start should skip leading white spaces and comments ([64eea11](https://github.com/meriyah/meriyah/commit/64eea116bd197a5ebb34dfeab2100d1425a08857)), closes [#81](https://github.com/meriyah/meriyah/issues/81) + +### Features + +- **all:** added Unicode v.13 support ([550f86f](https://github.com/meriyah/meriyah/commit/550f86fefbb6412b95f2f57dd5c598706291a060)) +- **parser:** add .range: [start, end] to improve compatibility with ESTree tools ([f60ae26](https://github.com/meriyah/meriyah/commit/f60ae26e8d7d999fcb13ac60cf1e16d8ae97f3df)) +- **parser:** support latest ESTree spec on optional chaining ([055eb1c](https://github.com/meriyah/meriyah/commit/055eb1c180c4922b5971c32e9e8e1fc079ef7c33)) + +## [1.9.6](https://github.com/meriyah/meriyah/compare/ade6e8f757beb2220783e7ab3bc6615d90bcdc91...v1.9.6) (2020-01-19) + +### Bug Fixes + +- **all:** fixed issue with TS bundle 'const enum'. Values out of order and tokens got wrong values ([4ed317c](https://github.com/meriyah/meriyah/commit/4ed317cdeb4ee649e818c30212e448f331fc6596)) +- **all:** Improved ESTree compat ([4192641](https://github.com/meriyah/meriyah/commit/4192641c1ad45c4989965a6ee9ca81d92c6891ca)) +- **all:** used logical names to avoid confusions ([6f25b7b](https://github.com/meriyah/meriyah/commit/6f25b7b4fde7d35cb3ec84935dc8e8bbb6fbb815)) +- **chore:** improved line and column tracking - [#46](https://github.com/meriyah/meriyah/issues/46) ([dc2f3be](https://github.com/meriyah/meriyah/commit/dc2f3bef49a32f5a3215522220f2b33f713eb6c3)) +- **lexer:** dedupe some code ([bc86b42](https://github.com/meriyah/meriyah/commit/bc86b422f3baa1e5e5cb83f2832eebf19f41a7c9)) +- **lexer:** fixed a optional chaining token bug introduced earlier ([79e8fa3](https://github.com/meriyah/meriyah/commit/79e8fa31c04458ad796653064cd17e9449c875c4)) +- **lexer:** fixed CRLF issues - [#46](https://github.com/meriyah/meriyah/issues/46) ([43bc755](https://github.com/meriyah/meriyah/commit/43bc7551af1d3b93453ae592c87b113e52f4252d)) +- **lexer:** fixed incorrect error messages ([1934295](https://github.com/meriyah/meriyah/commit/1934295c947ee70d857b56773d310428d485f257)) +- **lexer:** fixed issue with PS and LS between tokens ([3dd08b3](https://github.com/meriyah/meriyah/commit/3dd08b3ed6eb17247b90d021b8e38cee679dd249)) +- **lexer:** fixed issue with raw in numeric scanning ([db21faf](https://github.com/meriyah/meriyah/commit/db21faf09ca54a3766666fc5dfc9b65d519ca8a3)) +- **lexer:** fixed JSX issue break bundled build only and in the REPL ([32f347f](https://github.com/meriyah/meriyah/commit/32f347f5399e37e2ff5d7a009a76acede4145965)) +- **lexer:** fixed JSX issue in lexer. Caused only the bundled build to break on JSX parsing. ([0bc45af](https://github.com/meriyah/meriyah/commit/0bc45af2e562c1eebede23bf125ecad41c80a914)) +- **lexer:** fixed loc tracking for jsx and optimized jsx scanning ([708a1a6](https://github.com/meriyah/meriyah/commit/708a1a63374a4fdbbf422028d66b8e35f26a1247)) +- **lexer:** fixed potential issue with BOM ([b380d62](https://github.com/meriyah/meriyah/commit/b380d6275293045808ca62951b3a5334b8536e31)) +- **lexer:** fixed WS skipping issue ([bf27362](https://github.com/meriyah/meriyah/commit/bf27362f06f15031aaa148f25643a60a941cdbf1)) +- **lexer:** fixed ZWJ issue in identifierPart validation ([3708214](https://github.com/meriyah/meriyah/commit/3708214121e8de4d74560755ed2b6fa673755f70)) +- **lexer:** improved identifier scanning ([bb65cd7](https://github.com/meriyah/meriyah/commit/bb65cd744415ed41fe690cb4cd6f298f5049a8f5)) +- **lexer:** improved identifier scanning performance ([29c1d3d](https://github.com/meriyah/meriyah/commit/29c1d3d993f9e345bf42ea9528464643f5dfa592)) +- **lexer:** improved identifier scanning performance ([15131d4](https://github.com/meriyah/meriyah/commit/15131d4738d293a72ee542d924531f67518236a1)) +- **lexer:** improved line counting ([c29be84](https://github.com/meriyah/meriyah/commit/c29be847f393d05fcc0bdcb322a5e4507da5d002)) +- **lexer:** improved punctuator scanning ([ddef09f](https://github.com/meriyah/meriyah/commit/ddef09f4ca1cc54c6fe431a93ad839b3b533d78b)) +- **lexer:** improved scanner performance ([c637ee5](https://github.com/meriyah/meriyah/commit/c637ee5ca277c5347690d4ba94ce919a969aaebd)) +- **lexer:** improved single line comment scanning ([9370535](https://github.com/meriyah/meriyah/commit/937053511de83f296befc510ca6ebc481a13ffcb)) +- **lexer:** improved template literal scanning ([68175f6](https://github.com/meriyah/meriyah/commit/68175f6114e2fd9eab099dfaba05c49505f2fdfc)) +- **lexer:** improved template scanning ([a2af86f](https://github.com/meriyah/meriyah/commit/a2af86ff88028fc3b6c3a22d9e0f8f53bd12150d)) +- **lexer:** improved unicode escape scanning ([61c471b](https://github.com/meriyah/meriyah/commit/61c471b53a12fb6c460fe961d4f37b925592ce86)) +- **lexer:** minor optimization tweaks ([20a118c](https://github.com/meriyah/meriyah/commit/20a118c67db5bbd179d9a328d47a268e40b50f6a)) +- **lexer:** optimized number scanning ([0a09e9e](https://github.com/meriyah/meriyah/commit/0a09e9ed7be4891b6cfa2c4e004cbc15eb7be399)) +- **lexer:** optimized WS skipping and comment scanning ([9f85539](https://github.com/meriyah/meriyah/commit/9f855395e9691c03cbeff3ea9d9c17a3f104d37b)) +- **lexer:** performance tweaks ([01557c8](https://github.com/meriyah/meriyah/commit/01557c8d1784fad68971fd52916927efee603e10)) +- **lexer:** performance tweaks ([109fdbb](https://github.com/meriyah/meriyah/commit/109fdbbd3a77e85392f49f9d68b699ebb25a0fb7)) +- **lexer:** simplified a few things in the lexer ([8415be7](https://github.com/meriyah/meriyah/commit/8415be7b7b8772e8d780a3e71d2a3aa67be95bb5)) +- **lexer:** simplified SMP scanning ([58f4a30](https://github.com/meriyah/meriyah/commit/58f4a30c3228e49c310c4abf398ea1c3c033e1b1)) +- **lexer:** tweaked ident scanning ([a205210](https://github.com/meriyah/meriyah/commit/a205210e66dcf2122b5a454979e398d2f9b8acf6)) +- **lexer:** tweaked number scanning ([e2d78cc](https://github.com/meriyah/meriyah/commit/e2d78ccb6df9cc5a5647cfedb1ef603729e361e0)) +- **lexer:** tweaked numeric separators implementation ([4cfcb28](https://github.com/meriyah/meriyah/commit/4cfcb28fb71a062d91a76e700374006780ee578f)) +- **lexer:** use direct lookup and avoid bitmasks for idStart & idContinue ([901bfb0](https://github.com/meriyah/meriyah/commit/901bfb083282304047fdfc72617a9bad6d5d74e3)) +- **parser:** fixed useless context definition, since its value is never read ([7eec823](https://github.com/meriyah/meriyah/commit/7eec823cdc54a2912202bcbcd52048f5d5aee8e4)) +- **parser:** swapped names on bitmasks for destruct and assign ([f3eb024](https://github.com/meriyah/meriyah/commit/f3eb02455c9ad8d0a62fbde052cd5b103b7f046f)) +- **parser:** added 'onComment' types ([3ce01f3](https://github.com/meriyah/meriyah/commit/3ce01f3a8704dc12301a1d790bd53a1a11aae23d)) +- **parser:** Adds error loc object to be Acorn compat. fixes [#43](https://github.com/meriyah/meriyah/issues/43) . ([a474cd7](https://github.com/meriyah/meriyah/commit/a474cd7cf69c5098c8c4685b23fa8e84cde58656)) +- **parser:** adjusted loc and ranges for JSX AST nodes ([7073fdd](https://github.com/meriyah/meriyah/commit/7073fddeafdb3d75845ffc9e7391d149b5225915)) +- **parser:** avoid 'push' in module parsing (performance) ([e99a8a8](https://github.com/meriyah/meriyah/commit/e99a8a8997ceea08aadc14dae78a228c616242bf)) +- **parser:** avoid reinterpretation to pattern if not needed ([671dc57](https://github.com/meriyah/meriyah/commit/671dc573cf5046fdf828bb955770561e380f2e16)) +- **parser:** avoid setting 'PropertyKind' if a field definition ([9498c55](https://github.com/meriyah/meriyah/commit/9498c5524d96179973e0d407273a4b0befbda04c)) +- **parser:** changed name on options to be Acorn compat ([43b0029](https://github.com/meriyah/meriyah/commit/43b00299bdd7bd14c2f42adfb74daf6e597cd5db)) +- **parser:** Context based escape keyword validation ([17d4649](https://github.com/meriyah/meriyah/commit/17d46497c7b75aa3d56009ecfb4df777430ab7b9)) +- **parser:** dedupe class field parsing ([4c61090](https://github.com/meriyah/meriyah/commit/4c610901cc7777cc7c3136b39d228c2aa71c1880)) +- **parser:** dedupe even more logic for perf reasons ([6af320c](https://github.com/meriyah/meriyah/commit/6af320c810c31af5ce8ba911d51469116097b737)) +- **parser:** dedupe some code ([21e4449](https://github.com/meriyah/meriyah/commit/21e4449cd70fec6c2d3c8e01af37f528dd4b771c)) +- **parser:** dedupe some code ([ca79f80](https://github.com/meriyah/meriyah/commit/ca79f80f8329f04a45dbbacf4a027aaa937d56f1)) +- **parser:** dedupe some code ([c41a671](https://github.com/meriyah/meriyah/commit/c41a671a8e03e6b84293f0eba16247feebaceb27)) +- **parser:** dedupe some code ([0a53f77](https://github.com/meriyah/meriyah/commit/0a53f77446eeeaa70e77f5ddfc02690ccc1817ec)) +- **parser:** dedupe some code ([91e0233](https://github.com/meriyah/meriyah/commit/91e023390a0a57170a62796d2a04368bc9216ad2)) +- **parser:** dedupe some code ([42f1afa](https://github.com/meriyah/meriyah/commit/42f1afa1f171aa19394734eeb5dc438151c7ab0a)) +- **parser:** dedupe some code ([16c95b1](https://github.com/meriyah/meriyah/commit/16c95b1111cd33115b2ef7fa8d5bc66a5e2aa183)) +- **parser:** dedupe some code ([82d9407](https://github.com/meriyah/meriyah/commit/82d9407882593a4af6eff13733128fc39ec255fc)) +- **parser:** dedupe some code ([3c1409a](https://github.com/meriyah/meriyah/commit/3c1409ad224ccb3092ebb33959800e79f388fc9c)) +- **parser:** dedupe some code ([5265848](https://github.com/meriyah/meriyah/commit/52658489e1896c07e97dae936e33c123400d1f67)) +- **parser:** dedupe some code ([51fcd14](https://github.com/meriyah/meriyah/commit/51fcd143baef72619074377bbc492cf97861c6e4)) +- **parser:** dedupe some code ([0858e3b](https://github.com/meriyah/meriyah/commit/0858e3bcdc2ae766b4e4c2b6f1f2a73605ce5f97)) +- **parser:** dedupe some code and improved performance ([b972e90](https://github.com/meriyah/meriyah/commit/b972e90bd19b11dd695af6ef7c8f273f3677e0d8)) +- **parser:** dedupe some logic ([de7d970](https://github.com/meriyah/meriyah/commit/de7d9706aeabf50327cabc756aab944058efd67f)) +- **parser:** dedupe some logic for perf reasons ([fd7f2d8](https://github.com/meriyah/meriyah/commit/fd7f2d8bdb73161f78b167dc32b38f59c9b3b9d6)) +- **parser:** Dedupe some logic to reduce branching ([a69476c](https://github.com/meriyah/meriyah/commit/a69476ca2003b7b771160b0ff6e01cd6df5a9bb3)) +- **parser:** export Options & ESTree TS types ([9e8ff6c](https://github.com/meriyah/meriyah/commit/9e8ff6c83731a5958d6e89ec6132db43da38a85d)) +- **parser:** Fix a bunch of edge cases ([96126e4](https://github.com/meriyah/meriyah/commit/96126e492b1b714edd2d08f3d4b788b14415bf12)) +- **parser:** Fix a bunch of edge cases ([edfe03c](https://github.com/meriyah/meriyah/commit/edfe03c891d3442b8368fd64567a7345c72e18f3)) +- **parser:** fixed **proto** edge cases ([91cdefd](https://github.com/meriyah/meriyah/commit/91cdefd3630bd36fd84e611f7f82558183db23cd)) +- **parser:** Fixed "ecma262 PR 1174" implementation ([0bd2a60](https://github.com/meriyah/meriyah/commit/0bd2a605fa9a23bb88becb86f305423ba98ffbc9)) +- **parser:** fixed [#37](https://github.com/meriyah/meriyah/issues/37) ([6c28caf](https://github.com/meriyah/meriyah/commit/6c28cafec6823e86963fe8448781403e33c3e0e0)) +- **parser:** fixed a bunch of edge cases ([14160c5](https://github.com/meriyah/meriyah/commit/14160c59e9791b83d477a31ecb8569da77a1df37)) +- **parser:** fixed a bunch of edge cases ([1a100ba](https://github.com/meriyah/meriyah/commit/1a100bac63ec3bdf7d6488516d1d185c4031c59f)) +- **parser:** fixed a bunch of edge cases ([fe941bc](https://github.com/meriyah/meriyah/commit/fe941bc64d60a0fef3b4013afed52b3ab17a23a6)) +- **parser:** fixed a bunch of edge cases ([2fd9c4e](https://github.com/meriyah/meriyah/commit/2fd9c4e79a6058b7529aff54a3cc2a74b3c5771d)) +- **parser:** Fixed a bunch of edge cases ([d7e08fe](https://github.com/meriyah/meriyah/commit/d7e08fef14d7f6757d481041d030d1fb7623a242)) +- **parser:** Fixed a bunch of edge cases ([9854a83](https://github.com/meriyah/meriyah/commit/9854a83351f268431dd2d72763aa1dc94cd9200a)) +- **parser:** fixed a couple of edge cases ([f4de592](https://github.com/meriyah/meriyah/commit/f4de592ea791eef60fc84849fab77b830ad6b37a)) +- **parser:** fixed a few edge cases ([0a425ba](https://github.com/meriyah/meriyah/commit/0a425bac4f49734b042d4e05b1c0de0b0e1268fd)) +- **parser:** fixed a few edgy cases ([43130ac](https://github.com/meriyah/meriyah/commit/43130ac9ce7e0d822bc58f9d278709afd83ee33f)) +- **parser:** fixed a few edgy cases for escape keywords ([5165c2e](https://github.com/meriyah/meriyah/commit/5165c2e1bfc8287f8cb39749c03924c78b485660)) +- **parser:** fixed a few non-throwing edge cases ([c9e08cd](https://github.com/meriyah/meriyah/commit/c9e08cda3a608f5de40d52e16dac7febd9fda8e8)) +- **parser:** fixed a few non-throwing edge cases ([8977bd8](https://github.com/meriyah/meriyah/commit/8977bd8e57823225cf721990bf129ff49111dae1)) +- **parser:** fixed a slip up ([e9f5950](https://github.com/meriyah/meriyah/commit/e9f59507504379fcffce2e6dde46595d4a5b5684)) +- **parser:** fixed a slip-up ([7aab914](https://github.com/meriyah/meriyah/commit/7aab91440be28bbcd66a4199ee0f3649cb764014)) +- **parser:** fixed an issue where async as ident wasn't assignable ([48b67c3](https://github.com/meriyah/meriyah/commit/48b67c3560ce226f5d73a06d2ce817a28bc7141b)) +- **parser:** fixed AST output for optional chaining ([18d6735](https://github.com/meriyah/meriyah/commit/18d6735a888a15977018c9631733f145d660d3a0)) +- **parser:** fixed async arrow edge cases ([65e6c20](https://github.com/meriyah/meriyah/commit/65e6c203bd287b9320fe0144a591ec743679866b)) +- **parser:** fixed async await edge cases ([7ffdea3](https://github.com/meriyah/meriyah/commit/7ffdea3d6e97f4254ccae9b7a0e8a361c226efce)) +- **parser:** fixed bunch of class field edge cases ([48077ab](https://github.com/meriyah/meriyah/commit/48077ab9665713cd0c82833a452af3da56c81885)) +- **parser:** fixed bunch of class field edge cases ([75c881a](https://github.com/meriyah/meriyah/commit/75c881a1d2fcf39560904746722f4021b43db4b7)) +- **parser:** fixed bunch of edge cases ([f18f5b4](https://github.com/meriyah/meriyah/commit/f18f5b467eac24c5c0528a5b72edeaec68d91132)) +- **parser:** fixed class field edge cases ([de0d0b5](https://github.com/meriyah/meriyah/commit/de0d0b596497ef24da01e1b5f3c0258588b5e986)) +- **parser:** fixed computed property names - added missing "parseMemberOrUpdateExpression" ([01add5d](https://github.com/meriyah/meriyah/commit/01add5d07bbdff6fca1978cb50da07b49407ecc3)) +- **parser:** fixed confusing error message ([a6e0e71](https://github.com/meriyah/meriyah/commit/a6e0e71e17d4da1b9469abdc78e4d176d2524628)) +- **parser:** fixed const enum values and extended API tests to guard against TS issues ([c69ac52](https://github.com/meriyah/meriyah/commit/c69ac520d9dfeca8e9e1059012793f58c7d2e70f)) +- **parser:** fixed directive prologue edge cases ([9092515](https://github.com/meriyah/meriyah/commit/9092515322666e77402ac83802b10645e49329f2)) +- **parser:** fixed duplicate call to 2parseMemberOrUpdateExpression" ([501b76c](https://github.com/meriyah/meriyah/commit/501b76c41036210d035509b81f07f68700ca5bc3)) +- **parser:** fixed edge cases ([b7cc2f8](https://github.com/meriyah/meriyah/commit/b7cc2f827a2ce06dec6b8cb0ca7b489a77f42c61)) +- **parser:** fixed edge cases ([6397c0f](https://github.com/meriyah/meriyah/commit/6397c0fa4cff32d0ccd562054061c0923b3c5195)) +- **parser:** fixed edge cases and corrected a few tests ([c2c56da](https://github.com/meriyah/meriyah/commit/c2c56dad9e84038742156ffdf183a75184a28518)) +- **parser:** fixed edge cases and test coverage ([e1da2d2](https://github.com/meriyah/meriyah/commit/e1da2d29c38b3ce288d3c756de20c15d490da1f3)) +- **parser:** fixed edgy cases ([a4434ef](https://github.com/meriyah/meriyah/commit/a4434ef75c53158dcaf56f3ffaee21a177b4123f)) +- **parser:** fixed escape keyword edgy cases ([6c48765](https://github.com/meriyah/meriyah/commit/6c487651a2bf62a8c36c80803cb5922be34693c6)) +- **parser:** fixed escape keywords ([de9c43b](https://github.com/meriyah/meriyah/commit/de9c43b10dde8fce845fca9e1aa7f7d3274c67fb)) +- **parser:** fixed eval and arguments validations ([1a927be](https://github.com/meriyah/meriyah/commit/1a927be61aa05f1847db5878a4e829d684611811)) +- **parser:** Fixed for-statement edge case ([544a7e7](https://github.com/meriyah/meriyah/commit/544a7e7c99ec59a01e0ef0903ec37c57b1f08976)) +- **parser:** fixed for-statement ranges ([68481ee](https://github.com/meriyah/meriyah/commit/68481eee7c5d42e20ae75f271eb4b2aeda133fe3)) +- **parser:** fixed import call and added 'ImportExpression' AST node ([f735377](https://github.com/meriyah/meriyah/commit/f735377fe3eb9476e1c16f5e1dd83df4c0d8a70f)) +- **parser:** fixed import call implementation ([cb09a9c](https://github.com/meriyah/meriyah/commit/cb09a9cb1abb5819d781c8471380b542c851052a)) +- **parser:** Fixed incorrect capitalized option ([917a0f1](https://github.com/meriyah/meriyah/commit/917a0f17afbdeba20eacce4dbcc8bb2c2b963d3e)) +- **parser:** fixed incorrect error locations ([6d894e5](https://github.com/meriyah/meriyah/commit/6d894e5425a134a163ddfddd74a681b55308fa0f)) +- **parser:** fixed issue with OctalEscapeSequence discovered by fuzzer ([5d62f79](https://github.com/meriyah/meriyah/commit/5d62f79160c202a5d49648b2dcc6d912be3693c2)) +- **parser:** fixed issue with a directive preceding an 'use strict' directive containing an OctalEscapeSequence ([84bd498](https://github.com/meriyah/meriyah/commit/84bd4986de30bc407745a72bb5b5e27268e9030e)) +- **parser:** fixed issue with module code not in strict mode in a few cases ([c6d24b6](https://github.com/meriyah/meriyah/commit/c6d24b6883a738f74b31068ab06aa201bffdd464)) +- **parser:** fixed issue with private field didn't pass the 'kind' state ([bd6ec68](https://github.com/meriyah/meriyah/commit/bd6ec689cf4e582f2c7f405f4f7b948e9c5db07b)) +- **parser:** Fixed issue with single line comment extraction. Exposed parser obj instead of comment end value ([a9a8958](https://github.com/meriyah/meriyah/commit/a9a8958018c66feff8466cbd26b1babb7c92503b)) +- **parser:** fixed issue with template & sequence expr ([627cf3b](https://github.com/meriyah/meriyah/commit/627cf3b73ca99c76941516f08ac11af226d94915)) +- **parser:** fixed JSX non failing cases ([e5bc9de](https://github.com/meriyah/meriyah/commit/e5bc9defe5fe54499d7085e7397c4c156ade8b2b)) +- **parser:** fixed lexical edge case ([98c6ee7](https://github.com/meriyah/meriyah/commit/98c6ee796740feb12f635e47cc9b954bb9fa649d)) +- **parser:** fixed lgtm warnings ([558ba1f](https://github.com/meriyah/meriyah/commit/558ba1fcb9130c887c52ee24ac6f5f7addb092ca)) +- **parser:** fixed lgtm warnings ([e14cb97](https://github.com/meriyah/meriyah/commit/e14cb975f3ca5ac4b0d732c3da77910de4fe59ff)) +- **parser:** fixed lgtm warnings ([0d20e52](https://github.com/meriyah/meriyah/commit/0d20e5277ccc9ff375ec067458f5c304b2e95028)) +- **parser:** fixed LGTM warnings ([7746e25](https://github.com/meriyah/meriyah/commit/7746e25b9910d30b3170cefd2d295c85a261c5bc)) +- **parser:** fixed LGTM warnings ([d58536e](https://github.com/meriyah/meriyah/commit/d58536e123fe5d5a1ccb489b95edb5842487e035)) +- **parser:** fixed LGTM warnings ([c3efc64](https://github.com/meriyah/meriyah/commit/c3efc645b18743a9e09cbddce2d3786232efb422)) +- **parser:** Fixed LGTM warnings ([7d36ae3](https://github.com/meriyah/meriyah/commit/7d36ae3b0ab7dc6061d8d6716afe5a62f78e9edf)) +- **parser:** fixed negative bitmask values ([972a6f0](https://github.com/meriyah/meriyah/commit/972a6f01297c5c2268f15867349547a3c8e5ec67)) +- **parser:** Fixed non-failing cases ([2e3ff8d](https://github.com/meriyah/meriyah/commit/2e3ff8d8f7ae1702f7c9d9c077e4c23226bceb6b)) +- **parser:** Fixed object lit edge cases ([1c0c2e8](https://github.com/meriyah/meriyah/commit/1c0c2e8d1b8d7122a7a3dc12d5948487e740f054)) +- **parser:** fixed possible conflicts ([b72ffe2](https://github.com/meriyah/meriyah/commit/b72ffe22adfe2cec0511f69877cc82f4e14575d8)) +- **parser:** fixed possible performance regression ([80c75de](https://github.com/meriyah/meriyah/commit/80c75de7d1fe7f83fc12a697121a43df7fdd037d)) +- **parser:** fixed template expression edge cases ([281ad30](https://github.com/meriyah/meriyah/commit/281ad3071fc4b8289b32d144d443c3608a969012)) +- **parser:** fixed Test262 test suite edge cases ([c9545fe](https://github.com/meriyah/meriyah/commit/c9545fe968ffe32221af587f120aaeb8213993c7)) +- **parser:** fixed unused func params ([12ba7e6](https://github.com/meriyah/meriyah/commit/12ba7e6f84a5a9bb4168552e39a265ab72e8e88b)) +- **parser:** fixed wrong line count in single line comment ([c35b6d0](https://github.com/meriyah/meriyah/commit/c35b6d08b6c18df656aa8e5fbaebb1bf90b877d2)) +- **parser:** Fixes [#25](https://github.com/meriyah/meriyah/issues/25) ([c2b96cb](https://github.com/meriyah/meriyah/commit/c2b96cb3de7aabd10045f08b81539ef37bad71cc)) +- **parser:** fixes [#31](https://github.com/meriyah/meriyah/issues/31) ([7576780](https://github.com/meriyah/meriyah/commit/7576780a9467ac897fe7a69ebef93c613e0790dc)) +- **parser:** fixes [#38](https://github.com/meriyah/meriyah/issues/38) ([9834975](https://github.com/meriyah/meriyah/commit/9834975321cad92d1d79795354ae41dc600a0285)) +- **parser:** Fixes [#5](https://github.com/meriyah/meriyah/issues/5) ([7805610](https://github.com/meriyah/meriyah/commit/78056102d8ceb0e60a987c2b19ea6833c3f0b7a7)) +- **parser:** fixes [#58](https://github.com/meriyah/meriyah/issues/58) ([bbfc5c2](https://github.com/meriyah/meriyah/commit/bbfc5c2e1e9e5748ef496544a785d12454179a53)) +- **parser:** fixes assignment edge cases ([b2cf29f](https://github.com/meriyah/meriyah/commit/b2cf29f0b13d5a884295cd8d5238becb07a1325c)) +- **parser:** fixes do while edge cases ([024e459](https://github.com/meriyah/meriyah/commit/024e4595805af50b677bbb0d6092b0243dd902dc)) +- **parser:** fixes loc tracking for optional chaining ([e875e14](https://github.com/meriyah/meriyah/commit/e875e14579bab71df8fc00094f296c37dfea89db)) +- **parser:** fixes yield edge cases ([54d5669](https://github.com/meriyah/meriyah/commit/54d56691dde6e77c0c86555b638f8c6fb51fce86)) +- **parser:** implemented optional chaining ([cc334f3](https://github.com/meriyah/meriyah/commit/cc334f3ceafa77bd55187a8252962ce3c6369311)) +- **parser:** Improved a bunch of yield edge cases ([e58ea2b](https://github.com/meriyah/meriyah/commit/e58ea2b1c8f515ab03a6e4859bc983809aa7fc2c)) +- **parser:** improved comment extraction ([1f1daf9](https://github.com/meriyah/meriyah/commit/1f1daf926c37139ea72c98799c769819ec66f174)) +- **parser:** improved error reporting for duplicate bindings ([0483d25](https://github.com/meriyah/meriyah/commit/0483d25f3794f0b8d339f1e920d036b443e0eaca)) +- **parser:** improved module code parsing ([9ecef95](https://github.com/meriyah/meriyah/commit/9ecef95779b2de807bc54e59e8389dd30b387008)) +- **parser:** improved nullish coalescing performance ([83cbdd5](https://github.com/meriyah/meriyah/commit/83cbdd54323e467d7dfb626fd18646aa4f366ecf)) +- **parser:** improved optional chaining implementation ([c8532d9](https://github.com/meriyah/meriyah/commit/c8532d9a95fd611fe902771fe0a07eb7d5681b27)) +- **parser:** improved optional chaining implementation ([90c139c](https://github.com/meriyah/meriyah/commit/90c139ce36af5fdd2500e365f23ed305445bfdec)) +- **parser:** improved optional chaining implementation ([2766dd9](https://github.com/meriyah/meriyah/commit/2766dd9303a3775a09492f4ca9bfd68015b0dd0d)) +- **parser:** improved performance - create less lexical scopes ([8485cbb](https://github.com/meriyah/meriyah/commit/8485cbb9d6a75a2a4d9cbbfaef1b29278bc94ac7)) +- **parser:** improved performance for edgy cases ([c8a3677](https://github.com/meriyah/meriyah/commit/c8a3677cc1d834b6aa93e1ef67d8b30e2349b0f2)) +- **parser:** improved performance for import default ([e814e36](https://github.com/meriyah/meriyah/commit/e814e3603cafb6ec10b99c03744513b1e7310e43)) +- **parser:** JSX attributes must only be assigned a non-empty 'expression' ([712d8e6](https://github.com/meriyah/meriyah/commit/712d8e6030e4ab60714747e66bcfe9210eead021)) +- **parser:** make nested async arrow assignable ([83c8db0](https://github.com/meriyah/meriyah/commit/83c8db0514d3605a8ae5e7936e9d71bb0f583642)) +- **parser:** minor refactoring & performance tweaks ([39dc0e7](https://github.com/meriyah/meriyah/commit/39dc0e79000854cc35362f4e79b1c9bfdadc6910)) +- **parser:** minor tweaks ([6a14bab](https://github.com/meriyah/meriyah/commit/6a14babb6200c8d953ad00433ae095c78e7cdbf9)) +- **parser:** minor tweaks ([35ead44](https://github.com/meriyah/meriyah/commit/35ead44cb0fee7160ec0ce02e062a17a5cb83526)) +- **parser:** minor tweaks ([7080dee](https://github.com/meriyah/meriyah/commit/7080dee35b7bb64d40932df1a100b9e4783a1cd1)) +- **parser:** moved enums to common.ts for improved readability ([09683b4](https://github.com/meriyah/meriyah/commit/09683b4e83b704c146fe144c1c6aa3a0fa3f7c92)) +- **parser:** moved func flags to 'common.ts' ([21e771d](https://github.com/meriyah/meriyah/commit/21e771d4f4f165bc83f064a581afa02772256169)) +- **parser:** now unsets 'SimpleParameterList' masks correctly ([f48b486](https://github.com/meriyah/meriyah/commit/f48b486a1eb8b8de031725c62b3e0264fabadc44)) +- **parser:** optimization tweaks ([9e983a8](https://github.com/meriyah/meriyah/commit/9e983a8ed9e2a0e3cd7531ffbfedd74fa5a49702)) +- **parser:** optimization tweaks ([49b78e3](https://github.com/meriyah/meriyah/commit/49b78e3eac08c70c161275bbe009055a9829739f)) +- **parser:** optimized class field parsing ([2c1bf99](https://github.com/meriyah/meriyah/commit/2c1bf99d7e7f0911c423c30528dc97fcdb8e13c5)) +- **parser:** pass 'inClass' as function argument ([5129b0a](https://github.com/meriyah/meriyah/commit/5129b0a5ee6b99cee40504d0fbb17241c91b9605)) +- **parser:** performance improvements ([39f0a80](https://github.com/meriyah/meriyah/commit/39f0a802396d577d9dd3cb7153b4c158c660dd71)) +- **parser:** performance improvements ([5bd745a](https://github.com/meriyah/meriyah/commit/5bd745ab7069ca3cd74af1e21fcb85dfc7f6a201)) +- **parser:** performance improvements ([89c4006](https://github.com/meriyah/meriyah/commit/89c400678e18eb0814193964717f8af42c23e354)), closes [#21](https://github.com/meriyah/meriyah/issues/21) +- **parser:** performance improvements ([7f2c32f](https://github.com/meriyah/meriyah/commit/7f2c32ff7b657fc7764c1d22d021726d735804d6)) +- **parser:** performance improvements ([62c2d6f](https://github.com/meriyah/meriyah/commit/62c2d6f0f87e5e1770ac00656092e29624fc146f)) +- **parser:** permanently fixed yield edge cases ([6166b2b](https://github.com/meriyah/meriyah/commit/6166b2ba9703107ca0eb2c41e747e2970f51d770)) +- **parser:** prevented a possible var name conflict ([fc310db](https://github.com/meriyah/meriyah/commit/fc310dba10cf46824efe8856c9bfa615897bdacb)) +- **parser:** reduced branching and simplified for parenthesized arrow head & async arrow ([25a5bff](https://github.com/meriyah/meriyah/commit/25a5bffc4364f0d26f5903d55d4985d76e887c2b)) +- **parser:** refactored and simplified location tracking ([0899ad3](https://github.com/meriyah/meriyah/commit/0899ad37fab3cec42545727f7b79b77fa7d55c66)) +- **parser:** Refactoring SyntaxError messages ([66098ea](https://github.com/meriyah/meriyah/commit/66098ea443b91ae12b15e55a7d1577f9a2b81f66)) +- **parser:** removed redundant empty binding validations ([cf98ab5](https://github.com/meriyah/meriyah/commit/cf98ab53a12915dfdc84e56e6ae49d7276643170)) +- **parser:** removed some unused code and simplified a few things ([4ffe12d](https://github.com/meriyah/meriyah/commit/4ffe12d597367dd75c45651558b406e390617730)) +- **parser:** removed some useless code ([597eaf2](https://github.com/meriyah/meriyah/commit/597eaf25d36ab4971a07df391321ec97fb0c911f)) +- **parser:** removed unnecessary func args ([6c44bb7](https://github.com/meriyah/meriyah/commit/6c44bb75d86ff269f5bfcf61c6bf7d5ebe43b3b6)) +- **parser:** removed unused code ([f423485](https://github.com/meriyah/meriyah/commit/f423485ea1a6af1ca75530a7d61fca7e3c10caf9)) +- **parser:** removed unused code ([db4231b](https://github.com/meriyah/meriyah/commit/db4231bd49e20f34fd6ef0ec7332e301c0fb018e)) +- **parser:** removed unused code and improved test coverage ([7b4b56f](https://github.com/meriyah/meriyah/commit/7b4b56fd1ee9a97cbcd1003652aff72895f0a5aa)) +- **parser:** rename 'OptionalChain' AST node to 'OptionalExpression'. ([a184f67](https://github.com/meriyah/meriyah/commit/a184f6782d86fd18192a32684f5ae9775905fcdb)) +- **parser:** renamed deFacto opt to "specDeviation" ([d2e7e08](https://github.com/meriyah/meriyah/commit/d2e7e08fc0c276de348e75f539d17eb739a0a0b8)) +- **parser:** simplified arrow parsing ([db388db](https://github.com/meriyah/meriyah/commit/db388db66fb8bbbaa1f41d989bfa07fc93553d21)) +- **parser:** simplified assignment expr parsing ([ce89217](https://github.com/meriyah/meriyah/commit/ce89217ec96d7d912fff747b4a0b6050963fc9de)) +- **parser:** simplified async arrow parsing ([fb046c7](https://github.com/meriyah/meriyah/commit/fb046c777d1a000b7e744140990468e6d422af10)), closes [#22](https://github.com/meriyah/meriyah/issues/22) +- **parser:** simplified DestructuringAssignmentTarget validation ([6f04c41](https://github.com/meriyah/meriyah/commit/6f04c41dd868caad00f1db0bdc35499f1e7e18b0)) +- **parser:** simplified DestructuringAssignmentTarget validation ([1ce5eb0](https://github.com/meriyah/meriyah/commit/1ce5eb04e2c614a2d205921d79fc6dc609212e8a)) +- **parser:** simplified some logic ([7978118](https://github.com/meriyah/meriyah/commit/79781187d51b5e4dc3bd139864c8eb7d2606c844)) +- **parser:** Skips one validation - Token.IsLogical will not "exist" unless "next" option enabled ([6941da7](https://github.com/meriyah/meriyah/commit/6941da78bde97a17ef084e5bfd69bc8577ac4387)) +- **parser:** small corrections to line offset ([99406ac](https://github.com/meriyah/meriyah/commit/99406acc075d69d1555927efb10bf9c316fd65d6)) +- **parser:** start with empty label set ([90d2d78](https://github.com/meriyah/meriyah/commit/90d2d78b423a7c7f5bfe9beeda4e7e02340c1fb5)) +- **parser:** test import call both for module and script code ([66fe1b0](https://github.com/meriyah/meriyah/commit/66fe1b0d8cd9bf03c835dfcb5d6117525359554e)) +- **parser:** throws on `super()` used in class field ([b659e5b](https://github.com/meriyah/meriyah/commit/b659e5b39f593814668b37392374fc74b77306c7)) +- **parser:** tweaked and optimized JSX lexer code ([a701555](https://github.com/meriyah/meriyah/commit/a701555fc8a77f0415a10b04e0fbf176f94fb7c6)) +- **parser:** tweaked await and yield parsing ([2bfe889](https://github.com/meriyah/meriyah/commit/2bfe8899c905f008c79f38c01c973ba087a715d3)) +- **parser:** tweaked bit masks ([2b623cd](https://github.com/meriyah/meriyah/commit/2b623cd1a1e31a9a9c8de2acf7a3a1b73500325d)) +- **parser:** tweaked bit masks ([1cb0718](https://github.com/meriyah/meriyah/commit/1cb0718828ea4cf518158dbe5e2b9e5c45aa7ada)) +- **parser:** tweaked bit masks and improved performance ([a1f41a5](https://github.com/meriyah/meriyah/commit/a1f41a5ed64f86a44482945600c3afc2a9d60969)) +- **parser:** tweaked performance ([4b7a9b5](https://github.com/meriyah/meriyah/commit/4b7a9b5daf970efece7ca1331b3b725ee2a74417)) +- **parser:** tweaked ranges implementation ([e443537](https://github.com/meriyah/meriyah/commit/e443537c600b83932b69f36287cd08b0331225a3)) +- **parser:** tweaked some code ([6acf9ad](https://github.com/meriyah/meriyah/commit/6acf9adb49ff72ed4cc486e1b607b7ca49f58335)) +- **parser:** tweaked the label tracking ([77702c8](https://github.com/meriyah/meriyah/commit/77702c85b4bd4b7f407a01c717e5c12dbd2455be)) +- **parser:** update group.ts ([cc915cc](https://github.com/meriyah/meriyah/commit/cc915cc4f502a424adf2d73cf068964b083d1dc3)) +- **parser:** Use 'const' instead of 'let' ([f1bc71f](https://github.com/meriyah/meriyah/commit/f1bc71fab231a632ecaede604a6d7fdc585a4142)) +- **parser:** WIP: fixed and optimized await edge cases ([7f006fc](https://github.com/meriyah/meriyah/commit/7f006fc0275bb17526563e72d3f1aab6c41be035)) +- **parser:** WIP! await & yield edge cases ([13ce4e6](https://github.com/meriyah/meriyah/commit/13ce4e692c7ed535ea99eeab6d51cdee1f5e721f)) +- **parser:** WIP! fixes bunch of yield edge case ([46b7cba](https://github.com/meriyah/meriyah/commit/46b7cba43ab2ebc482f387fd4c9d725de2bdc1f4)) +- **scanner:** dedupe some scanner code and tweaked bit masks ([1e9d1b1](https://github.com/meriyah/meriyah/commit/1e9d1b1f42709fbb5e97adecaacdcb0756958dcf)) + +### Features + +- **all:** added benchmark ([8a525b3](https://github.com/meriyah/meriyah/commit/8a525b36e290d4d6f8c8dd0dafc55ea77c6dec3e)) +- **all:** Emit errors in standard format for compilers ([7f83f6a](https://github.com/meriyah/meriyah/commit/7f83f6a368c1b0fdd4d724f075887f140577bd0f)) +- **lexer:** added lexer source code ([ade6e8f](https://github.com/meriyah/meriyah/commit/ade6e8f757beb2220783e7ab3bc6615d90bcdc91)) +- **lexer:** implement numeric literal scanning ([8ba7461](https://github.com/meriyah/meriyah/commit/8ba7461e9a2cfbafbf180da1792070b641c76e0a)) +- **parser:** enable line/column location information to each node ([75c43c7](https://github.com/meriyah/meriyah/commit/75c43c7005a8fc69fbbbf283556dec1c67ae354b)) +- **parser:** 'export' '\*' 'as' IdentifierName 'from' ModuleSpecifier ';' ([01db03c](https://github.com/meriyah/meriyah/commit/01db03c08816ffdb092ebd890130bfd189f5e3eb)) +- **parser:** added 'sourceFile' option ([0c62a08](https://github.com/meriyah/meriyah/commit/0c62a08f9d176d37772f406cfac379cae4bdb599)) +- **parser:** added label tracking ([930f825](https://github.com/meriyah/meriyah/commit/930f8251171a7f9e2219916a3b007efa179d7ac1)) +- **parser:** added new option to allow edge cases that deviate from the spec ([30d8c23](https://github.com/meriyah/meriyah/commit/30d8c23bdb6d0a3b5f301e8c4b82d21c45f8c50f)) +- **parser:** added option to enable non-standard parenthesized expression node ([82d423d](https://github.com/meriyah/meriyah/commit/82d423dc72a13b7cc745e9bbc664a678bff879d2)) +- **parser:** added parser code ([866b546](https://github.com/meriyah/meriyah/commit/866b5460afa65a81cf4c6136352eb67db1629aec)) +- **parser:** Distinguish Identifier from IdentifierPattern ([68da76b](https://github.com/meriyah/meriyah/commit/68da76b209ac871bb9d4b6d8f7b186c7709c7ea2)) +- **parser:** Implemented Class Public Instance Fields (WIP) ([c08d907](https://github.com/meriyah/meriyah/commit/c08d907060f7f23d9fbdbae4804b83edd89c0fda)) +- **parser:** implemented dynamic import (stage 3) ([64a54a8](https://github.com/meriyah/meriyah/commit/64a54a80560870dec179e1e4003b911cd2526363)) +- **parser:** implemented import.meta as well ([e838c8e](https://github.com/meriyah/meriyah/commit/e838c8ea675bd9e2bc096fde87098275cf533873)) +- **parser:** implemented support for v8 Intrinsic ([5e41577](https://github.com/meriyah/meriyah/commit/5e41577ab64cebdd98623c787310410328ffd568)) +- **parser:** implements nullish coalescing (stage 3) ([f38480d](https://github.com/meriyah/meriyah/commit/f38480d3498da64270ed44c1802a75a9d3366b44)) +- **parser:** implements ranges ([73ede30](https://github.com/meriyah/meriyah/commit/73ede309f518430f53a1a5adb7b3a1ce648ec781)) +- **parser:** support latest TC39 specs ([82cb1f4](https://github.com/meriyah/meriyah/commit/82cb1f41209ea28792ceb4143007631b6dbd7295)) +- **parser:** WIP: Enable JSX parsing ([9dd80d4](https://github.com/meriyah/meriyah/commit/9dd80d448e9877323a2edf12a9cde9c48fde411d)) +- **parser:** WIP! Implements optional chaining ([09425fc](https://github.com/meriyah/meriyah/commit/09425fca1798fb2a82a893572005528dea301b62)) + +### Reverts + +- Revert "Update parser.ts" ([9671b37](https://github.com/meriyah/meriyah/commit/9671b377b4089ee4ef69f6ab282b07c1d21fb974)) +- Revert "dsaf" ([74edb5b](https://github.com/meriyah/meriyah/commit/74edb5b618a72f722d133a017a7a1fca5c2b063c)) diff --git a/node_modules/meriyah/LICENSE.md b/node_modules/meriyah/LICENSE.md new file mode 100644 index 0000000..86e8894 --- /dev/null +++ b/node_modules/meriyah/LICENSE.md @@ -0,0 +1,7 @@ +ISC License + +Copyright (c) 2019 and later, KFlash and others. + +Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/meriyah/README.md b/node_modules/meriyah/README.md new file mode 100644 index 0000000..bb3b8df --- /dev/null +++ b/node_modules/meriyah/README.md @@ -0,0 +1,207 @@ +

Meriyah

+ +

100% compliant, self-hosted javascript parser with high focus on both performance and stability. Stable and already used in production.

+ +

+ Meriyah NPM + Node.js CI + License +

+ +
+ +[Interactive Playground](https://meriyah.github.io/meriyah) +[Benchmark](https://meriyah.github.io/meriyah/performance) + +## Features + +- Conforms to the standard ECMAScript® 2024 (ECMA-262 15th Edition) language specification + - See [RegExp support](#regexp-support) +- Support some TC39 stage 3 proposals via option "next" +- Support for additional ECMAScript features for Web Browsers (Annex B) +- JSX support via option "jsx" +- Does **NOT** support TypeScript or Flow syntax +- Track syntactic node locations with option "ranges" or "loc" +- Emits an ESTree-compatible abstract syntax tree +- No backtracking +- Low memory usage + +## ESNext Stage 3 features + +### Supported stage 3 features: + +These features need to be enabled with the `next` option. + +- [Decorators](https://github.com/tc39/proposal-decorators) +- [JSON Modules](https://github.com/tc39/proposal-json-modules) + +### Not yet supported stage 3 features: + +- [Explicit resource management](https://github.com/tc39/proposal-explicit-resource-management) +- [Source phase import](https://github.com/tc39/proposal-source-phase-imports) + +## RegExp support + +Meriyah doesn't parse RegExp internal syntax, ESTree spec didn't require internal structure of RegExp. Meriyah +does use JavaScript runtime to validate the RegExp literal. That means Meriyah's RegExp support is only as good +as JavaScript runtime's RegExp support. + +As of May 2025, some latest RegExp features requires Node.js>=24. + +- [RegExp modifiers](https://github.com/tc39/proposal-regexp-modifiers) +- [RegExp duplicate named groups](https://github.com/tc39/proposal-duplicate-named-capturing-groups) + +In addition, RegExp v flag (unicodeSets) only works on Nodejs v20+ and latest browsers. + +## Installation + +```sh +npm install meriyah --save-dev +``` + +## API + +Meriyah generates `AST` according to [ESTree AST format](https://github.com/estree/estree), and can be used to perform [syntactic analysis](https://en.wikipedia.org/wiki/Parsing) (parsing) of a JavaScript program, and with `ES2015` and later a JavaScript program can be either [a script or a module](https://tc39.github.io/ecma262/index.html#sec-ecmascript-language-scripts-and-modules). + +The `parse` method exposed by meriyah takes an optional `options` object which allows you to specify whether to parse in [`script`](https://tc39.github.io/ecma262/#sec-parse-script) mode (the default) or in [`module`](https://tc39.github.io/ecma262/#sec-parsemodule) mode. + +```js +// There are also "parseScript" and "parseModule" exported. +import { parse } from 'meriyah'; +const result = parse('let some = "code";', { ranges: true }); +``` + +The available options: + +```js +{ + // The flag to allow module code + module: false; + + // The flag to enable stage 3 support (ESNext) + next: false; + + // The flag to enable start, end offsets and range: [start, end] to each node + ranges: false; + + // Enable web compatibility + webcompat: false; + + // The flag to enable line/column location information to each node + loc: false; + + // The flag to attach raw property to each literal and identifier node + raw: false; + + // The flag to allow return in the global scope + globalReturn: false; + + // The flag to enable implied strict mode + impliedStrict: false; + + // Allows comment extraction. Accepts either a function or array + onComment: []; + + // Allows detection of automatic semicolon insertion. Accepts a callback function that will be passed the character offset where the semicolon was inserted + onInsertedSemicolon: (pos) => {}; + + // Allows token extraction. Accepts either a function or array + onToken: []; + + // Enable non-standard parenthesized expression node + preserveParens: false; + + // Enable lexical binding and scope tracking + lexical: false; + + // Adds a source attribute in every node’s loc object when the locations option is `true` + source: undefined; // Set to source: 'source-file.js' + + // Enable React JSX parsing + jsx: false; +} +``` + +### onComment and onToken + +If an array is supplied, comments/tokens will be pushed to the array, the item in the array contains `start/end/range` information when ranges flag is true, it will also contain `loc` information when loc flag is true. + +If a function callback is supplied, the signature must be + +```ts +declare function onComment(type: string, value: string, start: number, end: number, loc: SourceLocation): void; + +declare function onToken(token: string, start: number, end: number, loc: SourceLocation): void; +``` + +Note the `start/end/loc` information are provided to the function callback regardless of the settings on ranges and loc flags. onComment callback has one extra argument `value: string` for the body string of the comment. + +### onInsertedSemicolon + +If a function callback is supplied, the signature must be + +```ts +declare function onInsertedSemicolon(position: number): void; +``` + +## Example usage + +```js +import { parse } from './meriyah'; + +parse('({x: [y] = 0} = 1)'); +``` + +This will return when serialized in json: + +```js +{ + type: "Program", + sourceType: "script", + body: [ + { + type: "ExpressionStatement", + expression: { + type: "AssignmentExpression", + left: { + type: "ObjectPattern", + properties: [ + { + type: "Property", + key: { + type: "Identifier", + name: "x" + }, + value: { + type: "AssignmentPattern", + left: { + type: "ArrayPattern", + elements: [ + { + "type": "Identifier", + "name": "y" + } + ] + }, + right: { + type: "Literal", + value: 0 + } + }, + kind: "init", + computed: false, + method: false, + shorthand: false + } + ] + }, + operator: "=", + right: { + type: "Literal", + value: 1 + } + } + } + ] +} +``` diff --git a/node_modules/meriyah/dist/meriyah.cjs b/node_modules/meriyah/dist/meriyah.cjs new file mode 100644 index 0000000..032837a --- /dev/null +++ b/node_modules/meriyah/dist/meriyah.cjs @@ -0,0 +1,9204 @@ +'use strict'; + +const unicodeLookup = ((compressed, lookup) => { + const result = new Uint32Array(69632); + let index = 0; + let subIndex = 0; + while (index < 2571) { + const inst = compressed[index++]; + if (inst < 0) { + subIndex -= inst; + } + else { + let code = compressed[index++]; + if (inst & 2) + code = lookup[code]; + if (inst & 1) { + result.fill(code, subIndex, subIndex += compressed[index++]); + } + else { + result[subIndex++] = code; + } + } + } + return result; +})([-1, 2, 26, 2, 27, 2, 5, -1, 0, 77595648, 3, 44, 2, 3, 0, 14, 2, 63, 2, 64, 3, 0, 3, 0, 3168796671, 0, 4294956992, 2, 1, 2, 0, 2, 41, 3, 0, 4, 0, 4294966523, 3, 0, 4, 2, 16, 2, 65, 2, 0, 0, 4294836735, 0, 3221225471, 0, 4294901942, 2, 66, 0, 134152192, 3, 0, 2, 0, 4294951935, 3, 0, 2, 0, 2683305983, 0, 2684354047, 2, 18, 2, 0, 0, 4294961151, 3, 0, 2, 2, 19, 2, 0, 0, 608174079, 2, 0, 2, 60, 2, 7, 2, 6, 0, 4286611199, 3, 0, 2, 2, 1, 3, 0, 3, 0, 4294901711, 2, 40, 0, 4089839103, 0, 2961209759, 0, 1342439375, 0, 4294543342, 0, 3547201023, 0, 1577204103, 0, 4194240, 0, 4294688750, 2, 2, 0, 80831, 0, 4261478351, 0, 4294549486, 2, 2, 0, 2967484831, 0, 196559, 0, 3594373100, 0, 3288319768, 0, 8469959, 0, 65472, 2, 3, 0, 4093640191, 0, 660618719, 0, 65487, 0, 4294828015, 0, 4092591615, 0, 1616920031, 0, 982991, 2, 3, 2, 0, 0, 2163244511, 0, 4227923919, 0, 4236247022, 2, 71, 0, 4284449919, 0, 851904, 2, 4, 2, 12, 0, 67076095, -1, 2, 72, 0, 1073741743, 0, 4093607775, -1, 0, 50331649, 0, 3265266687, 2, 33, 0, 4294844415, 0, 4278190047, 2, 20, 2, 137, -1, 3, 0, 2, 2, 23, 2, 0, 2, 10, 2, 0, 2, 15, 2, 22, 3, 0, 10, 2, 74, 2, 0, 2, 75, 2, 76, 2, 77, 2, 0, 2, 78, 2, 0, 2, 11, 0, 261632, 2, 25, 3, 0, 2, 2, 13, 2, 4, 3, 0, 18, 2, 79, 2, 5, 3, 0, 2, 2, 80, 0, 2151677951, 2, 29, 2, 9, 0, 909311, 3, 0, 2, 0, 814743551, 2, 49, 0, 67090432, 3, 0, 2, 2, 42, 2, 0, 2, 6, 2, 0, 2, 30, 2, 8, 0, 268374015, 2, 110, 2, 51, 2, 0, 2, 81, 0, 134153215, -1, 2, 7, 2, 0, 2, 8, 0, 2684354559, 0, 67044351, 0, 3221160064, 2, 17, -1, 3, 0, 2, 2, 53, 0, 1046528, 3, 0, 3, 2, 9, 2, 0, 2, 54, 0, 4294960127, 2, 10, 2, 6, 2, 11, 0, 4294377472, 2, 12, 3, 0, 16, 2, 13, 2, 0, 2, 82, 2, 10, 2, 0, 2, 83, 2, 84, 2, 85, 0, 12288, 2, 55, 0, 1048577, 2, 86, 2, 14, -1, 2, 14, 0, 131042, 2, 87, 2, 88, 2, 89, 2, 0, 2, 34, -83, 3, 0, 7, 0, 1046559, 2, 0, 2, 15, 2, 0, 0, 2147516671, 2, 21, 3, 90, 2, 2, 0, -16, 2, 91, 0, 524222462, 2, 4, 2, 0, 0, 4269801471, 2, 4, 3, 0, 2, 2, 28, 2, 16, 3, 0, 2, 2, 17, 2, 0, -1, 2, 18, -16, 3, 0, 206, -2, 3, 0, 692, 2, 73, -1, 2, 18, 2, 10, 3, 0, 8, 2, 93, 2, 133, 2, 0, 0, 3220242431, 3, 0, 3, 2, 19, 2, 94, 2, 95, 3, 0, 2, 2, 96, 2, 0, 2, 97, 2, 46, 2, 0, 0, 4351, 2, 0, 2, 9, 3, 0, 2, 0, 67043391, 0, 3909091327, 2, 0, 2, 24, 2, 9, 2, 20, 3, 0, 2, 0, 67076097, 2, 8, 2, 0, 2, 21, 0, 67059711, 0, 4236247039, 3, 0, 2, 0, 939524103, 0, 8191999, 2, 101, 2, 102, 2, 22, 2, 23, 3, 0, 3, 0, 67057663, 3, 0, 349, 2, 103, 2, 104, 2, 7, -264, 3, 0, 11, 2, 24, 3, 0, 2, 2, 32, -1, 0, 3774349439, 2, 105, 2, 106, 3, 0, 2, 2, 19, 2, 107, 3, 0, 10, 2, 10, 2, 18, 2, 0, 2, 47, 2, 0, 2, 31, 2, 108, 2, 25, 0, 1638399, 0, 57344, 2, 109, 3, 0, 3, 2, 20, 2, 26, 2, 27, 2, 5, 2, 28, 2, 0, 2, 8, 2, 111, -1, 2, 112, 2, 113, 2, 114, -1, 3, 0, 3, 2, 12, -2, 2, 0, 2, 29, -3, 0, 536870912, -4, 2, 20, 2, 0, 2, 36, 0, 1, 2, 0, 2, 67, 2, 6, 2, 12, 2, 10, 2, 0, 2, 115, -1, 3, 0, 4, 2, 10, 2, 23, 2, 116, 2, 7, 2, 0, 2, 117, 2, 0, 2, 118, 2, 119, 2, 120, 2, 0, 2, 9, 3, 0, 9, 2, 21, 2, 30, 2, 31, 2, 121, 2, 122, -2, 2, 123, 2, 124, 2, 30, 2, 21, 2, 8, -2, 2, 125, 2, 30, 2, 32, -2, 2, 0, 2, 39, -2, 0, 4277137519, 0, 2269118463, -1, 3, 20, 2, -1, 2, 33, 2, 38, 2, 0, 3, 30, 2, 2, 35, 2, 19, -3, 3, 0, 2, 2, 34, -1, 2, 0, 2, 35, 2, 0, 2, 35, 2, 0, 2, 48, 2, 0, 0, 4294950463, 2, 37, -7, 2, 0, 0, 203775, 2, 57, 0, 4026531840, 2, 20, 2, 43, 2, 36, 2, 18, 2, 37, 2, 18, 2, 126, 2, 21, 3, 0, 2, 2, 38, 0, 2151677888, 2, 0, 2, 12, 0, 4294901764, 2, 144, 2, 0, 2, 58, 2, 56, 0, 5242879, 3, 0, 2, 0, 402644511, -1, 2, 128, 2, 39, 0, 3, -1, 2, 129, 2, 130, 2, 0, 0, 67045375, 2, 40, 0, 4226678271, 0, 3766565279, 0, 2039759, 2, 132, 2, 41, 0, 1046437, 0, 6, 3, 0, 2, 0, 3288270847, 0, 3, 3, 0, 2, 0, 67043519, -5, 2, 0, 0, 4282384383, 0, 1056964609, -1, 3, 0, 2, 0, 67043345, -1, 2, 0, 2, 42, 2, 23, 2, 50, 2, 11, 2, 61, 2, 38, -5, 2, 0, 2, 12, -3, 3, 0, 2, 0, 2147484671, 2, 134, 0, 4190109695, 2, 52, -2, 2, 135, 0, 4244635647, 0, 27, 2, 0, 2, 8, 2, 43, 2, 0, 2, 68, 2, 18, 2, 0, 2, 42, -6, 2, 0, 2, 45, 2, 59, 2, 44, 2, 45, 2, 46, 2, 47, 0, 8388351, -2, 2, 136, 0, 3028287487, 2, 48, 2, 138, 0, 33259519, 2, 49, -9, 2, 21, 0, 4294836223, 0, 3355443199, 0, 134152199, -2, 2, 69, -2, 3, 0, 28, 2, 32, -3, 3, 0, 3, 2, 17, 3, 0, 6, 2, 50, -81, 2, 18, 3, 0, 2, 2, 36, 3, 0, 33, 2, 25, 2, 30, 3, 0, 124, 2, 12, 3, 0, 18, 2, 38, -213, 2, 0, 2, 32, -54, 3, 0, 17, 2, 42, 2, 8, 2, 23, 2, 0, 2, 8, 2, 23, 2, 51, 2, 0, 2, 21, 2, 52, 2, 139, 2, 25, -13, 2, 0, 2, 53, -6, 3, 0, 2, -4, 3, 0, 2, 0, 4294936575, 2, 0, 0, 4294934783, -2, 0, 196635, 3, 0, 191, 2, 54, 3, 0, 38, 2, 30, 2, 55, 2, 34, -278, 2, 140, 3, 0, 9, 2, 141, 2, 142, 2, 56, 3, 0, 11, 2, 7, -72, 3, 0, 3, 2, 143, 0, 1677656575, -130, 2, 26, -16, 2, 0, 2, 24, 2, 38, -16, 0, 4161266656, 0, 4071, 0, 15360, -4, 2, 57, -13, 3, 0, 2, 2, 58, 2, 0, 2, 145, 2, 146, 2, 62, 2, 0, 2, 147, 2, 148, 2, 149, 3, 0, 10, 2, 150, 2, 151, 2, 22, 3, 58, 2, 3, 152, 2, 3, 59, 2, 0, 4294954999, 2, 0, -16, 2, 0, 2, 92, 2, 0, 0, 2105343, 0, 4160749584, 0, 65534, -34, 2, 8, 2, 154, -6, 0, 4194303871, 0, 4294903771, 2, 0, 2, 60, 2, 100, -3, 2, 0, 0, 1073684479, 0, 17407, -9, 2, 18, 2, 17, 2, 0, 2, 32, -14, 2, 18, 2, 32, -6, 2, 18, 2, 12, -15, 2, 155, 3, 0, 6, 0, 8323103, -1, 3, 0, 2, 2, 61, -37, 2, 62, 2, 156, 2, 157, 2, 158, 2, 159, 2, 160, -105, 2, 26, -32, 3, 0, 1335, -1, 3, 0, 129, 2, 32, 3, 0, 6, 2, 10, 3, 0, 180, 2, 161, 3, 0, 233, 2, 162, 3, 0, 18, 2, 10, -77, 3, 0, 16, 2, 10, -47, 3, 0, 154, 2, 6, 3, 0, 130, 2, 25, -22250, 3, 0, 7, 2, 25, -6130, 3, 5, 2, -1, 0, 69207040, 3, 44, 2, 3, 0, 14, 2, 63, 2, 64, -3, 0, 3168731136, 0, 4294956864, 2, 1, 2, 0, 2, 41, 3, 0, 4, 0, 4294966275, 3, 0, 4, 2, 16, 2, 65, 2, 0, 2, 34, -1, 2, 18, 2, 66, -1, 2, 0, 0, 2047, 0, 4294885376, 3, 0, 2, 0, 3145727, 0, 2617294944, 0, 4294770688, 2, 25, 2, 67, 3, 0, 2, 0, 131135, 2, 98, 0, 70256639, 0, 71303167, 0, 272, 2, 42, 2, 6, 0, 32511, 2, 0, 2, 49, -1, 2, 99, 2, 68, 0, 4278255616, 0, 4294836227, 0, 4294549473, 0, 600178175, 0, 2952806400, 0, 268632067, 0, 4294543328, 0, 57540095, 0, 1577058304, 0, 1835008, 0, 4294688736, 2, 70, 2, 69, 0, 33554435, 2, 131, 2, 70, 0, 2952790016, 0, 131075, 0, 3594373096, 0, 67094296, 2, 69, -1, 0, 4294828000, 0, 603979263, 0, 654311424, 0, 3, 0, 4294828001, 0, 602930687, 0, 1610612736, 0, 393219, 0, 4294828016, 0, 671088639, 0, 2154840064, 0, 4227858435, 0, 4236247008, 2, 71, 2, 38, -1, 2, 4, 0, 917503, 2, 38, -1, 2, 72, 0, 537788335, 0, 4026531935, -1, 0, 1, -1, 2, 33, 2, 73, 0, 7936, -3, 2, 0, 0, 2147485695, 0, 1010761728, 0, 4292984930, 0, 16387, 2, 0, 2, 15, 2, 22, 3, 0, 10, 2, 74, 2, 0, 2, 75, 2, 76, 2, 77, 2, 0, 2, 78, 2, 0, 2, 12, -1, 2, 25, 3, 0, 2, 2, 13, 2, 4, 3, 0, 18, 2, 79, 2, 5, 3, 0, 2, 2, 80, 0, 2147745791, 3, 19, 2, 0, 122879, 2, 0, 2, 9, 0, 276824064, -2, 3, 0, 2, 2, 42, 2, 0, 0, 4294903295, 2, 0, 2, 30, 2, 8, -1, 2, 18, 2, 51, 2, 0, 2, 81, 2, 49, -1, 2, 21, 2, 0, 2, 29, -2, 0, 128, -2, 2, 28, 2, 9, 0, 8160, -1, 2, 127, 0, 4227907585, 2, 0, 2, 37, 2, 0, 2, 50, 0, 4227915776, 2, 10, 2, 6, 2, 11, -1, 0, 74440192, 3, 0, 6, -2, 3, 0, 8, 2, 13, 2, 0, 2, 82, 2, 10, 2, 0, 2, 83, 2, 84, 2, 85, -3, 2, 86, 2, 14, -3, 2, 87, 2, 88, 2, 89, 2, 0, 2, 34, -83, 3, 0, 7, 0, 817183, 2, 0, 2, 15, 2, 0, 0, 33023, 2, 21, 3, 90, 2, -17, 2, 91, 0, 524157950, 2, 4, 2, 0, 2, 92, 2, 4, 2, 0, 2, 22, 2, 28, 2, 16, 3, 0, 2, 2, 17, 2, 0, -1, 2, 18, -16, 3, 0, 206, -2, 3, 0, 692, 2, 73, -1, 2, 18, 2, 10, 3, 0, 8, 2, 93, 0, 3072, 2, 0, 0, 2147516415, 2, 10, 3, 0, 2, 2, 25, 2, 94, 2, 95, 3, 0, 2, 2, 96, 2, 0, 2, 97, 2, 46, 0, 4294965179, 0, 7, 2, 0, 2, 9, 2, 95, 2, 9, -1, 0, 1761345536, 2, 98, 0, 4294901823, 2, 38, 2, 20, 2, 99, 2, 35, 2, 100, 0, 2080440287, 2, 0, 2, 34, 2, 153, 0, 3296722943, 2, 0, 0, 1046675455, 0, 939524101, 0, 1837055, 2, 101, 2, 102, 2, 22, 2, 23, 3, 0, 3, 0, 7, 3, 0, 349, 2, 103, 2, 104, 2, 7, -264, 3, 0, 11, 2, 24, 3, 0, 2, 2, 32, -1, 0, 2700607615, 2, 105, 2, 106, 3, 0, 2, 2, 19, 2, 107, 3, 0, 10, 2, 10, 2, 18, 2, 0, 2, 47, 2, 0, 2, 31, 2, 108, -3, 2, 109, 3, 0, 3, 2, 20, -1, 3, 5, 2, 2, 110, 2, 0, 2, 8, 2, 111, -1, 2, 112, 2, 113, 2, 114, -1, 3, 0, 3, 2, 12, -2, 2, 0, 2, 29, -8, 2, 20, 2, 0, 2, 36, -1, 2, 0, 2, 67, 2, 6, 2, 30, 2, 10, 2, 0, 2, 115, -1, 3, 0, 4, 2, 10, 2, 18, 2, 116, 2, 7, 2, 0, 2, 117, 2, 0, 2, 118, 2, 119, 2, 120, 2, 0, 2, 9, 3, 0, 9, 2, 21, 2, 30, 2, 31, 2, 121, 2, 122, -2, 2, 123, 2, 124, 2, 30, 2, 21, 2, 8, -2, 2, 125, 2, 30, 2, 32, -2, 2, 0, 2, 39, -2, 0, 4277075969, 2, 30, -1, 3, 20, 2, -1, 2, 33, 2, 126, 2, 0, 3, 30, 2, 2, 35, 2, 19, -3, 3, 0, 2, 2, 34, -1, 2, 0, 2, 35, 2, 0, 2, 35, 2, 0, 2, 50, 2, 98, 0, 4294934591, 2, 37, -7, 2, 0, 0, 197631, 2, 57, -1, 2, 20, 2, 43, 2, 37, 2, 18, 0, 3, 2, 18, 2, 126, 2, 21, 2, 127, 2, 54, -1, 0, 2490368, 2, 127, 2, 25, 2, 18, 2, 34, 2, 127, 2, 38, 0, 4294901904, 0, 4718591, 2, 127, 2, 35, 0, 335544350, -1, 2, 128, 0, 2147487743, 0, 1, -1, 2, 129, 2, 130, 2, 8, -1, 2, 131, 2, 70, 0, 3758161920, 0, 3, 2, 132, 0, 12582911, 0, 655360, -1, 2, 0, 2, 29, 0, 2147485568, 0, 3, 2, 0, 2, 25, 0, 176, -5, 2, 0, 2, 17, 0, 251658240, -1, 2, 0, 2, 25, 0, 16, -1, 2, 0, 0, 16779263, -2, 2, 12, -1, 2, 38, -5, 2, 0, 2, 133, -3, 3, 0, 2, 2, 55, 2, 134, 0, 2147549183, 0, 2, -2, 2, 135, 2, 36, 0, 10, 0, 4294965249, 0, 67633151, 0, 4026597376, 2, 0, 0, 536871935, 2, 18, 2, 0, 2, 42, -6, 2, 0, 0, 1, 2, 59, 2, 17, 0, 1, 2, 46, 2, 25, -3, 2, 136, 2, 36, 2, 137, 2, 138, 0, 16778239, -10, 2, 35, 0, 4294836212, 2, 9, -3, 2, 69, -2, 3, 0, 28, 2, 32, -3, 3, 0, 3, 2, 17, 3, 0, 6, 2, 50, -81, 2, 18, 3, 0, 2, 2, 36, 3, 0, 33, 2, 25, 0, 126, 3, 0, 124, 2, 12, 3, 0, 18, 2, 38, -213, 2, 10, -55, 3, 0, 17, 2, 42, 2, 8, 2, 18, 2, 0, 2, 8, 2, 18, 2, 60, 2, 0, 2, 25, 2, 50, 2, 139, 2, 25, -13, 2, 0, 2, 73, -6, 3, 0, 2, -4, 3, 0, 2, 0, 67583, -1, 2, 107, -2, 0, 11, 3, 0, 191, 2, 54, 3, 0, 38, 2, 30, 2, 55, 2, 34, -278, 2, 140, 3, 0, 9, 2, 141, 2, 142, 2, 56, 3, 0, 11, 2, 7, -72, 3, 0, 3, 2, 143, 2, 144, -187, 3, 0, 2, 2, 58, 2, 0, 2, 145, 2, 146, 2, 62, 2, 0, 2, 147, 2, 148, 2, 149, 3, 0, 10, 2, 150, 2, 151, 2, 22, 3, 58, 2, 3, 152, 2, 3, 59, 2, 2, 153, -57, 2, 8, 2, 154, -7, 2, 18, 2, 0, 2, 60, -4, 2, 0, 0, 1065361407, 0, 16384, -9, 2, 18, 2, 60, 2, 0, 2, 133, -14, 2, 18, 2, 133, -6, 2, 18, 0, 81919, -15, 2, 155, 3, 0, 6, 2, 126, -1, 3, 0, 2, 0, 2063, -37, 2, 62, 2, 156, 2, 157, 2, 158, 2, 159, 2, 160, -138, 3, 0, 1335, -1, 3, 0, 129, 2, 32, 3, 0, 6, 2, 10, 3, 0, 180, 2, 161, 3, 0, 233, 2, 162, 3, 0, 18, 2, 10, -77, 3, 0, 16, 2, 10, -47, 3, 0, 154, 2, 6, 3, 0, 130, 2, 25, -28386], [4294967295, 4294967291, 4092460543, 4294828031, 4294967294, 134217726, 4294903807, 268435455, 2147483647, 1048575, 1073741823, 3892314111, 134217727, 1061158911, 536805376, 4294910143, 4294901759, 32767, 4294901760, 262143, 536870911, 8388607, 4160749567, 4294902783, 4294918143, 65535, 67043328, 2281701374, 4294967264, 2097151, 4194303, 255, 67108863, 4294967039, 511, 524287, 131071, 63, 127, 3238002687, 4294549487, 4290772991, 33554431, 4294901888, 4286578687, 67043329, 4294705152, 4294770687, 67043583, 1023, 15, 2047999, 67043343, 67051519, 16777215, 2147483648, 4294902000, 28, 4292870143, 4294966783, 16383, 67047423, 4294967279, 262083, 20511, 41943039, 493567, 4294959104, 603979775, 65536, 602799615, 805044223, 4294965206, 8191, 1031749119, 4294917631, 2134769663, 4286578493, 4282253311, 4294942719, 33540095, 4294905855, 2868854591, 1608515583, 265232348, 534519807, 2147614720, 1060109444, 4093640016, 17376, 2139062143, 224, 4169138175, 4294909951, 4286578688, 4294967292, 4294965759, 535511039, 4294966272, 4294967280, 32768, 8289918, 4294934399, 4294901775, 4294965375, 1602223615, 4294967259, 4294443008, 268369920, 4292804608, 4294967232, 486341884, 4294963199, 3087007615, 1073692671, 4128527, 4279238655, 4294902015, 4160684047, 4290246655, 469499899, 4294967231, 134086655, 4294966591, 2445279231, 3670015, 31, 4294967288, 4294705151, 3221208447, 4294902271, 4294549472, 4294921215, 4095, 4285526655, 4294966527, 4294966143, 64, 4294966719, 3774873592, 1877934080, 262151, 2555904, 536807423, 67043839, 3758096383, 3959414372, 3755993023, 2080374783, 4294835295, 4294967103, 4160749565, 4294934527, 4087, 2016, 2147446655, 184024726, 2862017156, 1593309078, 268434431, 268434414, 4294901763, 4294901761]); +const isIDContinue = (code) => (unicodeLookup[(code >>> 5) + 0] >>> code & 31 & 1) !== 0; +const isIDStart = (code) => (unicodeLookup[(code >>> 5) + 34816] >>> code & 31 & 1) !== 0; + +function advanceChar(parser) { + parser.column++; + return (parser.currentChar = parser.source.charCodeAt(++parser.index)); +} +function consumePossibleSurrogatePair(parser) { + const hi = parser.currentChar; + if ((hi & 0xfc00) !== 55296) + return 0; + const lo = parser.source.charCodeAt(parser.index + 1); + if ((lo & 0xfc00) !== 56320) + return 0; + return 65536 + ((hi & 0x3ff) << 10) + (lo & 0x3ff); +} +function consumeLineFeed(parser, state) { + parser.currentChar = parser.source.charCodeAt(++parser.index); + parser.flags |= 1; + if ((state & 4) === 0) { + parser.column = 0; + parser.line++; + } +} +function scanNewLine(parser) { + parser.flags |= 1; + parser.currentChar = parser.source.charCodeAt(++parser.index); + parser.column = 0; + parser.line++; +} +function isExoticECMAScriptWhitespace(ch) { + return (ch === 160 || + ch === 65279 || + ch === 133 || + ch === 5760 || + (ch >= 8192 && ch <= 8203) || + ch === 8239 || + ch === 8287 || + ch === 12288 || + ch === 8201 || + ch === 65519); +} +function toHex(code) { + return code < 65 ? code - 48 : (code - 65 + 10) & 0xf; +} +function convertTokenType(t) { + switch (t) { + case 134283266: + return 'NumericLiteral'; + case 134283267: + return 'StringLiteral'; + case 86021: + case 86022: + return 'BooleanLiteral'; + case 86023: + return 'NullLiteral'; + case 65540: + return 'RegularExpression'; + case 67174408: + case 67174409: + case 131: + return 'TemplateLiteral'; + default: + if ((t & 143360) === 143360) + return 'Identifier'; + if ((t & 4096) === 4096) + return 'Keyword'; + return 'Punctuator'; + } +} + +const CharTypes = [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 8 | 1024, + 0, + 0, + 8 | 2048, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 8192, + 0, + 1 | 2, + 0, + 0, + 8192, + 0, + 0, + 0, + 256, + 0, + 256 | 32768, + 0, + 0, + 2 | 16 | 128 | 32 | 64, + 2 | 16 | 128 | 32 | 64, + 2 | 16 | 32 | 64, + 2 | 16 | 32 | 64, + 2 | 16 | 32 | 64, + 2 | 16 | 32 | 64, + 2 | 16 | 32 | 64, + 2 | 16 | 32 | 64, + 2 | 16 | 512 | 64, + 2 | 16 | 512 | 64, + 0, + 0, + 16384, + 0, + 0, + 0, + 0, + 1 | 2 | 64, + 1 | 2 | 64, + 1 | 2 | 64, + 1 | 2 | 64, + 1 | 2 | 64, + 1 | 2 | 64, + 1 | 2, + 1 | 2, + 1 | 2, + 1 | 2, + 1 | 2, + 1 | 2, + 1 | 2, + 1 | 2, + 1 | 2, + 1 | 2, + 1 | 2, + 1 | 2, + 1 | 2, + 1 | 2, + 1 | 2, + 1 | 2, + 1 | 2, + 1 | 2, + 1 | 2, + 1 | 2, + 0, + 1, + 0, + 0, + 1 | 2 | 4096, + 0, + 1 | 2 | 4 | 64, + 1 | 2 | 4 | 64, + 1 | 2 | 4 | 64, + 1 | 2 | 4 | 64, + 1 | 2 | 4 | 64, + 1 | 2 | 4 | 64, + 1 | 2 | 4, + 1 | 2 | 4, + 1 | 2 | 4, + 1 | 2 | 4, + 1 | 2 | 4, + 1 | 2 | 4, + 1 | 2 | 4, + 1 | 2 | 4, + 1 | 2 | 4, + 1 | 2 | 4, + 1 | 2 | 4, + 1 | 2 | 4, + 1 | 2 | 4, + 1 | 2 | 4, + 1 | 2 | 4, + 1 | 2 | 4, + 1 | 2 | 4, + 1 | 2 | 4, + 1 | 2 | 4, + 1 | 2 | 4, + 16384, + 0, + 0, + 0, + 0 +]; +const isIdStart = [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 0, + 0, + 0, + 0, + 1, + 0, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 0, + 0, + 0, + 0, + 0 +]; +const isIdPart = [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 0, + 0, + 0, + 0, + 1, + 0, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 0, + 0, + 0, + 0, + 0 +]; +function isIdentifierStart(code) { + return code <= 0x7F + ? isIdStart[code] > 0 + : isIDStart(code); +} +function isIdentifierPart(code) { + return code <= 0x7F + ? isIdPart[code] > 0 + : isIDContinue(code) || (code === 8204 || code === 8205); +} + +const CommentTypes = ['SingleLine', 'MultiLine', 'HTMLOpen', 'HTMLClose', 'HashbangComment']; +function skipHashBang(parser) { + const { source } = parser; + if (parser.currentChar === 35 && source.charCodeAt(parser.index + 1) === 33) { + advanceChar(parser); + advanceChar(parser); + skipSingleLineComment(parser, source, 0, 4, parser.tokenStart); + } +} +function skipSingleHTMLComment(parser, source, state, context, type, start) { + if (context & 2) + parser.report(0); + return skipSingleLineComment(parser, source, state, type, start); +} +function skipSingleLineComment(parser, source, state, type, start) { + const { index } = parser; + parser.tokenIndex = parser.index; + parser.tokenLine = parser.line; + parser.tokenColumn = parser.column; + while (parser.index < parser.end) { + if (CharTypes[parser.currentChar] & 8) { + const isCR = parser.currentChar === 13; + scanNewLine(parser); + if (isCR && parser.index < parser.end && parser.currentChar === 10) + parser.currentChar = source.charCodeAt(++parser.index); + break; + } + else if ((parser.currentChar ^ 8232) <= 1) { + scanNewLine(parser); + break; + } + advanceChar(parser); + parser.tokenIndex = parser.index; + parser.tokenLine = parser.line; + parser.tokenColumn = parser.column; + } + if (parser.options.onComment) { + const loc = { + start: { + line: start.line, + column: start.column, + }, + end: { + line: parser.tokenLine, + column: parser.tokenColumn, + }, + }; + parser.options.onComment(CommentTypes[type & 0xff], source.slice(index, parser.tokenIndex), start.index, parser.tokenIndex, loc); + } + return state | 1; +} +function skipMultiLineComment(parser, source, state) { + const { index } = parser; + while (parser.index < parser.end) { + if (parser.currentChar < 0x2b) { + let skippedOneAsterisk = false; + while (parser.currentChar === 42) { + if (!skippedOneAsterisk) { + state &= -5; + skippedOneAsterisk = true; + } + if (advanceChar(parser) === 47) { + advanceChar(parser); + if (parser.options.onComment) { + const loc = { + start: { + line: parser.tokenLine, + column: parser.tokenColumn, + }, + end: { + line: parser.line, + column: parser.column, + }, + }; + parser.options.onComment(CommentTypes[1 & 0xff], source.slice(index, parser.index - 2), index - 2, parser.index, loc); + } + parser.tokenIndex = parser.index; + parser.tokenLine = parser.line; + parser.tokenColumn = parser.column; + return state; + } + } + if (skippedOneAsterisk) { + continue; + } + if (CharTypes[parser.currentChar] & 8) { + if (parser.currentChar === 13) { + state |= 1 | 4; + scanNewLine(parser); + } + else { + consumeLineFeed(parser, state); + state = (state & -5) | 1; + } + } + else { + advanceChar(parser); + } + } + else if ((parser.currentChar ^ 8232) <= 1) { + state = (state & -5) | 1; + scanNewLine(parser); + } + else { + state &= -5; + advanceChar(parser); + } + } + parser.report(18); +} + +var RegexState; +(function (RegexState) { + RegexState[RegexState["Empty"] = 0] = "Empty"; + RegexState[RegexState["Escape"] = 1] = "Escape"; + RegexState[RegexState["Class"] = 2] = "Class"; +})(RegexState || (RegexState = {})); +var RegexFlags; +(function (RegexFlags) { + RegexFlags[RegexFlags["Empty"] = 0] = "Empty"; + RegexFlags[RegexFlags["IgnoreCase"] = 1] = "IgnoreCase"; + RegexFlags[RegexFlags["Global"] = 2] = "Global"; + RegexFlags[RegexFlags["Multiline"] = 4] = "Multiline"; + RegexFlags[RegexFlags["Unicode"] = 16] = "Unicode"; + RegexFlags[RegexFlags["Sticky"] = 8] = "Sticky"; + RegexFlags[RegexFlags["DotAll"] = 32] = "DotAll"; + RegexFlags[RegexFlags["Indices"] = 64] = "Indices"; + RegexFlags[RegexFlags["UnicodeSets"] = 128] = "UnicodeSets"; +})(RegexFlags || (RegexFlags = {})); +function scanRegularExpression(parser) { + const bodyStart = parser.index; + let preparseState = RegexState.Empty; + loop: while (true) { + const ch = parser.currentChar; + advanceChar(parser); + if (preparseState & RegexState.Escape) { + preparseState &= ~RegexState.Escape; + } + else { + switch (ch) { + case 47: + if (!preparseState) + break loop; + else + break; + case 92: + preparseState |= RegexState.Escape; + break; + case 91: + preparseState |= RegexState.Class; + break; + case 93: + preparseState &= RegexState.Escape; + break; + } + } + if (ch === 13 || + ch === 10 || + ch === 8232 || + ch === 8233) { + parser.report(34); + } + if (parser.index >= parser.source.length) { + return parser.report(34); + } + } + const bodyEnd = parser.index - 1; + let mask = RegexFlags.Empty; + let char = parser.currentChar; + const { index: flagStart } = parser; + while (isIdentifierPart(char)) { + switch (char) { + case 103: + if (mask & RegexFlags.Global) + parser.report(36, 'g'); + mask |= RegexFlags.Global; + break; + case 105: + if (mask & RegexFlags.IgnoreCase) + parser.report(36, 'i'); + mask |= RegexFlags.IgnoreCase; + break; + case 109: + if (mask & RegexFlags.Multiline) + parser.report(36, 'm'); + mask |= RegexFlags.Multiline; + break; + case 117: + if (mask & RegexFlags.Unicode) + parser.report(36, 'u'); + if (mask & RegexFlags.UnicodeSets) + parser.report(36, 'vu'); + mask |= RegexFlags.Unicode; + break; + case 118: + if (mask & RegexFlags.Unicode) + parser.report(36, 'uv'); + if (mask & RegexFlags.UnicodeSets) + parser.report(36, 'v'); + mask |= RegexFlags.UnicodeSets; + break; + case 121: + if (mask & RegexFlags.Sticky) + parser.report(36, 'y'); + mask |= RegexFlags.Sticky; + break; + case 115: + if (mask & RegexFlags.DotAll) + parser.report(36, 's'); + mask |= RegexFlags.DotAll; + break; + case 100: + if (mask & RegexFlags.Indices) + parser.report(36, 'd'); + mask |= RegexFlags.Indices; + break; + default: + parser.report(35); + } + char = advanceChar(parser); + } + const flags = parser.source.slice(flagStart, parser.index); + const pattern = parser.source.slice(bodyStart, bodyEnd); + parser.tokenRegExp = { pattern, flags }; + if (parser.options.raw) + parser.tokenRaw = parser.source.slice(parser.tokenIndex, parser.index); + parser.tokenValue = validate(parser, pattern, flags); + return 65540; +} +function validate(parser, pattern, flags) { + try { + return new RegExp(pattern, flags); + } + catch { + try { + new RegExp(pattern, flags); + return null; + } + catch { + parser.report(34); + } + } +} + +function scanString(parser, context, quote) { + const { index: start } = parser; + let ret = ''; + let char = advanceChar(parser); + let marker = parser.index; + while ((CharTypes[char] & 8) === 0) { + if (char === quote) { + ret += parser.source.slice(marker, parser.index); + advanceChar(parser); + if (parser.options.raw) + parser.tokenRaw = parser.source.slice(start, parser.index); + parser.tokenValue = ret; + return 134283267; + } + if ((char & 8) === 8 && char === 92) { + ret += parser.source.slice(marker, parser.index); + char = advanceChar(parser); + if (char < 0x7f || char === 8232 || char === 8233) { + const code = parseEscape(parser, context, char); + if (code >= 0) + ret += String.fromCodePoint(code); + else + handleStringError(parser, code, 0); + } + else { + ret += String.fromCodePoint(char); + } + marker = parser.index + 1; + } + else if (char === 8232 || char === 8233) { + parser.column = -1; + parser.line++; + } + if (parser.index >= parser.end) + parser.report(16); + char = advanceChar(parser); + } + parser.report(16); +} +function parseEscape(parser, context, first, isTemplate = 0) { + switch (first) { + case 98: + return 8; + case 102: + return 12; + case 114: + return 13; + case 110: + return 10; + case 116: + return 9; + case 118: + return 11; + case 13: { + if (parser.index < parser.end) { + const nextChar = parser.source.charCodeAt(parser.index + 1); + if (nextChar === 10) { + parser.index = parser.index + 1; + parser.currentChar = nextChar; + } + } + } + case 10: + case 8232: + case 8233: + parser.column = -1; + parser.line++; + return -1; + case 48: + case 49: + case 50: + case 51: { + let code = first - 48; + let index = parser.index + 1; + let column = parser.column + 1; + if (index < parser.end) { + const next = parser.source.charCodeAt(index); + if ((CharTypes[next] & 32) === 0) { + if (code !== 0 || CharTypes[next] & 512) { + if (context & 1 || isTemplate) + return -2; + parser.flags |= 64; + } + } + else if (context & 1 || isTemplate) { + return -2; + } + else { + parser.currentChar = next; + code = (code << 3) | (next - 48); + index++; + column++; + if (index < parser.end) { + const next = parser.source.charCodeAt(index); + if (CharTypes[next] & 32) { + parser.currentChar = next; + code = (code << 3) | (next - 48); + index++; + column++; + } + } + parser.flags |= 64; + } + parser.index = index - 1; + parser.column = column - 1; + } + return code; + } + case 52: + case 53: + case 54: + case 55: { + if (isTemplate || context & 1) + return -2; + let code = first - 48; + const index = parser.index + 1; + const column = parser.column + 1; + if (index < parser.end) { + const next = parser.source.charCodeAt(index); + if (CharTypes[next] & 32) { + code = (code << 3) | (next - 48); + parser.currentChar = next; + parser.index = index; + parser.column = column; + } + } + parser.flags |= 64; + return code; + } + case 120: { + const ch1 = advanceChar(parser); + if ((CharTypes[ch1] & 64) === 0) + return -4; + const hi = toHex(ch1); + const ch2 = advanceChar(parser); + if ((CharTypes[ch2] & 64) === 0) + return -4; + const lo = toHex(ch2); + return (hi << 4) | lo; + } + case 117: { + const ch = advanceChar(parser); + if (parser.currentChar === 123) { + let code = 0; + while ((CharTypes[advanceChar(parser)] & 64) !== 0) { + code = (code << 4) | toHex(parser.currentChar); + if (code > 1114111) + return -5; + } + if (parser.currentChar < 1 || parser.currentChar !== 125) { + return -4; + } + return code; + } + else { + if ((CharTypes[ch] & 64) === 0) + return -4; + const ch2 = parser.source.charCodeAt(parser.index + 1); + if ((CharTypes[ch2] & 64) === 0) + return -4; + const ch3 = parser.source.charCodeAt(parser.index + 2); + if ((CharTypes[ch3] & 64) === 0) + return -4; + const ch4 = parser.source.charCodeAt(parser.index + 3); + if ((CharTypes[ch4] & 64) === 0) + return -4; + parser.index += 3; + parser.column += 3; + parser.currentChar = parser.source.charCodeAt(parser.index); + return (toHex(ch) << 12) | (toHex(ch2) << 8) | (toHex(ch3) << 4) | toHex(ch4); + } + } + case 56: + case 57: + if (isTemplate || !parser.options.webcompat || context & 1) + return -3; + parser.flags |= 4096; + default: + return first; + } +} +function handleStringError(parser, code, isTemplate) { + switch (code) { + case -1: + return; + case -2: + parser.report(isTemplate ? 2 : 1); + case -3: + parser.report(isTemplate ? 3 : 14); + case -4: + parser.report(7); + case -5: + parser.report(104); + } +} + +function scanTemplate(parser, context) { + const { index: start } = parser; + let token = 67174409; + let ret = ''; + let char = advanceChar(parser); + while (char !== 96) { + if (char === 36 && parser.source.charCodeAt(parser.index + 1) === 123) { + advanceChar(parser); + token = 67174408; + break; + } + else if (char === 92) { + char = advanceChar(parser); + if (char > 0x7e) { + ret += String.fromCodePoint(char); + } + else { + const { index, line, column } = parser; + const code = parseEscape(parser, context | 1, char, 1); + if (code >= 0) { + ret += String.fromCodePoint(code); + } + else if (code !== -1 && context & 64) { + parser.index = index; + parser.line = line; + parser.column = column; + ret = null; + char = scanBadTemplate(parser, char); + if (char < 0) + token = 67174408; + break; + } + else { + handleStringError(parser, code, 1); + } + } + } + else if (parser.index < parser.end) { + if (char === 13 && parser.source.charCodeAt(parser.index) === 10) { + ret += String.fromCodePoint(char); + parser.currentChar = parser.source.charCodeAt(++parser.index); + } + if (((char & 83) < 3 && char === 10) || (char ^ 8232) <= 1) { + parser.column = -1; + parser.line++; + } + ret += String.fromCodePoint(char); + } + if (parser.index >= parser.end) + parser.report(17); + char = advanceChar(parser); + } + advanceChar(parser); + parser.tokenValue = ret; + parser.tokenRaw = parser.source.slice(start + 1, parser.index - (token === 67174409 ? 1 : 2)); + return token; +} +function scanBadTemplate(parser, ch) { + while (ch !== 96) { + switch (ch) { + case 36: { + const index = parser.index + 1; + if (index < parser.end && parser.source.charCodeAt(index) === 123) { + parser.index = index; + parser.column++; + return -ch; + } + break; + } + case 10: + case 8232: + case 8233: + parser.column = -1; + parser.line++; + } + if (parser.index >= parser.end) + parser.report(17); + ch = advanceChar(parser); + } + return ch; +} +function scanTemplateTail(parser, context) { + if (parser.index >= parser.end) + parser.report(0); + parser.index--; + parser.column--; + return scanTemplate(parser, context); +} + +const errorMessages = { + [0]: 'Unexpected token', + [30]: "Unexpected token: '%0'", + [1]: 'Octal escape sequences are not allowed in strict mode', + [2]: 'Octal escape sequences are not allowed in template strings', + [3]: '\\8 and \\9 are not allowed in template strings', + [4]: 'Private identifier #%0 is not defined', + [5]: 'Illegal Unicode escape sequence', + [6]: 'Invalid code point %0', + [7]: 'Invalid hexadecimal escape sequence', + [9]: 'Octal literals are not allowed in strict mode', + [8]: 'Decimal integer literals with a leading zero are forbidden in strict mode', + [10]: 'Expected number in radix %0', + [151]: 'Invalid left-hand side assignment to a destructible right-hand side', + [11]: 'Non-number found after exponent indicator', + [12]: 'Invalid BigIntLiteral', + [13]: 'No identifiers allowed directly after numeric literal', + [14]: 'Escapes \\8 or \\9 are not syntactically valid escapes', + [15]: 'Escapes \\8 or \\9 are not allowed in strict mode', + [16]: 'Unterminated string literal', + [17]: 'Unterminated template literal', + [18]: 'Multiline comment was not closed properly', + [19]: 'The identifier contained dynamic unicode escape that was not closed', + [20]: "Illegal character '%0'", + [21]: 'Missing hexadecimal digits', + [22]: 'Invalid implicit octal', + [23]: 'Invalid line break in string literal', + [24]: 'Only unicode escapes are legal in identifier names', + [25]: "Expected '%0'", + [26]: 'Invalid left-hand side in assignment', + [27]: 'Invalid left-hand side in async arrow', + [28]: 'Calls to super must be in the "constructor" method of a class expression or class declaration that has a superclass', + [29]: 'Member access on super must be in a method', + [31]: 'Await expression not allowed in formal parameter', + [32]: 'Yield expression not allowed in formal parameter', + [95]: "Unexpected token: 'escaped keyword'", + [33]: 'Unary expressions as the left operand of an exponentiation expression must be disambiguated with parentheses', + [123]: 'Async functions can only be declared at the top level or inside a block', + [34]: 'Unterminated regular expression', + [35]: 'Unexpected regular expression flag', + [36]: "Duplicate regular expression flag '%0'", + [37]: '%0 functions must have exactly %1 argument%2', + [38]: 'Setter function argument must not be a rest parameter', + [39]: '%0 declaration must have a name in this context', + [40]: 'Function name may not contain any reserved words or be eval or arguments in strict mode', + [41]: 'The rest operator is missing an argument', + [42]: 'A getter cannot be a generator', + [43]: 'A setter cannot be a generator', + [44]: 'A computed property name must be followed by a colon or paren', + [134]: 'Object literal keys that are strings or numbers must be a method or have a colon', + [46]: 'Found `* async x(){}` but this should be `async * x(){}`', + [45]: 'Getters and setters can not be generators', + [47]: "'%0' can not be generator method", + [48]: "No line break is allowed after '=>'", + [49]: 'The left-hand side of the arrow can only be destructed through assignment', + [50]: 'The binding declaration is not destructible', + [51]: 'Async arrow can not be followed by new expression', + [52]: "Classes may not have a static property named 'prototype'", + [53]: 'Class constructor may not be a %0', + [54]: 'Duplicate constructor method in class', + [55]: 'Invalid increment/decrement operand', + [56]: 'Invalid use of `new` keyword on an increment/decrement expression', + [57]: '`=>` is an invalid assignment target', + [58]: 'Rest element may not have a trailing comma', + [59]: 'Missing initializer in %0 declaration', + [60]: "'for-%0' loop head declarations can not have an initializer", + [61]: 'Invalid left-hand side in for-%0 loop: Must have a single binding', + [62]: 'Invalid shorthand property initializer', + [63]: 'Property name __proto__ appears more than once in object literal', + [64]: 'Let is disallowed as a lexically bound name', + [65]: "Invalid use of '%0' inside new expression", + [66]: "Illegal 'use strict' directive in function with non-simple parameter list", + [67]: 'Identifier "let" disallowed as left-hand side expression in strict mode', + [68]: 'Illegal continue statement', + [69]: 'Illegal break statement', + [70]: 'Cannot have `let[...]` as a var name in strict mode', + [71]: 'Invalid destructuring assignment target', + [72]: 'Rest parameter may not have a default initializer', + [73]: 'The rest argument must the be last parameter', + [74]: 'Invalid rest argument', + [76]: 'In strict mode code, functions can only be declared at top level or inside a block', + [77]: 'In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement', + [78]: 'Without web compatibility enabled functions can not be declared at top level, inside a block, or as the body of an if statement', + [79]: "Class declaration can't appear in single-statement context", + [80]: 'Invalid left-hand side in for-%0', + [81]: 'Invalid assignment in for-%0', + [82]: 'for await (... of ...) is only valid in async functions and async generators', + [83]: 'The first token after the template expression should be a continuation of the template', + [85]: '`let` declaration not allowed here and `let` cannot be a regular var name in strict mode', + [84]: '`let \n [` is a restricted production at the start of a statement', + [86]: 'Catch clause requires exactly one parameter, not more (and no trailing comma)', + [87]: 'Catch clause parameter does not support default values', + [88]: 'Missing catch or finally after try', + [89]: 'More than one default clause in switch statement', + [90]: 'Illegal newline after throw', + [91]: 'Strict mode code may not include a with statement', + [92]: 'Illegal return statement', + [93]: 'The left hand side of the for-header binding declaration is not destructible', + [94]: 'new.target only allowed within functions or static blocks', + [96]: "'#' not followed by identifier", + [102]: 'Invalid keyword', + [101]: "Can not use 'let' as a class name", + [100]: "'A lexical declaration can't define a 'let' binding", + [99]: 'Can not use `let` as variable name in strict mode', + [97]: "'%0' may not be used as an identifier in this context", + [98]: 'Await is only valid in async functions', + [103]: 'The %0 keyword can only be used with the module goal', + [104]: 'Unicode codepoint must not be greater than 0x10FFFF', + [105]: '%0 source must be string', + [106]: 'Only a identifier or string can be used to indicate alias', + [107]: "Only '*' or '{...}' can be imported after default", + [108]: 'Trailing decorator may be followed by method', + [109]: "Decorators can't be used with a constructor", + [110]: 'Can not use `await` as identifier in module or async func', + [111]: 'Can not use `await` as identifier in module', + [112]: 'HTML comments are only allowed with web compatibility (Annex B)', + [113]: "The identifier 'let' must not be in expression position in strict mode", + [114]: 'Cannot assign to `eval` and `arguments` in strict mode', + [115]: "The left-hand side of a for-of loop may not start with 'let'", + [116]: 'Block body arrows can not be immediately invoked without a group', + [117]: 'Block body arrows can not be immediately accessed without a group', + [118]: 'Unexpected strict mode reserved word', + [119]: 'Unexpected eval or arguments in strict mode', + [120]: 'Decorators must not be followed by a semicolon', + [121]: 'Calling delete on expression not allowed in strict mode', + [122]: 'Pattern can not have a tail', + [124]: 'Can not have a `yield` expression on the left side of a ternary', + [125]: 'An arrow function can not have a postfix update operator', + [126]: 'Invalid object literal key character after generator star', + [127]: 'Private fields can not be deleted', + [129]: 'Classes may not have a field called constructor', + [128]: 'Classes may not have a private element named constructor', + [130]: 'A class field initializer or static block may not contain arguments', + [131]: 'Generators can only be declared at the top level or inside a block', + [132]: 'Async methods are a restricted production and cannot have a newline following it', + [133]: 'Unexpected character after object literal property name', + [135]: 'Invalid key token', + [136]: "Label '%0' has already been declared", + [137]: 'continue statement must be nested within an iteration statement', + [138]: "Undefined label '%0'", + [139]: 'Trailing comma is disallowed inside import(...) arguments', + [140]: 'Invalid binding in JSON import', + [141]: 'import() requires exactly one argument', + [142]: 'Cannot use new with import(...)', + [143]: '... is not allowed in import()', + [144]: "Expected '=>'", + [145]: "Duplicate binding '%0'", + [146]: 'Duplicate private identifier #%0', + [147]: "Cannot export a duplicate name '%0'", + [150]: 'Duplicate %0 for-binding', + [148]: "Exported binding '%0' needs to refer to a top-level declared variable", + [149]: 'Unexpected private field', + [153]: 'Numeric separators are not allowed at the end of numeric literals', + [152]: 'Only one underscore is allowed as numeric separator', + [154]: 'JSX value should be either an expression or a quoted JSX text', + [155]: 'Expected corresponding JSX closing tag for %0', + [156]: 'Adjacent JSX elements must be wrapped in an enclosing tag', + [157]: "JSX attributes must only be assigned a non-empty 'expression'", + [158]: "'%0' has already been declared", + [159]: "'%0' shadowed a catch clause binding", + [160]: 'Dot property must be an identifier', + [161]: 'Encountered invalid input after spread/rest argument', + [162]: 'Catch without try', + [163]: 'Finally without try', + [164]: 'Expected corresponding closing tag for JSX fragment', + [165]: 'Coalescing and logical operators used together in the same expression must be disambiguated with parentheses', + [166]: 'Invalid tagged template on optional chain', + [167]: 'Invalid optional chain from super property', + [168]: 'Invalid optional chain from new expression', + [169]: 'Cannot use "import.meta" outside a module', + [170]: 'Leading decorators must be attached to a class declaration', + [171]: 'An export name cannot include a lone surrogate, found %0', + [172]: 'A string literal cannot be used as an exported binding without `from`', + [173]: "Private fields can't be accessed on super", + [174]: "The only valid meta property for import is 'import.meta'", + [175]: "'import.meta' must not contain escaped characters", + [176]: 'cannot use "await" as identifier inside an async function', + [177]: 'cannot use "await" in static blocks', +}; +class ParseError extends SyntaxError { + start; + end; + range; + loc; + description; + constructor(start, end, type, ...params) { + const description = errorMessages[type].replace(/%(\d+)/g, (_, i) => params[i]); + const message = '[' + start.line + ':' + start.column + '-' + end.line + ':' + end.column + ']: ' + description; + super(message); + this.start = start.index; + this.end = end.index; + this.range = [start.index, end.index]; + this.loc = { + start: { line: start.line, column: start.column }, + end: { line: end.line, column: end.column }, + }; + this.description = description; + } +} + +function scanNumber(parser, context, kind) { + let char = parser.currentChar; + let value = 0; + let digit = 9; + let atStart = kind & 64 ? 0 : 1; + let digits = 0; + let allowSeparator = 0; + if (kind & 64) { + value = '.' + scanDecimalDigitsOrSeparator(parser, char); + char = parser.currentChar; + if (char === 110) + parser.report(12); + } + else { + if (char === 48) { + char = advanceChar(parser); + if ((char | 32) === 120) { + kind = 8 | 128; + char = advanceChar(parser); + while (CharTypes[char] & (64 | 4096)) { + if (char === 95) { + if (!allowSeparator) + parser.report(152); + allowSeparator = 0; + char = advanceChar(parser); + continue; + } + allowSeparator = 1; + value = value * 0x10 + toHex(char); + digits++; + char = advanceChar(parser); + } + if (digits === 0 || !allowSeparator) { + parser.report(digits === 0 ? 21 : 153); + } + } + else if ((char | 32) === 111) { + kind = 4 | 128; + char = advanceChar(parser); + while (CharTypes[char] & (32 | 4096)) { + if (char === 95) { + if (!allowSeparator) { + parser.report(152); + } + allowSeparator = 0; + char = advanceChar(parser); + continue; + } + allowSeparator = 1; + value = value * 8 + (char - 48); + digits++; + char = advanceChar(parser); + } + if (digits === 0 || !allowSeparator) { + parser.report(digits === 0 ? 0 : 153); + } + } + else if ((char | 32) === 98) { + kind = 2 | 128; + char = advanceChar(parser); + while (CharTypes[char] & (128 | 4096)) { + if (char === 95) { + if (!allowSeparator) { + parser.report(152); + } + allowSeparator = 0; + char = advanceChar(parser); + continue; + } + allowSeparator = 1; + value = value * 2 + (char - 48); + digits++; + char = advanceChar(parser); + } + if (digits === 0 || !allowSeparator) { + parser.report(digits === 0 ? 0 : 153); + } + } + else if (CharTypes[char] & 32) { + if (context & 1) + parser.report(1); + kind = 1; + while (CharTypes[char] & 16) { + if (CharTypes[char] & 512) { + kind = 32; + atStart = 0; + break; + } + value = value * 8 + (char - 48); + char = advanceChar(parser); + } + } + else if (CharTypes[char] & 512) { + if (context & 1) + parser.report(1); + parser.flags |= 64; + kind = 32; + } + else if (char === 95) { + parser.report(0); + } + } + if (kind & 48) { + if (atStart) { + while (digit >= 0 && CharTypes[char] & (16 | 4096)) { + if (char === 95) { + char = advanceChar(parser); + if (char === 95 || kind & 32) { + throw new ParseError(parser.currentLocation, { index: parser.index + 1, line: parser.line, column: parser.column }, 152); + } + allowSeparator = 1; + continue; + } + allowSeparator = 0; + value = 10 * value + (char - 48); + char = advanceChar(parser); + --digit; + } + if (allowSeparator) { + throw new ParseError(parser.currentLocation, { index: parser.index + 1, line: parser.line, column: parser.column }, 153); + } + if (digit >= 0 && !isIdentifierStart(char) && char !== 46) { + parser.tokenValue = value; + if (parser.options.raw) + parser.tokenRaw = parser.source.slice(parser.tokenIndex, parser.index); + return 134283266; + } + } + value += scanDecimalDigitsOrSeparator(parser, char); + char = parser.currentChar; + if (char === 46) { + if (advanceChar(parser) === 95) + parser.report(0); + kind = 64; + value += '.' + scanDecimalDigitsOrSeparator(parser, parser.currentChar); + char = parser.currentChar; + } + } + } + const end = parser.index; + let isBigInt = 0; + if (char === 110 && kind & 128) { + isBigInt = 1; + char = advanceChar(parser); + } + else { + if ((char | 32) === 101) { + char = advanceChar(parser); + if (CharTypes[char] & 256) + char = advanceChar(parser); + const { index } = parser; + if ((CharTypes[char] & 16) === 0) + parser.report(11); + value += parser.source.substring(end, index) + scanDecimalDigitsOrSeparator(parser, char); + char = parser.currentChar; + } + } + if ((parser.index < parser.end && CharTypes[char] & 16) || isIdentifierStart(char)) { + parser.report(13); + } + if (isBigInt) { + parser.tokenRaw = parser.source.slice(parser.tokenIndex, parser.index); + parser.tokenValue = BigInt(parser.tokenRaw.slice(0, -1).replaceAll('_', '')); + return 134283388; + } + parser.tokenValue = + kind & (1 | 2 | 8 | 4) + ? value + : kind & 32 + ? parseFloat(parser.source.substring(parser.tokenIndex, parser.index)) + : +value; + if (parser.options.raw) + parser.tokenRaw = parser.source.slice(parser.tokenIndex, parser.index); + return 134283266; +} +function scanDecimalDigitsOrSeparator(parser, char) { + let allowSeparator = 0; + let start = parser.index; + let ret = ''; + while (CharTypes[char] & (16 | 4096)) { + if (char === 95) { + const { index } = parser; + char = advanceChar(parser); + if (char === 95) { + throw new ParseError(parser.currentLocation, { index: parser.index + 1, line: parser.line, column: parser.column }, 152); + } + allowSeparator = 1; + ret += parser.source.substring(start, index); + start = parser.index; + continue; + } + allowSeparator = 0; + char = advanceChar(parser); + } + if (allowSeparator) { + throw new ParseError(parser.currentLocation, { index: parser.index + 1, line: parser.line, column: parser.column }, 153); + } + return ret + parser.source.substring(start, parser.index); +} + +const KeywordDescTable = [ + 'end of source', + 'identifier', 'number', 'string', 'regular expression', + 'false', 'true', 'null', + 'template continuation', 'template tail', + '=>', '(', '{', '.', '...', '}', ')', ';', ',', '[', ']', ':', '?', '\'', '"', + '++', '--', + '=', '<<=', '>>=', '>>>=', '**=', '+=', '-=', '*=', '/=', '%=', '^=', '|=', + '&=', '||=', '&&=', '??=', + 'typeof', 'delete', 'void', '!', '~', '+', '-', 'in', 'instanceof', '*', '%', '/', '**', '&&', + '||', '===', '!==', '==', '!=', '<=', '>=', '<', '>', '<<', '>>', '>>>', '&', '|', '^', + 'var', 'let', 'const', + 'break', 'case', 'catch', 'class', 'continue', 'debugger', 'default', 'do', 'else', 'export', + 'extends', 'finally', 'for', 'function', 'if', 'import', 'new', 'return', 'super', 'switch', + 'this', 'throw', 'try', 'while', 'with', + 'implements', 'interface', 'package', 'private', 'protected', 'public', 'static', 'yield', + 'as', 'async', 'await', 'constructor', 'get', 'set', 'accessor', 'from', 'of', + 'enum', 'eval', 'arguments', 'escaped keyword', 'escaped future reserved keyword', 'reserved if strict', '#', + 'BigIntLiteral', '??', '?.', 'WhiteSpace', 'Illegal', 'LineTerminator', 'PrivateField', + 'Template', '@', 'target', 'meta', 'LineFeed', 'Escaped', 'JSXText' +]; +const descKeywordTable = { + this: 86111, + function: 86104, + if: 20569, + return: 20572, + var: 86088, + else: 20563, + for: 20567, + new: 86107, + in: 8673330, + typeof: 16863275, + while: 20578, + case: 20556, + break: 20555, + try: 20577, + catch: 20557, + delete: 16863276, + throw: 86112, + switch: 86110, + continue: 20559, + default: 20561, + instanceof: 8411187, + do: 20562, + void: 16863277, + finally: 20566, + async: 209005, + await: 209006, + class: 86094, + const: 86090, + constructor: 12399, + debugger: 20560, + export: 20564, + extends: 20565, + false: 86021, + from: 209011, + get: 209008, + implements: 36964, + import: 86106, + interface: 36965, + let: 241737, + null: 86023, + of: 471156, + package: 36966, + private: 36967, + protected: 36968, + public: 36969, + set: 209009, + static: 36970, + super: 86109, + true: 86022, + with: 20579, + yield: 241771, + enum: 86133, + eval: 537079926, + as: 77932, + arguments: 537079927, + target: 209029, + meta: 209030, + accessor: 12402, +}; + +function matchOrInsertSemicolon(parser, context) { + if ((parser.flags & 1) === 0 && (parser.getToken() & 1048576) !== 1048576) { + parser.report(30, KeywordDescTable[parser.getToken() & 255]); + } + if (!consumeOpt(parser, context, 1074790417)) { + parser.options.onInsertedSemicolon?.(parser.startIndex); + } +} +function isValidStrictMode(parser, index, tokenIndex, tokenValue) { + if (index - tokenIndex < 13 && tokenValue === 'use strict') { + if ((parser.getToken() & 1048576) === 1048576 || parser.flags & 1) { + return 1; + } + } + return 0; +} +function optionalBit(parser, context, t) { + if (parser.getToken() !== t) + return 0; + nextToken(parser, context); + return 1; +} +function consumeOpt(parser, context, t) { + if (parser.getToken() !== t) + return false; + nextToken(parser, context); + return true; +} +function consume(parser, context, t) { + if (parser.getToken() !== t) + parser.report(25, KeywordDescTable[t & 255]); + nextToken(parser, context); +} +function reinterpretToPattern(parser, node) { + switch (node.type) { + case 'ArrayExpression': { + node.type = 'ArrayPattern'; + const { elements } = node; + for (let i = 0, n = elements.length; i < n; ++i) { + const element = elements[i]; + if (element) + reinterpretToPattern(parser, element); + } + return; + } + case 'ObjectExpression': { + node.type = 'ObjectPattern'; + const { properties } = node; + for (let i = 0, n = properties.length; i < n; ++i) { + reinterpretToPattern(parser, properties[i]); + } + return; + } + case 'AssignmentExpression': + node.type = 'AssignmentPattern'; + if (node.operator !== '=') + parser.report(71); + delete node.operator; + reinterpretToPattern(parser, node.left); + return; + case 'Property': + reinterpretToPattern(parser, node.value); + return; + case 'SpreadElement': + node.type = 'RestElement'; + reinterpretToPattern(parser, node.argument); + } +} +function validateBindingIdentifier(parser, context, kind, t, skipEvalArgCheck) { + if (context & 1) { + if ((t & 36864) === 36864) { + parser.report(118); + } + if (!skipEvalArgCheck && (t & 537079808) === 537079808) { + parser.report(119); + } + } + if ((t & 20480) === 20480 || t === -2147483528) { + parser.report(102); + } + if (kind & (8 | 16) && (t & 255) === (241737 & 255)) { + parser.report(100); + } + if (context & (2048 | 2) && t === 209006) { + parser.report(110); + } + if (context & (1024 | 1) && t === 241771) { + parser.report(97, 'yield'); + } +} +function validateFunctionName(parser, context, t) { + if (context & 1) { + if ((t & 36864) === 36864) { + parser.report(118); + } + if ((t & 537079808) === 537079808) { + parser.report(119); + } + if (t === -2147483527) { + parser.report(95); + } + if (t === -2147483528) { + parser.report(95); + } + } + if ((t & 20480) === 20480) { + parser.report(102); + } + if (context & (2048 | 2) && t === 209006) { + parser.report(110); + } + if (context & (1024 | 1) && t === 241771) { + parser.report(97, 'yield'); + } +} +function isStrictReservedWord(parser, context, t) { + if (t === 209006) { + if (context & (2048 | 2)) + parser.report(110); + parser.destructible |= 128; + } + if (t === 241771 && context & 1024) + parser.report(97, 'yield'); + return ((t & 20480) === 20480 || + (t & 36864) === 36864 || + t == -2147483527); +} +function isPropertyWithPrivateFieldKey(expr) { + return !expr.property ? false : expr.property.type === 'PrivateIdentifier'; +} +function isValidLabel(parser, labels, name, isIterationStatement) { + while (labels) { + if (labels['$' + name]) { + if (isIterationStatement) + parser.report(137); + return 1; + } + if (isIterationStatement && labels.loop) + isIterationStatement = 0; + labels = labels['$']; + } + return 0; +} +function validateAndDeclareLabel(parser, labels, name) { + let set = labels; + while (set) { + if (set['$' + name]) + parser.report(136, name); + set = set['$']; + } + labels['$' + name] = 1; +} +function isEqualTagName(elementName) { + switch (elementName.type) { + case 'JSXIdentifier': + return elementName.name; + case 'JSXNamespacedName': + return elementName.namespace + ':' + elementName.name; + case 'JSXMemberExpression': + return isEqualTagName(elementName.object) + '.' + isEqualTagName(elementName.property); + } +} +function isValidIdentifier(context, t) { + if (context & (1 | 1024)) { + if (context & 2 && t === 209006) + return false; + if (context & 1024 && t === 241771) + return false; + return (t & 12288) === 12288; + } + return (t & 12288) === 12288 || (t & 36864) === 36864; +} +function classifyIdentifier(parser, context, t) { + if ((t & 537079808) === 537079808) { + if (context & 1) + parser.report(119); + parser.flags |= 512; + } + if (!isValidIdentifier(context, t)) + parser.report(0); +} +function getOwnProperty(object, key) { + return Object.hasOwn(object, key) ? object[key] : undefined; +} + +function scanIdentifier(parser, context, isValidAsKeyword) { + while (isIdPart[advanceChar(parser)]) + ; + parser.tokenValue = parser.source.slice(parser.tokenIndex, parser.index); + return parser.currentChar !== 92 && parser.currentChar <= 0x7e + ? (getOwnProperty(descKeywordTable, parser.tokenValue) ?? 208897) + : scanIdentifierSlowCase(parser, context, 0, isValidAsKeyword); +} +function scanUnicodeIdentifier(parser, context) { + const cookedChar = scanIdentifierUnicodeEscape(parser); + if (!isIdentifierStart(cookedChar)) + parser.report(5); + parser.tokenValue = String.fromCodePoint(cookedChar); + return scanIdentifierSlowCase(parser, context, 1, CharTypes[cookedChar] & 4); +} +function scanIdentifierSlowCase(parser, context, hasEscape, isValidAsKeyword) { + let start = parser.index; + while (parser.index < parser.end) { + if (parser.currentChar === 92) { + parser.tokenValue += parser.source.slice(start, parser.index); + hasEscape = 1; + const code = scanIdentifierUnicodeEscape(parser); + if (!isIdentifierPart(code)) + parser.report(5); + isValidAsKeyword = isValidAsKeyword && CharTypes[code] & 4; + parser.tokenValue += String.fromCodePoint(code); + start = parser.index; + } + else { + const merged = consumePossibleSurrogatePair(parser); + if (merged > 0) { + if (!isIdentifierPart(merged)) { + parser.report(20, String.fromCodePoint(merged)); + } + parser.currentChar = merged; + parser.index++; + parser.column++; + } + else if (!isIdentifierPart(parser.currentChar)) { + break; + } + advanceChar(parser); + } + } + if (parser.index <= parser.end) { + parser.tokenValue += parser.source.slice(start, parser.index); + } + const { length } = parser.tokenValue; + if (isValidAsKeyword && length >= 2 && length <= 11) { + const token = getOwnProperty(descKeywordTable, parser.tokenValue); + if (token === void 0) + return 208897 | (hasEscape ? -2147483648 : 0); + if (!hasEscape) + return token; + if (token === 209006) { + if ((context & (2 | 2048)) === 0) { + return token | -2147483648; + } + return -2147483528; + } + if (context & 1) { + if (token === 36970) { + return -2147483527; + } + if ((token & 36864) === 36864) { + return -2147483527; + } + if ((token & 20480) === 20480) { + if (context & 262144 && (context & 8) === 0) { + return token | -2147483648; + } + else { + return -2147483528; + } + } + return 209018 | -2147483648; + } + if (context & 262144 && + (context & 8) === 0 && + (token & 20480) === 20480) { + return token | -2147483648; + } + if (token === 241771) { + return context & 262144 + ? 209018 | -2147483648 + : context & 1024 + ? -2147483528 + : token | -2147483648; + } + if (token === 209005) { + return 209018 | -2147483648; + } + if ((token & 36864) === 36864) { + return token | 12288 | -2147483648; + } + return -2147483528; + } + return 208897 | (hasEscape ? -2147483648 : 0); +} +function scanPrivateIdentifier(parser) { + let char = advanceChar(parser); + if (char === 92) + return 130; + const merged = consumePossibleSurrogatePair(parser); + if (merged) + char = merged; + if (!isIdentifierStart(char)) + parser.report(96); + return 130; +} +function scanIdentifierUnicodeEscape(parser) { + if (parser.source.charCodeAt(parser.index + 1) !== 117) { + parser.report(5); + } + parser.currentChar = parser.source.charCodeAt((parser.index += 2)); + parser.column += 2; + return scanUnicodeEscape(parser); +} +function scanUnicodeEscape(parser) { + let codePoint = 0; + const char = parser.currentChar; + if (char === 123) { + const begin = parser.index - 2; + while (CharTypes[advanceChar(parser)] & 64) { + codePoint = (codePoint << 4) | toHex(parser.currentChar); + if (codePoint > 1114111) + throw new ParseError({ index: begin, line: parser.line, column: parser.column }, parser.currentLocation, 104); + } + if (parser.currentChar !== 125) { + throw new ParseError({ index: begin, line: parser.line, column: parser.column }, parser.currentLocation, 7); + } + advanceChar(parser); + return codePoint; + } + if ((CharTypes[char] & 64) === 0) + parser.report(7); + const char2 = parser.source.charCodeAt(parser.index + 1); + if ((CharTypes[char2] & 64) === 0) + parser.report(7); + const char3 = parser.source.charCodeAt(parser.index + 2); + if ((CharTypes[char3] & 64) === 0) + parser.report(7); + const char4 = parser.source.charCodeAt(parser.index + 3); + if ((CharTypes[char4] & 64) === 0) + parser.report(7); + codePoint = (toHex(char) << 12) | (toHex(char2) << 8) | (toHex(char3) << 4) | toHex(char4); + parser.currentChar = parser.source.charCodeAt((parser.index += 4)); + parser.column += 4; + return codePoint; +} + +const TokenLookup = [ + 128, + 128, + 128, + 128, + 128, + 128, + 128, + 128, + 128, + 127, + 135, + 127, + 127, + 129, + 128, + 128, + 128, + 128, + 128, + 128, + 128, + 128, + 128, + 128, + 128, + 128, + 128, + 128, + 128, + 128, + 128, + 128, + 127, + 16842798, + 134283267, + 130, + 208897, + 8391477, + 8390213, + 134283267, + 67174411, + 16, + 8391476, + 25233968, + 18, + 25233969, + 67108877, + 8457014, + 134283266, + 134283266, + 134283266, + 134283266, + 134283266, + 134283266, + 134283266, + 134283266, + 134283266, + 134283266, + 21, + 1074790417, + 8456256, + 1077936155, + 8390721, + 22, + 132, + 208897, + 208897, + 208897, + 208897, + 208897, + 208897, + 208897, + 208897, + 208897, + 208897, + 208897, + 208897, + 208897, + 208897, + 208897, + 208897, + 208897, + 208897, + 208897, + 208897, + 208897, + 208897, + 208897, + 208897, + 208897, + 208897, + 69271571, + 136, + 20, + 8389959, + 208897, + 131, + 4096, + 4096, + 4096, + 4096, + 4096, + 4096, + 4096, + 208897, + 4096, + 208897, + 208897, + 4096, + 208897, + 4096, + 208897, + 4096, + 208897, + 4096, + 4096, + 4096, + 208897, + 4096, + 4096, + 208897, + 4096, + 4096, + 2162700, + 8389702, + 1074790415, + 16842799, + 128, +]; +function nextToken(parser, context) { + parser.flags = (parser.flags | 1) ^ 1; + parser.startIndex = parser.index; + parser.startColumn = parser.column; + parser.startLine = parser.line; + parser.setToken(scanSingleToken(parser, context, 0)); +} +function scanSingleToken(parser, context, state) { + const isStartOfLine = parser.index === 0; + const { source } = parser; + let start = parser.currentLocation; + while (parser.index < parser.end) { + parser.tokenIndex = parser.index; + parser.tokenColumn = parser.column; + parser.tokenLine = parser.line; + let char = parser.currentChar; + if (char <= 0x7e) { + const token = TokenLookup[char]; + switch (token) { + case 67174411: + case 16: + case 2162700: + case 1074790415: + case 69271571: + case 20: + case 21: + case 1074790417: + case 18: + case 16842799: + case 132: + case 128: + advanceChar(parser); + return token; + case 208897: + return scanIdentifier(parser, context, 0); + case 4096: + return scanIdentifier(parser, context, 1); + case 134283266: + return scanNumber(parser, context, 16 | 128); + case 134283267: + return scanString(parser, context, char); + case 131: + return scanTemplate(parser, context); + case 136: + return scanUnicodeIdentifier(parser, context); + case 130: + return scanPrivateIdentifier(parser); + case 127: + advanceChar(parser); + break; + case 129: + state |= 1 | 4; + scanNewLine(parser); + break; + case 135: + consumeLineFeed(parser, state); + state = (state & -5) | 1; + break; + case 8456256: { + const ch = advanceChar(parser); + if (parser.index < parser.end) { + if (ch === 60) { + if (parser.index < parser.end && advanceChar(parser) === 61) { + advanceChar(parser); + return 4194332; + } + return 8390978; + } + else if (ch === 61) { + advanceChar(parser); + return 8390718; + } + if (ch === 33) { + const index = parser.index + 1; + if (index + 1 < parser.end && + source.charCodeAt(index) === 45 && + source.charCodeAt(index + 1) == 45) { + parser.column += 3; + parser.currentChar = source.charCodeAt((parser.index += 3)); + state = skipSingleHTMLComment(parser, source, state, context, 2, parser.tokenStart); + start = parser.tokenStart; + continue; + } + return 8456256; + } + } + return 8456256; + } + case 1077936155: { + advanceChar(parser); + const ch = parser.currentChar; + if (ch === 61) { + if (advanceChar(parser) === 61) { + advanceChar(parser); + return 8390458; + } + return 8390460; + } + if (ch === 62) { + advanceChar(parser); + return 10; + } + return 1077936155; + } + case 16842798: + if (advanceChar(parser) !== 61) { + return 16842798; + } + if (advanceChar(parser) !== 61) { + return 8390461; + } + advanceChar(parser); + return 8390459; + case 8391477: + if (advanceChar(parser) !== 61) + return 8391477; + advanceChar(parser); + return 4194340; + case 8391476: { + advanceChar(parser); + if (parser.index >= parser.end) + return 8391476; + const ch = parser.currentChar; + if (ch === 61) { + advanceChar(parser); + return 4194338; + } + if (ch !== 42) + return 8391476; + if (advanceChar(parser) !== 61) + return 8391735; + advanceChar(parser); + return 4194335; + } + case 8389959: + if (advanceChar(parser) !== 61) + return 8389959; + advanceChar(parser); + return 4194341; + case 25233968: { + advanceChar(parser); + const ch = parser.currentChar; + if (ch === 43) { + advanceChar(parser); + return 33619993; + } + if (ch === 61) { + advanceChar(parser); + return 4194336; + } + return 25233968; + } + case 25233969: { + advanceChar(parser); + const ch = parser.currentChar; + if (ch === 45) { + advanceChar(parser); + if ((state & 1 || isStartOfLine) && parser.currentChar === 62) { + if (!parser.options.webcompat) + parser.report(112); + advanceChar(parser); + state = skipSingleHTMLComment(parser, source, state, context, 3, start); + start = parser.tokenStart; + continue; + } + return 33619994; + } + if (ch === 61) { + advanceChar(parser); + return 4194337; + } + return 25233969; + } + case 8457014: { + advanceChar(parser); + if (parser.index < parser.end) { + const ch = parser.currentChar; + if (ch === 47) { + advanceChar(parser); + state = skipSingleLineComment(parser, source, state, 0, parser.tokenStart); + start = parser.tokenStart; + continue; + } + if (ch === 42) { + advanceChar(parser); + state = skipMultiLineComment(parser, source, state); + start = parser.tokenStart; + continue; + } + if (context & 32) { + return scanRegularExpression(parser); + } + if (ch === 61) { + advanceChar(parser); + return 4259875; + } + } + return 8457014; + } + case 67108877: { + const next = advanceChar(parser); + if (next >= 48 && next <= 57) + return scanNumber(parser, context, 64 | 16); + if (next === 46) { + const index = parser.index + 1; + if (index < parser.end && source.charCodeAt(index) === 46) { + parser.column += 2; + parser.currentChar = source.charCodeAt((parser.index += 2)); + return 14; + } + } + return 67108877; + } + case 8389702: { + advanceChar(parser); + const ch = parser.currentChar; + if (ch === 124) { + advanceChar(parser); + if (parser.currentChar === 61) { + advanceChar(parser); + return 4194344; + } + return 8913465; + } + if (ch === 61) { + advanceChar(parser); + return 4194342; + } + return 8389702; + } + case 8390721: { + advanceChar(parser); + const ch = parser.currentChar; + if (ch === 61) { + advanceChar(parser); + return 8390719; + } + if (ch !== 62) + return 8390721; + advanceChar(parser); + if (parser.index < parser.end) { + const ch = parser.currentChar; + if (ch === 62) { + if (advanceChar(parser) === 61) { + advanceChar(parser); + return 4194334; + } + return 8390980; + } + if (ch === 61) { + advanceChar(parser); + return 4194333; + } + } + return 8390979; + } + case 8390213: { + advanceChar(parser); + const ch = parser.currentChar; + if (ch === 38) { + advanceChar(parser); + if (parser.currentChar === 61) { + advanceChar(parser); + return 4194345; + } + return 8913720; + } + if (ch === 61) { + advanceChar(parser); + return 4194343; + } + return 8390213; + } + case 22: { + let ch = advanceChar(parser); + if (ch === 63) { + advanceChar(parser); + if (parser.currentChar === 61) { + advanceChar(parser); + return 4194346; + } + return 276824445; + } + if (ch === 46) { + const index = parser.index + 1; + if (index < parser.end) { + ch = source.charCodeAt(index); + if (!(ch >= 48 && ch <= 57)) { + advanceChar(parser); + return 67108990; + } + } + } + return 22; + } + } + } + else { + if ((char ^ 8232) <= 1) { + state = (state & -5) | 1; + scanNewLine(parser); + continue; + } + const merged = consumePossibleSurrogatePair(parser); + if (merged > 0) + char = merged; + if (isIDStart(char)) { + parser.tokenValue = ''; + return scanIdentifierSlowCase(parser, context, 0, 0); + } + if (isExoticECMAScriptWhitespace(char)) { + advanceChar(parser); + continue; + } + parser.report(20, String.fromCodePoint(char)); + } + } + return 1048576; +} + +const entities = { + AElig: '\u00C6', + AMP: '\u0026', + Aacute: '\u00C1', + Abreve: '\u0102', + Acirc: '\u00C2', + Acy: '\u0410', + Afr: '\uD835\uDD04', + Agrave: '\u00C0', + Alpha: '\u0391', + Amacr: '\u0100', + And: '\u2A53', + Aogon: '\u0104', + Aopf: '\uD835\uDD38', + ApplyFunction: '\u2061', + Aring: '\u00C5', + Ascr: '\uD835\uDC9C', + Assign: '\u2254', + Atilde: '\u00C3', + Auml: '\u00C4', + Backslash: '\u2216', + Barv: '\u2AE7', + Barwed: '\u2306', + Bcy: '\u0411', + Because: '\u2235', + Bernoullis: '\u212C', + Beta: '\u0392', + Bfr: '\uD835\uDD05', + Bopf: '\uD835\uDD39', + Breve: '\u02D8', + Bscr: '\u212C', + Bumpeq: '\u224E', + CHcy: '\u0427', + COPY: '\u00A9', + Cacute: '\u0106', + Cap: '\u22D2', + CapitalDifferentialD: '\u2145', + Cayleys: '\u212D', + Ccaron: '\u010C', + Ccedil: '\u00C7', + Ccirc: '\u0108', + Cconint: '\u2230', + Cdot: '\u010A', + Cedilla: '\u00B8', + CenterDot: '\u00B7', + Cfr: '\u212D', + Chi: '\u03A7', + CircleDot: '\u2299', + CircleMinus: '\u2296', + CirclePlus: '\u2295', + CircleTimes: '\u2297', + ClockwiseContourIntegral: '\u2232', + CloseCurlyDoubleQuote: '\u201D', + CloseCurlyQuote: '\u2019', + Colon: '\u2237', + Colone: '\u2A74', + Congruent: '\u2261', + Conint: '\u222F', + ContourIntegral: '\u222E', + Copf: '\u2102', + Coproduct: '\u2210', + CounterClockwiseContourIntegral: '\u2233', + Cross: '\u2A2F', + Cscr: '\uD835\uDC9E', + Cup: '\u22D3', + CupCap: '\u224D', + DD: '\u2145', + DDotrahd: '\u2911', + DJcy: '\u0402', + DScy: '\u0405', + DZcy: '\u040F', + Dagger: '\u2021', + Darr: '\u21A1', + Dashv: '\u2AE4', + Dcaron: '\u010E', + Dcy: '\u0414', + Del: '\u2207', + Delta: '\u0394', + Dfr: '\uD835\uDD07', + DiacriticalAcute: '\u00B4', + DiacriticalDot: '\u02D9', + DiacriticalDoubleAcute: '\u02DD', + DiacriticalGrave: '\u0060', + DiacriticalTilde: '\u02DC', + Diamond: '\u22C4', + DifferentialD: '\u2146', + Dopf: '\uD835\uDD3B', + Dot: '\u00A8', + DotDot: '\u20DC', + DotEqual: '\u2250', + DoubleContourIntegral: '\u222F', + DoubleDot: '\u00A8', + DoubleDownArrow: '\u21D3', + DoubleLeftArrow: '\u21D0', + DoubleLeftRightArrow: '\u21D4', + DoubleLeftTee: '\u2AE4', + DoubleLongLeftArrow: '\u27F8', + DoubleLongLeftRightArrow: '\u27FA', + DoubleLongRightArrow: '\u27F9', + DoubleRightArrow: '\u21D2', + DoubleRightTee: '\u22A8', + DoubleUpArrow: '\u21D1', + DoubleUpDownArrow: '\u21D5', + DoubleVerticalBar: '\u2225', + DownArrow: '\u2193', + DownArrowBar: '\u2913', + DownArrowUpArrow: '\u21F5', + DownBreve: '\u0311', + DownLeftRightVector: '\u2950', + DownLeftTeeVector: '\u295E', + DownLeftVector: '\u21BD', + DownLeftVectorBar: '\u2956', + DownRightTeeVector: '\u295F', + DownRightVector: '\u21C1', + DownRightVectorBar: '\u2957', + DownTee: '\u22A4', + DownTeeArrow: '\u21A7', + Downarrow: '\u21D3', + Dscr: '\uD835\uDC9F', + Dstrok: '\u0110', + ENG: '\u014A', + ETH: '\u00D0', + Eacute: '\u00C9', + Ecaron: '\u011A', + Ecirc: '\u00CA', + Ecy: '\u042D', + Edot: '\u0116', + Efr: '\uD835\uDD08', + Egrave: '\u00C8', + Element: '\u2208', + Emacr: '\u0112', + EmptySmallSquare: '\u25FB', + EmptyVerySmallSquare: '\u25AB', + Eogon: '\u0118', + Eopf: '\uD835\uDD3C', + Epsilon: '\u0395', + Equal: '\u2A75', + EqualTilde: '\u2242', + Equilibrium: '\u21CC', + Escr: '\u2130', + Esim: '\u2A73', + Eta: '\u0397', + Euml: '\u00CB', + Exists: '\u2203', + ExponentialE: '\u2147', + Fcy: '\u0424', + Ffr: '\uD835\uDD09', + FilledSmallSquare: '\u25FC', + FilledVerySmallSquare: '\u25AA', + Fopf: '\uD835\uDD3D', + ForAll: '\u2200', + Fouriertrf: '\u2131', + Fscr: '\u2131', + GJcy: '\u0403', + GT: '\u003E', + Gamma: '\u0393', + Gammad: '\u03DC', + Gbreve: '\u011E', + Gcedil: '\u0122', + Gcirc: '\u011C', + Gcy: '\u0413', + Gdot: '\u0120', + Gfr: '\uD835\uDD0A', + Gg: '\u22D9', + Gopf: '\uD835\uDD3E', + GreaterEqual: '\u2265', + GreaterEqualLess: '\u22DB', + GreaterFullEqual: '\u2267', + GreaterGreater: '\u2AA2', + GreaterLess: '\u2277', + GreaterSlantEqual: '\u2A7E', + GreaterTilde: '\u2273', + Gscr: '\uD835\uDCA2', + Gt: '\u226B', + HARDcy: '\u042A', + Hacek: '\u02C7', + Hat: '\u005E', + Hcirc: '\u0124', + Hfr: '\u210C', + HilbertSpace: '\u210B', + Hopf: '\u210D', + HorizontalLine: '\u2500', + Hscr: '\u210B', + Hstrok: '\u0126', + HumpDownHump: '\u224E', + HumpEqual: '\u224F', + IEcy: '\u0415', + IJlig: '\u0132', + IOcy: '\u0401', + Iacute: '\u00CD', + Icirc: '\u00CE', + Icy: '\u0418', + Idot: '\u0130', + Ifr: '\u2111', + Igrave: '\u00CC', + Im: '\u2111', + Imacr: '\u012A', + ImaginaryI: '\u2148', + Implies: '\u21D2', + Int: '\u222C', + Integral: '\u222B', + Intersection: '\u22C2', + InvisibleComma: '\u2063', + InvisibleTimes: '\u2062', + Iogon: '\u012E', + Iopf: '\uD835\uDD40', + Iota: '\u0399', + Iscr: '\u2110', + Itilde: '\u0128', + Iukcy: '\u0406', + Iuml: '\u00CF', + Jcirc: '\u0134', + Jcy: '\u0419', + Jfr: '\uD835\uDD0D', + Jopf: '\uD835\uDD41', + Jscr: '\uD835\uDCA5', + Jsercy: '\u0408', + Jukcy: '\u0404', + KHcy: '\u0425', + KJcy: '\u040C', + Kappa: '\u039A', + Kcedil: '\u0136', + Kcy: '\u041A', + Kfr: '\uD835\uDD0E', + Kopf: '\uD835\uDD42', + Kscr: '\uD835\uDCA6', + LJcy: '\u0409', + LT: '\u003C', + Lacute: '\u0139', + Lambda: '\u039B', + Lang: '\u27EA', + Laplacetrf: '\u2112', + Larr: '\u219E', + Lcaron: '\u013D', + Lcedil: '\u013B', + Lcy: '\u041B', + LeftAngleBracket: '\u27E8', + LeftArrow: '\u2190', + LeftArrowBar: '\u21E4', + LeftArrowRightArrow: '\u21C6', + LeftCeiling: '\u2308', + LeftDoubleBracket: '\u27E6', + LeftDownTeeVector: '\u2961', + LeftDownVector: '\u21C3', + LeftDownVectorBar: '\u2959', + LeftFloor: '\u230A', + LeftRightArrow: '\u2194', + LeftRightVector: '\u294E', + LeftTee: '\u22A3', + LeftTeeArrow: '\u21A4', + LeftTeeVector: '\u295A', + LeftTriangle: '\u22B2', + LeftTriangleBar: '\u29CF', + LeftTriangleEqual: '\u22B4', + LeftUpDownVector: '\u2951', + LeftUpTeeVector: '\u2960', + LeftUpVector: '\u21BF', + LeftUpVectorBar: '\u2958', + LeftVector: '\u21BC', + LeftVectorBar: '\u2952', + Leftarrow: '\u21D0', + Leftrightarrow: '\u21D4', + LessEqualGreater: '\u22DA', + LessFullEqual: '\u2266', + LessGreater: '\u2276', + LessLess: '\u2AA1', + LessSlantEqual: '\u2A7D', + LessTilde: '\u2272', + Lfr: '\uD835\uDD0F', + Ll: '\u22D8', + Lleftarrow: '\u21DA', + Lmidot: '\u013F', + LongLeftArrow: '\u27F5', + LongLeftRightArrow: '\u27F7', + LongRightArrow: '\u27F6', + Longleftarrow: '\u27F8', + Longleftrightarrow: '\u27FA', + Longrightarrow: '\u27F9', + Lopf: '\uD835\uDD43', + LowerLeftArrow: '\u2199', + LowerRightArrow: '\u2198', + Lscr: '\u2112', + Lsh: '\u21B0', + Lstrok: '\u0141', + Lt: '\u226A', + Map: '\u2905', + Mcy: '\u041C', + MediumSpace: '\u205F', + Mellintrf: '\u2133', + Mfr: '\uD835\uDD10', + MinusPlus: '\u2213', + Mopf: '\uD835\uDD44', + Mscr: '\u2133', + Mu: '\u039C', + NJcy: '\u040A', + Nacute: '\u0143', + Ncaron: '\u0147', + Ncedil: '\u0145', + Ncy: '\u041D', + NegativeMediumSpace: '\u200B', + NegativeThickSpace: '\u200B', + NegativeThinSpace: '\u200B', + NegativeVeryThinSpace: '\u200B', + NestedGreaterGreater: '\u226B', + NestedLessLess: '\u226A', + NewLine: '\u000A', + Nfr: '\uD835\uDD11', + NoBreak: '\u2060', + NonBreakingSpace: '\u00A0', + Nopf: '\u2115', + Not: '\u2AEC', + NotCongruent: '\u2262', + NotCupCap: '\u226D', + NotDoubleVerticalBar: '\u2226', + NotElement: '\u2209', + NotEqual: '\u2260', + NotEqualTilde: '\u2242\u0338', + NotExists: '\u2204', + NotGreater: '\u226F', + NotGreaterEqual: '\u2271', + NotGreaterFullEqual: '\u2267\u0338', + NotGreaterGreater: '\u226B\u0338', + NotGreaterLess: '\u2279', + NotGreaterSlantEqual: '\u2A7E\u0338', + NotGreaterTilde: '\u2275', + NotHumpDownHump: '\u224E\u0338', + NotHumpEqual: '\u224F\u0338', + NotLeftTriangle: '\u22EA', + NotLeftTriangleBar: '\u29CF\u0338', + NotLeftTriangleEqual: '\u22EC', + NotLess: '\u226E', + NotLessEqual: '\u2270', + NotLessGreater: '\u2278', + NotLessLess: '\u226A\u0338', + NotLessSlantEqual: '\u2A7D\u0338', + NotLessTilde: '\u2274', + NotNestedGreaterGreater: '\u2AA2\u0338', + NotNestedLessLess: '\u2AA1\u0338', + NotPrecedes: '\u2280', + NotPrecedesEqual: '\u2AAF\u0338', + NotPrecedesSlantEqual: '\u22E0', + NotReverseElement: '\u220C', + NotRightTriangle: '\u22EB', + NotRightTriangleBar: '\u29D0\u0338', + NotRightTriangleEqual: '\u22ED', + NotSquareSubset: '\u228F\u0338', + NotSquareSubsetEqual: '\u22E2', + NotSquareSuperset: '\u2290\u0338', + NotSquareSupersetEqual: '\u22E3', + NotSubset: '\u2282\u20D2', + NotSubsetEqual: '\u2288', + NotSucceeds: '\u2281', + NotSucceedsEqual: '\u2AB0\u0338', + NotSucceedsSlantEqual: '\u22E1', + NotSucceedsTilde: '\u227F\u0338', + NotSuperset: '\u2283\u20D2', + NotSupersetEqual: '\u2289', + NotTilde: '\u2241', + NotTildeEqual: '\u2244', + NotTildeFullEqual: '\u2247', + NotTildeTilde: '\u2249', + NotVerticalBar: '\u2224', + Nscr: '\uD835\uDCA9', + Ntilde: '\u00D1', + Nu: '\u039D', + OElig: '\u0152', + Oacute: '\u00D3', + Ocirc: '\u00D4', + Ocy: '\u041E', + Odblac: '\u0150', + Ofr: '\uD835\uDD12', + Ograve: '\u00D2', + Omacr: '\u014C', + Omega: '\u03A9', + Omicron: '\u039F', + Oopf: '\uD835\uDD46', + OpenCurlyDoubleQuote: '\u201C', + OpenCurlyQuote: '\u2018', + Or: '\u2A54', + Oscr: '\uD835\uDCAA', + Oslash: '\u00D8', + Otilde: '\u00D5', + Otimes: '\u2A37', + Ouml: '\u00D6', + OverBar: '\u203E', + OverBrace: '\u23DE', + OverBracket: '\u23B4', + OverParenthesis: '\u23DC', + PartialD: '\u2202', + Pcy: '\u041F', + Pfr: '\uD835\uDD13', + Phi: '\u03A6', + Pi: '\u03A0', + PlusMinus: '\u00B1', + Poincareplane: '\u210C', + Popf: '\u2119', + Pr: '\u2ABB', + Precedes: '\u227A', + PrecedesEqual: '\u2AAF', + PrecedesSlantEqual: '\u227C', + PrecedesTilde: '\u227E', + Prime: '\u2033', + Product: '\u220F', + Proportion: '\u2237', + Proportional: '\u221D', + Pscr: '\uD835\uDCAB', + Psi: '\u03A8', + QUOT: '\u0022', + Qfr: '\uD835\uDD14', + Qopf: '\u211A', + Qscr: '\uD835\uDCAC', + RBarr: '\u2910', + REG: '\u00AE', + Racute: '\u0154', + Rang: '\u27EB', + Rarr: '\u21A0', + Rarrtl: '\u2916', + Rcaron: '\u0158', + Rcedil: '\u0156', + Rcy: '\u0420', + Re: '\u211C', + ReverseElement: '\u220B', + ReverseEquilibrium: '\u21CB', + ReverseUpEquilibrium: '\u296F', + Rfr: '\u211C', + Rho: '\u03A1', + RightAngleBracket: '\u27E9', + RightArrow: '\u2192', + RightArrowBar: '\u21E5', + RightArrowLeftArrow: '\u21C4', + RightCeiling: '\u2309', + RightDoubleBracket: '\u27E7', + RightDownTeeVector: '\u295D', + RightDownVector: '\u21C2', + RightDownVectorBar: '\u2955', + RightFloor: '\u230B', + RightTee: '\u22A2', + RightTeeArrow: '\u21A6', + RightTeeVector: '\u295B', + RightTriangle: '\u22B3', + RightTriangleBar: '\u29D0', + RightTriangleEqual: '\u22B5', + RightUpDownVector: '\u294F', + RightUpTeeVector: '\u295C', + RightUpVector: '\u21BE', + RightUpVectorBar: '\u2954', + RightVector: '\u21C0', + RightVectorBar: '\u2953', + Rightarrow: '\u21D2', + Ropf: '\u211D', + RoundImplies: '\u2970', + Rrightarrow: '\u21DB', + Rscr: '\u211B', + Rsh: '\u21B1', + RuleDelayed: '\u29F4', + SHCHcy: '\u0429', + SHcy: '\u0428', + SOFTcy: '\u042C', + Sacute: '\u015A', + Sc: '\u2ABC', + Scaron: '\u0160', + Scedil: '\u015E', + Scirc: '\u015C', + Scy: '\u0421', + Sfr: '\uD835\uDD16', + ShortDownArrow: '\u2193', + ShortLeftArrow: '\u2190', + ShortRightArrow: '\u2192', + ShortUpArrow: '\u2191', + Sigma: '\u03A3', + SmallCircle: '\u2218', + Sopf: '\uD835\uDD4A', + Sqrt: '\u221A', + Square: '\u25A1', + SquareIntersection: '\u2293', + SquareSubset: '\u228F', + SquareSubsetEqual: '\u2291', + SquareSuperset: '\u2290', + SquareSupersetEqual: '\u2292', + SquareUnion: '\u2294', + Sscr: '\uD835\uDCAE', + Star: '\u22C6', + Sub: '\u22D0', + Subset: '\u22D0', + SubsetEqual: '\u2286', + Succeeds: '\u227B', + SucceedsEqual: '\u2AB0', + SucceedsSlantEqual: '\u227D', + SucceedsTilde: '\u227F', + SuchThat: '\u220B', + Sum: '\u2211', + Sup: '\u22D1', + Superset: '\u2283', + SupersetEqual: '\u2287', + Supset: '\u22D1', + THORN: '\u00DE', + TRADE: '\u2122', + TSHcy: '\u040B', + TScy: '\u0426', + Tab: '\u0009', + Tau: '\u03A4', + Tcaron: '\u0164', + Tcedil: '\u0162', + Tcy: '\u0422', + Tfr: '\uD835\uDD17', + Therefore: '\u2234', + Theta: '\u0398', + ThickSpace: '\u205F\u200A', + ThinSpace: '\u2009', + Tilde: '\u223C', + TildeEqual: '\u2243', + TildeFullEqual: '\u2245', + TildeTilde: '\u2248', + Topf: '\uD835\uDD4B', + TripleDot: '\u20DB', + Tscr: '\uD835\uDCAF', + Tstrok: '\u0166', + Uacute: '\u00DA', + Uarr: '\u219F', + Uarrocir: '\u2949', + Ubrcy: '\u040E', + Ubreve: '\u016C', + Ucirc: '\u00DB', + Ucy: '\u0423', + Udblac: '\u0170', + Ufr: '\uD835\uDD18', + Ugrave: '\u00D9', + Umacr: '\u016A', + UnderBar: '\u005F', + UnderBrace: '\u23DF', + UnderBracket: '\u23B5', + UnderParenthesis: '\u23DD', + Union: '\u22C3', + UnionPlus: '\u228E', + Uogon: '\u0172', + Uopf: '\uD835\uDD4C', + UpArrow: '\u2191', + UpArrowBar: '\u2912', + UpArrowDownArrow: '\u21C5', + UpDownArrow: '\u2195', + UpEquilibrium: '\u296E', + UpTee: '\u22A5', + UpTeeArrow: '\u21A5', + Uparrow: '\u21D1', + Updownarrow: '\u21D5', + UpperLeftArrow: '\u2196', + UpperRightArrow: '\u2197', + Upsi: '\u03D2', + Upsilon: '\u03A5', + Uring: '\u016E', + Uscr: '\uD835\uDCB0', + Utilde: '\u0168', + Uuml: '\u00DC', + VDash: '\u22AB', + Vbar: '\u2AEB', + Vcy: '\u0412', + Vdash: '\u22A9', + Vdashl: '\u2AE6', + Vee: '\u22C1', + Verbar: '\u2016', + Vert: '\u2016', + VerticalBar: '\u2223', + VerticalLine: '\u007C', + VerticalSeparator: '\u2758', + VerticalTilde: '\u2240', + VeryThinSpace: '\u200A', + Vfr: '\uD835\uDD19', + Vopf: '\uD835\uDD4D', + Vscr: '\uD835\uDCB1', + Vvdash: '\u22AA', + Wcirc: '\u0174', + Wedge: '\u22C0', + Wfr: '\uD835\uDD1A', + Wopf: '\uD835\uDD4E', + Wscr: '\uD835\uDCB2', + Xfr: '\uD835\uDD1B', + Xi: '\u039E', + Xopf: '\uD835\uDD4F', + Xscr: '\uD835\uDCB3', + YAcy: '\u042F', + YIcy: '\u0407', + YUcy: '\u042E', + Yacute: '\u00DD', + Ycirc: '\u0176', + Ycy: '\u042B', + Yfr: '\uD835\uDD1C', + Yopf: '\uD835\uDD50', + Yscr: '\uD835\uDCB4', + Yuml: '\u0178', + ZHcy: '\u0416', + Zacute: '\u0179', + Zcaron: '\u017D', + Zcy: '\u0417', + Zdot: '\u017B', + ZeroWidthSpace: '\u200B', + Zeta: '\u0396', + Zfr: '\u2128', + Zopf: '\u2124', + Zscr: '\uD835\uDCB5', + aacute: '\u00E1', + abreve: '\u0103', + ac: '\u223E', + acE: '\u223E\u0333', + acd: '\u223F', + acirc: '\u00E2', + acute: '\u00B4', + acy: '\u0430', + aelig: '\u00E6', + af: '\u2061', + afr: '\uD835\uDD1E', + agrave: '\u00E0', + alefsym: '\u2135', + aleph: '\u2135', + alpha: '\u03B1', + amacr: '\u0101', + amalg: '\u2A3F', + amp: '\u0026', + and: '\u2227', + andand: '\u2A55', + andd: '\u2A5C', + andslope: '\u2A58', + andv: '\u2A5A', + ang: '\u2220', + ange: '\u29A4', + angle: '\u2220', + angmsd: '\u2221', + angmsdaa: '\u29A8', + angmsdab: '\u29A9', + angmsdac: '\u29AA', + angmsdad: '\u29AB', + angmsdae: '\u29AC', + angmsdaf: '\u29AD', + angmsdag: '\u29AE', + angmsdah: '\u29AF', + angrt: '\u221F', + angrtvb: '\u22BE', + angrtvbd: '\u299D', + angsph: '\u2222', + angst: '\u00C5', + angzarr: '\u237C', + aogon: '\u0105', + aopf: '\uD835\uDD52', + ap: '\u2248', + apE: '\u2A70', + apacir: '\u2A6F', + ape: '\u224A', + apid: '\u224B', + apos: '\u0027', + approx: '\u2248', + approxeq: '\u224A', + aring: '\u00E5', + ascr: '\uD835\uDCB6', + ast: '\u002A', + asymp: '\u2248', + asympeq: '\u224D', + atilde: '\u00E3', + auml: '\u00E4', + awconint: '\u2233', + awint: '\u2A11', + bNot: '\u2AED', + backcong: '\u224C', + backepsilon: '\u03F6', + backprime: '\u2035', + backsim: '\u223D', + backsimeq: '\u22CD', + barvee: '\u22BD', + barwed: '\u2305', + barwedge: '\u2305', + bbrk: '\u23B5', + bbrktbrk: '\u23B6', + bcong: '\u224C', + bcy: '\u0431', + bdquo: '\u201E', + becaus: '\u2235', + because: '\u2235', + bemptyv: '\u29B0', + bepsi: '\u03F6', + bernou: '\u212C', + beta: '\u03B2', + beth: '\u2136', + between: '\u226C', + bfr: '\uD835\uDD1F', + bigcap: '\u22C2', + bigcirc: '\u25EF', + bigcup: '\u22C3', + bigodot: '\u2A00', + bigoplus: '\u2A01', + bigotimes: '\u2A02', + bigsqcup: '\u2A06', + bigstar: '\u2605', + bigtriangledown: '\u25BD', + bigtriangleup: '\u25B3', + biguplus: '\u2A04', + bigvee: '\u22C1', + bigwedge: '\u22C0', + bkarow: '\u290D', + blacklozenge: '\u29EB', + blacksquare: '\u25AA', + blacktriangle: '\u25B4', + blacktriangledown: '\u25BE', + blacktriangleleft: '\u25C2', + blacktriangleright: '\u25B8', + blank: '\u2423', + blk12: '\u2592', + blk14: '\u2591', + blk34: '\u2593', + block: '\u2588', + bne: '\u003D\u20E5', + bnequiv: '\u2261\u20E5', + bnot: '\u2310', + bopf: '\uD835\uDD53', + bot: '\u22A5', + bottom: '\u22A5', + bowtie: '\u22C8', + boxDL: '\u2557', + boxDR: '\u2554', + boxDl: '\u2556', + boxDr: '\u2553', + boxH: '\u2550', + boxHD: '\u2566', + boxHU: '\u2569', + boxHd: '\u2564', + boxHu: '\u2567', + boxUL: '\u255D', + boxUR: '\u255A', + boxUl: '\u255C', + boxUr: '\u2559', + boxV: '\u2551', + boxVH: '\u256C', + boxVL: '\u2563', + boxVR: '\u2560', + boxVh: '\u256B', + boxVl: '\u2562', + boxVr: '\u255F', + boxbox: '\u29C9', + boxdL: '\u2555', + boxdR: '\u2552', + boxdl: '\u2510', + boxdr: '\u250C', + boxh: '\u2500', + boxhD: '\u2565', + boxhU: '\u2568', + boxhd: '\u252C', + boxhu: '\u2534', + boxminus: '\u229F', + boxplus: '\u229E', + boxtimes: '\u22A0', + boxuL: '\u255B', + boxuR: '\u2558', + boxul: '\u2518', + boxur: '\u2514', + boxv: '\u2502', + boxvH: '\u256A', + boxvL: '\u2561', + boxvR: '\u255E', + boxvh: '\u253C', + boxvl: '\u2524', + boxvr: '\u251C', + bprime: '\u2035', + breve: '\u02D8', + brvbar: '\u00A6', + bscr: '\uD835\uDCB7', + bsemi: '\u204F', + bsim: '\u223D', + bsime: '\u22CD', + bsol: '\u005C', + bsolb: '\u29C5', + bsolhsub: '\u27C8', + bull: '\u2022', + bullet: '\u2022', + bump: '\u224E', + bumpE: '\u2AAE', + bumpe: '\u224F', + bumpeq: '\u224F', + cacute: '\u0107', + cap: '\u2229', + capand: '\u2A44', + capbrcup: '\u2A49', + capcap: '\u2A4B', + capcup: '\u2A47', + capdot: '\u2A40', + caps: '\u2229\uFE00', + caret: '\u2041', + caron: '\u02C7', + ccaps: '\u2A4D', + ccaron: '\u010D', + ccedil: '\u00E7', + ccirc: '\u0109', + ccups: '\u2A4C', + ccupssm: '\u2A50', + cdot: '\u010B', + cedil: '\u00B8', + cemptyv: '\u29B2', + cent: '\u00A2', + centerdot: '\u00B7', + cfr: '\uD835\uDD20', + chcy: '\u0447', + check: '\u2713', + checkmark: '\u2713', + chi: '\u03C7', + cir: '\u25CB', + cirE: '\u29C3', + circ: '\u02C6', + circeq: '\u2257', + circlearrowleft: '\u21BA', + circlearrowright: '\u21BB', + circledR: '\u00AE', + circledS: '\u24C8', + circledast: '\u229B', + circledcirc: '\u229A', + circleddash: '\u229D', + cire: '\u2257', + cirfnint: '\u2A10', + cirmid: '\u2AEF', + cirscir: '\u29C2', + clubs: '\u2663', + clubsuit: '\u2663', + colon: '\u003A', + colone: '\u2254', + coloneq: '\u2254', + comma: '\u002C', + commat: '\u0040', + comp: '\u2201', + compfn: '\u2218', + complement: '\u2201', + complexes: '\u2102', + cong: '\u2245', + congdot: '\u2A6D', + conint: '\u222E', + copf: '\uD835\uDD54', + coprod: '\u2210', + copy: '\u00A9', + copysr: '\u2117', + crarr: '\u21B5', + cross: '\u2717', + cscr: '\uD835\uDCB8', + csub: '\u2ACF', + csube: '\u2AD1', + csup: '\u2AD0', + csupe: '\u2AD2', + ctdot: '\u22EF', + cudarrl: '\u2938', + cudarrr: '\u2935', + cuepr: '\u22DE', + cuesc: '\u22DF', + cularr: '\u21B6', + cularrp: '\u293D', + cup: '\u222A', + cupbrcap: '\u2A48', + cupcap: '\u2A46', + cupcup: '\u2A4A', + cupdot: '\u228D', + cupor: '\u2A45', + cups: '\u222A\uFE00', + curarr: '\u21B7', + curarrm: '\u293C', + curlyeqprec: '\u22DE', + curlyeqsucc: '\u22DF', + curlyvee: '\u22CE', + curlywedge: '\u22CF', + curren: '\u00A4', + curvearrowleft: '\u21B6', + curvearrowright: '\u21B7', + cuvee: '\u22CE', + cuwed: '\u22CF', + cwconint: '\u2232', + cwint: '\u2231', + cylcty: '\u232D', + dArr: '\u21D3', + dHar: '\u2965', + dagger: '\u2020', + daleth: '\u2138', + darr: '\u2193', + dash: '\u2010', + dashv: '\u22A3', + dbkarow: '\u290F', + dblac: '\u02DD', + dcaron: '\u010F', + dcy: '\u0434', + dd: '\u2146', + ddagger: '\u2021', + ddarr: '\u21CA', + ddotseq: '\u2A77', + deg: '\u00B0', + delta: '\u03B4', + demptyv: '\u29B1', + dfisht: '\u297F', + dfr: '\uD835\uDD21', + dharl: '\u21C3', + dharr: '\u21C2', + diam: '\u22C4', + diamond: '\u22C4', + diamondsuit: '\u2666', + diams: '\u2666', + die: '\u00A8', + digamma: '\u03DD', + disin: '\u22F2', + div: '\u00F7', + divide: '\u00F7', + divideontimes: '\u22C7', + divonx: '\u22C7', + djcy: '\u0452', + dlcorn: '\u231E', + dlcrop: '\u230D', + dollar: '\u0024', + dopf: '\uD835\uDD55', + dot: '\u02D9', + doteq: '\u2250', + doteqdot: '\u2251', + dotminus: '\u2238', + dotplus: '\u2214', + dotsquare: '\u22A1', + doublebarwedge: '\u2306', + downarrow: '\u2193', + downdownarrows: '\u21CA', + downharpoonleft: '\u21C3', + downharpoonright: '\u21C2', + drbkarow: '\u2910', + drcorn: '\u231F', + drcrop: '\u230C', + dscr: '\uD835\uDCB9', + dscy: '\u0455', + dsol: '\u29F6', + dstrok: '\u0111', + dtdot: '\u22F1', + dtri: '\u25BF', + dtrif: '\u25BE', + duarr: '\u21F5', + duhar: '\u296F', + dwangle: '\u29A6', + dzcy: '\u045F', + dzigrarr: '\u27FF', + eDDot: '\u2A77', + eDot: '\u2251', + eacute: '\u00E9', + easter: '\u2A6E', + ecaron: '\u011B', + ecir: '\u2256', + ecirc: '\u00EA', + ecolon: '\u2255', + ecy: '\u044D', + edot: '\u0117', + ee: '\u2147', + efDot: '\u2252', + efr: '\uD835\uDD22', + eg: '\u2A9A', + egrave: '\u00E8', + egs: '\u2A96', + egsdot: '\u2A98', + el: '\u2A99', + elinters: '\u23E7', + ell: '\u2113', + els: '\u2A95', + elsdot: '\u2A97', + emacr: '\u0113', + empty: '\u2205', + emptyset: '\u2205', + emptyv: '\u2205', + emsp13: '\u2004', + emsp14: '\u2005', + emsp: '\u2003', + eng: '\u014B', + ensp: '\u2002', + eogon: '\u0119', + eopf: '\uD835\uDD56', + epar: '\u22D5', + eparsl: '\u29E3', + eplus: '\u2A71', + epsi: '\u03B5', + epsilon: '\u03B5', + epsiv: '\u03F5', + eqcirc: '\u2256', + eqcolon: '\u2255', + eqsim: '\u2242', + eqslantgtr: '\u2A96', + eqslantless: '\u2A95', + equals: '\u003D', + equest: '\u225F', + equiv: '\u2261', + equivDD: '\u2A78', + eqvparsl: '\u29E5', + erDot: '\u2253', + erarr: '\u2971', + escr: '\u212F', + esdot: '\u2250', + esim: '\u2242', + eta: '\u03B7', + eth: '\u00F0', + euml: '\u00EB', + euro: '\u20AC', + excl: '\u0021', + exist: '\u2203', + expectation: '\u2130', + exponentiale: '\u2147', + fallingdotseq: '\u2252', + fcy: '\u0444', + female: '\u2640', + ffilig: '\uFB03', + fflig: '\uFB00', + ffllig: '\uFB04', + ffr: '\uD835\uDD23', + filig: '\uFB01', + fjlig: '\u0066\u006A', + flat: '\u266D', + fllig: '\uFB02', + fltns: '\u25B1', + fnof: '\u0192', + fopf: '\uD835\uDD57', + forall: '\u2200', + fork: '\u22D4', + forkv: '\u2AD9', + fpartint: '\u2A0D', + frac12: '\u00BD', + frac13: '\u2153', + frac14: '\u00BC', + frac15: '\u2155', + frac16: '\u2159', + frac18: '\u215B', + frac23: '\u2154', + frac25: '\u2156', + frac34: '\u00BE', + frac35: '\u2157', + frac38: '\u215C', + frac45: '\u2158', + frac56: '\u215A', + frac58: '\u215D', + frac78: '\u215E', + frasl: '\u2044', + frown: '\u2322', + fscr: '\uD835\uDCBB', + gE: '\u2267', + gEl: '\u2A8C', + gacute: '\u01F5', + gamma: '\u03B3', + gammad: '\u03DD', + gap: '\u2A86', + gbreve: '\u011F', + gcirc: '\u011D', + gcy: '\u0433', + gdot: '\u0121', + ge: '\u2265', + gel: '\u22DB', + geq: '\u2265', + geqq: '\u2267', + geqslant: '\u2A7E', + ges: '\u2A7E', + gescc: '\u2AA9', + gesdot: '\u2A80', + gesdoto: '\u2A82', + gesdotol: '\u2A84', + gesl: '\u22DB\uFE00', + gesles: '\u2A94', + gfr: '\uD835\uDD24', + gg: '\u226B', + ggg: '\u22D9', + gimel: '\u2137', + gjcy: '\u0453', + gl: '\u2277', + glE: '\u2A92', + gla: '\u2AA5', + glj: '\u2AA4', + gnE: '\u2269', + gnap: '\u2A8A', + gnapprox: '\u2A8A', + gne: '\u2A88', + gneq: '\u2A88', + gneqq: '\u2269', + gnsim: '\u22E7', + gopf: '\uD835\uDD58', + grave: '\u0060', + gscr: '\u210A', + gsim: '\u2273', + gsime: '\u2A8E', + gsiml: '\u2A90', + gt: '\u003E', + gtcc: '\u2AA7', + gtcir: '\u2A7A', + gtdot: '\u22D7', + gtlPar: '\u2995', + gtquest: '\u2A7C', + gtrapprox: '\u2A86', + gtrarr: '\u2978', + gtrdot: '\u22D7', + gtreqless: '\u22DB', + gtreqqless: '\u2A8C', + gtrless: '\u2277', + gtrsim: '\u2273', + gvertneqq: '\u2269\uFE00', + gvnE: '\u2269\uFE00', + hArr: '\u21D4', + hairsp: '\u200A', + half: '\u00BD', + hamilt: '\u210B', + hardcy: '\u044A', + harr: '\u2194', + harrcir: '\u2948', + harrw: '\u21AD', + hbar: '\u210F', + hcirc: '\u0125', + hearts: '\u2665', + heartsuit: '\u2665', + hellip: '\u2026', + hercon: '\u22B9', + hfr: '\uD835\uDD25', + hksearow: '\u2925', + hkswarow: '\u2926', + hoarr: '\u21FF', + homtht: '\u223B', + hookleftarrow: '\u21A9', + hookrightarrow: '\u21AA', + hopf: '\uD835\uDD59', + horbar: '\u2015', + hscr: '\uD835\uDCBD', + hslash: '\u210F', + hstrok: '\u0127', + hybull: '\u2043', + hyphen: '\u2010', + iacute: '\u00ED', + ic: '\u2063', + icirc: '\u00EE', + icy: '\u0438', + iecy: '\u0435', + iexcl: '\u00A1', + iff: '\u21D4', + ifr: '\uD835\uDD26', + igrave: '\u00EC', + ii: '\u2148', + iiiint: '\u2A0C', + iiint: '\u222D', + iinfin: '\u29DC', + iiota: '\u2129', + ijlig: '\u0133', + imacr: '\u012B', + image: '\u2111', + imagline: '\u2110', + imagpart: '\u2111', + imath: '\u0131', + imof: '\u22B7', + imped: '\u01B5', + in: '\u2208', + incare: '\u2105', + infin: '\u221E', + infintie: '\u29DD', + inodot: '\u0131', + int: '\u222B', + intcal: '\u22BA', + integers: '\u2124', + intercal: '\u22BA', + intlarhk: '\u2A17', + intprod: '\u2A3C', + iocy: '\u0451', + iogon: '\u012F', + iopf: '\uD835\uDD5A', + iota: '\u03B9', + iprod: '\u2A3C', + iquest: '\u00BF', + iscr: '\uD835\uDCBE', + isin: '\u2208', + isinE: '\u22F9', + isindot: '\u22F5', + isins: '\u22F4', + isinsv: '\u22F3', + isinv: '\u2208', + it: '\u2062', + itilde: '\u0129', + iukcy: '\u0456', + iuml: '\u00EF', + jcirc: '\u0135', + jcy: '\u0439', + jfr: '\uD835\uDD27', + jmath: '\u0237', + jopf: '\uD835\uDD5B', + jscr: '\uD835\uDCBF', + jsercy: '\u0458', + jukcy: '\u0454', + kappa: '\u03BA', + kappav: '\u03F0', + kcedil: '\u0137', + kcy: '\u043A', + kfr: '\uD835\uDD28', + kgreen: '\u0138', + khcy: '\u0445', + kjcy: '\u045C', + kopf: '\uD835\uDD5C', + kscr: '\uD835\uDCC0', + lAarr: '\u21DA', + lArr: '\u21D0', + lAtail: '\u291B', + lBarr: '\u290E', + lE: '\u2266', + lEg: '\u2A8B', + lHar: '\u2962', + lacute: '\u013A', + laemptyv: '\u29B4', + lagran: '\u2112', + lambda: '\u03BB', + lang: '\u27E8', + langd: '\u2991', + langle: '\u27E8', + lap: '\u2A85', + laquo: '\u00AB', + larr: '\u2190', + larrb: '\u21E4', + larrbfs: '\u291F', + larrfs: '\u291D', + larrhk: '\u21A9', + larrlp: '\u21AB', + larrpl: '\u2939', + larrsim: '\u2973', + larrtl: '\u21A2', + lat: '\u2AAB', + latail: '\u2919', + late: '\u2AAD', + lates: '\u2AAD\uFE00', + lbarr: '\u290C', + lbbrk: '\u2772', + lbrace: '\u007B', + lbrack: '\u005B', + lbrke: '\u298B', + lbrksld: '\u298F', + lbrkslu: '\u298D', + lcaron: '\u013E', + lcedil: '\u013C', + lceil: '\u2308', + lcub: '\u007B', + lcy: '\u043B', + ldca: '\u2936', + ldquo: '\u201C', + ldquor: '\u201E', + ldrdhar: '\u2967', + ldrushar: '\u294B', + ldsh: '\u21B2', + le: '\u2264', + leftarrow: '\u2190', + leftarrowtail: '\u21A2', + leftharpoondown: '\u21BD', + leftharpoonup: '\u21BC', + leftleftarrows: '\u21C7', + leftrightarrow: '\u2194', + leftrightarrows: '\u21C6', + leftrightharpoons: '\u21CB', + leftrightsquigarrow: '\u21AD', + leftthreetimes: '\u22CB', + leg: '\u22DA', + leq: '\u2264', + leqq: '\u2266', + leqslant: '\u2A7D', + les: '\u2A7D', + lescc: '\u2AA8', + lesdot: '\u2A7F', + lesdoto: '\u2A81', + lesdotor: '\u2A83', + lesg: '\u22DA\uFE00', + lesges: '\u2A93', + lessapprox: '\u2A85', + lessdot: '\u22D6', + lesseqgtr: '\u22DA', + lesseqqgtr: '\u2A8B', + lessgtr: '\u2276', + lesssim: '\u2272', + lfisht: '\u297C', + lfloor: '\u230A', + lfr: '\uD835\uDD29', + lg: '\u2276', + lgE: '\u2A91', + lhard: '\u21BD', + lharu: '\u21BC', + lharul: '\u296A', + lhblk: '\u2584', + ljcy: '\u0459', + ll: '\u226A', + llarr: '\u21C7', + llcorner: '\u231E', + llhard: '\u296B', + lltri: '\u25FA', + lmidot: '\u0140', + lmoust: '\u23B0', + lmoustache: '\u23B0', + lnE: '\u2268', + lnap: '\u2A89', + lnapprox: '\u2A89', + lne: '\u2A87', + lneq: '\u2A87', + lneqq: '\u2268', + lnsim: '\u22E6', + loang: '\u27EC', + loarr: '\u21FD', + lobrk: '\u27E6', + longleftarrow: '\u27F5', + longleftrightarrow: '\u27F7', + longmapsto: '\u27FC', + longrightarrow: '\u27F6', + looparrowleft: '\u21AB', + looparrowright: '\u21AC', + lopar: '\u2985', + lopf: '\uD835\uDD5D', + loplus: '\u2A2D', + lotimes: '\u2A34', + lowast: '\u2217', + lowbar: '\u005F', + loz: '\u25CA', + lozenge: '\u25CA', + lozf: '\u29EB', + lpar: '\u0028', + lparlt: '\u2993', + lrarr: '\u21C6', + lrcorner: '\u231F', + lrhar: '\u21CB', + lrhard: '\u296D', + lrm: '\u200E', + lrtri: '\u22BF', + lsaquo: '\u2039', + lscr: '\uD835\uDCC1', + lsh: '\u21B0', + lsim: '\u2272', + lsime: '\u2A8D', + lsimg: '\u2A8F', + lsqb: '\u005B', + lsquo: '\u2018', + lsquor: '\u201A', + lstrok: '\u0142', + lt: '\u003C', + ltcc: '\u2AA6', + ltcir: '\u2A79', + ltdot: '\u22D6', + lthree: '\u22CB', + ltimes: '\u22C9', + ltlarr: '\u2976', + ltquest: '\u2A7B', + ltrPar: '\u2996', + ltri: '\u25C3', + ltrie: '\u22B4', + ltrif: '\u25C2', + lurdshar: '\u294A', + luruhar: '\u2966', + lvertneqq: '\u2268\uFE00', + lvnE: '\u2268\uFE00', + mDDot: '\u223A', + macr: '\u00AF', + male: '\u2642', + malt: '\u2720', + maltese: '\u2720', + map: '\u21A6', + mapsto: '\u21A6', + mapstodown: '\u21A7', + mapstoleft: '\u21A4', + mapstoup: '\u21A5', + marker: '\u25AE', + mcomma: '\u2A29', + mcy: '\u043C', + mdash: '\u2014', + measuredangle: '\u2221', + mfr: '\uD835\uDD2A', + mho: '\u2127', + micro: '\u00B5', + mid: '\u2223', + midast: '\u002A', + midcir: '\u2AF0', + middot: '\u00B7', + minus: '\u2212', + minusb: '\u229F', + minusd: '\u2238', + minusdu: '\u2A2A', + mlcp: '\u2ADB', + mldr: '\u2026', + mnplus: '\u2213', + models: '\u22A7', + mopf: '\uD835\uDD5E', + mp: '\u2213', + mscr: '\uD835\uDCC2', + mstpos: '\u223E', + mu: '\u03BC', + multimap: '\u22B8', + mumap: '\u22B8', + nGg: '\u22D9\u0338', + nGt: '\u226B\u20D2', + nGtv: '\u226B\u0338', + nLeftarrow: '\u21CD', + nLeftrightarrow: '\u21CE', + nLl: '\u22D8\u0338', + nLt: '\u226A\u20D2', + nLtv: '\u226A\u0338', + nRightarrow: '\u21CF', + nVDash: '\u22AF', + nVdash: '\u22AE', + nabla: '\u2207', + nacute: '\u0144', + nang: '\u2220\u20D2', + nap: '\u2249', + napE: '\u2A70\u0338', + napid: '\u224B\u0338', + napos: '\u0149', + napprox: '\u2249', + natur: '\u266E', + natural: '\u266E', + naturals: '\u2115', + nbsp: '\u00A0', + nbump: '\u224E\u0338', + nbumpe: '\u224F\u0338', + ncap: '\u2A43', + ncaron: '\u0148', + ncedil: '\u0146', + ncong: '\u2247', + ncongdot: '\u2A6D\u0338', + ncup: '\u2A42', + ncy: '\u043D', + ndash: '\u2013', + ne: '\u2260', + neArr: '\u21D7', + nearhk: '\u2924', + nearr: '\u2197', + nearrow: '\u2197', + nedot: '\u2250\u0338', + nequiv: '\u2262', + nesear: '\u2928', + nesim: '\u2242\u0338', + nexist: '\u2204', + nexists: '\u2204', + nfr: '\uD835\uDD2B', + ngE: '\u2267\u0338', + nge: '\u2271', + ngeq: '\u2271', + ngeqq: '\u2267\u0338', + ngeqslant: '\u2A7E\u0338', + nges: '\u2A7E\u0338', + ngsim: '\u2275', + ngt: '\u226F', + ngtr: '\u226F', + nhArr: '\u21CE', + nharr: '\u21AE', + nhpar: '\u2AF2', + ni: '\u220B', + nis: '\u22FC', + nisd: '\u22FA', + niv: '\u220B', + njcy: '\u045A', + nlArr: '\u21CD', + nlE: '\u2266\u0338', + nlarr: '\u219A', + nldr: '\u2025', + nle: '\u2270', + nleftarrow: '\u219A', + nleftrightarrow: '\u21AE', + nleq: '\u2270', + nleqq: '\u2266\u0338', + nleqslant: '\u2A7D\u0338', + nles: '\u2A7D\u0338', + nless: '\u226E', + nlsim: '\u2274', + nlt: '\u226E', + nltri: '\u22EA', + nltrie: '\u22EC', + nmid: '\u2224', + nopf: '\uD835\uDD5F', + not: '\u00AC', + notin: '\u2209', + notinE: '\u22F9\u0338', + notindot: '\u22F5\u0338', + notinva: '\u2209', + notinvb: '\u22F7', + notinvc: '\u22F6', + notni: '\u220C', + notniva: '\u220C', + notnivb: '\u22FE', + notnivc: '\u22FD', + npar: '\u2226', + nparallel: '\u2226', + nparsl: '\u2AFD\u20E5', + npart: '\u2202\u0338', + npolint: '\u2A14', + npr: '\u2280', + nprcue: '\u22E0', + npre: '\u2AAF\u0338', + nprec: '\u2280', + npreceq: '\u2AAF\u0338', + nrArr: '\u21CF', + nrarr: '\u219B', + nrarrc: '\u2933\u0338', + nrarrw: '\u219D\u0338', + nrightarrow: '\u219B', + nrtri: '\u22EB', + nrtrie: '\u22ED', + nsc: '\u2281', + nsccue: '\u22E1', + nsce: '\u2AB0\u0338', + nscr: '\uD835\uDCC3', + nshortmid: '\u2224', + nshortparallel: '\u2226', + nsim: '\u2241', + nsime: '\u2244', + nsimeq: '\u2244', + nsmid: '\u2224', + nspar: '\u2226', + nsqsube: '\u22E2', + nsqsupe: '\u22E3', + nsub: '\u2284', + nsubE: '\u2AC5\u0338', + nsube: '\u2288', + nsubset: '\u2282\u20D2', + nsubseteq: '\u2288', + nsubseteqq: '\u2AC5\u0338', + nsucc: '\u2281', + nsucceq: '\u2AB0\u0338', + nsup: '\u2285', + nsupE: '\u2AC6\u0338', + nsupe: '\u2289', + nsupset: '\u2283\u20D2', + nsupseteq: '\u2289', + nsupseteqq: '\u2AC6\u0338', + ntgl: '\u2279', + ntilde: '\u00F1', + ntlg: '\u2278', + ntriangleleft: '\u22EA', + ntrianglelefteq: '\u22EC', + ntriangleright: '\u22EB', + ntrianglerighteq: '\u22ED', + nu: '\u03BD', + num: '\u0023', + numero: '\u2116', + numsp: '\u2007', + nvDash: '\u22AD', + nvHarr: '\u2904', + nvap: '\u224D\u20D2', + nvdash: '\u22AC', + nvge: '\u2265\u20D2', + nvgt: '\u003E\u20D2', + nvinfin: '\u29DE', + nvlArr: '\u2902', + nvle: '\u2264\u20D2', + nvlt: '\u003C\u20D2', + nvltrie: '\u22B4\u20D2', + nvrArr: '\u2903', + nvrtrie: '\u22B5\u20D2', + nvsim: '\u223C\u20D2', + nwArr: '\u21D6', + nwarhk: '\u2923', + nwarr: '\u2196', + nwarrow: '\u2196', + nwnear: '\u2927', + oS: '\u24C8', + oacute: '\u00F3', + oast: '\u229B', + ocir: '\u229A', + ocirc: '\u00F4', + ocy: '\u043E', + odash: '\u229D', + odblac: '\u0151', + odiv: '\u2A38', + odot: '\u2299', + odsold: '\u29BC', + oelig: '\u0153', + ofcir: '\u29BF', + ofr: '\uD835\uDD2C', + ogon: '\u02DB', + ograve: '\u00F2', + ogt: '\u29C1', + ohbar: '\u29B5', + ohm: '\u03A9', + oint: '\u222E', + olarr: '\u21BA', + olcir: '\u29BE', + olcross: '\u29BB', + oline: '\u203E', + olt: '\u29C0', + omacr: '\u014D', + omega: '\u03C9', + omicron: '\u03BF', + omid: '\u29B6', + ominus: '\u2296', + oopf: '\uD835\uDD60', + opar: '\u29B7', + operp: '\u29B9', + oplus: '\u2295', + or: '\u2228', + orarr: '\u21BB', + ord: '\u2A5D', + order: '\u2134', + orderof: '\u2134', + ordf: '\u00AA', + ordm: '\u00BA', + origof: '\u22B6', + oror: '\u2A56', + orslope: '\u2A57', + orv: '\u2A5B', + oscr: '\u2134', + oslash: '\u00F8', + osol: '\u2298', + otilde: '\u00F5', + otimes: '\u2297', + otimesas: '\u2A36', + ouml: '\u00F6', + ovbar: '\u233D', + par: '\u2225', + para: '\u00B6', + parallel: '\u2225', + parsim: '\u2AF3', + parsl: '\u2AFD', + part: '\u2202', + pcy: '\u043F', + percnt: '\u0025', + period: '\u002E', + permil: '\u2030', + perp: '\u22A5', + pertenk: '\u2031', + pfr: '\uD835\uDD2D', + phi: '\u03C6', + phiv: '\u03D5', + phmmat: '\u2133', + phone: '\u260E', + pi: '\u03C0', + pitchfork: '\u22D4', + piv: '\u03D6', + planck: '\u210F', + planckh: '\u210E', + plankv: '\u210F', + plus: '\u002B', + plusacir: '\u2A23', + plusb: '\u229E', + pluscir: '\u2A22', + plusdo: '\u2214', + plusdu: '\u2A25', + pluse: '\u2A72', + plusmn: '\u00B1', + plussim: '\u2A26', + plustwo: '\u2A27', + pm: '\u00B1', + pointint: '\u2A15', + popf: '\uD835\uDD61', + pound: '\u00A3', + pr: '\u227A', + prE: '\u2AB3', + prap: '\u2AB7', + prcue: '\u227C', + pre: '\u2AAF', + prec: '\u227A', + precapprox: '\u2AB7', + preccurlyeq: '\u227C', + preceq: '\u2AAF', + precnapprox: '\u2AB9', + precneqq: '\u2AB5', + precnsim: '\u22E8', + precsim: '\u227E', + prime: '\u2032', + primes: '\u2119', + prnE: '\u2AB5', + prnap: '\u2AB9', + prnsim: '\u22E8', + prod: '\u220F', + profalar: '\u232E', + profline: '\u2312', + profsurf: '\u2313', + prop: '\u221D', + propto: '\u221D', + prsim: '\u227E', + prurel: '\u22B0', + pscr: '\uD835\uDCC5', + psi: '\u03C8', + puncsp: '\u2008', + qfr: '\uD835\uDD2E', + qint: '\u2A0C', + qopf: '\uD835\uDD62', + qprime: '\u2057', + qscr: '\uD835\uDCC6', + quaternions: '\u210D', + quatint: '\u2A16', + quest: '\u003F', + questeq: '\u225F', + quot: '\u0022', + rAarr: '\u21DB', + rArr: '\u21D2', + rAtail: '\u291C', + rBarr: '\u290F', + rHar: '\u2964', + race: '\u223D\u0331', + racute: '\u0155', + radic: '\u221A', + raemptyv: '\u29B3', + rang: '\u27E9', + rangd: '\u2992', + range: '\u29A5', + rangle: '\u27E9', + raquo: '\u00BB', + rarr: '\u2192', + rarrap: '\u2975', + rarrb: '\u21E5', + rarrbfs: '\u2920', + rarrc: '\u2933', + rarrfs: '\u291E', + rarrhk: '\u21AA', + rarrlp: '\u21AC', + rarrpl: '\u2945', + rarrsim: '\u2974', + rarrtl: '\u21A3', + rarrw: '\u219D', + ratail: '\u291A', + ratio: '\u2236', + rationals: '\u211A', + rbarr: '\u290D', + rbbrk: '\u2773', + rbrace: '\u007D', + rbrack: '\u005D', + rbrke: '\u298C', + rbrksld: '\u298E', + rbrkslu: '\u2990', + rcaron: '\u0159', + rcedil: '\u0157', + rceil: '\u2309', + rcub: '\u007D', + rcy: '\u0440', + rdca: '\u2937', + rdldhar: '\u2969', + rdquo: '\u201D', + rdquor: '\u201D', + rdsh: '\u21B3', + real: '\u211C', + realine: '\u211B', + realpart: '\u211C', + reals: '\u211D', + rect: '\u25AD', + reg: '\u00AE', + rfisht: '\u297D', + rfloor: '\u230B', + rfr: '\uD835\uDD2F', + rhard: '\u21C1', + rharu: '\u21C0', + rharul: '\u296C', + rho: '\u03C1', + rhov: '\u03F1', + rightarrow: '\u2192', + rightarrowtail: '\u21A3', + rightharpoondown: '\u21C1', + rightharpoonup: '\u21C0', + rightleftarrows: '\u21C4', + rightleftharpoons: '\u21CC', + rightrightarrows: '\u21C9', + rightsquigarrow: '\u219D', + rightthreetimes: '\u22CC', + ring: '\u02DA', + risingdotseq: '\u2253', + rlarr: '\u21C4', + rlhar: '\u21CC', + rlm: '\u200F', + rmoust: '\u23B1', + rmoustache: '\u23B1', + rnmid: '\u2AEE', + roang: '\u27ED', + roarr: '\u21FE', + robrk: '\u27E7', + ropar: '\u2986', + ropf: '\uD835\uDD63', + roplus: '\u2A2E', + rotimes: '\u2A35', + rpar: '\u0029', + rpargt: '\u2994', + rppolint: '\u2A12', + rrarr: '\u21C9', + rsaquo: '\u203A', + rscr: '\uD835\uDCC7', + rsh: '\u21B1', + rsqb: '\u005D', + rsquo: '\u2019', + rsquor: '\u2019', + rthree: '\u22CC', + rtimes: '\u22CA', + rtri: '\u25B9', + rtrie: '\u22B5', + rtrif: '\u25B8', + rtriltri: '\u29CE', + ruluhar: '\u2968', + rx: '\u211E', + sacute: '\u015B', + sbquo: '\u201A', + sc: '\u227B', + scE: '\u2AB4', + scap: '\u2AB8', + scaron: '\u0161', + sccue: '\u227D', + sce: '\u2AB0', + scedil: '\u015F', + scirc: '\u015D', + scnE: '\u2AB6', + scnap: '\u2ABA', + scnsim: '\u22E9', + scpolint: '\u2A13', + scsim: '\u227F', + scy: '\u0441', + sdot: '\u22C5', + sdotb: '\u22A1', + sdote: '\u2A66', + seArr: '\u21D8', + searhk: '\u2925', + searr: '\u2198', + searrow: '\u2198', + sect: '\u00A7', + semi: '\u003B', + seswar: '\u2929', + setminus: '\u2216', + setmn: '\u2216', + sext: '\u2736', + sfr: '\uD835\uDD30', + sfrown: '\u2322', + sharp: '\u266F', + shchcy: '\u0449', + shcy: '\u0448', + shortmid: '\u2223', + shortparallel: '\u2225', + shy: '\u00AD', + sigma: '\u03C3', + sigmaf: '\u03C2', + sigmav: '\u03C2', + sim: '\u223C', + simdot: '\u2A6A', + sime: '\u2243', + simeq: '\u2243', + simg: '\u2A9E', + simgE: '\u2AA0', + siml: '\u2A9D', + simlE: '\u2A9F', + simne: '\u2246', + simplus: '\u2A24', + simrarr: '\u2972', + slarr: '\u2190', + smallsetminus: '\u2216', + smashp: '\u2A33', + smeparsl: '\u29E4', + smid: '\u2223', + smile: '\u2323', + smt: '\u2AAA', + smte: '\u2AAC', + smtes: '\u2AAC\uFE00', + softcy: '\u044C', + sol: '\u002F', + solb: '\u29C4', + solbar: '\u233F', + sopf: '\uD835\uDD64', + spades: '\u2660', + spadesuit: '\u2660', + spar: '\u2225', + sqcap: '\u2293', + sqcaps: '\u2293\uFE00', + sqcup: '\u2294', + sqcups: '\u2294\uFE00', + sqsub: '\u228F', + sqsube: '\u2291', + sqsubset: '\u228F', + sqsubseteq: '\u2291', + sqsup: '\u2290', + sqsupe: '\u2292', + sqsupset: '\u2290', + sqsupseteq: '\u2292', + squ: '\u25A1', + square: '\u25A1', + squarf: '\u25AA', + squf: '\u25AA', + srarr: '\u2192', + sscr: '\uD835\uDCC8', + ssetmn: '\u2216', + ssmile: '\u2323', + sstarf: '\u22C6', + star: '\u2606', + starf: '\u2605', + straightepsilon: '\u03F5', + straightphi: '\u03D5', + strns: '\u00AF', + sub: '\u2282', + subE: '\u2AC5', + subdot: '\u2ABD', + sube: '\u2286', + subedot: '\u2AC3', + submult: '\u2AC1', + subnE: '\u2ACB', + subne: '\u228A', + subplus: '\u2ABF', + subrarr: '\u2979', + subset: '\u2282', + subseteq: '\u2286', + subseteqq: '\u2AC5', + subsetneq: '\u228A', + subsetneqq: '\u2ACB', + subsim: '\u2AC7', + subsub: '\u2AD5', + subsup: '\u2AD3', + succ: '\u227B', + succapprox: '\u2AB8', + succcurlyeq: '\u227D', + succeq: '\u2AB0', + succnapprox: '\u2ABA', + succneqq: '\u2AB6', + succnsim: '\u22E9', + succsim: '\u227F', + sum: '\u2211', + sung: '\u266A', + sup1: '\u00B9', + sup2: '\u00B2', + sup3: '\u00B3', + sup: '\u2283', + supE: '\u2AC6', + supdot: '\u2ABE', + supdsub: '\u2AD8', + supe: '\u2287', + supedot: '\u2AC4', + suphsol: '\u27C9', + suphsub: '\u2AD7', + suplarr: '\u297B', + supmult: '\u2AC2', + supnE: '\u2ACC', + supne: '\u228B', + supplus: '\u2AC0', + supset: '\u2283', + supseteq: '\u2287', + supseteqq: '\u2AC6', + supsetneq: '\u228B', + supsetneqq: '\u2ACC', + supsim: '\u2AC8', + supsub: '\u2AD4', + supsup: '\u2AD6', + swArr: '\u21D9', + swarhk: '\u2926', + swarr: '\u2199', + swarrow: '\u2199', + swnwar: '\u292A', + szlig: '\u00DF', + target: '\u2316', + tau: '\u03C4', + tbrk: '\u23B4', + tcaron: '\u0165', + tcedil: '\u0163', + tcy: '\u0442', + tdot: '\u20DB', + telrec: '\u2315', + tfr: '\uD835\uDD31', + there4: '\u2234', + therefore: '\u2234', + theta: '\u03B8', + thetasym: '\u03D1', + thetav: '\u03D1', + thickapprox: '\u2248', + thicksim: '\u223C', + thinsp: '\u2009', + thkap: '\u2248', + thksim: '\u223C', + thorn: '\u00FE', + tilde: '\u02DC', + times: '\u00D7', + timesb: '\u22A0', + timesbar: '\u2A31', + timesd: '\u2A30', + tint: '\u222D', + toea: '\u2928', + top: '\u22A4', + topbot: '\u2336', + topcir: '\u2AF1', + topf: '\uD835\uDD65', + topfork: '\u2ADA', + tosa: '\u2929', + tprime: '\u2034', + trade: '\u2122', + triangle: '\u25B5', + triangledown: '\u25BF', + triangleleft: '\u25C3', + trianglelefteq: '\u22B4', + triangleq: '\u225C', + triangleright: '\u25B9', + trianglerighteq: '\u22B5', + tridot: '\u25EC', + trie: '\u225C', + triminus: '\u2A3A', + triplus: '\u2A39', + trisb: '\u29CD', + tritime: '\u2A3B', + trpezium: '\u23E2', + tscr: '\uD835\uDCC9', + tscy: '\u0446', + tshcy: '\u045B', + tstrok: '\u0167', + twixt: '\u226C', + twoheadleftarrow: '\u219E', + twoheadrightarrow: '\u21A0', + uArr: '\u21D1', + uHar: '\u2963', + uacute: '\u00FA', + uarr: '\u2191', + ubrcy: '\u045E', + ubreve: '\u016D', + ucirc: '\u00FB', + ucy: '\u0443', + udarr: '\u21C5', + udblac: '\u0171', + udhar: '\u296E', + ufisht: '\u297E', + ufr: '\uD835\uDD32', + ugrave: '\u00F9', + uharl: '\u21BF', + uharr: '\u21BE', + uhblk: '\u2580', + ulcorn: '\u231C', + ulcorner: '\u231C', + ulcrop: '\u230F', + ultri: '\u25F8', + umacr: '\u016B', + uml: '\u00A8', + uogon: '\u0173', + uopf: '\uD835\uDD66', + uparrow: '\u2191', + updownarrow: '\u2195', + upharpoonleft: '\u21BF', + upharpoonright: '\u21BE', + uplus: '\u228E', + upsi: '\u03C5', + upsih: '\u03D2', + upsilon: '\u03C5', + upuparrows: '\u21C8', + urcorn: '\u231D', + urcorner: '\u231D', + urcrop: '\u230E', + uring: '\u016F', + urtri: '\u25F9', + uscr: '\uD835\uDCCA', + utdot: '\u22F0', + utilde: '\u0169', + utri: '\u25B5', + utrif: '\u25B4', + uuarr: '\u21C8', + uuml: '\u00FC', + uwangle: '\u29A7', + vArr: '\u21D5', + vBar: '\u2AE8', + vBarv: '\u2AE9', + vDash: '\u22A8', + vangrt: '\u299C', + varepsilon: '\u03F5', + varkappa: '\u03F0', + varnothing: '\u2205', + varphi: '\u03D5', + varpi: '\u03D6', + varpropto: '\u221D', + varr: '\u2195', + varrho: '\u03F1', + varsigma: '\u03C2', + varsubsetneq: '\u228A\uFE00', + varsubsetneqq: '\u2ACB\uFE00', + varsupsetneq: '\u228B\uFE00', + varsupsetneqq: '\u2ACC\uFE00', + vartheta: '\u03D1', + vartriangleleft: '\u22B2', + vartriangleright: '\u22B3', + vcy: '\u0432', + vdash: '\u22A2', + vee: '\u2228', + veebar: '\u22BB', + veeeq: '\u225A', + vellip: '\u22EE', + verbar: '\u007C', + vert: '\u007C', + vfr: '\uD835\uDD33', + vltri: '\u22B2', + vnsub: '\u2282\u20D2', + vnsup: '\u2283\u20D2', + vopf: '\uD835\uDD67', + vprop: '\u221D', + vrtri: '\u22B3', + vscr: '\uD835\uDCCB', + vsubnE: '\u2ACB\uFE00', + vsubne: '\u228A\uFE00', + vsupnE: '\u2ACC\uFE00', + vsupne: '\u228B\uFE00', + vzigzag: '\u299A', + wcirc: '\u0175', + wedbar: '\u2A5F', + wedge: '\u2227', + wedgeq: '\u2259', + weierp: '\u2118', + wfr: '\uD835\uDD34', + wopf: '\uD835\uDD68', + wp: '\u2118', + wr: '\u2240', + wreath: '\u2240', + wscr: '\uD835\uDCCC', + xcap: '\u22C2', + xcirc: '\u25EF', + xcup: '\u22C3', + xdtri: '\u25BD', + xfr: '\uD835\uDD35', + xhArr: '\u27FA', + xharr: '\u27F7', + xi: '\u03BE', + xlArr: '\u27F8', + xlarr: '\u27F5', + xmap: '\u27FC', + xnis: '\u22FB', + xodot: '\u2A00', + xopf: '\uD835\uDD69', + xoplus: '\u2A01', + xotime: '\u2A02', + xrArr: '\u27F9', + xrarr: '\u27F6', + xscr: '\uD835\uDCCD', + xsqcup: '\u2A06', + xuplus: '\u2A04', + xutri: '\u25B3', + xvee: '\u22C1', + xwedge: '\u22C0', + yacute: '\u00FD', + yacy: '\u044F', + ycirc: '\u0177', + ycy: '\u044B', + yen: '\u00A5', + yfr: '\uD835\uDD36', + yicy: '\u0457', + yopf: '\uD835\uDD6A', + yscr: '\uD835\uDCCE', + yucy: '\u044E', + yuml: '\u00FF', + zacute: '\u017A', + zcaron: '\u017E', + zcy: '\u0437', + zdot: '\u017C', + zeetrf: '\u2128', + zeta: '\u03B6', + zfr: '\uD835\uDD37', + zhcy: '\u0436', + zigrarr: '\u21DD', + zopf: '\uD835\uDD6B', + zscr: '\uD835\uDCCF', + zwj: '\u200D', + zwnj: '\u200C', +}; +const decodeMap = { + '0': 65533, + '128': 8364, + '130': 8218, + '131': 402, + '132': 8222, + '133': 8230, + '134': 8224, + '135': 8225, + '136': 710, + '137': 8240, + '138': 352, + '139': 8249, + '140': 338, + '142': 381, + '145': 8216, + '146': 8217, + '147': 8220, + '148': 8221, + '149': 8226, + '150': 8211, + '151': 8212, + '152': 732, + '153': 8482, + '154': 353, + '155': 8250, + '156': 339, + '158': 382, + '159': 376, +}; +function decodeHTMLStrict(text) { + return text.replace(/&(?:[a-zA-Z]+|#[xX][\da-fA-F]+|#\d+);/g, (key) => { + if (key.charAt(1) === '#') { + const secondChar = key.charAt(2); + const codePoint = secondChar === 'X' || secondChar === 'x' ? parseInt(key.slice(3), 16) : parseInt(key.slice(2), 10); + return decodeCodePoint(codePoint); + } + return getOwnProperty(entities, key.slice(1, -1)) ?? key; + }); +} +function decodeCodePoint(codePoint) { + if ((codePoint >= 0xd800 && codePoint <= 0xdfff) || codePoint > 0x10ffff) { + return '\uFFFD'; + } + return String.fromCodePoint(getOwnProperty(decodeMap, codePoint) ?? codePoint); +} + +function scanJSXAttributeValue(parser, context) { + parser.startIndex = parser.tokenIndex = parser.index; + parser.startColumn = parser.tokenColumn = parser.column; + parser.startLine = parser.tokenLine = parser.line; + parser.setToken(CharTypes[parser.currentChar] & 8192 + ? scanJSXString(parser) + : scanSingleToken(parser, context, 0)); + return parser.getToken(); +} +function scanJSXString(parser) { + const quote = parser.currentChar; + let char = advanceChar(parser); + const start = parser.index; + while (char !== quote) { + if (parser.index >= parser.end) + parser.report(16); + char = advanceChar(parser); + } + if (char !== quote) + parser.report(16); + parser.tokenValue = parser.source.slice(start, parser.index); + advanceChar(parser); + if (parser.options.raw) + parser.tokenRaw = parser.source.slice(parser.tokenIndex, parser.index); + return 134283267; +} +function nextJSXToken(parser) { + parser.startIndex = parser.tokenIndex = parser.index; + parser.startColumn = parser.tokenColumn = parser.column; + parser.startLine = parser.tokenLine = parser.line; + if (parser.index >= parser.end) { + parser.setToken(1048576); + return; + } + if (parser.currentChar === 60) { + advanceChar(parser); + parser.setToken(8456256); + return; + } + if (parser.currentChar === 123) { + advanceChar(parser); + parser.setToken(2162700); + return; + } + let state = 0; + while (parser.index < parser.end) { + const type = CharTypes[parser.source.charCodeAt(parser.index)]; + if (type & 1024) { + state |= 1 | 4; + scanNewLine(parser); + } + else if (type & 2048) { + consumeLineFeed(parser, state); + state = (state & -5) | 1; + } + else { + advanceChar(parser); + } + if (CharTypes[parser.currentChar] & 16384) + break; + } + if (parser.tokenIndex === parser.index) + parser.report(0); + const raw = parser.source.slice(parser.tokenIndex, parser.index); + if (parser.options.raw) + parser.tokenRaw = raw; + parser.tokenValue = decodeHTMLStrict(raw); + parser.setToken(137); +} +function rescanJSXIdentifier(parser) { + if ((parser.getToken() & 143360) === 143360) { + const { index } = parser; + let char = parser.currentChar; + while (CharTypes[char] & (32768 | 2)) { + char = advanceChar(parser); + } + parser.tokenValue += parser.source.slice(index, parser.index); + parser.setToken(208897, true); + } + return parser.getToken(); +} + +class Scope { + parser; + type; + parent; + scopeError; + variableBindings = new Map(); + constructor(parser, type = 2, parent) { + this.parser = parser; + this.type = type; + this.parent = parent; + } + createChildScope(type) { + return new Scope(this.parser, type, this); + } + addVarOrBlock(context, name, kind, origin) { + if (kind & 4) { + this.addVarName(context, name, kind); + } + else { + this.addBlockName(context, name, kind, origin); + } + if (origin & 64) { + this.parser.declareUnboundVariable(name); + } + } + addVarName(context, name, kind) { + const { parser } = this; + let currentScope = this; + while (currentScope && (currentScope.type & 128) === 0) { + const { variableBindings } = currentScope; + const value = variableBindings.get(name); + if (value && value & 248) { + if (parser.options.webcompat && + (context & 1) === 0 && + ((kind & 128 && value & 68) || + (value & 128 && kind & 68))) ; + else { + parser.report(145, name); + } + } + if (currentScope === this) { + if (value && value & 1 && kind & 1) { + currentScope.recordScopeError(145, name); + } + } + if (value && + (value & 256 || (value & 512 && !parser.options.webcompat))) { + parser.report(145, name); + } + currentScope.variableBindings.set(name, kind); + currentScope = currentScope.parent; + } + } + hasVariable(name) { + return this.variableBindings.has(name); + } + addBlockName(context, name, kind, origin) { + const { parser } = this; + const value = this.variableBindings.get(name); + if (value && (value & 2) === 0) { + if (kind & 1) { + this.recordScopeError(145, name); + } + else if (parser.options.webcompat && + (context & 1) === 0 && + origin & 2 && + value === 64 && + kind === 64) ; + else { + parser.report(145, name); + } + } + if (this.type & 64 && + this.parent?.hasVariable(name) && + (this.parent.variableBindings.get(name) & 2) === 0) { + parser.report(145, name); + } + if (this.type & 512 && value && (value & 2) === 0) { + if (kind & 1) { + this.recordScopeError(145, name); + } + } + if (this.type & 32) { + if (this.parent.variableBindings.get(name) & 768) + parser.report(159, name); + } + this.variableBindings.set(name, kind); + } + recordScopeError(type, ...params) { + this.scopeError = { + type, + params, + start: this.parser.tokenStart, + end: this.parser.currentLocation, + }; + } + reportScopeError() { + const { scopeError } = this; + if (!scopeError) { + return; + } + throw new ParseError(scopeError.start, scopeError.end, scopeError.type, ...scopeError.params); + } +} +function createArrowHeadParsingScope(parser, context, value) { + const scope = parser.createScope().createChildScope(512); + scope.addBlockName(context, value, 1, 0); + return scope; +} + +class PrivateScope { + parser; + parent; + refs = Object.create(null); + privateIdentifiers = new Map(); + constructor(parser, parent) { + this.parser = parser; + this.parent = parent; + } + addPrivateIdentifier(name, kind) { + const { privateIdentifiers } = this; + let focusKind = kind & (32 | 768); + if (!(focusKind & 768)) + focusKind |= 768; + const value = privateIdentifiers.get(name); + if (this.hasPrivateIdentifier(name) && + ((value & 32) !== (focusKind & 32) || value & focusKind & 768)) { + this.parser.report(146, name); + } + privateIdentifiers.set(name, this.hasPrivateIdentifier(name) ? value | focusKind : focusKind); + } + addPrivateIdentifierRef(name) { + this.refs[name] ??= []; + this.refs[name].push(this.parser.tokenStart); + } + isPrivateIdentifierDefined(name) { + return this.hasPrivateIdentifier(name) || Boolean(this.parent?.isPrivateIdentifierDefined(name)); + } + validatePrivateIdentifierRefs() { + for (const name in this.refs) { + if (!this.isPrivateIdentifierDefined(name)) { + const { index, line, column } = this.refs[name][0]; + throw new ParseError({ index, line, column }, { index: index + name.length, line, column: column + name.length }, 4, name); + } + } + } + hasPrivateIdentifier(name) { + return this.privateIdentifiers.has(name); + } +} + +class Parser { + source; + options; + lastOnToken = null; + token = 1048576; + flags = 0; + index = 0; + line = 1; + column = 0; + startIndex = 0; + end = 0; + tokenIndex = 0; + startColumn = 0; + tokenColumn = 0; + tokenLine = 1; + startLine = 1; + tokenValue = ''; + tokenRaw = ''; + tokenRegExp = void 0; + currentChar = 0; + exportedNames = new Set(); + exportedBindings = new Set(); + assignable = 1; + destructible = 0; + leadingDecorators = { decorators: [] }; + constructor(source, options = {}) { + this.source = source; + this.options = options; + this.end = source.length; + this.currentChar = source.charCodeAt(0); + } + getToken() { + return this.token; + } + setToken(value, replaceLast = false) { + this.token = value; + const { onToken } = this.options; + if (onToken) { + if (value !== 1048576) { + const loc = { + start: { + line: this.tokenLine, + column: this.tokenColumn, + }, + end: { + line: this.line, + column: this.column, + }, + }; + if (!replaceLast && this.lastOnToken) { + onToken(...this.lastOnToken); + } + this.lastOnToken = [convertTokenType(value), this.tokenIndex, this.index, loc]; + } + else { + if (this.lastOnToken) { + onToken(...this.lastOnToken); + this.lastOnToken = null; + } + } + } + return value; + } + get tokenStart() { + return { + index: this.tokenIndex, + line: this.tokenLine, + column: this.tokenColumn, + }; + } + get currentLocation() { + return { index: this.index, line: this.line, column: this.column }; + } + finishNode(node, start, end) { + if (this.options.ranges) { + node.start = start.index; + const endIndex = end ? end.index : this.startIndex; + node.end = endIndex; + node.range = [start.index, endIndex]; + } + if (this.options.loc) { + node.loc = { + start: { + line: start.line, + column: start.column, + }, + end: end ? { line: end.line, column: end.column } : { line: this.startLine, column: this.startColumn }, + }; + if (this.options.source) { + node.loc.source = this.options.source; + } + } + return node; + } + addBindingToExports(name) { + this.exportedBindings.add(name); + } + declareUnboundVariable(name) { + const { exportedNames } = this; + if (exportedNames.has(name)) { + this.report(147, name); + } + exportedNames.add(name); + } + report(type, ...params) { + throw new ParseError(this.tokenStart, this.currentLocation, type, ...params); + } + createScopeIfLexical(type, parent) { + if (this.options.lexical) { + return this.createScope(type, parent); + } + return undefined; + } + createScope(type, parent) { + return new Scope(this, type, parent); + } + createPrivateScopeIfLexical(parent) { + if (this.options.lexical) { + return new PrivateScope(this, parent); + } + return undefined; + } +} +function pushComment(comments, options) { + return function (type, value, start, end, loc) { + const comment = { + type, + value, + }; + if (options.ranges) { + comment.start = start; + comment.end = end; + comment.range = [start, end]; + } + if (options.loc) { + comment.loc = loc; + } + comments.push(comment); + }; +} +function pushToken(tokens, options) { + return function (type, start, end, loc) { + const token = { + token: type, + }; + if (options.ranges) { + token.start = start; + token.end = end; + token.range = [start, end]; + } + if (options.loc) { + token.loc = loc; + } + tokens.push(token); + }; +} + +function normalizeOptions(rawOptions) { + const options = { ...rawOptions }; + if (options.onComment) { + options.onComment = Array.isArray(options.onComment) ? pushComment(options.onComment, options) : options.onComment; + } + if (options.onToken) { + options.onToken = Array.isArray(options.onToken) ? pushToken(options.onToken, options) : options.onToken; + } + return options; +} + +function parseSource(source, rawOptions = {}, context = 0) { + const options = normalizeOptions(rawOptions); + if (options.module) + context |= 2 | 1; + if (options.globalReturn) + context |= 4096; + if (options.impliedStrict) + context |= 1; + const parser = new Parser(source, options); + skipHashBang(parser); + const scope = parser.createScopeIfLexical(); + let body = []; + let sourceType = 'script'; + if (context & 2) { + sourceType = 'module'; + body = parseModuleItemList(parser, context | 8, scope); + if (scope) { + for (const name of parser.exportedBindings) { + if (!scope.hasVariable(name)) + parser.report(148, name); + } + } + } + else { + body = parseStatementList(parser, context | 8, scope); + } + return parser.finishNode({ + type: 'Program', + sourceType, + body, + }, { index: 0, line: 1, column: 0 }, parser.currentLocation); +} +function parseStatementList(parser, context, scope) { + nextToken(parser, context | 32 | 262144); + const statements = []; + while (parser.getToken() === 134283267) { + const { index, tokenValue, tokenStart, tokenIndex } = parser; + const token = parser.getToken(); + const expr = parseLiteral(parser, context); + if (isValidStrictMode(parser, index, tokenIndex, tokenValue)) { + context |= 1; + if (parser.flags & 64) { + throw new ParseError(parser.tokenStart, parser.currentLocation, 9); + } + if (parser.flags & 4096) { + throw new ParseError(parser.tokenStart, parser.currentLocation, 15); + } + } + statements.push(parseDirective(parser, context, expr, token, tokenStart)); + } + while (parser.getToken() !== 1048576) { + statements.push(parseStatementListItem(parser, context, scope, undefined, 4, {})); + } + return statements; +} +function parseModuleItemList(parser, context, scope) { + nextToken(parser, context | 32); + const statements = []; + while (parser.getToken() === 134283267) { + const { tokenStart } = parser; + const token = parser.getToken(); + statements.push(parseDirective(parser, context, parseLiteral(parser, context), token, tokenStart)); + } + while (parser.getToken() !== 1048576) { + statements.push(parseModuleItem(parser, context, scope)); + } + return statements; +} +function parseModuleItem(parser, context, scope) { + if (parser.getToken() === 132) { + Object.assign(parser.leadingDecorators, { + start: parser.tokenStart, + decorators: parseDecorators(parser, context, undefined), + }); + } + let moduleItem; + switch (parser.getToken()) { + case 20564: + moduleItem = parseExportDeclaration(parser, context, scope); + break; + case 86106: + moduleItem = parseImportDeclaration(parser, context, scope); + break; + default: + moduleItem = parseStatementListItem(parser, context, scope, undefined, 4, {}); + } + if (parser.leadingDecorators?.decorators.length) { + parser.report(170); + } + return moduleItem; +} +function parseStatementListItem(parser, context, scope, privateScope, origin, labels) { + const start = parser.tokenStart; + switch (parser.getToken()) { + case 86104: + return parseFunctionDeclaration(parser, context, scope, privateScope, origin, 1, 0, 0, start); + case 132: + case 86094: + return parseClassDeclaration(parser, context, scope, privateScope, 0); + case 86090: + return parseLexicalDeclaration(parser, context, scope, privateScope, 16, 0); + case 241737: + return parseLetIdentOrVarDeclarationStatement(parser, context, scope, privateScope, origin); + case 20564: + parser.report(103, 'export'); + case 86106: + nextToken(parser, context); + switch (parser.getToken()) { + case 67174411: + return parseImportCallDeclaration(parser, context, privateScope, start); + case 67108877: + return parseImportMetaDeclaration(parser, context, start); + default: + parser.report(103, 'import'); + } + case 209005: + return parseAsyncArrowOrAsyncFunctionDeclaration(parser, context, scope, privateScope, origin, labels, 1); + default: + return parseStatement(parser, context, scope, privateScope, origin, labels, 1); + } +} +function parseStatement(parser, context, scope, privateScope, origin, labels, allowFuncDecl) { + switch (parser.getToken()) { + case 86088: + return parseVariableStatement(parser, context, scope, privateScope, 0); + case 20572: + return parseReturnStatement(parser, context, privateScope); + case 20569: + return parseIfStatement(parser, context, scope, privateScope, labels); + case 20567: + return parseForStatement(parser, context, scope, privateScope, labels); + case 20562: + return parseDoWhileStatement(parser, context, scope, privateScope, labels); + case 20578: + return parseWhileStatement(parser, context, scope, privateScope, labels); + case 86110: + return parseSwitchStatement(parser, context, scope, privateScope, labels); + case 1074790417: + return parseEmptyStatement(parser, context); + case 2162700: + return parseBlock(parser, context, scope?.createChildScope(), privateScope, labels, parser.tokenStart); + case 86112: + return parseThrowStatement(parser, context, privateScope); + case 20555: + return parseBreakStatement(parser, context, labels); + case 20559: + return parseContinueStatement(parser, context, labels); + case 20577: + return parseTryStatement(parser, context, scope, privateScope, labels); + case 20579: + return parseWithStatement(parser, context, scope, privateScope, labels); + case 20560: + return parseDebuggerStatement(parser, context); + case 209005: + return parseAsyncArrowOrAsyncFunctionDeclaration(parser, context, scope, privateScope, origin, labels, 0); + case 20557: + parser.report(162); + case 20566: + parser.report(163); + case 86104: + parser.report(context & 1 + ? 76 + : !parser.options.webcompat + ? 78 + : 77); + case 86094: + parser.report(79); + default: + return parseExpressionOrLabelledStatement(parser, context, scope, privateScope, origin, labels, allowFuncDecl); + } +} +function parseExpressionOrLabelledStatement(parser, context, scope, privateScope, origin, labels, allowFuncDecl) { + const { tokenValue, tokenStart } = parser; + const token = parser.getToken(); + let expr; + switch (token) { + case 241737: + expr = parseIdentifier(parser, context); + if (context & 1) + parser.report(85); + if (parser.getToken() === 69271571) + parser.report(84); + break; + default: + expr = parsePrimaryExpression(parser, context, privateScope, 2, 0, 1, 0, 1, parser.tokenStart); + } + if (token & 143360 && parser.getToken() === 21) { + return parseLabelledStatement(parser, context, scope, privateScope, origin, labels, tokenValue, expr, token, allowFuncDecl, tokenStart); + } + expr = parseMemberOrUpdateExpression(parser, context, privateScope, expr, 0, 0, tokenStart); + expr = parseAssignmentExpression(parser, context, privateScope, 0, 0, tokenStart, expr); + if (parser.getToken() === 18) { + expr = parseSequenceExpression(parser, context, privateScope, 0, tokenStart, expr); + } + return parseExpressionStatement(parser, context, expr, tokenStart); +} +function parseBlock(parser, context, scope, privateScope, labels, start = parser.tokenStart, type = 'BlockStatement') { + const body = []; + consume(parser, context | 32, 2162700); + while (parser.getToken() !== 1074790415) { + body.push(parseStatementListItem(parser, context, scope, privateScope, 2, { $: labels })); + } + consume(parser, context | 32, 1074790415); + return parser.finishNode({ + type, + body, + }, start); +} +function parseReturnStatement(parser, context, privateScope) { + if ((context & 4096) === 0) + parser.report(92); + const start = parser.tokenStart; + nextToken(parser, context | 32); + const argument = parser.flags & 1 || parser.getToken() & 1048576 + ? null + : parseExpressions(parser, context, privateScope, 0, 1, parser.tokenStart); + matchOrInsertSemicolon(parser, context | 32); + return parser.finishNode({ + type: 'ReturnStatement', + argument, + }, start); +} +function parseExpressionStatement(parser, context, expression, start) { + matchOrInsertSemicolon(parser, context | 32); + return parser.finishNode({ + type: 'ExpressionStatement', + expression, + }, start); +} +function parseLabelledStatement(parser, context, scope, privateScope, origin, labels, value, expr, token, allowFuncDecl, start) { + validateBindingIdentifier(parser, context, 0, token, 1); + validateAndDeclareLabel(parser, labels, value); + nextToken(parser, context | 32); + const body = allowFuncDecl && + (context & 1) === 0 && + parser.options.webcompat && + parser.getToken() === 86104 + ? parseFunctionDeclaration(parser, context, scope?.createChildScope(), privateScope, origin, 0, 0, 0, parser.tokenStart) + : parseStatement(parser, context, scope, privateScope, origin, labels, allowFuncDecl); + return parser.finishNode({ + type: 'LabeledStatement', + label: expr, + body, + }, start); +} +function parseAsyncArrowOrAsyncFunctionDeclaration(parser, context, scope, privateScope, origin, labels, allowFuncDecl) { + const { tokenValue, tokenStart: start } = parser; + const token = parser.getToken(); + let expr = parseIdentifier(parser, context); + if (parser.getToken() === 21) { + return parseLabelledStatement(parser, context, scope, privateScope, origin, labels, tokenValue, expr, token, 1, start); + } + const asyncNewLine = parser.flags & 1; + if (!asyncNewLine) { + if (parser.getToken() === 86104) { + if (!allowFuncDecl) + parser.report(123); + return parseFunctionDeclaration(parser, context, scope, privateScope, origin, 1, 0, 1, start); + } + if (isValidIdentifier(context, parser.getToken())) { + expr = parseAsyncArrowAfterIdent(parser, context, privateScope, 1, start); + if (parser.getToken() === 18) + expr = parseSequenceExpression(parser, context, privateScope, 0, start, expr); + return parseExpressionStatement(parser, context, expr, start); + } + } + if (parser.getToken() === 67174411) { + expr = parseAsyncArrowOrCallExpression(parser, context, privateScope, expr, 1, 1, 0, asyncNewLine, start); + } + else { + if (parser.getToken() === 10) { + classifyIdentifier(parser, context, token); + if ((token & 36864) === 36864) { + parser.flags |= 256; + } + expr = parseArrowFromIdentifier(parser, context | 2048, privateScope, parser.tokenValue, expr, 0, 1, 0, start); + } + parser.assignable = 1; + } + expr = parseMemberOrUpdateExpression(parser, context, privateScope, expr, 0, 0, start); + expr = parseAssignmentExpression(parser, context, privateScope, 0, 0, start, expr); + parser.assignable = 1; + if (parser.getToken() === 18) { + expr = parseSequenceExpression(parser, context, privateScope, 0, start, expr); + } + return parseExpressionStatement(parser, context, expr, start); +} +function parseDirective(parser, context, expression, token, start) { + const endIndex = parser.startIndex; + if (token !== 1074790417) { + parser.assignable = 2; + expression = parseMemberOrUpdateExpression(parser, context, undefined, expression, 0, 0, start); + if (parser.getToken() !== 1074790417) { + expression = parseAssignmentExpression(parser, context, undefined, 0, 0, start, expression); + if (parser.getToken() === 18) { + expression = parseSequenceExpression(parser, context, undefined, 0, start, expression); + } + } + matchOrInsertSemicolon(parser, context | 32); + } + const node = { + type: 'ExpressionStatement', + expression, + }; + if (expression.type === 'Literal' && typeof expression.value === 'string') { + node.directive = parser.source.slice(start.index + 1, endIndex - 1); + } + return parser.finishNode(node, start); +} +function parseEmptyStatement(parser, context) { + const start = parser.tokenStart; + nextToken(parser, context | 32); + return parser.finishNode({ + type: 'EmptyStatement', + }, start); +} +function parseThrowStatement(parser, context, privateScope) { + const start = parser.tokenStart; + nextToken(parser, context | 32); + if (parser.flags & 1) + parser.report(90); + const argument = parseExpressions(parser, context, privateScope, 0, 1, parser.tokenStart); + matchOrInsertSemicolon(parser, context | 32); + return parser.finishNode({ + type: 'ThrowStatement', + argument, + }, start); +} +function parseIfStatement(parser, context, scope, privateScope, labels) { + const start = parser.tokenStart; + nextToken(parser, context); + consume(parser, context | 32, 67174411); + parser.assignable = 1; + const test = parseExpressions(parser, context, privateScope, 0, 1, parser.tokenStart); + consume(parser, context | 32, 16); + const consequent = parseConsequentOrAlternative(parser, context, scope, privateScope, labels); + let alternate = null; + if (parser.getToken() === 20563) { + nextToken(parser, context | 32); + alternate = parseConsequentOrAlternative(parser, context, scope, privateScope, labels); + } + return parser.finishNode({ + type: 'IfStatement', + test, + consequent, + alternate, + }, start); +} +function parseConsequentOrAlternative(parser, context, scope, privateScope, labels) { + const { tokenStart } = parser; + return context & 1 || + !parser.options.webcompat || + parser.getToken() !== 86104 + ? parseStatement(parser, context, scope, privateScope, 0, { $: labels }, 0) + : parseFunctionDeclaration(parser, context, scope?.createChildScope(), privateScope, 0, 0, 0, 0, tokenStart); +} +function parseSwitchStatement(parser, context, scope, privateScope, labels) { + const start = parser.tokenStart; + nextToken(parser, context); + consume(parser, context | 32, 67174411); + const discriminant = parseExpressions(parser, context, privateScope, 0, 1, parser.tokenStart); + consume(parser, context, 16); + consume(parser, context, 2162700); + const cases = []; + let seenDefault = 0; + scope = scope?.createChildScope(8); + while (parser.getToken() !== 1074790415) { + const { tokenStart } = parser; + let test = null; + const consequent = []; + if (consumeOpt(parser, context | 32, 20556)) { + test = parseExpressions(parser, context, privateScope, 0, 1, parser.tokenStart); + } + else { + consume(parser, context | 32, 20561); + if (seenDefault) + parser.report(89); + seenDefault = 1; + } + consume(parser, context | 32, 21); + while (parser.getToken() !== 20556 && + parser.getToken() !== 1074790415 && + parser.getToken() !== 20561) { + consequent.push(parseStatementListItem(parser, context | 4, scope, privateScope, 2, { + $: labels, + })); + } + cases.push(parser.finishNode({ + type: 'SwitchCase', + test, + consequent, + }, tokenStart)); + } + consume(parser, context | 32, 1074790415); + return parser.finishNode({ + type: 'SwitchStatement', + discriminant, + cases, + }, start); +} +function parseWhileStatement(parser, context, scope, privateScope, labels) { + const start = parser.tokenStart; + nextToken(parser, context); + consume(parser, context | 32, 67174411); + const test = parseExpressions(parser, context, privateScope, 0, 1, parser.tokenStart); + consume(parser, context | 32, 16); + const body = parseIterationStatementBody(parser, context, scope, privateScope, labels); + return parser.finishNode({ + type: 'WhileStatement', + test, + body, + }, start); +} +function parseIterationStatementBody(parser, context, scope, privateScope, labels) { + return parseStatement(parser, ((context | 131072) ^ 131072) | 128, scope, privateScope, 0, { loop: 1, $: labels }, 0); +} +function parseContinueStatement(parser, context, labels) { + if ((context & 128) === 0) + parser.report(68); + const start = parser.tokenStart; + nextToken(parser, context); + let label = null; + if ((parser.flags & 1) === 0 && parser.getToken() & 143360) { + const { tokenValue } = parser; + label = parseIdentifier(parser, context | 32); + if (!isValidLabel(parser, labels, tokenValue, 1)) + parser.report(138, tokenValue); + } + matchOrInsertSemicolon(parser, context | 32); + return parser.finishNode({ + type: 'ContinueStatement', + label, + }, start); +} +function parseBreakStatement(parser, context, labels) { + const start = parser.tokenStart; + nextToken(parser, context | 32); + let label = null; + if ((parser.flags & 1) === 0 && parser.getToken() & 143360) { + const { tokenValue } = parser; + label = parseIdentifier(parser, context | 32); + if (!isValidLabel(parser, labels, tokenValue, 0)) + parser.report(138, tokenValue); + } + else if ((context & (4 | 128)) === 0) { + parser.report(69); + } + matchOrInsertSemicolon(parser, context | 32); + return parser.finishNode({ + type: 'BreakStatement', + label, + }, start); +} +function parseWithStatement(parser, context, scope, privateScope, labels) { + const start = parser.tokenStart; + nextToken(parser, context); + if (context & 1) + parser.report(91); + consume(parser, context | 32, 67174411); + const object = parseExpressions(parser, context, privateScope, 0, 1, parser.tokenStart); + consume(parser, context | 32, 16); + const body = parseStatement(parser, context, scope, privateScope, 2, labels, 0); + return parser.finishNode({ + type: 'WithStatement', + object, + body, + }, start); +} +function parseDebuggerStatement(parser, context) { + const start = parser.tokenStart; + nextToken(parser, context | 32); + matchOrInsertSemicolon(parser, context | 32); + return parser.finishNode({ + type: 'DebuggerStatement', + }, start); +} +function parseTryStatement(parser, context, scope, privateScope, labels) { + const start = parser.tokenStart; + nextToken(parser, context | 32); + const firstScope = scope?.createChildScope(16); + const block = parseBlock(parser, context, firstScope, privateScope, { $: labels }); + const { tokenStart } = parser; + const handler = consumeOpt(parser, context | 32, 20557) + ? parseCatchBlock(parser, context, scope, privateScope, labels, tokenStart) + : null; + let finalizer = null; + if (parser.getToken() === 20566) { + nextToken(parser, context | 32); + const finalizerScope = scope?.createChildScope(4); + const block = parseBlock(parser, context, finalizerScope, privateScope, { $: labels }); + finalizer = block; + } + if (!handler && !finalizer) { + parser.report(88); + } + return parser.finishNode({ + type: 'TryStatement', + block, + handler, + finalizer, + }, start); +} +function parseCatchBlock(parser, context, scope, privateScope, labels, start) { + let param = null; + let additionalScope = scope; + if (consumeOpt(parser, context, 67174411)) { + scope = scope?.createChildScope(4); + param = parseBindingPattern(parser, context, scope, privateScope, (parser.getToken() & 2097152) === 2097152 + ? 256 + : 512, 0); + if (parser.getToken() === 18) { + parser.report(86); + } + else if (parser.getToken() === 1077936155) { + parser.report(87); + } + consume(parser, context | 32, 16); + } + additionalScope = scope?.createChildScope(32); + const body = parseBlock(parser, context, additionalScope, privateScope, { $: labels }); + return parser.finishNode({ + type: 'CatchClause', + param, + body, + }, start); +} +function parseStaticBlock(parser, context, scope, privateScope, start) { + scope = scope?.createChildScope(); + const ctorContext = 512 | 4096 | 1024 | 4 | 128; + context = + ((context | ctorContext) ^ ctorContext) | + 256 | + 2048 | + 524288 | + 65536; + return parseBlock(parser, context, scope, privateScope, {}, start, 'StaticBlock'); +} +function parseDoWhileStatement(parser, context, scope, privateScope, labels) { + const start = parser.tokenStart; + nextToken(parser, context | 32); + const body = parseIterationStatementBody(parser, context, scope, privateScope, labels); + consume(parser, context, 20578); + consume(parser, context | 32, 67174411); + const test = parseExpressions(parser, context, privateScope, 0, 1, parser.tokenStart); + consume(parser, context | 32, 16); + consumeOpt(parser, context | 32, 1074790417); + return parser.finishNode({ + type: 'DoWhileStatement', + body, + test, + }, start); +} +function parseLetIdentOrVarDeclarationStatement(parser, context, scope, privateScope, origin) { + const { tokenValue, tokenStart } = parser; + const token = parser.getToken(); + let expr = parseIdentifier(parser, context); + if (parser.getToken() & (143360 | 2097152)) { + const declarations = parseVariableDeclarationList(parser, context, scope, privateScope, 8, 0); + matchOrInsertSemicolon(parser, context | 32); + return parser.finishNode({ + type: 'VariableDeclaration', + kind: 'let', + declarations, + }, tokenStart); + } + parser.assignable = 1; + if (context & 1) + parser.report(85); + if (parser.getToken() === 21) { + return parseLabelledStatement(parser, context, scope, privateScope, origin, {}, tokenValue, expr, token, 0, tokenStart); + } + if (parser.getToken() === 10) { + let scope = void 0; + if (parser.options.lexical) + scope = createArrowHeadParsingScope(parser, context, tokenValue); + parser.flags = (parser.flags | 128) ^ 128; + expr = parseArrowFunctionExpression(parser, context, scope, privateScope, [expr], 0, tokenStart); + } + else { + expr = parseMemberOrUpdateExpression(parser, context, privateScope, expr, 0, 0, tokenStart); + expr = parseAssignmentExpression(parser, context, privateScope, 0, 0, tokenStart, expr); + } + if (parser.getToken() === 18) { + expr = parseSequenceExpression(parser, context, privateScope, 0, tokenStart, expr); + } + return parseExpressionStatement(parser, context, expr, tokenStart); +} +function parseLexicalDeclaration(parser, context, scope, privateScope, kind, origin) { + const start = parser.tokenStart; + nextToken(parser, context); + const declarations = parseVariableDeclarationList(parser, context, scope, privateScope, kind, origin); + matchOrInsertSemicolon(parser, context | 32); + return parser.finishNode({ + type: 'VariableDeclaration', + kind: kind & 8 ? 'let' : 'const', + declarations, + }, start); +} +function parseVariableStatement(parser, context, scope, privateScope, origin) { + const start = parser.tokenStart; + nextToken(parser, context); + const declarations = parseVariableDeclarationList(parser, context, scope, privateScope, 4, origin); + matchOrInsertSemicolon(parser, context | 32); + return parser.finishNode({ + type: 'VariableDeclaration', + kind: 'var', + declarations, + }, start); +} +function parseVariableDeclarationList(parser, context, scope, privateScope, kind, origin) { + let bindingCount = 1; + const list = [ + parseVariableDeclaration(parser, context, scope, privateScope, kind, origin), + ]; + while (consumeOpt(parser, context, 18)) { + bindingCount++; + list.push(parseVariableDeclaration(parser, context, scope, privateScope, kind, origin)); + } + if (bindingCount > 1 && origin & 32 && parser.getToken() & 262144) { + parser.report(61, KeywordDescTable[parser.getToken() & 255]); + } + return list; +} +function parseVariableDeclaration(parser, context, scope, privateScope, kind, origin) { + const { tokenStart } = parser; + const token = parser.getToken(); + let init = null; + const id = parseBindingPattern(parser, context, scope, privateScope, kind, origin); + if (parser.getToken() === 1077936155) { + nextToken(parser, context | 32); + init = parseExpression(parser, context, privateScope, 1, 0, parser.tokenStart); + if (origin & 32 || (token & 2097152) === 0) { + if (parser.getToken() === 471156 || + (parser.getToken() === 8673330 && + (token & 2097152 || (kind & 4) === 0 || context & 1))) { + throw new ParseError(tokenStart, parser.currentLocation, 60, parser.getToken() === 471156 ? 'of' : 'in'); + } + } + } + else if ((kind & 16 || (token & 2097152) > 0) && + (parser.getToken() & 262144) !== 262144) { + parser.report(59, kind & 16 ? 'const' : 'destructuring'); + } + return parser.finishNode({ + type: 'VariableDeclarator', + id, + init, + }, tokenStart); +} +function parseForStatement(parser, context, scope, privateScope, labels) { + const start = parser.tokenStart; + nextToken(parser, context); + const forAwait = ((context & 2048) > 0 || ((context & 2) > 0 && (context & 8) > 0)) && + consumeOpt(parser, context, 209006); + consume(parser, context | 32, 67174411); + scope = scope?.createChildScope(1); + let test = null; + let update = null; + let destructible = 0; + let init = null; + let isVarDecl = parser.getToken() === 86088 || + parser.getToken() === 241737 || + parser.getToken() === 86090; + let right; + const { tokenStart } = parser; + const token = parser.getToken(); + if (isVarDecl) { + if (token === 241737) { + init = parseIdentifier(parser, context); + if (parser.getToken() & (143360 | 2097152)) { + if (parser.getToken() === 8673330) { + if (context & 1) + parser.report(67); + } + else { + init = parser.finishNode({ + type: 'VariableDeclaration', + kind: 'let', + declarations: parseVariableDeclarationList(parser, context | 131072, scope, privateScope, 8, 32), + }, tokenStart); + } + parser.assignable = 1; + } + else if (context & 1) { + parser.report(67); + } + else { + isVarDecl = false; + parser.assignable = 1; + init = parseMemberOrUpdateExpression(parser, context, privateScope, init, 0, 0, tokenStart); + if (parser.getToken() === 471156) + parser.report(115); + } + } + else { + nextToken(parser, context); + init = parser.finishNode(token === 86088 + ? { + type: 'VariableDeclaration', + kind: 'var', + declarations: parseVariableDeclarationList(parser, context | 131072, scope, privateScope, 4, 32), + } + : { + type: 'VariableDeclaration', + kind: 'const', + declarations: parseVariableDeclarationList(parser, context | 131072, scope, privateScope, 16, 32), + }, tokenStart); + parser.assignable = 1; + } + } + else if (token === 1074790417) { + if (forAwait) + parser.report(82); + } + else if ((token & 2097152) === 2097152) { + const patternStart = parser.tokenStart; + init = + token === 2162700 + ? parseObjectLiteralOrPattern(parser, context, void 0, privateScope, 1, 0, 0, 2, 32) + : parseArrayExpressionOrPattern(parser, context, void 0, privateScope, 1, 0, 0, 2, 32); + destructible = parser.destructible; + if (destructible & 64) { + parser.report(63); + } + parser.assignable = + destructible & 16 ? 2 : 1; + init = parseMemberOrUpdateExpression(parser, context | 131072, privateScope, init, 0, 0, patternStart); + } + else { + init = parseLeftHandSideExpression(parser, context | 131072, privateScope, 1, 0, 1); + } + if ((parser.getToken() & 262144) === 262144) { + if (parser.getToken() === 471156) { + if (parser.assignable & 2) + parser.report(80, forAwait ? 'await' : 'of'); + reinterpretToPattern(parser, init); + nextToken(parser, context | 32); + right = parseExpression(parser, context, privateScope, 1, 0, parser.tokenStart); + consume(parser, context | 32, 16); + const body = parseIterationStatementBody(parser, context, scope, privateScope, labels); + return parser.finishNode({ + type: 'ForOfStatement', + left: init, + right, + body, + await: forAwait, + }, start); + } + if (parser.assignable & 2) + parser.report(80, 'in'); + reinterpretToPattern(parser, init); + nextToken(parser, context | 32); + if (forAwait) + parser.report(82); + right = parseExpressions(parser, context, privateScope, 0, 1, parser.tokenStart); + consume(parser, context | 32, 16); + const body = parseIterationStatementBody(parser, context, scope, privateScope, labels); + return parser.finishNode({ + type: 'ForInStatement', + body, + left: init, + right, + }, start); + } + if (forAwait) + parser.report(82); + if (!isVarDecl) { + if (destructible & 8 && parser.getToken() !== 1077936155) { + parser.report(80, 'loop'); + } + init = parseAssignmentExpression(parser, context | 131072, privateScope, 0, 0, tokenStart, init); + } + if (parser.getToken() === 18) + init = parseSequenceExpression(parser, context, privateScope, 0, tokenStart, init); + consume(parser, context | 32, 1074790417); + if (parser.getToken() !== 1074790417) + test = parseExpressions(parser, context, privateScope, 0, 1, parser.tokenStart); + consume(parser, context | 32, 1074790417); + if (parser.getToken() !== 16) + update = parseExpressions(parser, context, privateScope, 0, 1, parser.tokenStart); + consume(parser, context | 32, 16); + const body = parseIterationStatementBody(parser, context, scope, privateScope, labels); + return parser.finishNode({ + type: 'ForStatement', + init, + test, + update, + body, + }, start); +} +function parseRestrictedIdentifier(parser, context, scope) { + if (!isValidIdentifier(context, parser.getToken())) + parser.report(118); + if ((parser.getToken() & 537079808) === 537079808) + parser.report(119); + scope?.addBlockName(context, parser.tokenValue, 8, 0); + return parseIdentifier(parser, context); +} +function parseImportDeclaration(parser, context, scope) { + const start = parser.tokenStart; + nextToken(parser, context); + let source = null; + const { tokenStart } = parser; + let specifiers = []; + if (parser.getToken() === 134283267) { + source = parseLiteral(parser, context); + } + else { + if (parser.getToken() & 143360) { + const local = parseRestrictedIdentifier(parser, context, scope); + specifiers = [ + parser.finishNode({ + type: 'ImportDefaultSpecifier', + local, + }, tokenStart), + ]; + if (consumeOpt(parser, context, 18)) { + switch (parser.getToken()) { + case 8391476: + specifiers.push(parseImportNamespaceSpecifier(parser, context, scope)); + break; + case 2162700: + parseImportSpecifierOrNamedImports(parser, context, scope, specifiers); + break; + default: + parser.report(107); + } + } + } + else { + switch (parser.getToken()) { + case 8391476: + specifiers = [parseImportNamespaceSpecifier(parser, context, scope)]; + break; + case 2162700: + parseImportSpecifierOrNamedImports(parser, context, scope, specifiers); + break; + case 67174411: + return parseImportCallDeclaration(parser, context, undefined, start); + case 67108877: + return parseImportMetaDeclaration(parser, context, start); + default: + parser.report(30, KeywordDescTable[parser.getToken() & 255]); + } + } + source = parseModuleSpecifier(parser, context); + } + const attributes = parseImportAttributes(parser, context); + const node = { + type: 'ImportDeclaration', + specifiers, + source, + attributes, + }; + matchOrInsertSemicolon(parser, context | 32); + return parser.finishNode(node, start); +} +function parseImportNamespaceSpecifier(parser, context, scope) { + const { tokenStart } = parser; + nextToken(parser, context); + consume(parser, context, 77932); + if ((parser.getToken() & 134217728) === 134217728) { + throw new ParseError(tokenStart, parser.currentLocation, 30, KeywordDescTable[parser.getToken() & 255]); + } + return parser.finishNode({ + type: 'ImportNamespaceSpecifier', + local: parseRestrictedIdentifier(parser, context, scope), + }, tokenStart); +} +function parseModuleSpecifier(parser, context) { + consume(parser, context, 209011); + if (parser.getToken() !== 134283267) + parser.report(105, 'Import'); + return parseLiteral(parser, context); +} +function parseImportSpecifierOrNamedImports(parser, context, scope, specifiers) { + nextToken(parser, context); + while (parser.getToken() & 143360 || parser.getToken() === 134283267) { + let { tokenValue, tokenStart } = parser; + const token = parser.getToken(); + const imported = parseModuleExportName(parser, context); + let local; + if (consumeOpt(parser, context, 77932)) { + if ((parser.getToken() & 134217728) === 134217728 || + parser.getToken() === 18) { + parser.report(106); + } + else { + validateBindingIdentifier(parser, context, 16, parser.getToken(), 0); + } + tokenValue = parser.tokenValue; + local = parseIdentifier(parser, context); + } + else if (imported.type === 'Identifier') { + validateBindingIdentifier(parser, context, 16, token, 0); + local = imported; + } + else { + parser.report(25, KeywordDescTable[77932 & 255]); + } + scope?.addBlockName(context, tokenValue, 8, 0); + specifiers.push(parser.finishNode({ + type: 'ImportSpecifier', + local, + imported, + }, tokenStart)); + if (parser.getToken() !== 1074790415) + consume(parser, context, 18); + } + consume(parser, context, 1074790415); + return specifiers; +} +function parseImportMetaDeclaration(parser, context, start) { + let expr = parseImportMetaExpression(parser, context, parser.finishNode({ + type: 'Identifier', + name: 'import', + }, start), start); + expr = parseMemberOrUpdateExpression(parser, context, undefined, expr, 0, 0, start); + expr = parseAssignmentExpression(parser, context, undefined, 0, 0, start, expr); + if (parser.getToken() === 18) { + expr = parseSequenceExpression(parser, context, undefined, 0, start, expr); + } + return parseExpressionStatement(parser, context, expr, start); +} +function parseImportCallDeclaration(parser, context, privateScope, start) { + let expr = parseImportExpression(parser, context, privateScope, 0, start); + expr = parseMemberOrUpdateExpression(parser, context, privateScope, expr, 0, 0, start); + if (parser.getToken() === 18) { + expr = parseSequenceExpression(parser, context, privateScope, 0, start, expr); + } + return parseExpressionStatement(parser, context, expr, start); +} +function parseExportDeclaration(parser, context, scope) { + const start = parser.leadingDecorators.decorators.length ? parser.leadingDecorators.start : parser.tokenStart; + nextToken(parser, context | 32); + const specifiers = []; + let declaration = null; + let source = null; + let attributes = []; + if (consumeOpt(parser, context | 32, 20561)) { + switch (parser.getToken()) { + case 86104: { + declaration = parseFunctionDeclaration(parser, context, scope, undefined, 4, 1, 1, 0, parser.tokenStart); + break; + } + case 132: + case 86094: + declaration = parseClassDeclaration(parser, context, scope, undefined, 1); + break; + case 209005: { + const { tokenStart } = parser; + declaration = parseIdentifier(parser, context); + const { flags } = parser; + if ((flags & 1) === 0) { + if (parser.getToken() === 86104) { + declaration = parseFunctionDeclaration(parser, context, scope, undefined, 4, 1, 1, 1, tokenStart); + } + else { + if (parser.getToken() === 67174411) { + declaration = parseAsyncArrowOrCallExpression(parser, context, undefined, declaration, 1, 1, 0, flags, tokenStart); + declaration = parseMemberOrUpdateExpression(parser, context, undefined, declaration, 0, 0, tokenStart); + declaration = parseAssignmentExpression(parser, context, undefined, 0, 0, tokenStart, declaration); + } + else if (parser.getToken() & 143360) { + if (scope) + scope = createArrowHeadParsingScope(parser, context, parser.tokenValue); + declaration = parseIdentifier(parser, context); + declaration = parseArrowFunctionExpression(parser, context, scope, undefined, [declaration], 1, tokenStart); + } + } + } + break; + } + default: + declaration = parseExpression(parser, context, undefined, 1, 0, parser.tokenStart); + matchOrInsertSemicolon(parser, context | 32); + } + if (scope) + parser.declareUnboundVariable('default'); + return parser.finishNode({ + type: 'ExportDefaultDeclaration', + declaration, + }, start); + } + switch (parser.getToken()) { + case 8391476: { + nextToken(parser, context); + let exported = null; + const isNamedDeclaration = consumeOpt(parser, context, 77932); + if (isNamedDeclaration) { + if (scope) + parser.declareUnboundVariable(parser.tokenValue); + exported = parseModuleExportName(parser, context); + } + consume(parser, context, 209011); + if (parser.getToken() !== 134283267) + parser.report(105, 'Export'); + source = parseLiteral(parser, context); + const attributes = parseImportAttributes(parser, context); + const node = { + type: 'ExportAllDeclaration', + source, + exported, + attributes, + }; + matchOrInsertSemicolon(parser, context | 32); + return parser.finishNode(node, start); + } + case 2162700: { + nextToken(parser, context); + const tmpExportedNames = []; + const tmpExportedBindings = []; + let hasLiteralLocal = 0; + while (parser.getToken() & 143360 || parser.getToken() === 134283267) { + const { tokenStart, tokenValue } = parser; + const local = parseModuleExportName(parser, context); + if (local.type === 'Literal') { + hasLiteralLocal = 1; + } + let exported; + if (parser.getToken() === 77932) { + nextToken(parser, context); + if ((parser.getToken() & 143360) === 0 && parser.getToken() !== 134283267) { + parser.report(106); + } + if (scope) { + tmpExportedNames.push(parser.tokenValue); + tmpExportedBindings.push(tokenValue); + } + exported = parseModuleExportName(parser, context); + } + else { + if (scope) { + tmpExportedNames.push(parser.tokenValue); + tmpExportedBindings.push(parser.tokenValue); + } + exported = local; + } + specifiers.push(parser.finishNode({ + type: 'ExportSpecifier', + local, + exported, + }, tokenStart)); + if (parser.getToken() !== 1074790415) + consume(parser, context, 18); + } + consume(parser, context, 1074790415); + if (consumeOpt(parser, context, 209011)) { + if (parser.getToken() !== 134283267) + parser.report(105, 'Export'); + source = parseLiteral(parser, context); + attributes = parseImportAttributes(parser, context); + if (scope) { + tmpExportedNames.forEach((n) => parser.declareUnboundVariable(n)); + } + } + else { + if (hasLiteralLocal) { + parser.report(172); + } + if (scope) { + tmpExportedNames.forEach((n) => parser.declareUnboundVariable(n)); + tmpExportedBindings.forEach((b) => parser.addBindingToExports(b)); + } + } + matchOrInsertSemicolon(parser, context | 32); + break; + } + case 132: + case 86094: + declaration = parseClassDeclaration(parser, context, scope, undefined, 2); + break; + case 86104: + declaration = parseFunctionDeclaration(parser, context, scope, undefined, 4, 1, 2, 0, parser.tokenStart); + break; + case 241737: + declaration = parseLexicalDeclaration(parser, context, scope, undefined, 8, 64); + break; + case 86090: + declaration = parseLexicalDeclaration(parser, context, scope, undefined, 16, 64); + break; + case 86088: + declaration = parseVariableStatement(parser, context, scope, undefined, 64); + break; + case 209005: { + const { tokenStart } = parser; + nextToken(parser, context); + if ((parser.flags & 1) === 0 && parser.getToken() === 86104) { + declaration = parseFunctionDeclaration(parser, context, scope, undefined, 4, 1, 2, 1, tokenStart); + break; + } + } + default: + parser.report(30, KeywordDescTable[parser.getToken() & 255]); + } + const node = { + type: 'ExportNamedDeclaration', + declaration, + specifiers, + source, + attributes: attributes, + }; + return parser.finishNode(node, start); +} +function parseExpression(parser, context, privateScope, canAssign, inGroup, start) { + let expr = parsePrimaryExpression(parser, context, privateScope, 2, 0, canAssign, inGroup, 1, start); + expr = parseMemberOrUpdateExpression(parser, context, privateScope, expr, inGroup, 0, start); + return parseAssignmentExpression(parser, context, privateScope, inGroup, 0, start, expr); +} +function parseSequenceExpression(parser, context, privateScope, inGroup, start, expr) { + const expressions = [expr]; + while (consumeOpt(parser, context | 32, 18)) { + expressions.push(parseExpression(parser, context, privateScope, 1, inGroup, parser.tokenStart)); + } + return parser.finishNode({ + type: 'SequenceExpression', + expressions, + }, start); +} +function parseExpressions(parser, context, privateScope, inGroup, canAssign, start) { + const expr = parseExpression(parser, context, privateScope, canAssign, inGroup, start); + return parser.getToken() === 18 + ? parseSequenceExpression(parser, context, privateScope, inGroup, start, expr) + : expr; +} +function parseAssignmentExpression(parser, context, privateScope, inGroup, isPattern, start, left) { + const token = parser.getToken(); + if ((token & 4194304) === 4194304) { + if (parser.assignable & 2) + parser.report(26); + if ((!isPattern && token === 1077936155 && left.type === 'ArrayExpression') || + left.type === 'ObjectExpression') { + reinterpretToPattern(parser, left); + } + nextToken(parser, context | 32); + const right = parseExpression(parser, context, privateScope, 1, inGroup, parser.tokenStart); + parser.assignable = 2; + return parser.finishNode(isPattern + ? { + type: 'AssignmentPattern', + left, + right, + } + : { + type: 'AssignmentExpression', + left, + operator: KeywordDescTable[token & 255], + right, + }, start); + } + if ((token & 8388608) === 8388608) { + left = parseBinaryExpression(parser, context, privateScope, inGroup, start, 4, token, left); + } + if (consumeOpt(parser, context | 32, 22)) { + left = parseConditionalExpression(parser, context, privateScope, left, start); + } + return left; +} +function parseAssignmentExpressionOrPattern(parser, context, privateScope, inGroup, isPattern, start, left) { + const token = parser.getToken(); + nextToken(parser, context | 32); + const right = parseExpression(parser, context, privateScope, 1, inGroup, parser.tokenStart); + left = parser.finishNode(isPattern + ? { + type: 'AssignmentPattern', + left, + right, + } + : { + type: 'AssignmentExpression', + left, + operator: KeywordDescTable[token & 255], + right, + }, start); + parser.assignable = 2; + return left; +} +function parseConditionalExpression(parser, context, privateScope, test, start) { + const consequent = parseExpression(parser, (context | 131072) ^ 131072, privateScope, 1, 0, parser.tokenStart); + consume(parser, context | 32, 21); + parser.assignable = 1; + const alternate = parseExpression(parser, context, privateScope, 1, 0, parser.tokenStart); + parser.assignable = 2; + return parser.finishNode({ + type: 'ConditionalExpression', + test, + consequent, + alternate, + }, start); +} +function parseBinaryExpression(parser, context, privateScope, inGroup, start, minPrecedence, operator, left) { + const bit = -((context & 131072) > 0) & 8673330; + let t; + let precedence; + parser.assignable = 2; + while (parser.getToken() & 8388608) { + t = parser.getToken(); + precedence = t & 3840; + if ((t & 524288 && operator & 268435456) || (operator & 524288 && t & 268435456)) { + parser.report(165); + } + if (precedence + ((t === 8391735) << 8) - ((bit === t) << 12) <= minPrecedence) + break; + nextToken(parser, context | 32); + left = parser.finishNode({ + type: t & 524288 || t & 268435456 ? 'LogicalExpression' : 'BinaryExpression', + left, + right: parseBinaryExpression(parser, context, privateScope, inGroup, parser.tokenStart, precedence, t, parseLeftHandSideExpression(parser, context, privateScope, 0, inGroup, 1)), + operator: KeywordDescTable[t & 255], + }, start); + } + if (parser.getToken() === 1077936155) + parser.report(26); + return left; +} +function parseUnaryExpression(parser, context, privateScope, isLHS, inGroup) { + if (!isLHS) + parser.report(0); + const { tokenStart } = parser; + const unaryOperator = parser.getToken(); + nextToken(parser, context | 32); + const arg = parseLeftHandSideExpression(parser, context, privateScope, 0, inGroup, 1); + if (parser.getToken() === 8391735) + parser.report(33); + if (context & 1 && unaryOperator === 16863276) { + if (arg.type === 'Identifier') { + parser.report(121); + } + else if (isPropertyWithPrivateFieldKey(arg)) { + parser.report(127); + } + } + parser.assignable = 2; + return parser.finishNode({ + type: 'UnaryExpression', + operator: KeywordDescTable[unaryOperator & 255], + argument: arg, + prefix: true, + }, tokenStart); +} +function parseAsyncExpression(parser, context, privateScope, inGroup, isLHS, canAssign, inNew, start) { + const token = parser.getToken(); + const expr = parseIdentifier(parser, context); + const { flags } = parser; + if ((flags & 1) === 0) { + if (parser.getToken() === 86104) { + return parseFunctionExpression(parser, context, privateScope, 1, inGroup, start); + } + if (isValidIdentifier(context, parser.getToken())) { + if (!isLHS) + parser.report(0); + if ((parser.getToken() & 36864) === 36864) { + parser.flags |= 256; + } + return parseAsyncArrowAfterIdent(parser, context, privateScope, canAssign, start); + } + } + if (!inNew && parser.getToken() === 67174411) { + return parseAsyncArrowOrCallExpression(parser, context, privateScope, expr, canAssign, 1, 0, flags, start); + } + if (parser.getToken() === 10) { + classifyIdentifier(parser, context, token); + if (inNew) + parser.report(51); + if ((token & 36864) === 36864) { + parser.flags |= 256; + } + return parseArrowFromIdentifier(parser, context, privateScope, parser.tokenValue, expr, inNew, canAssign, 0, start); + } + parser.assignable = 1; + return expr; +} +function parseYieldExpressionOrIdentifier(parser, context, privateScope, inGroup, canAssign, start) { + if (inGroup) + parser.destructible |= 256; + if (context & 1024) { + nextToken(parser, context | 32); + if (context & 8192) + parser.report(32); + if (!canAssign) + parser.report(26); + if (parser.getToken() === 22) + parser.report(124); + let argument = null; + let delegate = false; + if ((parser.flags & 1) === 0) { + delegate = consumeOpt(parser, context | 32, 8391476); + if (parser.getToken() & (12288 | 65536) || delegate) { + argument = parseExpression(parser, context, privateScope, 1, 0, parser.tokenStart); + } + } + else if (parser.getToken() === 8391476) { + parser.report(30, KeywordDescTable[parser.getToken() & 255]); + } + parser.assignable = 2; + return parser.finishNode({ + type: 'YieldExpression', + argument, + delegate, + }, start); + } + if (context & 1) + parser.report(97, 'yield'); + return parseIdentifierOrArrow(parser, context, privateScope); +} +function parseAwaitExpressionOrIdentifier(parser, context, privateScope, inNew, inGroup, start) { + if (inGroup) + parser.destructible |= 128; + if (context & 524288) + parser.report(177); + const possibleIdentifierOrArrowFunc = parseIdentifierOrArrow(parser, context, privateScope); + const isIdentifier = possibleIdentifierOrArrowFunc.type === 'ArrowFunctionExpression' || + (parser.getToken() & 65536) === 0; + if (isIdentifier) { + if (context & 2048) + throw new ParseError(start, { index: parser.startIndex, line: parser.startLine, column: parser.startColumn }, 176); + if (context & 2) + throw new ParseError(start, { index: parser.startIndex, line: parser.startLine, column: parser.startColumn }, 110); + if (context & 8192 && context & 2048) + throw new ParseError(start, { index: parser.startIndex, line: parser.startLine, column: parser.startColumn }, 110); + return possibleIdentifierOrArrowFunc; + } + if (context & 8192) { + throw new ParseError(start, { index: parser.startIndex, line: parser.startLine, column: parser.startColumn }, 31); + } + if (context & 2048 || (context & 2 && context & 8)) { + if (inNew) + throw new ParseError(start, { index: parser.startIndex, line: parser.startLine, column: parser.startColumn }, 0); + const argument = parseLeftHandSideExpression(parser, context, privateScope, 0, 0, 1); + if (parser.getToken() === 8391735) + parser.report(33); + parser.assignable = 2; + return parser.finishNode({ + type: 'AwaitExpression', + argument, + }, start); + } + if (context & 2) + throw new ParseError(start, { index: parser.startIndex, line: parser.startLine, column: parser.startColumn }, 98); + return possibleIdentifierOrArrowFunc; +} +function parseFunctionBody(parser, context, scope, privateScope, origin, funcNameToken, functionScope) { + const { tokenStart } = parser; + consume(parser, context | 32, 2162700); + const body = []; + if (parser.getToken() !== 1074790415) { + while (parser.getToken() === 134283267) { + const { index, tokenStart, tokenIndex, tokenValue } = parser; + const token = parser.getToken(); + const expr = parseLiteral(parser, context); + if (isValidStrictMode(parser, index, tokenIndex, tokenValue)) { + context |= 1; + if (parser.flags & 128) { + throw new ParseError(tokenStart, parser.currentLocation, 66); + } + if (parser.flags & 64) { + throw new ParseError(tokenStart, parser.currentLocation, 9); + } + if (parser.flags & 4096) { + throw new ParseError(tokenStart, parser.currentLocation, 15); + } + functionScope?.reportScopeError(); + } + body.push(parseDirective(parser, context, expr, token, tokenStart)); + } + if (context & 1) { + if (funcNameToken) { + if ((funcNameToken & 537079808) === 537079808) { + parser.report(119); + } + if ((funcNameToken & 36864) === 36864) { + parser.report(40); + } + } + if (parser.flags & 512) + parser.report(119); + if (parser.flags & 256) + parser.report(118); + } + } + parser.flags = + (parser.flags | 512 | 256 | 64 | 4096) ^ + (512 | 256 | 64 | 4096); + parser.destructible = (parser.destructible | 256) ^ 256; + while (parser.getToken() !== 1074790415) { + body.push(parseStatementListItem(parser, context, scope, privateScope, 4, {})); + } + consume(parser, origin & (16 | 8) ? context | 32 : context, 1074790415); + parser.flags &= -4289; + if (parser.getToken() === 1077936155) + parser.report(26); + return parser.finishNode({ + type: 'BlockStatement', + body, + }, tokenStart); +} +function parseSuperExpression(parser, context) { + const { tokenStart } = parser; + nextToken(parser, context); + switch (parser.getToken()) { + case 67108990: + parser.report(167); + case 67174411: { + if ((context & 512) === 0) + parser.report(28); + parser.assignable = 2; + break; + } + case 69271571: + case 67108877: { + if ((context & 256) === 0) + parser.report(29); + parser.assignable = 1; + break; + } + default: + parser.report(30, 'super'); + } + return parser.finishNode({ type: 'Super' }, tokenStart); +} +function parseLeftHandSideExpression(parser, context, privateScope, canAssign, inGroup, isLHS) { + const start = parser.tokenStart; + const expression = parsePrimaryExpression(parser, context, privateScope, 2, 0, canAssign, inGroup, isLHS, start); + return parseMemberOrUpdateExpression(parser, context, privateScope, expression, inGroup, 0, start); +} +function parseUpdateExpression(parser, context, expr, start) { + if (parser.assignable & 2) + parser.report(55); + const token = parser.getToken(); + nextToken(parser, context); + parser.assignable = 2; + return parser.finishNode({ + type: 'UpdateExpression', + argument: expr, + operator: KeywordDescTable[token & 255], + prefix: false, + }, start); +} +function parseMemberOrUpdateExpression(parser, context, privateScope, expr, inGroup, inChain, start) { + if ((parser.getToken() & 33619968) === 33619968 && (parser.flags & 1) === 0) { + expr = parseUpdateExpression(parser, context, expr, start); + } + else if ((parser.getToken() & 67108864) === 67108864) { + context = (context | 131072) ^ 131072; + switch (parser.getToken()) { + case 67108877: { + nextToken(parser, (context | 262144 | 8) ^ 8); + if (context & 16 && parser.getToken() === 130 && parser.tokenValue === 'super') { + parser.report(173); + } + parser.assignable = 1; + const property = parsePropertyOrPrivatePropertyName(parser, context | 64, privateScope); + expr = parser.finishNode({ + type: 'MemberExpression', + object: expr, + computed: false, + property, + optional: false, + }, start); + break; + } + case 69271571: { + let restoreHasOptionalChaining = false; + if ((parser.flags & 2048) === 2048) { + restoreHasOptionalChaining = true; + parser.flags = (parser.flags | 2048) ^ 2048; + } + nextToken(parser, context | 32); + const { tokenStart } = parser; + const property = parseExpressions(parser, context, privateScope, inGroup, 1, tokenStart); + consume(parser, context, 20); + parser.assignable = 1; + expr = parser.finishNode({ + type: 'MemberExpression', + object: expr, + computed: true, + property, + optional: false, + }, start); + if (restoreHasOptionalChaining) { + parser.flags |= 2048; + } + break; + } + case 67174411: { + if ((parser.flags & 1024) === 1024) { + parser.flags = (parser.flags | 1024) ^ 1024; + return expr; + } + let restoreHasOptionalChaining = false; + if ((parser.flags & 2048) === 2048) { + restoreHasOptionalChaining = true; + parser.flags = (parser.flags | 2048) ^ 2048; + } + const args = parseArguments(parser, context, privateScope, inGroup); + parser.assignable = 2; + expr = parser.finishNode({ + type: 'CallExpression', + callee: expr, + arguments: args, + optional: false, + }, start); + if (restoreHasOptionalChaining) { + parser.flags |= 2048; + } + break; + } + case 67108990: { + nextToken(parser, (context | 262144 | 8) ^ 8); + parser.flags |= 2048; + parser.assignable = 2; + expr = parseOptionalChain(parser, context, privateScope, expr, start); + break; + } + default: + if ((parser.flags & 2048) === 2048) { + parser.report(166); + } + parser.assignable = 2; + expr = parser.finishNode({ + type: 'TaggedTemplateExpression', + tag: expr, + quasi: parser.getToken() === 67174408 + ? parseTemplate(parser, context | 64, privateScope) + : parseTemplateLiteral(parser, context), + }, start); + } + expr = parseMemberOrUpdateExpression(parser, context, privateScope, expr, 0, 1, start); + } + if (inChain === 0 && (parser.flags & 2048) === 2048) { + parser.flags = (parser.flags | 2048) ^ 2048; + expr = parser.finishNode({ + type: 'ChainExpression', + expression: expr, + }, start); + } + return expr; +} +function parseOptionalChain(parser, context, privateScope, expr, start) { + let restoreHasOptionalChaining = false; + let node; + if (parser.getToken() === 69271571 || parser.getToken() === 67174411) { + if ((parser.flags & 2048) === 2048) { + restoreHasOptionalChaining = true; + parser.flags = (parser.flags | 2048) ^ 2048; + } + } + if (parser.getToken() === 69271571) { + nextToken(parser, context | 32); + const { tokenStart } = parser; + const property = parseExpressions(parser, context, privateScope, 0, 1, tokenStart); + consume(parser, context, 20); + parser.assignable = 2; + node = parser.finishNode({ + type: 'MemberExpression', + object: expr, + computed: true, + optional: true, + property, + }, start); + } + else if (parser.getToken() === 67174411) { + const args = parseArguments(parser, context, privateScope, 0); + parser.assignable = 2; + node = parser.finishNode({ + type: 'CallExpression', + callee: expr, + arguments: args, + optional: true, + }, start); + } + else { + const property = parsePropertyOrPrivatePropertyName(parser, context, privateScope); + parser.assignable = 2; + node = parser.finishNode({ + type: 'MemberExpression', + object: expr, + computed: false, + optional: true, + property, + }, start); + } + if (restoreHasOptionalChaining) { + parser.flags |= 2048; + } + return node; +} +function parsePropertyOrPrivatePropertyName(parser, context, privateScope) { + if ((parser.getToken() & 143360) === 0 && + parser.getToken() !== -2147483528 && + parser.getToken() !== -2147483527 && + parser.getToken() !== 130) { + parser.report(160); + } + return parser.getToken() === 130 + ? parsePrivateIdentifier(parser, context, privateScope, 0) + : parseIdentifier(parser, context); +} +function parseUpdateExpressionPrefixed(parser, context, privateScope, inNew, isLHS, start) { + if (inNew) + parser.report(56); + if (!isLHS) + parser.report(0); + const token = parser.getToken(); + nextToken(parser, context | 32); + const arg = parseLeftHandSideExpression(parser, context, privateScope, 0, 0, 1); + if (parser.assignable & 2) { + parser.report(55); + } + parser.assignable = 2; + return parser.finishNode({ + type: 'UpdateExpression', + argument: arg, + operator: KeywordDescTable[token & 255], + prefix: true, + }, start); +} +function parsePrimaryExpression(parser, context, privateScope, kind, inNew, canAssign, inGroup, isLHS, start) { + if ((parser.getToken() & 143360) === 143360) { + switch (parser.getToken()) { + case 209006: + return parseAwaitExpressionOrIdentifier(parser, context, privateScope, inNew, inGroup, start); + case 241771: + return parseYieldExpressionOrIdentifier(parser, context, privateScope, inGroup, canAssign, start); + case 209005: + return parseAsyncExpression(parser, context, privateScope, inGroup, isLHS, canAssign, inNew, start); + } + const { tokenValue } = parser; + const token = parser.getToken(); + const expr = parseIdentifier(parser, context | 64); + if (parser.getToken() === 10) { + if (!isLHS) + parser.report(0); + classifyIdentifier(parser, context, token); + if ((token & 36864) === 36864) { + parser.flags |= 256; + } + return parseArrowFromIdentifier(parser, context, privateScope, tokenValue, expr, inNew, canAssign, 0, start); + } + if (context & 16 && + !(context & 32768) && + !(context & 8192) && + parser.tokenValue === 'arguments') + parser.report(130); + if ((token & 255) === (241737 & 255)) { + if (context & 1) + parser.report(113); + if (kind & (8 | 16)) + parser.report(100); + } + parser.assignable = + context & 1 && (token & 537079808) === 537079808 + ? 2 + : 1; + return expr; + } + if ((parser.getToken() & 134217728) === 134217728) { + return parseLiteral(parser, context); + } + switch (parser.getToken()) { + case 33619993: + case 33619994: + return parseUpdateExpressionPrefixed(parser, context, privateScope, inNew, isLHS, start); + case 16863276: + case 16842798: + case 16842799: + case 25233968: + case 25233969: + case 16863275: + case 16863277: + return parseUnaryExpression(parser, context, privateScope, isLHS, inGroup); + case 86104: + return parseFunctionExpression(parser, context, privateScope, 0, inGroup, start); + case 2162700: + return parseObjectLiteral(parser, context, privateScope, canAssign ? 0 : 1, inGroup); + case 69271571: + return parseArrayLiteral(parser, context, privateScope, canAssign ? 0 : 1, inGroup); + case 67174411: + return parseParenthesizedExpression(parser, context | 64, privateScope, canAssign, 1, 0, start); + case 86021: + case 86022: + case 86023: + return parseNullOrTrueOrFalseLiteral(parser, context); + case 86111: + return parseThisExpression(parser, context); + case 65540: + return parseRegExpLiteral(parser, context); + case 132: + case 86094: + return parseClassExpression(parser, context, privateScope, inGroup, start); + case 86109: + return parseSuperExpression(parser, context); + case 67174409: + return parseTemplateLiteral(parser, context); + case 67174408: + return parseTemplate(parser, context, privateScope); + case 86107: + return parseNewExpression(parser, context, privateScope, inGroup); + case 134283388: + return parseBigIntLiteral(parser, context); + case 130: + return parsePrivateIdentifier(parser, context, privateScope, 0); + case 86106: + return parseImportCallOrMetaExpression(parser, context, privateScope, inNew, inGroup, start); + case 8456256: + if (parser.options.jsx) + return parseJSXRootElementOrFragment(parser, context, privateScope, 0, parser.tokenStart); + default: + if (isValidIdentifier(context, parser.getToken())) + return parseIdentifierOrArrow(parser, context, privateScope); + parser.report(30, KeywordDescTable[parser.getToken() & 255]); + } +} +function parseImportCallOrMetaExpression(parser, context, privateScope, inNew, inGroup, start) { + let expr = parseIdentifier(parser, context); + if (parser.getToken() === 67108877) { + return parseImportMetaExpression(parser, context, expr, start); + } + if (inNew) + parser.report(142); + expr = parseImportExpression(parser, context, privateScope, inGroup, start); + parser.assignable = 2; + return parseMemberOrUpdateExpression(parser, context, privateScope, expr, inGroup, 0, start); +} +function parseImportMetaExpression(parser, context, meta, start) { + if ((context & 2) === 0) + parser.report(169); + nextToken(parser, context); + const token = parser.getToken(); + if (token !== 209030 && parser.tokenValue !== 'meta') { + parser.report(174); + } + else if (token & -2147483648) { + parser.report(175); + } + parser.assignable = 2; + return parser.finishNode({ + type: 'MetaProperty', + meta, + property: parseIdentifier(parser, context), + }, start); +} +function parseImportExpression(parser, context, privateScope, inGroup, start) { + consume(parser, context | 32, 67174411); + if (parser.getToken() === 14) + parser.report(143); + const source = parseExpression(parser, context, privateScope, 1, inGroup, parser.tokenStart); + let options = null; + if (parser.getToken() === 18) { + consume(parser, context, 18); + if (parser.getToken() !== 16) { + const expContext = (context | 131072) ^ 131072; + options = parseExpression(parser, expContext, privateScope, 1, inGroup, parser.tokenStart); + } + consumeOpt(parser, context, 18); + } + const node = { + type: 'ImportExpression', + source, + options, + }; + consume(parser, context, 16); + return parser.finishNode(node, start); +} +function parseImportAttributes(parser, context) { + if (!consumeOpt(parser, context, 20579)) + return []; + consume(parser, context, 2162700); + const attributes = []; + const keysContent = new Set(); + while (parser.getToken() !== 1074790415) { + const start = parser.tokenStart; + const key = parseIdentifierOrStringLiteral(parser, context); + consume(parser, context, 21); + const value = parseStringLiteral(parser, context); + const keyContent = key.type === 'Literal' ? key.value : key.name; + if (keysContent.has(keyContent)) { + parser.report(145, `${keyContent}`); + } + keysContent.add(keyContent); + attributes.push(parser.finishNode({ + type: 'ImportAttribute', + key, + value, + }, start)); + if (parser.getToken() !== 1074790415) { + consume(parser, context, 18); + } + } + consume(parser, context, 1074790415); + return attributes; +} +function parseStringLiteral(parser, context) { + if (parser.getToken() === 134283267) { + return parseLiteral(parser, context); + } + else { + parser.report(30, KeywordDescTable[parser.getToken() & 255]); + } +} +function parseIdentifierOrStringLiteral(parser, context) { + if (parser.getToken() === 134283267) { + return parseLiteral(parser, context); + } + else if (parser.getToken() & 143360) { + return parseIdentifier(parser, context); + } + else { + parser.report(30, KeywordDescTable[parser.getToken() & 255]); + } +} +function validateStringWellFormed(parser, str) { + const len = str.length; + for (let i = 0; i < len; i++) { + const code = str.charCodeAt(i); + if ((code & 0xfc00) !== 55296) + continue; + if (code > 56319 || ++i >= len || (str.charCodeAt(i) & 0xfc00) !== 56320) { + parser.report(171, JSON.stringify(str.charAt(i--))); + } + } +} +function parseModuleExportName(parser, context) { + if (parser.getToken() === 134283267) { + validateStringWellFormed(parser, parser.tokenValue); + return parseLiteral(parser, context); + } + else if (parser.getToken() & 143360) { + return parseIdentifier(parser, context); + } + else { + parser.report(30, KeywordDescTable[parser.getToken() & 255]); + } +} +function parseBigIntLiteral(parser, context) { + const { tokenRaw, tokenValue, tokenStart } = parser; + nextToken(parser, context); + parser.assignable = 2; + const node = { + type: 'Literal', + value: tokenValue, + bigint: String(tokenValue), + }; + if (parser.options.raw) { + node.raw = tokenRaw; + } + return parser.finishNode(node, tokenStart); +} +function parseTemplateLiteral(parser, context) { + parser.assignable = 2; + const { tokenValue, tokenRaw, tokenStart } = parser; + consume(parser, context, 67174409); + const quasis = [parseTemplateElement(parser, tokenValue, tokenRaw, tokenStart, true)]; + return parser.finishNode({ + type: 'TemplateLiteral', + expressions: [], + quasis, + }, tokenStart); +} +function parseTemplate(parser, context, privateScope) { + context = (context | 131072) ^ 131072; + const { tokenValue, tokenRaw, tokenStart } = parser; + consume(parser, (context & -65) | 32, 67174408); + const quasis = [parseTemplateElement(parser, tokenValue, tokenRaw, tokenStart, false)]; + const expressions = [ + parseExpressions(parser, context & -65, privateScope, 0, 1, parser.tokenStart), + ]; + if (parser.getToken() !== 1074790415) + parser.report(83); + while (parser.setToken(scanTemplateTail(parser, context), true) !== 67174409) { + const { tokenValue, tokenRaw, tokenStart } = parser; + consume(parser, (context & -65) | 32, 67174408); + quasis.push(parseTemplateElement(parser, tokenValue, tokenRaw, tokenStart, false)); + expressions.push(parseExpressions(parser, context, privateScope, 0, 1, parser.tokenStart)); + if (parser.getToken() !== 1074790415) + parser.report(83); + } + { + const { tokenValue, tokenRaw, tokenStart } = parser; + consume(parser, context, 67174409); + quasis.push(parseTemplateElement(parser, tokenValue, tokenRaw, tokenStart, true)); + } + return parser.finishNode({ + type: 'TemplateLiteral', + expressions, + quasis, + }, tokenStart); +} +function parseTemplateElement(parser, cooked, raw, start, tail) { + const node = parser.finishNode({ + type: 'TemplateElement', + value: { + cooked, + raw, + }, + tail, + }, start); + const tailSize = tail ? 1 : 2; + if (parser.options.ranges) { + node.start += 1; + node.range[0] += 1; + node.end -= tailSize; + node.range[1] -= tailSize; + } + if (parser.options.loc) { + node.loc.start.column += 1; + node.loc.end.column -= tailSize; + } + return node; +} +function parseSpreadElement(parser, context, privateScope) { + const start = parser.tokenStart; + context = (context | 131072) ^ 131072; + consume(parser, context | 32, 14); + const argument = parseExpression(parser, context, privateScope, 1, 0, parser.tokenStart); + parser.assignable = 1; + return parser.finishNode({ + type: 'SpreadElement', + argument, + }, start); +} +function parseArguments(parser, context, privateScope, inGroup) { + nextToken(parser, context | 32); + const args = []; + if (parser.getToken() === 16) { + nextToken(parser, context | 64); + return args; + } + while (parser.getToken() !== 16) { + if (parser.getToken() === 14) { + args.push(parseSpreadElement(parser, context, privateScope)); + } + else { + args.push(parseExpression(parser, context, privateScope, 1, inGroup, parser.tokenStart)); + } + if (parser.getToken() !== 18) + break; + nextToken(parser, context | 32); + if (parser.getToken() === 16) + break; + } + consume(parser, context | 64, 16); + return args; +} +function parseIdentifier(parser, context) { + const { tokenValue, tokenStart } = parser; + const allowRegex = tokenValue === 'await' && (parser.getToken() & -2147483648) === 0; + nextToken(parser, context | (allowRegex ? 32 : 0)); + return parser.finishNode({ + type: 'Identifier', + name: tokenValue, + }, tokenStart); +} +function parseLiteral(parser, context) { + const { tokenValue, tokenRaw, tokenStart } = parser; + if (parser.getToken() === 134283388) { + return parseBigIntLiteral(parser, context); + } + nextToken(parser, context); + parser.assignable = 2; + return parser.finishNode(parser.options.raw + ? { + type: 'Literal', + value: tokenValue, + raw: tokenRaw, + } + : { + type: 'Literal', + value: tokenValue, + }, tokenStart); +} +function parseNullOrTrueOrFalseLiteral(parser, context) { + const start = parser.tokenStart; + const raw = KeywordDescTable[parser.getToken() & 255]; + const value = parser.getToken() === 86023 ? null : raw === 'true'; + nextToken(parser, context); + parser.assignable = 2; + return parser.finishNode(parser.options.raw + ? { + type: 'Literal', + value, + raw, + } + : { + type: 'Literal', + value, + }, start); +} +function parseThisExpression(parser, context) { + const { tokenStart } = parser; + nextToken(parser, context); + parser.assignable = 2; + return parser.finishNode({ + type: 'ThisExpression', + }, tokenStart); +} +function parseFunctionDeclaration(parser, context, scope, privateScope, origin, allowGen, flags, isAsync, start) { + nextToken(parser, context | 32); + const isGenerator = allowGen ? optionalBit(parser, context, 8391476) : 0; + let id = null; + let funcNameToken; + let functionScope = scope ? parser.createScope() : void 0; + if (parser.getToken() === 67174411) { + if ((flags & 1) === 0) + parser.report(39, 'Function'); + } + else { + const kind = origin & 4 && ((context & 8) === 0 || (context & 2) === 0) + ? 4 + : 64 | (isAsync ? 1024 : 0) | (isGenerator ? 1024 : 0); + validateFunctionName(parser, context, parser.getToken()); + if (scope) { + if (kind & 4) { + scope.addVarName(context, parser.tokenValue, kind); + } + else { + scope.addBlockName(context, parser.tokenValue, kind, origin); + } + functionScope = functionScope?.createChildScope(128); + if (flags) { + if (flags & 2) { + parser.declareUnboundVariable(parser.tokenValue); + } + } + } + funcNameToken = parser.getToken(); + if (parser.getToken() & 143360) { + id = parseIdentifier(parser, context); + } + else { + parser.report(30, KeywordDescTable[parser.getToken() & 255]); + } + } + { + const modifierFlags = 256 | + 512 | + 1024 | + 2048 | + 8192 | + 16384; + context = + ((context | modifierFlags) ^ modifierFlags) | + 65536 | + (isAsync ? 2048 : 0) | + (isGenerator ? 1024 : 0) | + (isGenerator ? 0 : 262144); + } + functionScope = functionScope?.createChildScope(256); + const params = parseFormalParametersOrFormalList(parser, (context | 8192) & -524289, functionScope, privateScope, 0, 1); + const modifierFlags = 8 | 4 | 128 | 524288; + const body = parseFunctionBody(parser, ((context | modifierFlags) ^ modifierFlags) | 32768 | 4096, functionScope?.createChildScope(64), privateScope, 8, funcNameToken, functionScope); + return parser.finishNode({ + type: 'FunctionDeclaration', + id, + params, + body, + async: isAsync === 1, + generator: isGenerator === 1, + }, start); +} +function parseFunctionExpression(parser, context, privateScope, isAsync, inGroup, start) { + nextToken(parser, context | 32); + const isGenerator = optionalBit(parser, context, 8391476); + const generatorAndAsyncFlags = (isAsync ? 2048 : 0) | (isGenerator ? 1024 : 0); + let id = null; + let funcNameToken; + let scope = parser.createScopeIfLexical(); + const modifierFlags = 256 | + 512 | + 1024 | + 2048 | + 8192 | + 16384 | + 524288; + if (parser.getToken() & 143360) { + validateFunctionName(parser, ((context | modifierFlags) ^ modifierFlags) | generatorAndAsyncFlags, parser.getToken()); + scope = scope?.createChildScope(128); + funcNameToken = parser.getToken(); + id = parseIdentifier(parser, context); + } + context = + ((context | modifierFlags) ^ modifierFlags) | + 65536 | + generatorAndAsyncFlags | + (isGenerator ? 0 : 262144); + scope = scope?.createChildScope(256); + const params = parseFormalParametersOrFormalList(parser, (context | 8192) & -524289, scope, privateScope, inGroup, 1); + const body = parseFunctionBody(parser, (context & -131229) | + 32768 | + 4096, scope?.createChildScope(64), privateScope, 0, funcNameToken, scope); + parser.assignable = 2; + return parser.finishNode({ + type: 'FunctionExpression', + id, + params, + body, + async: isAsync === 1, + generator: isGenerator === 1, + }, start); +} +function parseArrayLiteral(parser, context, privateScope, skipInitializer, inGroup) { + const expr = parseArrayExpressionOrPattern(parser, context, void 0, privateScope, skipInitializer, inGroup, 0, 2, 0); + if (parser.destructible & 64) { + parser.report(63); + } + if (parser.destructible & 8) { + parser.report(62); + } + return expr; +} +function parseArrayExpressionOrPattern(parser, context, scope, privateScope, skipInitializer, inGroup, isPattern, kind, origin) { + const { tokenStart: start } = parser; + nextToken(parser, context | 32); + const elements = []; + let destructible = 0; + context = (context | 131072) ^ 131072; + while (parser.getToken() !== 20) { + if (consumeOpt(parser, context | 32, 18)) { + elements.push(null); + } + else { + let left; + const { tokenStart, tokenValue } = parser; + const token = parser.getToken(); + if (token & 143360) { + left = parsePrimaryExpression(parser, context, privateScope, kind, 0, 1, inGroup, 1, tokenStart); + if (parser.getToken() === 1077936155) { + if (parser.assignable & 2) + parser.report(26); + nextToken(parser, context | 32); + scope?.addVarOrBlock(context, tokenValue, kind, origin); + const right = parseExpression(parser, context, privateScope, 1, inGroup, parser.tokenStart); + left = parser.finishNode(isPattern + ? { + type: 'AssignmentPattern', + left, + right, + } + : { + type: 'AssignmentExpression', + operator: '=', + left, + right, + }, tokenStart); + destructible |= + parser.destructible & 256 + ? 256 + : 0 | (parser.destructible & 128) + ? 128 + : 0; + } + else if (parser.getToken() === 18 || parser.getToken() === 20) { + if (parser.assignable & 2) { + destructible |= 16; + } + else { + scope?.addVarOrBlock(context, tokenValue, kind, origin); + } + destructible |= + parser.destructible & 256 + ? 256 + : 0 | (parser.destructible & 128) + ? 128 + : 0; + } + else { + destructible |= + kind & 1 + ? 32 + : (kind & 2) === 0 + ? 16 + : 0; + left = parseMemberOrUpdateExpression(parser, context, privateScope, left, inGroup, 0, tokenStart); + if (parser.getToken() !== 18 && parser.getToken() !== 20) { + if (parser.getToken() !== 1077936155) + destructible |= 16; + left = parseAssignmentExpression(parser, context, privateScope, inGroup, isPattern, tokenStart, left); + } + else if (parser.getToken() !== 1077936155) { + destructible |= + parser.assignable & 2 + ? 16 + : 32; + } + } + } + else if (token & 2097152) { + left = + parser.getToken() === 2162700 + ? parseObjectLiteralOrPattern(parser, context, scope, privateScope, 0, inGroup, isPattern, kind, origin) + : parseArrayExpressionOrPattern(parser, context, scope, privateScope, 0, inGroup, isPattern, kind, origin); + destructible |= parser.destructible; + parser.assignable = + parser.destructible & 16 + ? 2 + : 1; + if (parser.getToken() === 18 || parser.getToken() === 20) { + if (parser.assignable & 2) { + destructible |= 16; + } + } + else if (parser.destructible & 8) { + parser.report(71); + } + else { + left = parseMemberOrUpdateExpression(parser, context, privateScope, left, inGroup, 0, tokenStart); + destructible = parser.assignable & 2 ? 16 : 0; + if (parser.getToken() !== 18 && parser.getToken() !== 20) { + left = parseAssignmentExpression(parser, context, privateScope, inGroup, isPattern, tokenStart, left); + } + else if (parser.getToken() !== 1077936155) { + destructible |= + parser.assignable & 2 + ? 16 + : 32; + } + } + } + else if (token === 14) { + left = parseSpreadOrRestElement(parser, context, scope, privateScope, 20, kind, origin, 0, inGroup, isPattern); + destructible |= parser.destructible; + if (parser.getToken() !== 18 && parser.getToken() !== 20) + parser.report(30, KeywordDescTable[parser.getToken() & 255]); + } + else { + left = parseLeftHandSideExpression(parser, context, privateScope, 1, 0, 1); + if (parser.getToken() !== 18 && parser.getToken() !== 20) { + left = parseAssignmentExpression(parser, context, privateScope, inGroup, isPattern, tokenStart, left); + if ((kind & (2 | 1)) === 0 && token === 67174411) + destructible |= 16; + } + else if (parser.assignable & 2) { + destructible |= 16; + } + else if (token === 67174411) { + destructible |= + parser.assignable & 1 && kind & (2 | 1) + ? 32 + : 16; + } + } + elements.push(left); + if (consumeOpt(parser, context | 32, 18)) { + if (parser.getToken() === 20) + break; + } + else + break; + } + } + consume(parser, context, 20); + const node = parser.finishNode({ + type: isPattern ? 'ArrayPattern' : 'ArrayExpression', + elements, + }, start); + if (!skipInitializer && parser.getToken() & 4194304) { + return parseArrayOrObjectAssignmentPattern(parser, context, privateScope, destructible, inGroup, isPattern, start, node); + } + parser.destructible = destructible; + return node; +} +function parseArrayOrObjectAssignmentPattern(parser, context, privateScope, destructible, inGroup, isPattern, start, node) { + if (parser.getToken() !== 1077936155) + parser.report(26); + nextToken(parser, context | 32); + if (destructible & 16) + parser.report(26); + if (!isPattern) + reinterpretToPattern(parser, node); + const { tokenStart } = parser; + const right = parseExpression(parser, context, privateScope, 1, inGroup, tokenStart); + parser.destructible = + ((destructible | 64 | 8) ^ + (8 | 64)) | + (parser.destructible & 128 ? 128 : 0) | + (parser.destructible & 256 ? 256 : 0); + return parser.finishNode(isPattern + ? { + type: 'AssignmentPattern', + left: node, + right, + } + : { + type: 'AssignmentExpression', + left: node, + operator: '=', + right, + }, start); +} +function parseSpreadOrRestElement(parser, context, scope, privateScope, closingToken, kind, origin, isAsync, inGroup, isPattern) { + const { tokenStart: start } = parser; + nextToken(parser, context | 32); + let argument = null; + let destructible = 0; + const { tokenValue, tokenStart } = parser; + let token = parser.getToken(); + if (token & 143360) { + parser.assignable = 1; + argument = parsePrimaryExpression(parser, context, privateScope, kind, 0, 1, inGroup, 1, tokenStart); + token = parser.getToken(); + argument = parseMemberOrUpdateExpression(parser, context, privateScope, argument, inGroup, 0, tokenStart); + if (parser.getToken() !== 18 && parser.getToken() !== closingToken) { + if (parser.assignable & 2 && parser.getToken() === 1077936155) + parser.report(71); + destructible |= 16; + argument = parseAssignmentExpression(parser, context, privateScope, inGroup, isPattern, tokenStart, argument); + } + if (parser.assignable & 2) { + destructible |= 16; + } + else if (token === closingToken || token === 18) { + scope?.addVarOrBlock(context, tokenValue, kind, origin); + } + else { + destructible |= 32; + } + destructible |= parser.destructible & 128 ? 128 : 0; + } + else if (token === closingToken) { + parser.report(41); + } + else if (token & 2097152) { + argument = + parser.getToken() === 2162700 + ? parseObjectLiteralOrPattern(parser, context, scope, privateScope, 1, inGroup, isPattern, kind, origin) + : parseArrayExpressionOrPattern(parser, context, scope, privateScope, 1, inGroup, isPattern, kind, origin); + token = parser.getToken(); + if (token !== 1077936155 && token !== closingToken && token !== 18) { + if (parser.destructible & 8) + parser.report(71); + argument = parseMemberOrUpdateExpression(parser, context, privateScope, argument, inGroup, 0, tokenStart); + destructible |= parser.assignable & 2 ? 16 : 0; + if ((parser.getToken() & 4194304) === 4194304) { + if (parser.getToken() !== 1077936155) + destructible |= 16; + argument = parseAssignmentExpression(parser, context, privateScope, inGroup, isPattern, tokenStart, argument); + } + else { + if ((parser.getToken() & 8388608) === 8388608) { + argument = parseBinaryExpression(parser, context, privateScope, 1, tokenStart, 4, token, argument); + } + if (consumeOpt(parser, context | 32, 22)) { + argument = parseConditionalExpression(parser, context, privateScope, argument, tokenStart); + } + destructible |= + parser.assignable & 2 + ? 16 + : 32; + } + } + else { + destructible |= + closingToken === 1074790415 && token !== 1077936155 + ? 16 + : parser.destructible; + } + } + else { + destructible |= 32; + argument = parseLeftHandSideExpression(parser, context, privateScope, 1, inGroup, 1); + const { tokenStart } = parser; + const token = parser.getToken(); + if (token === 1077936155) { + if (parser.assignable & 2) + parser.report(26); + argument = parseAssignmentExpression(parser, context, privateScope, inGroup, isPattern, tokenStart, argument); + destructible |= 16; + } + else { + if (token === 18) { + destructible |= 16; + } + else if (token !== closingToken) { + argument = parseAssignmentExpression(parser, context, privateScope, inGroup, isPattern, tokenStart, argument); + } + destructible |= + parser.assignable & 1 ? 32 : 16; + } + parser.destructible = destructible; + if (parser.getToken() !== closingToken && parser.getToken() !== 18) + parser.report(161); + return parser.finishNode({ + type: isPattern ? 'RestElement' : 'SpreadElement', + argument: argument, + }, start); + } + if (parser.getToken() !== closingToken) { + if (kind & 1) + destructible |= isAsync ? 16 : 32; + if (consumeOpt(parser, context | 32, 1077936155)) { + if (destructible & 16) + parser.report(26); + reinterpretToPattern(parser, argument); + const right = parseExpression(parser, context, privateScope, 1, inGroup, parser.tokenStart); + argument = parser.finishNode(isPattern + ? { + type: 'AssignmentPattern', + left: argument, + right, + } + : { + type: 'AssignmentExpression', + left: argument, + operator: '=', + right, + }, tokenStart); + destructible = 16; + } + else { + destructible |= 16; + } + } + parser.destructible = destructible; + return parser.finishNode({ + type: isPattern ? 'RestElement' : 'SpreadElement', + argument: argument, + }, start); +} +function parseMethodDefinition(parser, context, privateScope, kind, inGroup, start) { + const modifierFlags = 1024 | + 2048 | + 8192 | + ((kind & 64) === 0 ? 512 | 16384 : 0); + context = + ((context | modifierFlags) ^ modifierFlags) | + (kind & 8 ? 1024 : 0) | + (kind & 16 ? 2048 : 0) | + (kind & 64 ? 16384 : 0) | + 256 | + 32768 | + 65536; + let scope = parser.createScopeIfLexical(256); + const params = parseMethodFormals(parser, (context | 8192) & -524289, scope, privateScope, kind, 1, inGroup); + scope = scope?.createChildScope(64); + const body = parseFunctionBody(parser, (context & -655373) | + 32768 | + 4096, scope, privateScope, 0, void 0, scope?.parent); + return parser.finishNode({ + type: 'FunctionExpression', + params, + body, + async: (kind & 16) > 0, + generator: (kind & 8) > 0, + id: null, + }, start); +} +function parseObjectLiteral(parser, context, privateScope, skipInitializer, inGroup) { + const expr = parseObjectLiteralOrPattern(parser, context, void 0, privateScope, skipInitializer, inGroup, 0, 2, 0); + if (parser.destructible & 64) { + parser.report(63); + } + if (parser.destructible & 8) { + parser.report(62); + } + return expr; +} +function parseObjectLiteralOrPattern(parser, context, scope, privateScope, skipInitializer, inGroup, isPattern, kind, origin) { + const { tokenStart: start } = parser; + nextToken(parser, context); + const properties = []; + let destructible = 0; + let prototypeCount = 0; + context = (context | 131072) ^ 131072; + while (parser.getToken() !== 1074790415) { + const { tokenValue, tokenStart } = parser; + const token = parser.getToken(); + if (token === 14) { + properties.push(parseSpreadOrRestElement(parser, context, scope, privateScope, 1074790415, kind, origin, 0, inGroup, isPattern)); + } + else { + let state = 0; + let key = null; + let value; + if (parser.getToken() & 143360 || + parser.getToken() === -2147483528 || + parser.getToken() === -2147483527) { + if (parser.getToken() === -2147483527) + destructible |= 16; + key = parseIdentifier(parser, context); + if (parser.getToken() === 18 || + parser.getToken() === 1074790415 || + parser.getToken() === 1077936155) { + state |= 4; + if (context & 1 && (token & 537079808) === 537079808) { + destructible |= 16; + } + else { + validateBindingIdentifier(parser, context, kind, token, 0); + } + scope?.addVarOrBlock(context, tokenValue, kind, origin); + if (consumeOpt(parser, context | 32, 1077936155)) { + destructible |= 8; + const right = parseExpression(parser, context, privateScope, 1, inGroup, parser.tokenStart); + destructible |= + parser.destructible & 256 + ? 256 + : 0 | (parser.destructible & 128) + ? 128 + : 0; + value = parser.finishNode({ + type: 'AssignmentPattern', + left: parser.options.uniqueKeyInPattern ? Object.assign({}, key) : key, + right, + }, tokenStart); + } + else { + destructible |= + (token === 209006 ? 128 : 0) | + (token === -2147483528 ? 16 : 0); + value = parser.options.uniqueKeyInPattern ? Object.assign({}, key) : key; + } + } + else if (consumeOpt(parser, context | 32, 21)) { + const { tokenStart } = parser; + if (tokenValue === '__proto__') + prototypeCount++; + if (parser.getToken() & 143360) { + const tokenAfterColon = parser.getToken(); + const valueAfterColon = parser.tokenValue; + value = parsePrimaryExpression(parser, context, privateScope, kind, 0, 1, inGroup, 1, tokenStart); + const token = parser.getToken(); + value = parseMemberOrUpdateExpression(parser, context, privateScope, value, inGroup, 0, tokenStart); + if (parser.getToken() === 18 || parser.getToken() === 1074790415) { + if (token === 1077936155 || token === 1074790415 || token === 18) { + destructible |= parser.destructible & 128 ? 128 : 0; + if (parser.assignable & 2) { + destructible |= 16; + } + else if ((tokenAfterColon & 143360) === 143360) { + scope?.addVarOrBlock(context, valueAfterColon, kind, origin); + } + } + else { + destructible |= + parser.assignable & 1 + ? 32 + : 16; + } + } + else if ((parser.getToken() & 4194304) === 4194304) { + if (parser.assignable & 2) { + destructible |= 16; + } + else if (token !== 1077936155) { + destructible |= 32; + } + else { + scope?.addVarOrBlock(context, valueAfterColon, kind, origin); + } + value = parseAssignmentExpression(parser, context, privateScope, inGroup, isPattern, tokenStart, value); + } + else { + destructible |= 16; + if ((parser.getToken() & 8388608) === 8388608) { + value = parseBinaryExpression(parser, context, privateScope, 1, tokenStart, 4, token, value); + } + if (consumeOpt(parser, context | 32, 22)) { + value = parseConditionalExpression(parser, context, privateScope, value, tokenStart); + } + } + } + else if ((parser.getToken() & 2097152) === 2097152) { + value = + parser.getToken() === 69271571 + ? parseArrayExpressionOrPattern(parser, context, scope, privateScope, 0, inGroup, isPattern, kind, origin) + : parseObjectLiteralOrPattern(parser, context, scope, privateScope, 0, inGroup, isPattern, kind, origin); + destructible = parser.destructible; + parser.assignable = + destructible & 16 ? 2 : 1; + if (parser.getToken() === 18 || parser.getToken() === 1074790415) { + if (parser.assignable & 2) + destructible |= 16; + } + else if (parser.destructible & 8) { + parser.report(71); + } + else { + value = parseMemberOrUpdateExpression(parser, context, privateScope, value, inGroup, 0, tokenStart); + destructible = parser.assignable & 2 ? 16 : 0; + if ((parser.getToken() & 4194304) === 4194304) { + value = parseAssignmentExpressionOrPattern(parser, context, privateScope, inGroup, isPattern, tokenStart, value); + } + else { + if ((parser.getToken() & 8388608) === 8388608) { + value = parseBinaryExpression(parser, context, privateScope, 1, tokenStart, 4, token, value); + } + if (consumeOpt(parser, context | 32, 22)) { + value = parseConditionalExpression(parser, context, privateScope, value, tokenStart); + } + destructible |= + parser.assignable & 2 + ? 16 + : 32; + } + } + } + else { + value = parseLeftHandSideExpression(parser, context, privateScope, 1, inGroup, 1); + destructible |= + parser.assignable & 1 + ? 32 + : 16; + if (parser.getToken() === 18 || parser.getToken() === 1074790415) { + if (parser.assignable & 2) + destructible |= 16; + } + else { + value = parseMemberOrUpdateExpression(parser, context, privateScope, value, inGroup, 0, tokenStart); + destructible = parser.assignable & 2 ? 16 : 0; + if (parser.getToken() !== 18 && token !== 1074790415) { + if (parser.getToken() !== 1077936155) + destructible |= 16; + value = parseAssignmentExpression(parser, context, privateScope, inGroup, isPattern, tokenStart, value); + } + } + } + } + else if (parser.getToken() === 69271571) { + destructible |= 16; + if (token === 209005) + state |= 16; + state |= + (token === 209008 + ? 256 + : token === 209009 + ? 512 + : 1) | 2; + key = parseComputedPropertyName(parser, context, privateScope, inGroup); + destructible |= parser.assignable; + value = parseMethodDefinition(parser, context, privateScope, state, inGroup, parser.tokenStart); + } + else if (parser.getToken() & 143360) { + destructible |= 16; + if (token === -2147483528) + parser.report(95); + if (token === 209005) { + if (parser.flags & 1) + parser.report(132); + state |= 16 | 1; + } + else if (token === 209008) { + state |= 256; + } + else if (token === 209009) { + state |= 512; + } + else { + parser.report(0); + } + key = parseIdentifier(parser, context); + value = parseMethodDefinition(parser, context, privateScope, state, inGroup, parser.tokenStart); + } + else if (parser.getToken() === 67174411) { + destructible |= 16; + state |= 1; + value = parseMethodDefinition(parser, context, privateScope, state, inGroup, parser.tokenStart); + } + else if (parser.getToken() === 8391476) { + destructible |= 16; + if (token === 209008) { + parser.report(42); + } + else if (token === 209009) { + parser.report(43); + } + else if (token !== 209005) { + parser.report(30, KeywordDescTable[8391476 & 255]); + } + nextToken(parser, context); + state |= + 8 | 1 | (token === 209005 ? 16 : 0); + if (parser.getToken() & 143360) { + key = parseIdentifier(parser, context); + } + else if ((parser.getToken() & 134217728) === 134217728) { + key = parseLiteral(parser, context); + } + else if (parser.getToken() === 69271571) { + state |= 2; + key = parseComputedPropertyName(parser, context, privateScope, inGroup); + destructible |= parser.assignable; + } + else { + parser.report(30, KeywordDescTable[parser.getToken() & 255]); + } + value = parseMethodDefinition(parser, context, privateScope, state, inGroup, parser.tokenStart); + } + else if ((parser.getToken() & 134217728) === 134217728) { + if (token === 209005) + state |= 16; + state |= + token === 209008 + ? 256 + : token === 209009 + ? 512 + : 1; + destructible |= 16; + key = parseLiteral(parser, context); + value = parseMethodDefinition(parser, context, privateScope, state, inGroup, parser.tokenStart); + } + else { + parser.report(133); + } + } + else if ((parser.getToken() & 134217728) === 134217728) { + key = parseLiteral(parser, context); + if (parser.getToken() === 21) { + consume(parser, context | 32, 21); + const { tokenStart } = parser; + if (tokenValue === '__proto__') + prototypeCount++; + if (parser.getToken() & 143360) { + value = parsePrimaryExpression(parser, context, privateScope, kind, 0, 1, inGroup, 1, tokenStart); + const { tokenValue: valueAfterColon } = parser; + const token = parser.getToken(); + value = parseMemberOrUpdateExpression(parser, context, privateScope, value, inGroup, 0, tokenStart); + if (parser.getToken() === 18 || parser.getToken() === 1074790415) { + if (token === 1077936155 || token === 1074790415 || token === 18) { + if (parser.assignable & 2) { + destructible |= 16; + } + else { + scope?.addVarOrBlock(context, valueAfterColon, kind, origin); + } + } + else { + destructible |= + parser.assignable & 1 + ? 32 + : 16; + } + } + else if (parser.getToken() === 1077936155) { + if (parser.assignable & 2) + destructible |= 16; + value = parseAssignmentExpression(parser, context, privateScope, inGroup, isPattern, tokenStart, value); + } + else { + destructible |= 16; + value = parseAssignmentExpression(parser, context, privateScope, inGroup, isPattern, tokenStart, value); + } + } + else if ((parser.getToken() & 2097152) === 2097152) { + value = + parser.getToken() === 69271571 + ? parseArrayExpressionOrPattern(parser, context, scope, privateScope, 0, inGroup, isPattern, kind, origin) + : parseObjectLiteralOrPattern(parser, context, scope, privateScope, 0, inGroup, isPattern, kind, origin); + destructible = parser.destructible; + parser.assignable = + destructible & 16 ? 2 : 1; + if (parser.getToken() === 18 || parser.getToken() === 1074790415) { + if (parser.assignable & 2) { + destructible |= 16; + } + } + else if ((parser.destructible & 8) !== 8) { + value = parseMemberOrUpdateExpression(parser, context, privateScope, value, inGroup, 0, tokenStart); + destructible = parser.assignable & 2 ? 16 : 0; + if ((parser.getToken() & 4194304) === 4194304) { + value = parseAssignmentExpressionOrPattern(parser, context, privateScope, inGroup, isPattern, tokenStart, value); + } + else { + if ((parser.getToken() & 8388608) === 8388608) { + value = parseBinaryExpression(parser, context, privateScope, 1, tokenStart, 4, token, value); + } + if (consumeOpt(parser, context | 32, 22)) { + value = parseConditionalExpression(parser, context, privateScope, value, tokenStart); + } + destructible |= + parser.assignable & 2 + ? 16 + : 32; + } + } + } + else { + value = parseLeftHandSideExpression(parser, context, privateScope, 1, 0, 1); + destructible |= + parser.assignable & 1 + ? 32 + : 16; + if (parser.getToken() === 18 || parser.getToken() === 1074790415) { + if (parser.assignable & 2) { + destructible |= 16; + } + } + else { + value = parseMemberOrUpdateExpression(parser, context, privateScope, value, inGroup, 0, tokenStart); + destructible = parser.assignable & 1 ? 0 : 16; + if (parser.getToken() !== 18 && parser.getToken() !== 1074790415) { + if (parser.getToken() !== 1077936155) + destructible |= 16; + value = parseAssignmentExpression(parser, context, privateScope, inGroup, isPattern, tokenStart, value); + } + } + } + } + else if (parser.getToken() === 67174411) { + state |= 1; + value = parseMethodDefinition(parser, context, privateScope, state, inGroup, parser.tokenStart); + destructible = parser.assignable | 16; + } + else { + parser.report(134); + } + } + else if (parser.getToken() === 69271571) { + key = parseComputedPropertyName(parser, context, privateScope, inGroup); + destructible |= parser.destructible & 256 ? 256 : 0; + state |= 2; + if (parser.getToken() === 21) { + nextToken(parser, context | 32); + const { tokenStart, tokenValue } = parser; + const tokenAfterColon = parser.getToken(); + if (parser.getToken() & 143360) { + value = parsePrimaryExpression(parser, context, privateScope, kind, 0, 1, inGroup, 1, tokenStart); + const token = parser.getToken(); + value = parseMemberOrUpdateExpression(parser, context, privateScope, value, inGroup, 0, tokenStart); + if ((parser.getToken() & 4194304) === 4194304) { + destructible |= + parser.assignable & 2 + ? 16 + : token === 1077936155 + ? 0 + : 32; + value = parseAssignmentExpressionOrPattern(parser, context, privateScope, inGroup, isPattern, tokenStart, value); + } + else if (parser.getToken() === 18 || parser.getToken() === 1074790415) { + if (token === 1077936155 || token === 1074790415 || token === 18) { + if (parser.assignable & 2) { + destructible |= 16; + } + else if ((tokenAfterColon & 143360) === 143360) { + scope?.addVarOrBlock(context, tokenValue, kind, origin); + } + } + else { + destructible |= + parser.assignable & 1 + ? 32 + : 16; + } + } + else { + destructible |= 16; + value = parseAssignmentExpression(parser, context, privateScope, inGroup, isPattern, tokenStart, value); + } + } + else if ((parser.getToken() & 2097152) === 2097152) { + value = + parser.getToken() === 69271571 + ? parseArrayExpressionOrPattern(parser, context, scope, privateScope, 0, inGroup, isPattern, kind, origin) + : parseObjectLiteralOrPattern(parser, context, scope, privateScope, 0, inGroup, isPattern, kind, origin); + destructible = parser.destructible; + parser.assignable = + destructible & 16 ? 2 : 1; + if (parser.getToken() === 18 || parser.getToken() === 1074790415) { + if (parser.assignable & 2) + destructible |= 16; + } + else if (destructible & 8) { + parser.report(62); + } + else { + value = parseMemberOrUpdateExpression(parser, context, privateScope, value, inGroup, 0, tokenStart); + destructible = + parser.assignable & 2 ? destructible | 16 : 0; + if ((parser.getToken() & 4194304) === 4194304) { + if (parser.getToken() !== 1077936155) + destructible |= 16; + value = parseAssignmentExpressionOrPattern(parser, context, privateScope, inGroup, isPattern, tokenStart, value); + } + else { + if ((parser.getToken() & 8388608) === 8388608) { + value = parseBinaryExpression(parser, context, privateScope, 1, tokenStart, 4, token, value); + } + if (consumeOpt(parser, context | 32, 22)) { + value = parseConditionalExpression(parser, context, privateScope, value, tokenStart); + } + destructible |= + parser.assignable & 2 + ? 16 + : 32; + } + } + } + else { + value = parseLeftHandSideExpression(parser, context, privateScope, 1, 0, 1); + destructible |= + parser.assignable & 1 + ? 32 + : 16; + if (parser.getToken() === 18 || parser.getToken() === 1074790415) { + if (parser.assignable & 2) + destructible |= 16; + } + else { + value = parseMemberOrUpdateExpression(parser, context, privateScope, value, inGroup, 0, tokenStart); + destructible = parser.assignable & 1 ? 0 : 16; + if (parser.getToken() !== 18 && parser.getToken() !== 1074790415) { + if (parser.getToken() !== 1077936155) + destructible |= 16; + value = parseAssignmentExpression(parser, context, privateScope, inGroup, isPattern, tokenStart, value); + } + } + } + } + else if (parser.getToken() === 67174411) { + state |= 1; + value = parseMethodDefinition(parser, context, privateScope, state, inGroup, parser.tokenStart); + destructible = 16; + } + else { + parser.report(44); + } + } + else if (token === 8391476) { + consume(parser, context | 32, 8391476); + state |= 8; + if (parser.getToken() & 143360) { + const token = parser.getToken(); + key = parseIdentifier(parser, context); + state |= 1; + if (parser.getToken() === 67174411) { + destructible |= 16; + value = parseMethodDefinition(parser, context, privateScope, state, inGroup, parser.tokenStart); + } + else { + throw new ParseError(parser.tokenStart, parser.currentLocation, token === 209005 + ? 46 + : token === 209008 || parser.getToken() === 209009 + ? 45 + : 47, KeywordDescTable[token & 255]); + } + } + else if ((parser.getToken() & 134217728) === 134217728) { + destructible |= 16; + key = parseLiteral(parser, context); + state |= 1; + value = parseMethodDefinition(parser, context, privateScope, state, inGroup, parser.tokenStart); + } + else if (parser.getToken() === 69271571) { + destructible |= 16; + state |= 2 | 1; + key = parseComputedPropertyName(parser, context, privateScope, inGroup); + value = parseMethodDefinition(parser, context, privateScope, state, inGroup, parser.tokenStart); + } + else { + parser.report(126); + } + } + else { + parser.report(30, KeywordDescTable[token & 255]); + } + destructible |= parser.destructible & 128 ? 128 : 0; + parser.destructible = destructible; + properties.push(parser.finishNode({ + type: 'Property', + key: key, + value, + kind: !(state & 768) ? 'init' : state & 512 ? 'set' : 'get', + computed: (state & 2) > 0, + method: (state & 1) > 0, + shorthand: (state & 4) > 0, + }, tokenStart)); + } + destructible |= parser.destructible; + if (parser.getToken() !== 18) + break; + nextToken(parser, context); + } + consume(parser, context, 1074790415); + if (prototypeCount > 1) + destructible |= 64; + const node = parser.finishNode({ + type: isPattern ? 'ObjectPattern' : 'ObjectExpression', + properties, + }, start); + if (!skipInitializer && parser.getToken() & 4194304) { + return parseArrayOrObjectAssignmentPattern(parser, context, privateScope, destructible, inGroup, isPattern, start, node); + } + parser.destructible = destructible; + return node; +} +function parseMethodFormals(parser, context, scope, privateScope, kind, type, inGroup) { + consume(parser, context, 67174411); + const params = []; + parser.flags = (parser.flags | 128) ^ 128; + if (parser.getToken() === 16) { + if (kind & 512) { + parser.report(37, 'Setter', 'one', ''); + } + nextToken(parser, context); + return params; + } + if (kind & 256) { + parser.report(37, 'Getter', 'no', 's'); + } + if (kind & 512 && parser.getToken() === 14) { + parser.report(38); + } + context = (context | 131072) ^ 131072; + let setterArgs = 0; + let isNonSimpleParameterList = 0; + while (parser.getToken() !== 18) { + let left = null; + const { tokenStart } = parser; + if (parser.getToken() & 143360) { + if ((context & 1) === 0) { + if ((parser.getToken() & 36864) === 36864) { + parser.flags |= 256; + } + if ((parser.getToken() & 537079808) === 537079808) { + parser.flags |= 512; + } + } + left = parseAndClassifyIdentifier(parser, context, scope, kind | 1, 0); + } + else { + if (parser.getToken() === 2162700) { + left = parseObjectLiteralOrPattern(parser, context, scope, privateScope, 1, inGroup, 1, type, 0); + } + else if (parser.getToken() === 69271571) { + left = parseArrayExpressionOrPattern(parser, context, scope, privateScope, 1, inGroup, 1, type, 0); + } + else if (parser.getToken() === 14) { + left = parseSpreadOrRestElement(parser, context, scope, privateScope, 16, type, 0, 0, inGroup, 1); + } + isNonSimpleParameterList = 1; + if (parser.destructible & (32 | 16)) + parser.report(50); + } + if (parser.getToken() === 1077936155) { + nextToken(parser, context | 32); + isNonSimpleParameterList = 1; + const right = parseExpression(parser, context, privateScope, 1, 0, parser.tokenStart); + left = parser.finishNode({ + type: 'AssignmentPattern', + left: left, + right, + }, tokenStart); + } + setterArgs++; + params.push(left); + if (!consumeOpt(parser, context, 18)) + break; + if (parser.getToken() === 16) { + break; + } + } + if (kind & 512 && setterArgs !== 1) { + parser.report(37, 'Setter', 'one', ''); + } + scope?.reportScopeError(); + if (isNonSimpleParameterList) + parser.flags |= 128; + consume(parser, context, 16); + return params; +} +function parseComputedPropertyName(parser, context, privateScope, inGroup) { + nextToken(parser, context | 32); + const key = parseExpression(parser, (context | 131072) ^ 131072, privateScope, 1, inGroup, parser.tokenStart); + consume(parser, context, 20); + return key; +} +function parseParenthesizedExpression(parser, context, privateScope, canAssign, kind, origin, start) { + parser.flags = (parser.flags | 128) ^ 128; + const parenthesesStart = parser.tokenStart; + nextToken(parser, context | 32 | 262144); + const scope = parser.createScopeIfLexical()?.createChildScope(512); + context = (context | 131072) ^ 131072; + if (consumeOpt(parser, context, 16)) { + return parseParenthesizedArrow(parser, context, scope, privateScope, [], canAssign, 0, start); + } + let destructible = 0; + parser.destructible &= -385; + let expr; + let expressions = []; + let isSequence = 0; + let isNonSimpleParameterList = 0; + let hasStrictReserved = 0; + const tokenAfterParenthesesStart = parser.tokenStart; + parser.assignable = 1; + while (parser.getToken() !== 16) { + const { tokenStart } = parser; + const token = parser.getToken(); + if (token & 143360) { + scope?.addBlockName(context, parser.tokenValue, 1, 0); + if ((token & 537079808) === 537079808) { + isNonSimpleParameterList = 1; + } + else if ((token & 36864) === 36864) { + hasStrictReserved = 1; + } + expr = parsePrimaryExpression(parser, context, privateScope, kind, 0, 1, 1, 1, tokenStart); + if (parser.getToken() === 16 || parser.getToken() === 18) { + if (parser.assignable & 2) { + destructible |= 16; + isNonSimpleParameterList = 1; + } + } + else { + if (parser.getToken() === 1077936155) { + isNonSimpleParameterList = 1; + } + else { + destructible |= 16; + } + expr = parseMemberOrUpdateExpression(parser, context, privateScope, expr, 1, 0, tokenStart); + if (parser.getToken() !== 16 && parser.getToken() !== 18) { + expr = parseAssignmentExpression(parser, context, privateScope, 1, 0, tokenStart, expr); + } + } + } + else if ((token & 2097152) === 2097152) { + expr = + token === 2162700 + ? parseObjectLiteralOrPattern(parser, context | 262144, scope, privateScope, 0, 1, 0, kind, origin) + : parseArrayExpressionOrPattern(parser, context | 262144, scope, privateScope, 0, 1, 0, kind, origin); + destructible |= parser.destructible; + isNonSimpleParameterList = 1; + parser.assignable = 2; + if (parser.getToken() !== 16 && parser.getToken() !== 18) { + if (destructible & 8) + parser.report(122); + expr = parseMemberOrUpdateExpression(parser, context, privateScope, expr, 0, 0, tokenStart); + destructible |= 16; + if (parser.getToken() !== 16 && parser.getToken() !== 18) { + expr = parseAssignmentExpression(parser, context, privateScope, 0, 0, tokenStart, expr); + } + } + } + else if (token === 14) { + expr = parseSpreadOrRestElement(parser, context, scope, privateScope, 16, kind, origin, 0, 1, 0); + if (parser.destructible & 16) + parser.report(74); + isNonSimpleParameterList = 1; + if (isSequence && (parser.getToken() === 16 || parser.getToken() === 18)) { + expressions.push(expr); + } + destructible |= 8; + break; + } + else { + destructible |= 16; + expr = parseExpression(parser, context, privateScope, 1, 1, tokenStart); + if (isSequence && (parser.getToken() === 16 || parser.getToken() === 18)) { + expressions.push(expr); + } + if (parser.getToken() === 18) { + if (!isSequence) { + isSequence = 1; + expressions = [expr]; + } + } + if (isSequence) { + while (consumeOpt(parser, context | 32, 18)) { + expressions.push(parseExpression(parser, context, privateScope, 1, 1, parser.tokenStart)); + } + parser.assignable = 2; + expr = parser.finishNode({ + type: 'SequenceExpression', + expressions, + }, tokenAfterParenthesesStart); + } + consume(parser, context, 16); + parser.destructible = destructible; + return parser.options.preserveParens + ? parser.finishNode({ + type: 'ParenthesizedExpression', + expression: expr, + }, parenthesesStart) + : expr; + } + if (isSequence && (parser.getToken() === 16 || parser.getToken() === 18)) { + expressions.push(expr); + } + if (!consumeOpt(parser, context | 32, 18)) + break; + if (!isSequence) { + isSequence = 1; + expressions = [expr]; + } + if (parser.getToken() === 16) { + destructible |= 8; + break; + } + } + if (isSequence) { + parser.assignable = 2; + expr = parser.finishNode({ + type: 'SequenceExpression', + expressions, + }, tokenAfterParenthesesStart); + } + consume(parser, context, 16); + if (destructible & 16 && destructible & 8) + parser.report(151); + destructible |= + parser.destructible & 256 + ? 256 + : 0 | (parser.destructible & 128) + ? 128 + : 0; + if (parser.getToken() === 10) { + if (destructible & (32 | 16)) + parser.report(49); + if (context & (2048 | 2) && destructible & 128) + parser.report(31); + if (context & (1 | 1024) && destructible & 256) { + parser.report(32); + } + if (isNonSimpleParameterList) + parser.flags |= 128; + if (hasStrictReserved) + parser.flags |= 256; + return parseParenthesizedArrow(parser, context, scope, privateScope, isSequence ? expressions : [expr], canAssign, 0, start); + } + if (destructible & 64) { + parser.report(63); + } + if (destructible & 8) { + parser.report(144); + } + parser.destructible = ((parser.destructible | 256) ^ 256) | destructible; + return parser.options.preserveParens + ? parser.finishNode({ + type: 'ParenthesizedExpression', + expression: expr, + }, parenthesesStart) + : expr; +} +function parseIdentifierOrArrow(parser, context, privateScope) { + const { tokenStart: start } = parser; + const { tokenValue } = parser; + let isNonSimpleParameterList = 0; + let hasStrictReserved = 0; + if ((parser.getToken() & 537079808) === 537079808) { + isNonSimpleParameterList = 1; + } + else if ((parser.getToken() & 36864) === 36864) { + hasStrictReserved = 1; + } + const expr = parseIdentifier(parser, context); + parser.assignable = 1; + if (parser.getToken() === 10) { + const scope = parser.options.lexical ? createArrowHeadParsingScope(parser, context, tokenValue) : undefined; + if (isNonSimpleParameterList) + parser.flags |= 128; + if (hasStrictReserved) + parser.flags |= 256; + return parseArrowFunctionExpression(parser, context, scope, privateScope, [expr], 0, start); + } + return expr; +} +function parseArrowFromIdentifier(parser, context, privateScope, value, expr, inNew, canAssign, isAsync, start) { + if (!canAssign) + parser.report(57); + if (inNew) + parser.report(51); + parser.flags &= -129; + const scope = parser.options.lexical ? createArrowHeadParsingScope(parser, context, value) : void 0; + return parseArrowFunctionExpression(parser, context, scope, privateScope, [expr], isAsync, start); +} +function parseParenthesizedArrow(parser, context, scope, privateScope, params, canAssign, isAsync, start) { + if (!canAssign) + parser.report(57); + for (let i = 0; i < params.length; ++i) + reinterpretToPattern(parser, params[i]); + return parseArrowFunctionExpression(parser, context, scope, privateScope, params, isAsync, start); +} +function parseArrowFunctionExpression(parser, context, scope, privateScope, params, isAsync, start) { + if (parser.flags & 1) + parser.report(48); + consume(parser, context | 32, 10); + const modifierFlags = 1024 | 2048 | 8192 | 524288; + context = ((context | modifierFlags) ^ modifierFlags) | (isAsync ? 2048 : 0); + const expression = parser.getToken() !== 2162700; + let body; + scope?.reportScopeError(); + if (expression) { + parser.flags = + (parser.flags | 512 | 256 | 64 | 4096) ^ + (512 | 256 | 64 | 4096); + body = parseExpression(parser, context, privateScope, 1, 0, parser.tokenStart); + } + else { + scope = scope?.createChildScope(64); + const modifierFlags = 4 | 131072 | 8; + body = parseFunctionBody(parser, ((context | modifierFlags) ^ modifierFlags) | 4096, scope, privateScope, 16, void 0, void 0); + switch (parser.getToken()) { + case 69271571: + if ((parser.flags & 1) === 0) { + parser.report(116); + } + break; + case 67108877: + case 67174409: + case 22: + parser.report(117); + case 67174411: + if ((parser.flags & 1) === 0) { + parser.report(116); + } + parser.flags |= 1024; + break; + } + if ((parser.getToken() & 8388608) === 8388608 && (parser.flags & 1) === 0) + parser.report(30, KeywordDescTable[parser.getToken() & 255]); + if ((parser.getToken() & 33619968) === 33619968) + parser.report(125); + } + parser.assignable = 2; + return parser.finishNode({ + type: 'ArrowFunctionExpression', + params, + body, + async: isAsync === 1, + expression, + generator: false, + }, start); +} +function parseFormalParametersOrFormalList(parser, context, scope, privateScope, inGroup, kind) { + consume(parser, context, 67174411); + parser.flags = (parser.flags | 128) ^ 128; + const params = []; + if (consumeOpt(parser, context, 16)) + return params; + context = (context | 131072) ^ 131072; + let isNonSimpleParameterList = 0; + while (parser.getToken() !== 18) { + let left; + const { tokenStart } = parser; + const token = parser.getToken(); + if (token & 143360) { + if ((context & 1) === 0) { + if ((token & 36864) === 36864) { + parser.flags |= 256; + } + if ((token & 537079808) === 537079808) { + parser.flags |= 512; + } + } + left = parseAndClassifyIdentifier(parser, context, scope, kind | 1, 0); + } + else { + if (token === 2162700) { + left = parseObjectLiteralOrPattern(parser, context, scope, privateScope, 1, inGroup, 1, kind, 0); + } + else if (token === 69271571) { + left = parseArrayExpressionOrPattern(parser, context, scope, privateScope, 1, inGroup, 1, kind, 0); + } + else if (token === 14) { + left = parseSpreadOrRestElement(parser, context, scope, privateScope, 16, kind, 0, 0, inGroup, 1); + } + else { + parser.report(30, KeywordDescTable[token & 255]); + } + isNonSimpleParameterList = 1; + if (parser.destructible & (32 | 16)) { + parser.report(50); + } + } + if (parser.getToken() === 1077936155) { + nextToken(parser, context | 32); + isNonSimpleParameterList = 1; + const right = parseExpression(parser, context, privateScope, 1, inGroup, parser.tokenStart); + left = parser.finishNode({ + type: 'AssignmentPattern', + left, + right, + }, tokenStart); + } + params.push(left); + if (!consumeOpt(parser, context, 18)) + break; + if (parser.getToken() === 16) { + break; + } + } + if (isNonSimpleParameterList) + parser.flags |= 128; + if (isNonSimpleParameterList || context & 1) { + scope?.reportScopeError(); + } + consume(parser, context, 16); + return params; +} +function parseMemberExpressionNoCall(parser, context, privateScope, expr, inGroup, start) { + const token = parser.getToken(); + if (token & 67108864) { + if (token === 67108877) { + nextToken(parser, context | 262144); + parser.assignable = 1; + const property = parsePropertyOrPrivatePropertyName(parser, context, privateScope); + return parseMemberExpressionNoCall(parser, context, privateScope, parser.finishNode({ + type: 'MemberExpression', + object: expr, + computed: false, + property, + optional: false, + }, start), 0, start); + } + else if (token === 69271571) { + nextToken(parser, context | 32); + const { tokenStart } = parser; + const property = parseExpressions(parser, context, privateScope, inGroup, 1, tokenStart); + consume(parser, context, 20); + parser.assignable = 1; + return parseMemberExpressionNoCall(parser, context, privateScope, parser.finishNode({ + type: 'MemberExpression', + object: expr, + computed: true, + property, + optional: false, + }, start), 0, start); + } + else if (token === 67174408 || token === 67174409) { + parser.assignable = 2; + return parseMemberExpressionNoCall(parser, context, privateScope, parser.finishNode({ + type: 'TaggedTemplateExpression', + tag: expr, + quasi: parser.getToken() === 67174408 + ? parseTemplate(parser, context | 64, privateScope) + : parseTemplateLiteral(parser, context | 64), + }, start), 0, start); + } + } + return expr; +} +function parseNewExpression(parser, context, privateScope, inGroup) { + const { tokenStart: start } = parser; + const id = parseIdentifier(parser, context | 32); + const { tokenStart } = parser; + if (consumeOpt(parser, context, 67108877)) { + if (context & 65536 && parser.getToken() === 209029) { + parser.assignable = 2; + return parseMetaProperty(parser, context, id, start); + } + parser.report(94); + } + parser.assignable = 2; + if ((parser.getToken() & 16842752) === 16842752) { + parser.report(65, KeywordDescTable[parser.getToken() & 255]); + } + const expr = parsePrimaryExpression(parser, context, privateScope, 2, 1, 0, inGroup, 1, tokenStart); + context = (context | 131072) ^ 131072; + if (parser.getToken() === 67108990) + parser.report(168); + const callee = parseMemberExpressionNoCall(parser, context, privateScope, expr, inGroup, tokenStart); + parser.assignable = 2; + return parser.finishNode({ + type: 'NewExpression', + callee, + arguments: parser.getToken() === 67174411 ? parseArguments(parser, context, privateScope, inGroup) : [], + }, start); +} +function parseMetaProperty(parser, context, meta, start) { + const property = parseIdentifier(parser, context); + return parser.finishNode({ + type: 'MetaProperty', + meta, + property, + }, start); +} +function parseAsyncArrowAfterIdent(parser, context, privateScope, canAssign, start) { + if (parser.getToken() === 209006) + parser.report(31); + if (context & (1 | 1024) && parser.getToken() === 241771) { + parser.report(32); + } + classifyIdentifier(parser, context, parser.getToken()); + if ((parser.getToken() & 36864) === 36864) { + parser.flags |= 256; + } + return parseArrowFromIdentifier(parser, (context & -524289) | 2048, privateScope, parser.tokenValue, parseIdentifier(parser, context), 0, canAssign, 1, start); +} +function parseAsyncArrowOrCallExpression(parser, context, privateScope, callee, canAssign, kind, origin, flags, start) { + nextToken(parser, context | 32); + const scope = parser.createScopeIfLexical()?.createChildScope(512); + context = (context | 131072) ^ 131072; + if (consumeOpt(parser, context, 16)) { + if (parser.getToken() === 10) { + if (flags & 1) + parser.report(48); + return parseParenthesizedArrow(parser, context, scope, privateScope, [], canAssign, 1, start); + } + return parser.finishNode({ + type: 'CallExpression', + callee, + arguments: [], + optional: false, + }, start); + } + let destructible = 0; + let expr = null; + let isNonSimpleParameterList = 0; + parser.destructible = + (parser.destructible | 256 | 128) ^ + (256 | 128); + const params = []; + while (parser.getToken() !== 16) { + const { tokenStart } = parser; + const token = parser.getToken(); + if (token & 143360) { + scope?.addBlockName(context, parser.tokenValue, kind, 0); + if ((token & 537079808) === 537079808) { + parser.flags |= 512; + } + else if ((token & 36864) === 36864) { + parser.flags |= 256; + } + expr = parsePrimaryExpression(parser, context, privateScope, kind, 0, 1, 1, 1, tokenStart); + if (parser.getToken() === 16 || parser.getToken() === 18) { + if (parser.assignable & 2) { + destructible |= 16; + isNonSimpleParameterList = 1; + } + } + else { + if (parser.getToken() === 1077936155) { + isNonSimpleParameterList = 1; + } + else { + destructible |= 16; + } + expr = parseMemberOrUpdateExpression(parser, context, privateScope, expr, 1, 0, tokenStart); + if (parser.getToken() !== 16 && parser.getToken() !== 18) { + expr = parseAssignmentExpression(parser, context, privateScope, 1, 0, tokenStart, expr); + } + } + } + else if (token & 2097152) { + expr = + token === 2162700 + ? parseObjectLiteralOrPattern(parser, context, scope, privateScope, 0, 1, 0, kind, origin) + : parseArrayExpressionOrPattern(parser, context, scope, privateScope, 0, 1, 0, kind, origin); + destructible |= parser.destructible; + isNonSimpleParameterList = 1; + if (parser.getToken() !== 16 && parser.getToken() !== 18) { + if (destructible & 8) + parser.report(122); + expr = parseMemberOrUpdateExpression(parser, context, privateScope, expr, 0, 0, tokenStart); + destructible |= 16; + if ((parser.getToken() & 8388608) === 8388608) { + expr = parseBinaryExpression(parser, context, privateScope, 1, start, 4, token, expr); + } + if (consumeOpt(parser, context | 32, 22)) { + expr = parseConditionalExpression(parser, context, privateScope, expr, start); + } + } + } + else if (token === 14) { + expr = parseSpreadOrRestElement(parser, context, scope, privateScope, 16, kind, origin, 1, 1, 0); + destructible |= + (parser.getToken() === 16 ? 0 : 16) | parser.destructible; + isNonSimpleParameterList = 1; + } + else { + expr = parseExpression(parser, context, privateScope, 1, 0, tokenStart); + destructible = parser.assignable; + params.push(expr); + while (consumeOpt(parser, context | 32, 18)) { + params.push(parseExpression(parser, context, privateScope, 1, 0, tokenStart)); + } + destructible |= parser.assignable; + consume(parser, context, 16); + parser.destructible = destructible | 16; + parser.assignable = 2; + return parser.finishNode({ + type: 'CallExpression', + callee, + arguments: params, + optional: false, + }, start); + } + params.push(expr); + if (!consumeOpt(parser, context | 32, 18)) + break; + } + consume(parser, context, 16); + destructible |= + parser.destructible & 256 + ? 256 + : 0 | (parser.destructible & 128) + ? 128 + : 0; + if (parser.getToken() === 10) { + if (destructible & (32 | 16)) + parser.report(27); + if (parser.flags & 1 || flags & 1) + parser.report(48); + if (destructible & 128) + parser.report(31); + if (context & (1 | 1024) && destructible & 256) + parser.report(32); + if (isNonSimpleParameterList) + parser.flags |= 128; + return parseParenthesizedArrow(parser, context | 2048, scope, privateScope, params, canAssign, 1, start); + } + if (destructible & 64) { + parser.report(63); + } + if (destructible & 8) { + parser.report(62); + } + parser.assignable = 2; + return parser.finishNode({ + type: 'CallExpression', + callee, + arguments: params, + optional: false, + }, start); +} +function parseRegExpLiteral(parser, context) { + const { tokenRaw, tokenRegExp, tokenValue, tokenStart } = parser; + nextToken(parser, context); + parser.assignable = 2; + const node = { + type: 'Literal', + value: tokenValue, + regex: tokenRegExp, + }; + if (parser.options.raw) { + node.raw = tokenRaw; + } + return parser.finishNode(node, tokenStart); +} +function parseClassDeclaration(parser, context, scope, privateScope, flags) { + let start; + let decorators; + if (parser.leadingDecorators.decorators.length) { + if (parser.getToken() === 132) { + parser.report(30, '@'); + } + start = parser.leadingDecorators.start; + decorators = [...parser.leadingDecorators.decorators]; + parser.leadingDecorators.decorators.length = 0; + } + else { + start = parser.tokenStart; + decorators = parseDecorators(parser, context, privateScope); + } + context = (context | 16384 | 1) ^ 16384; + nextToken(parser, context); + let id = null; + let superClass = null; + const { tokenValue } = parser; + if (parser.getToken() & 4096 && parser.getToken() !== 20565) { + if (isStrictReservedWord(parser, context, parser.getToken())) { + parser.report(118); + } + if ((parser.getToken() & 537079808) === 537079808) { + parser.report(119); + } + if (scope) { + scope.addBlockName(context, tokenValue, 32, 0); + if (flags) { + if (flags & 2) { + parser.declareUnboundVariable(tokenValue); + } + } + } + id = parseIdentifier(parser, context); + } + else { + if ((flags & 1) === 0) + parser.report(39, 'Class'); + } + let inheritedContext = context; + if (consumeOpt(parser, context | 32, 20565)) { + superClass = parseLeftHandSideExpression(parser, context, privateScope, 0, 0, 0); + inheritedContext |= 512; + } + else { + inheritedContext = (inheritedContext | 512) ^ 512; + } + const body = parseClassBody(parser, inheritedContext, context, scope, privateScope, 2, 8, 0); + return parser.finishNode({ + type: 'ClassDeclaration', + id, + superClass, + body, + ...(parser.options.next ? { decorators } : null), + }, start); +} +function parseClassExpression(parser, context, privateScope, inGroup, start) { + let id = null; + let superClass = null; + const decorators = parseDecorators(parser, context, privateScope); + context = (context | 1 | 16384) ^ 16384; + nextToken(parser, context); + if (parser.getToken() & 4096 && parser.getToken() !== 20565) { + if (isStrictReservedWord(parser, context, parser.getToken())) + parser.report(118); + if ((parser.getToken() & 537079808) === 537079808) { + parser.report(119); + } + id = parseIdentifier(parser, context); + } + let inheritedContext = context; + if (consumeOpt(parser, context | 32, 20565)) { + superClass = parseLeftHandSideExpression(parser, context, privateScope, 0, inGroup, 0); + inheritedContext |= 512; + } + else { + inheritedContext = (inheritedContext | 512) ^ 512; + } + const body = parseClassBody(parser, inheritedContext, context, void 0, privateScope, 2, 0, inGroup); + parser.assignable = 2; + return parser.finishNode({ + type: 'ClassExpression', + id, + superClass, + body, + ...(parser.options.next ? { decorators } : null), + }, start); +} +function parseDecorators(parser, context, privateScope) { + const list = []; + if (parser.options.next) { + while (parser.getToken() === 132) { + list.push(parseDecoratorList(parser, context, privateScope)); + } + } + return list; +} +function parseDecoratorList(parser, context, privateScope) { + const start = parser.tokenStart; + nextToken(parser, context | 32); + let expression = parsePrimaryExpression(parser, context, privateScope, 2, 0, 1, 0, 1, start); + expression = parseMemberOrUpdateExpression(parser, context, privateScope, expression, 0, 0, parser.tokenStart); + return parser.finishNode({ + type: 'Decorator', + expression, + }, start); +} +function parseClassBody(parser, context, inheritedContext, scope, parentScope, kind, origin, inGroup) { + const { tokenStart } = parser; + const privateScope = parser.createPrivateScopeIfLexical(parentScope); + consume(parser, context | 32, 2162700); + const modifierFlags = 131072 | 524288; + context = (context | modifierFlags) ^ modifierFlags; + const hasConstr = parser.flags & 32; + parser.flags = (parser.flags | 32) ^ 32; + const body = []; + while (parser.getToken() !== 1074790415) { + const decoratorStart = parser.tokenStart; + const decorators = parseDecorators(parser, context, privateScope); + if (decorators.length > 0 && parser.tokenValue === 'constructor') { + parser.report(109); + } + if (parser.getToken() === 1074790415) + parser.report(108); + if (consumeOpt(parser, context, 1074790417)) { + if (decorators.length > 0) + parser.report(120); + continue; + } + body.push(parseClassElementList(parser, context, scope, privateScope, inheritedContext, kind, decorators, 0, inGroup, decorators.length > 0 ? decoratorStart : parser.tokenStart)); + } + consume(parser, origin & 8 ? context | 32 : context, 1074790415); + privateScope?.validatePrivateIdentifierRefs(); + parser.flags = (parser.flags & -33) | hasConstr; + return parser.finishNode({ + type: 'ClassBody', + body, + }, tokenStart); +} +function parseClassElementList(parser, context, scope, privateScope, inheritedContext, type, decorators, isStatic, inGroup, start) { + let kind = isStatic ? 32 : 0; + let key = null; + const token = parser.getToken(); + if (token & (143360 | 36864) || token === -2147483528) { + key = parseIdentifier(parser, context); + switch (token) { + case 36970: + if (!isStatic && + parser.getToken() !== 67174411 && + (parser.getToken() & 1048576) !== 1048576 && + parser.getToken() !== 1077936155) { + return parseClassElementList(parser, context, scope, privateScope, inheritedContext, type, decorators, 1, inGroup, start); + } + break; + case 209005: + if (parser.getToken() !== 67174411 && (parser.flags & 1) === 0) { + if ((parser.getToken() & 1073741824) === 1073741824) { + return parsePropertyDefinition(parser, context, privateScope, key, kind, decorators, start); + } + kind |= 16 | (optionalBit(parser, context, 8391476) ? 8 : 0); + } + break; + case 209008: + if (parser.getToken() !== 67174411) { + if ((parser.getToken() & 1073741824) === 1073741824) { + return parsePropertyDefinition(parser, context, privateScope, key, kind, decorators, start); + } + kind |= 256; + } + break; + case 209009: + if (parser.getToken() !== 67174411) { + if ((parser.getToken() & 1073741824) === 1073741824) { + return parsePropertyDefinition(parser, context, privateScope, key, kind, decorators, start); + } + kind |= 512; + } + break; + case 12402: + if (parser.getToken() !== 67174411 && (parser.flags & 1) === 0) { + if ((parser.getToken() & 1073741824) === 1073741824) { + return parsePropertyDefinition(parser, context, privateScope, key, kind, decorators, start); + } + if (parser.options.next) + kind |= 1024; + } + break; + } + } + else if (token === 69271571) { + kind |= 2; + key = parseComputedPropertyName(parser, inheritedContext, privateScope, inGroup); + } + else if ((token & 134217728) === 134217728) { + key = parseLiteral(parser, context); + } + else if (token === 8391476) { + kind |= 8; + nextToken(parser, context); + } + else if (parser.getToken() === 130) { + kind |= 8192; + key = parsePrivateIdentifier(parser, context | 16, privateScope, 768); + } + else if ((parser.getToken() & 1073741824) === 1073741824) { + kind |= 128; + } + else if (isStatic && token === 2162700) { + return parseStaticBlock(parser, context | 16, scope, privateScope, start); + } + else if (token === -2147483527) { + key = parseIdentifier(parser, context); + if (parser.getToken() !== 67174411) + parser.report(30, KeywordDescTable[parser.getToken() & 255]); + } + else { + parser.report(30, KeywordDescTable[parser.getToken() & 255]); + } + if (kind & (8 | 16 | 768 | 1024)) { + if (parser.getToken() & 143360 || + parser.getToken() === -2147483528 || + parser.getToken() === -2147483527) { + key = parseIdentifier(parser, context); + } + else if ((parser.getToken() & 134217728) === 134217728) { + key = parseLiteral(parser, context); + } + else if (parser.getToken() === 69271571) { + kind |= 2; + key = parseComputedPropertyName(parser, context, privateScope, 0); + } + else if (parser.getToken() === 130) { + kind |= 8192; + key = parsePrivateIdentifier(parser, context, privateScope, kind); + } + else + parser.report(135); + } + if ((kind & 2) === 0) { + if (parser.tokenValue === 'constructor') { + if ((parser.getToken() & 1073741824) === 1073741824) { + parser.report(129); + } + else if ((kind & 32) === 0 && parser.getToken() === 67174411) { + if (kind & (768 | 16 | 128 | 8)) { + parser.report(53, 'accessor'); + } + else if ((context & 512) === 0) { + if (parser.flags & 32) + parser.report(54); + else + parser.flags |= 32; + } + } + kind |= 64; + } + else if ((kind & 8192) === 0 && + kind & 32 && + parser.tokenValue === 'prototype') { + parser.report(52); + } + } + if (kind & 1024 || (parser.getToken() !== 67174411 && (kind & 768) === 0)) { + return parsePropertyDefinition(parser, context, privateScope, key, kind, decorators, start); + } + const value = parseMethodDefinition(parser, context | 16, privateScope, kind, inGroup, parser.tokenStart); + return parser.finishNode({ + type: 'MethodDefinition', + kind: (kind & 32) === 0 && kind & 64 + ? 'constructor' + : kind & 256 + ? 'get' + : kind & 512 + ? 'set' + : 'method', + static: (kind & 32) > 0, + computed: (kind & 2) > 0, + key, + value, + ...(parser.options.next ? { decorators } : null), + }, start); +} +function parsePrivateIdentifier(parser, context, privateScope, kind) { + const { tokenStart } = parser; + nextToken(parser, context); + const { tokenValue } = parser; + if (tokenValue === 'constructor') + parser.report(128); + if (parser.options.lexical) { + if (!privateScope) + parser.report(4, tokenValue); + if (kind) { + privateScope.addPrivateIdentifier(tokenValue, kind); + } + else { + privateScope.addPrivateIdentifierRef(tokenValue); + } + } + nextToken(parser, context); + return parser.finishNode({ + type: 'PrivateIdentifier', + name: tokenValue, + }, tokenStart); +} +function parsePropertyDefinition(parser, context, privateScope, key, state, decorators, start) { + let value = null; + if (state & 8) + parser.report(0); + if (parser.getToken() === 1077936155) { + nextToken(parser, context | 32); + const { tokenStart } = parser; + if (parser.getToken() === 537079927) + parser.report(119); + const modifierFlags = 1024 | + 2048 | + 8192 | + ((state & 64) === 0 ? 512 | 16384 : 0); + context = + ((context | modifierFlags) ^ modifierFlags) | + (state & 8 ? 1024 : 0) | + (state & 16 ? 2048 : 0) | + (state & 64 ? 16384 : 0) | + 256 | + 65536; + value = parsePrimaryExpression(parser, context | 16, privateScope, 2, 0, 1, 0, 1, tokenStart); + if ((parser.getToken() & 1073741824) !== 1073741824 || + (parser.getToken() & 4194304) === 4194304) { + value = parseMemberOrUpdateExpression(parser, context | 16, privateScope, value, 0, 0, tokenStart); + value = parseAssignmentExpression(parser, context | 16, privateScope, 0, 0, tokenStart, value); + } + } + matchOrInsertSemicolon(parser, context); + return parser.finishNode({ + type: state & 1024 ? 'AccessorProperty' : 'PropertyDefinition', + key, + value, + static: (state & 32) > 0, + computed: (state & 2) > 0, + ...(parser.options.next ? { decorators } : null), + }, start); +} +function parseBindingPattern(parser, context, scope, privateScope, type, origin) { + if (parser.getToken() & 143360 || + ((context & 1) === 0 && parser.getToken() === -2147483527)) + return parseAndClassifyIdentifier(parser, context, scope, type, origin); + if ((parser.getToken() & 2097152) !== 2097152) + parser.report(30, KeywordDescTable[parser.getToken() & 255]); + const left = parser.getToken() === 69271571 + ? parseArrayExpressionOrPattern(parser, context, scope, privateScope, 1, 0, 1, type, origin) + : parseObjectLiteralOrPattern(parser, context, scope, privateScope, 1, 0, 1, type, origin); + if (parser.destructible & 16) + parser.report(50); + if (parser.destructible & 32) + parser.report(50); + return left; +} +function parseAndClassifyIdentifier(parser, context, scope, kind, origin) { + const token = parser.getToken(); + if (context & 1) { + if ((token & 537079808) === 537079808) { + parser.report(119); + } + else if ((token & 36864) === 36864 || token === -2147483527) { + parser.report(118); + } + } + if ((token & 20480) === 20480) { + parser.report(102); + } + if (token === 241771) { + if (context & 1024) + parser.report(32); + if (context & 2) + parser.report(111); + } + if ((token & 255) === (241737 & 255)) { + if (kind & (8 | 16)) + parser.report(100); + } + if (token === 209006) { + if (context & 2048) + parser.report(176); + if (context & 2) + parser.report(110); + } + const { tokenValue, tokenStart: start } = parser; + nextToken(parser, context); + scope?.addVarOrBlock(context, tokenValue, kind, origin); + return parser.finishNode({ + type: 'Identifier', + name: tokenValue, + }, start); +} +function parseJSXRootElementOrFragment(parser, context, privateScope, inJSXChild, start) { + if (!inJSXChild) + consume(parser, context, 8456256); + if (parser.getToken() === 8390721) { + const openingFragment = parseJSXOpeningFragment(parser, start); + const [children, closingFragment] = parseJSXChildrenAndClosingFragment(parser, context, privateScope, inJSXChild); + return parser.finishNode({ + type: 'JSXFragment', + openingFragment, + children, + closingFragment, + }, start); + } + if (parser.getToken() === 8457014) + parser.report(30, KeywordDescTable[parser.getToken() & 255]); + let closingElement = null; + let children = []; + const openingElement = parseJSXOpeningElementOrSelfCloseElement(parser, context, privateScope, inJSXChild, start); + if (!openingElement.selfClosing) { + [children, closingElement] = parseJSXChildrenAndClosingElement(parser, context, privateScope, inJSXChild); + const close = isEqualTagName(closingElement.name); + if (isEqualTagName(openingElement.name) !== close) + parser.report(155, close); + } + return parser.finishNode({ + type: 'JSXElement', + children, + openingElement, + closingElement, + }, start); +} +function parseJSXOpeningFragment(parser, start) { + nextJSXToken(parser); + return parser.finishNode({ + type: 'JSXOpeningFragment', + }, start); +} +function parseJSXClosingElement(parser, context, inJSXChild, start) { + consume(parser, context, 8457014); + const name = parseJSXElementName(parser, context); + if (parser.getToken() !== 8390721) { + parser.report(25, KeywordDescTable[8390721 & 255]); + } + if (inJSXChild) { + nextJSXToken(parser); + } + else { + nextToken(parser, context); + } + return parser.finishNode({ + type: 'JSXClosingElement', + name, + }, start); +} +function parseJSXClosingFragment(parser, context, inJSXChild, start) { + consume(parser, context, 8457014); + if (parser.getToken() !== 8390721) { + parser.report(25, KeywordDescTable[8390721 & 255]); + } + if (inJSXChild) { + nextJSXToken(parser); + } + else { + nextToken(parser, context); + } + return parser.finishNode({ + type: 'JSXClosingFragment', + }, start); +} +function parseJSXChildrenAndClosingElement(parser, context, privateScope, inJSXChild) { + const children = []; + while (true) { + const child = parseJSXChildOrClosingElement(parser, context, privateScope, inJSXChild); + if (child.type === 'JSXClosingElement') { + return [children, child]; + } + children.push(child); + } +} +function parseJSXChildrenAndClosingFragment(parser, context, privateScope, inJSXChild) { + const children = []; + while (true) { + const child = parseJSXChildOrClosingFragment(parser, context, privateScope, inJSXChild); + if (child.type === 'JSXClosingFragment') { + return [children, child]; + } + children.push(child); + } +} +function parseJSXChildOrClosingElement(parser, context, privateScope, inJSXChild) { + if (parser.getToken() === 137) + return parseJSXText(parser, context); + if (parser.getToken() === 2162700) + return parseJSXExpressionContainer(parser, context, privateScope, 1, 0); + if (parser.getToken() === 8456256) { + const { tokenStart } = parser; + nextToken(parser, context); + if (parser.getToken() === 8457014) + return parseJSXClosingElement(parser, context, inJSXChild, tokenStart); + return parseJSXRootElementOrFragment(parser, context, privateScope, 1, tokenStart); + } + parser.report(0); +} +function parseJSXChildOrClosingFragment(parser, context, privateScope, inJSXChild) { + if (parser.getToken() === 137) + return parseJSXText(parser, context); + if (parser.getToken() === 2162700) + return parseJSXExpressionContainer(parser, context, privateScope, 1, 0); + if (parser.getToken() === 8456256) { + const { tokenStart } = parser; + nextToken(parser, context); + if (parser.getToken() === 8457014) + return parseJSXClosingFragment(parser, context, inJSXChild, tokenStart); + return parseJSXRootElementOrFragment(parser, context, privateScope, 1, tokenStart); + } + parser.report(0); +} +function parseJSXText(parser, context) { + const start = parser.tokenStart; + nextToken(parser, context); + const node = { + type: 'JSXText', + value: parser.tokenValue, + }; + if (parser.options.raw) { + node.raw = parser.tokenRaw; + } + return parser.finishNode(node, start); +} +function parseJSXOpeningElementOrSelfCloseElement(parser, context, privateScope, inJSXChild, start) { + if ((parser.getToken() & 143360) !== 143360 && + (parser.getToken() & 4096) !== 4096) + parser.report(0); + const tagName = parseJSXElementName(parser, context); + const attributes = parseJSXAttributes(parser, context, privateScope); + const selfClosing = parser.getToken() === 8457014; + if (selfClosing) + consume(parser, context, 8457014); + if (parser.getToken() !== 8390721) { + parser.report(25, KeywordDescTable[8390721 & 255]); + } + if (inJSXChild || !selfClosing) { + nextJSXToken(parser); + } + else { + nextToken(parser, context); + } + return parser.finishNode({ + type: 'JSXOpeningElement', + name: tagName, + attributes, + selfClosing, + }, start); +} +function parseJSXElementName(parser, context) { + const { tokenStart } = parser; + rescanJSXIdentifier(parser); + let key = parseJSXIdentifier(parser, context); + if (parser.getToken() === 21) + return parseJSXNamespacedName(parser, context, key, tokenStart); + while (consumeOpt(parser, context, 67108877)) { + rescanJSXIdentifier(parser); + key = parseJSXMemberExpression(parser, context, key, tokenStart); + } + return key; +} +function parseJSXMemberExpression(parser, context, object, start) { + const property = parseJSXIdentifier(parser, context); + return parser.finishNode({ + type: 'JSXMemberExpression', + object, + property, + }, start); +} +function parseJSXAttributes(parser, context, privateScope) { + const attributes = []; + while (parser.getToken() !== 8457014 && + parser.getToken() !== 8390721 && + parser.getToken() !== 1048576) { + attributes.push(parseJsxAttribute(parser, context, privateScope)); + } + return attributes; +} +function parseJSXSpreadAttribute(parser, context, privateScope) { + const start = parser.tokenStart; + nextToken(parser, context); + consume(parser, context, 14); + const expression = parseExpression(parser, context, privateScope, 1, 0, parser.tokenStart); + consume(parser, context, 1074790415); + return parser.finishNode({ + type: 'JSXSpreadAttribute', + argument: expression, + }, start); +} +function parseJsxAttribute(parser, context, privateScope) { + const { tokenStart } = parser; + if (parser.getToken() === 2162700) + return parseJSXSpreadAttribute(parser, context, privateScope); + rescanJSXIdentifier(parser); + let value = null; + let name = parseJSXIdentifier(parser, context); + if (parser.getToken() === 21) { + name = parseJSXNamespacedName(parser, context, name, tokenStart); + } + if (parser.getToken() === 1077936155) { + const token = scanJSXAttributeValue(parser, context); + switch (token) { + case 134283267: + value = parseLiteral(parser, context); + break; + case 8456256: + value = parseJSXRootElementOrFragment(parser, context, privateScope, 0, parser.tokenStart); + break; + case 2162700: + value = parseJSXExpressionContainer(parser, context, privateScope, 0, 1); + break; + default: + parser.report(154); + } + } + return parser.finishNode({ + type: 'JSXAttribute', + value, + name, + }, tokenStart); +} +function parseJSXNamespacedName(parser, context, namespace, start) { + consume(parser, context, 21); + const name = parseJSXIdentifier(parser, context); + return parser.finishNode({ + type: 'JSXNamespacedName', + namespace, + name, + }, start); +} +function parseJSXExpressionContainer(parser, context, privateScope, inJSXChild, isAttr) { + const { tokenStart: start } = parser; + nextToken(parser, context | 32); + const { tokenStart } = parser; + if (parser.getToken() === 14) + return parseJSXSpreadChild(parser, context, privateScope, start); + let expression = null; + if (parser.getToken() === 1074790415) { + if (isAttr) + parser.report(157); + expression = parseJSXEmptyExpression(parser, { + index: parser.startIndex, + line: parser.startLine, + column: parser.startColumn, + }); + } + else { + expression = parseExpression(parser, context, privateScope, 1, 0, tokenStart); + } + if (parser.getToken() !== 1074790415) { + parser.report(25, KeywordDescTable[1074790415 & 255]); + } + if (inJSXChild) { + nextJSXToken(parser); + } + else { + nextToken(parser, context); + } + return parser.finishNode({ + type: 'JSXExpressionContainer', + expression, + }, start); +} +function parseJSXSpreadChild(parser, context, privateScope, start) { + consume(parser, context, 14); + const expression = parseExpression(parser, context, privateScope, 1, 0, parser.tokenStart); + consume(parser, context, 1074790415); + return parser.finishNode({ + type: 'JSXSpreadChild', + expression, + }, start); +} +function parseJSXEmptyExpression(parser, start) { + return parser.finishNode({ + type: 'JSXEmptyExpression', + }, start, parser.tokenStart); +} +function parseJSXIdentifier(parser, context) { + const start = parser.tokenStart; + if (!(parser.getToken() & 143360)) { + parser.report(30, KeywordDescTable[parser.getToken() & 255]); + } + const { tokenValue } = parser; + nextToken(parser, context); + return parser.finishNode({ + type: 'JSXIdentifier', + name: tokenValue, + }, start); +} + +var version$1 = "6.1.4"; + +const version = version$1; +function parseScript(source, options) { + return parseSource(source, options); +} +function parseModule(source, options) { + return parseSource(source, options, 1 | 2); +} +function parse(source, options) { + return parseSource(source, options); +} + +exports.parse = parse; +exports.parseModule = parseModule; +exports.parseScript = parseScript; +exports.version = version; diff --git a/node_modules/meriyah/dist/meriyah.min.mjs b/node_modules/meriyah/dist/meriyah.min.mjs new file mode 100644 index 0000000..1e6d38a --- /dev/null +++ b/node_modules/meriyah/dist/meriyah.min.mjs @@ -0,0 +1 @@ +const e=((e,t)=>{const r=new Uint32Array(69632);let n=0,o=0;for(;n<2571;){const a=e[n++];if(a<0)o-=a;else{let i=e[n++];2&a&&(i=t[i]),1&a?r.fill(i,o,o+=e[n++]):r[o++]=i}}return r})([-1,2,26,2,27,2,5,-1,0,77595648,3,44,2,3,0,14,2,63,2,64,3,0,3,0,3168796671,0,4294956992,2,1,2,0,2,41,3,0,4,0,4294966523,3,0,4,2,16,2,65,2,0,0,4294836735,0,3221225471,0,4294901942,2,66,0,134152192,3,0,2,0,4294951935,3,0,2,0,2683305983,0,2684354047,2,18,2,0,0,4294961151,3,0,2,2,19,2,0,0,608174079,2,0,2,60,2,7,2,6,0,4286611199,3,0,2,2,1,3,0,3,0,4294901711,2,40,0,4089839103,0,2961209759,0,1342439375,0,4294543342,0,3547201023,0,1577204103,0,4194240,0,4294688750,2,2,0,80831,0,4261478351,0,4294549486,2,2,0,2967484831,0,196559,0,3594373100,0,3288319768,0,8469959,0,65472,2,3,0,4093640191,0,660618719,0,65487,0,4294828015,0,4092591615,0,1616920031,0,982991,2,3,2,0,0,2163244511,0,4227923919,0,4236247022,2,71,0,4284449919,0,851904,2,4,2,12,0,67076095,-1,2,72,0,1073741743,0,4093607775,-1,0,50331649,0,3265266687,2,33,0,4294844415,0,4278190047,2,20,2,137,-1,3,0,2,2,23,2,0,2,10,2,0,2,15,2,22,3,0,10,2,74,2,0,2,75,2,76,2,77,2,0,2,78,2,0,2,11,0,261632,2,25,3,0,2,2,13,2,4,3,0,18,2,79,2,5,3,0,2,2,80,0,2151677951,2,29,2,9,0,909311,3,0,2,0,814743551,2,49,0,67090432,3,0,2,2,42,2,0,2,6,2,0,2,30,2,8,0,268374015,2,110,2,51,2,0,2,81,0,134153215,-1,2,7,2,0,2,8,0,2684354559,0,67044351,0,3221160064,2,17,-1,3,0,2,2,53,0,1046528,3,0,3,2,9,2,0,2,54,0,4294960127,2,10,2,6,2,11,0,4294377472,2,12,3,0,16,2,13,2,0,2,82,2,10,2,0,2,83,2,84,2,85,0,12288,2,55,0,1048577,2,86,2,14,-1,2,14,0,131042,2,87,2,88,2,89,2,0,2,34,-83,3,0,7,0,1046559,2,0,2,15,2,0,0,2147516671,2,21,3,90,2,2,0,-16,2,91,0,524222462,2,4,2,0,0,4269801471,2,4,3,0,2,2,28,2,16,3,0,2,2,17,2,0,-1,2,18,-16,3,0,206,-2,3,0,692,2,73,-1,2,18,2,10,3,0,8,2,93,2,133,2,0,0,3220242431,3,0,3,2,19,2,94,2,95,3,0,2,2,96,2,0,2,97,2,46,2,0,0,4351,2,0,2,9,3,0,2,0,67043391,0,3909091327,2,0,2,24,2,9,2,20,3,0,2,0,67076097,2,8,2,0,2,21,0,67059711,0,4236247039,3,0,2,0,939524103,0,8191999,2,101,2,102,2,22,2,23,3,0,3,0,67057663,3,0,349,2,103,2,104,2,7,-264,3,0,11,2,24,3,0,2,2,32,-1,0,3774349439,2,105,2,106,3,0,2,2,19,2,107,3,0,10,2,10,2,18,2,0,2,47,2,0,2,31,2,108,2,25,0,1638399,0,57344,2,109,3,0,3,2,20,2,26,2,27,2,5,2,28,2,0,2,8,2,111,-1,2,112,2,113,2,114,-1,3,0,3,2,12,-2,2,0,2,29,-3,0,536870912,-4,2,20,2,0,2,36,0,1,2,0,2,67,2,6,2,12,2,10,2,0,2,115,-1,3,0,4,2,10,2,23,2,116,2,7,2,0,2,117,2,0,2,118,2,119,2,120,2,0,2,9,3,0,9,2,21,2,30,2,31,2,121,2,122,-2,2,123,2,124,2,30,2,21,2,8,-2,2,125,2,30,2,32,-2,2,0,2,39,-2,0,4277137519,0,2269118463,-1,3,20,2,-1,2,33,2,38,2,0,3,30,2,2,35,2,19,-3,3,0,2,2,34,-1,2,0,2,35,2,0,2,35,2,0,2,48,2,0,0,4294950463,2,37,-7,2,0,0,203775,2,57,0,4026531840,2,20,2,43,2,36,2,18,2,37,2,18,2,126,2,21,3,0,2,2,38,0,2151677888,2,0,2,12,0,4294901764,2,144,2,0,2,58,2,56,0,5242879,3,0,2,0,402644511,-1,2,128,2,39,0,3,-1,2,129,2,130,2,0,0,67045375,2,40,0,4226678271,0,3766565279,0,2039759,2,132,2,41,0,1046437,0,6,3,0,2,0,3288270847,0,3,3,0,2,0,67043519,-5,2,0,0,4282384383,0,1056964609,-1,3,0,2,0,67043345,-1,2,0,2,42,2,23,2,50,2,11,2,61,2,38,-5,2,0,2,12,-3,3,0,2,0,2147484671,2,134,0,4190109695,2,52,-2,2,135,0,4244635647,0,27,2,0,2,8,2,43,2,0,2,68,2,18,2,0,2,42,-6,2,0,2,45,2,59,2,44,2,45,2,46,2,47,0,8388351,-2,2,136,0,3028287487,2,48,2,138,0,33259519,2,49,-9,2,21,0,4294836223,0,3355443199,0,134152199,-2,2,69,-2,3,0,28,2,32,-3,3,0,3,2,17,3,0,6,2,50,-81,2,18,3,0,2,2,36,3,0,33,2,25,2,30,3,0,124,2,12,3,0,18,2,38,-213,2,0,2,32,-54,3,0,17,2,42,2,8,2,23,2,0,2,8,2,23,2,51,2,0,2,21,2,52,2,139,2,25,-13,2,0,2,53,-6,3,0,2,-4,3,0,2,0,4294936575,2,0,0,4294934783,-2,0,196635,3,0,191,2,54,3,0,38,2,30,2,55,2,34,-278,2,140,3,0,9,2,141,2,142,2,56,3,0,11,2,7,-72,3,0,3,2,143,0,1677656575,-130,2,26,-16,2,0,2,24,2,38,-16,0,4161266656,0,4071,0,15360,-4,2,57,-13,3,0,2,2,58,2,0,2,145,2,146,2,62,2,0,2,147,2,148,2,149,3,0,10,2,150,2,151,2,22,3,58,2,3,152,2,3,59,2,0,4294954999,2,0,-16,2,0,2,92,2,0,0,2105343,0,4160749584,0,65534,-34,2,8,2,154,-6,0,4194303871,0,4294903771,2,0,2,60,2,100,-3,2,0,0,1073684479,0,17407,-9,2,18,2,17,2,0,2,32,-14,2,18,2,32,-6,2,18,2,12,-15,2,155,3,0,6,0,8323103,-1,3,0,2,2,61,-37,2,62,2,156,2,157,2,158,2,159,2,160,-105,2,26,-32,3,0,1335,-1,3,0,129,2,32,3,0,6,2,10,3,0,180,2,161,3,0,233,2,162,3,0,18,2,10,-77,3,0,16,2,10,-47,3,0,154,2,6,3,0,130,2,25,-22250,3,0,7,2,25,-6130,3,5,2,-1,0,69207040,3,44,2,3,0,14,2,63,2,64,-3,0,3168731136,0,4294956864,2,1,2,0,2,41,3,0,4,0,4294966275,3,0,4,2,16,2,65,2,0,2,34,-1,2,18,2,66,-1,2,0,0,2047,0,4294885376,3,0,2,0,3145727,0,2617294944,0,4294770688,2,25,2,67,3,0,2,0,131135,2,98,0,70256639,0,71303167,0,272,2,42,2,6,0,32511,2,0,2,49,-1,2,99,2,68,0,4278255616,0,4294836227,0,4294549473,0,600178175,0,2952806400,0,268632067,0,4294543328,0,57540095,0,1577058304,0,1835008,0,4294688736,2,70,2,69,0,33554435,2,131,2,70,0,2952790016,0,131075,0,3594373096,0,67094296,2,69,-1,0,4294828e3,0,603979263,0,654311424,0,3,0,4294828001,0,602930687,0,1610612736,0,393219,0,4294828016,0,671088639,0,2154840064,0,4227858435,0,4236247008,2,71,2,38,-1,2,4,0,917503,2,38,-1,2,72,0,537788335,0,4026531935,-1,0,1,-1,2,33,2,73,0,7936,-3,2,0,0,2147485695,0,1010761728,0,4292984930,0,16387,2,0,2,15,2,22,3,0,10,2,74,2,0,2,75,2,76,2,77,2,0,2,78,2,0,2,12,-1,2,25,3,0,2,2,13,2,4,3,0,18,2,79,2,5,3,0,2,2,80,0,2147745791,3,19,2,0,122879,2,0,2,9,0,276824064,-2,3,0,2,2,42,2,0,0,4294903295,2,0,2,30,2,8,-1,2,18,2,51,2,0,2,81,2,49,-1,2,21,2,0,2,29,-2,0,128,-2,2,28,2,9,0,8160,-1,2,127,0,4227907585,2,0,2,37,2,0,2,50,0,4227915776,2,10,2,6,2,11,-1,0,74440192,3,0,6,-2,3,0,8,2,13,2,0,2,82,2,10,2,0,2,83,2,84,2,85,-3,2,86,2,14,-3,2,87,2,88,2,89,2,0,2,34,-83,3,0,7,0,817183,2,0,2,15,2,0,0,33023,2,21,3,90,2,-17,2,91,0,524157950,2,4,2,0,2,92,2,4,2,0,2,22,2,28,2,16,3,0,2,2,17,2,0,-1,2,18,-16,3,0,206,-2,3,0,692,2,73,-1,2,18,2,10,3,0,8,2,93,0,3072,2,0,0,2147516415,2,10,3,0,2,2,25,2,94,2,95,3,0,2,2,96,2,0,2,97,2,46,0,4294965179,0,7,2,0,2,9,2,95,2,9,-1,0,1761345536,2,98,0,4294901823,2,38,2,20,2,99,2,35,2,100,0,2080440287,2,0,2,34,2,153,0,3296722943,2,0,0,1046675455,0,939524101,0,1837055,2,101,2,102,2,22,2,23,3,0,3,0,7,3,0,349,2,103,2,104,2,7,-264,3,0,11,2,24,3,0,2,2,32,-1,0,2700607615,2,105,2,106,3,0,2,2,19,2,107,3,0,10,2,10,2,18,2,0,2,47,2,0,2,31,2,108,-3,2,109,3,0,3,2,20,-1,3,5,2,2,110,2,0,2,8,2,111,-1,2,112,2,113,2,114,-1,3,0,3,2,12,-2,2,0,2,29,-8,2,20,2,0,2,36,-1,2,0,2,67,2,6,2,30,2,10,2,0,2,115,-1,3,0,4,2,10,2,18,2,116,2,7,2,0,2,117,2,0,2,118,2,119,2,120,2,0,2,9,3,0,9,2,21,2,30,2,31,2,121,2,122,-2,2,123,2,124,2,30,2,21,2,8,-2,2,125,2,30,2,32,-2,2,0,2,39,-2,0,4277075969,2,30,-1,3,20,2,-1,2,33,2,126,2,0,3,30,2,2,35,2,19,-3,3,0,2,2,34,-1,2,0,2,35,2,0,2,35,2,0,2,50,2,98,0,4294934591,2,37,-7,2,0,0,197631,2,57,-1,2,20,2,43,2,37,2,18,0,3,2,18,2,126,2,21,2,127,2,54,-1,0,2490368,2,127,2,25,2,18,2,34,2,127,2,38,0,4294901904,0,4718591,2,127,2,35,0,335544350,-1,2,128,0,2147487743,0,1,-1,2,129,2,130,2,8,-1,2,131,2,70,0,3758161920,0,3,2,132,0,12582911,0,655360,-1,2,0,2,29,0,2147485568,0,3,2,0,2,25,0,176,-5,2,0,2,17,0,251658240,-1,2,0,2,25,0,16,-1,2,0,0,16779263,-2,2,12,-1,2,38,-5,2,0,2,133,-3,3,0,2,2,55,2,134,0,2147549183,0,2,-2,2,135,2,36,0,10,0,4294965249,0,67633151,0,4026597376,2,0,0,536871935,2,18,2,0,2,42,-6,2,0,0,1,2,59,2,17,0,1,2,46,2,25,-3,2,136,2,36,2,137,2,138,0,16778239,-10,2,35,0,4294836212,2,9,-3,2,69,-2,3,0,28,2,32,-3,3,0,3,2,17,3,0,6,2,50,-81,2,18,3,0,2,2,36,3,0,33,2,25,0,126,3,0,124,2,12,3,0,18,2,38,-213,2,10,-55,3,0,17,2,42,2,8,2,18,2,0,2,8,2,18,2,60,2,0,2,25,2,50,2,139,2,25,-13,2,0,2,73,-6,3,0,2,-4,3,0,2,0,67583,-1,2,107,-2,0,11,3,0,191,2,54,3,0,38,2,30,2,55,2,34,-278,2,140,3,0,9,2,141,2,142,2,56,3,0,11,2,7,-72,3,0,3,2,143,2,144,-187,3,0,2,2,58,2,0,2,145,2,146,2,62,2,0,2,147,2,148,2,149,3,0,10,2,150,2,151,2,22,3,58,2,3,152,2,3,59,2,2,153,-57,2,8,2,154,-7,2,18,2,0,2,60,-4,2,0,0,1065361407,0,16384,-9,2,18,2,60,2,0,2,133,-14,2,18,2,133,-6,2,18,0,81919,-15,2,155,3,0,6,2,126,-1,3,0,2,0,2063,-37,2,62,2,156,2,157,2,158,2,159,2,160,-138,3,0,1335,-1,3,0,129,2,32,3,0,6,2,10,3,0,180,2,161,3,0,233,2,162,3,0,18,2,10,-77,3,0,16,2,10,-47,3,0,154,2,6,3,0,130,2,25,-28386],[4294967295,4294967291,4092460543,4294828031,4294967294,134217726,4294903807,268435455,2147483647,1048575,1073741823,3892314111,134217727,1061158911,536805376,4294910143,4294901759,32767,4294901760,262143,536870911,8388607,4160749567,4294902783,4294918143,65535,67043328,2281701374,4294967264,2097151,4194303,255,67108863,4294967039,511,524287,131071,63,127,3238002687,4294549487,4290772991,33554431,4294901888,4286578687,67043329,4294705152,4294770687,67043583,1023,15,2047999,67043343,67051519,16777215,2147483648,4294902e3,28,4292870143,4294966783,16383,67047423,4294967279,262083,20511,41943039,493567,4294959104,603979775,65536,602799615,805044223,4294965206,8191,1031749119,4294917631,2134769663,4286578493,4282253311,4294942719,33540095,4294905855,2868854591,1608515583,265232348,534519807,2147614720,1060109444,4093640016,17376,2139062143,224,4169138175,4294909951,4286578688,4294967292,4294965759,535511039,4294966272,4294967280,32768,8289918,4294934399,4294901775,4294965375,1602223615,4294967259,4294443008,268369920,4292804608,4294967232,486341884,4294963199,3087007615,1073692671,4128527,4279238655,4294902015,4160684047,4290246655,469499899,4294967231,134086655,4294966591,2445279231,3670015,31,4294967288,4294705151,3221208447,4294902271,4294549472,4294921215,4095,4285526655,4294966527,4294966143,64,4294966719,3774873592,1877934080,262151,2555904,536807423,67043839,3758096383,3959414372,3755993023,2080374783,4294835295,4294967103,4160749565,4294934527,4087,2016,2147446655,184024726,2862017156,1593309078,268434431,268434414,4294901763,4294901761]),t=t=>!!(1&e[34816+(t>>>5)]>>>t);function r(e){return e.column++,e.currentChar=e.source.charCodeAt(++e.index)}function n(e){const t=e.currentChar;if(55296!=(64512&t))return 0;const r=e.source.charCodeAt(e.index+1);return 56320!=(64512&r)?0:65536+((1023&t)<<10)+(1023&r)}function o(e,t){e.currentChar=e.source.charCodeAt(++e.index),e.flags|=1,4&t||(e.column=0,e.line++)}function a(e){e.flags|=1,e.currentChar=e.source.charCodeAt(++e.index),e.column=0,e.line++}function i(e){return e<65?e-48:e-65+10&15}function s(e){switch(e){case 134283266:return"NumericLiteral";case 134283267:return"StringLiteral";case 86021:case 86022:return"BooleanLiteral";case 86023:return"NullLiteral";case 65540:return"RegularExpression";case 67174408:case 67174409:case 131:return"TemplateLiteral";default:return 143360&~e?4096&~e?"Punctuator":"Keyword":"Identifier"}}const c=[0,0,0,0,0,0,0,0,0,0,1032,0,0,2056,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8192,0,3,0,0,8192,0,0,0,256,0,33024,0,0,242,242,114,114,114,114,114,114,594,594,0,0,16384,0,0,0,0,67,67,67,67,67,67,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,0,1,0,0,4099,0,71,71,71,71,71,71,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,16384,0,0,0,0],l=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0],u=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0];function p(e){return e<=127?l[e]>0:t(e)}function d(t){return t<=127?u[t]>0:(t=>!!(1&e[0+(t>>>5)]>>>t))(t)||8204===t||8205===t}const g=["SingleLine","MultiLine","HTMLOpen","HTMLClose","HashbangComment"];function f(e,t,r,n,o,a){return 2&n&&e.report(0),k(e,t,r,o,a)}function k(e,t,n,o,i){const{index:s}=e;for(e.tokenIndex=e.index,e.tokenLine=e.line,e.tokenColumn=e.column;e.index=e.source.length)return e.report(34)}const o=e.index-1;let a=b.Empty,i=e.currentChar;const{index:s}=e;for(;d(i);){switch(i){case 103:a&b.Global&&e.report(36,"g"),a|=b.Global;break;case 105:a&b.IgnoreCase&&e.report(36,"i"),a|=b.IgnoreCase;break;case 109:a&b.Multiline&&e.report(36,"m"),a|=b.Multiline;break;case 117:a&b.Unicode&&e.report(36,"u"),a&b.UnicodeSets&&e.report(36,"vu"),a|=b.Unicode;break;case 118:a&b.Unicode&&e.report(36,"uv"),a&b.UnicodeSets&&e.report(36,"v"),a|=b.UnicodeSets;break;case 121:a&b.Sticky&&e.report(36,"y"),a|=b.Sticky;break;case 115:a&b.DotAll&&e.report(36,"s"),a|=b.DotAll;break;case 100:a&b.Indices&&e.report(36,"d"),a|=b.Indices;break;default:e.report(35)}i=r(e)}const c=e.source.slice(s,e.index),l=e.source.slice(t,o);return e.tokenRegExp={pattern:l,flags:c},e.options.raw&&(e.tokenRaw=e.source.slice(e.tokenIndex,e.index)),e.tokenValue=function(e,t,r){try{return new RegExp(t,r)}catch{try{return new RegExp(t,r),null}catch{e.report(34)}}}(e,l,c),65540}function y(e,t,n){const{index:o}=e;let a="",i=r(e),s=e.index;for(;!(8&c[i]);){if(i===n)return a+=e.source.slice(s,e.index),r(e),e.options.raw&&(e.tokenRaw=e.source.slice(o,e.index)),e.tokenValue=a,134283267;if(8&~i||92!==i)8232!==i&&8233!==i||(e.column=-1,e.line++);else{if(a+=e.source.slice(s,e.index),i=r(e),i<127||8232===i||8233===i){const r=x(e,t,i);r>=0?a+=String.fromCodePoint(r):w(e,r,0)}else a+=String.fromCodePoint(i);s=e.index+1}e.index>=e.end&&e.report(16),i=r(e)}e.report(16)}function x(e,t,n,o=0){switch(n){case 98:return 8;case 102:return 12;case 114:return 13;case 110:return 10;case 116:return 9;case 118:return 11;case 13:if(e.index1114111)return-5;return e.currentChar<1||125!==e.currentChar?-4:t}{if(!(64&c[t]))return-4;const r=e.source.charCodeAt(e.index+1);if(!(64&c[r]))return-4;const n=e.source.charCodeAt(e.index+2);if(!(64&c[n]))return-4;const o=e.source.charCodeAt(e.index+3);return 64&c[o]?(e.index+=3,e.column+=3,e.currentChar=e.source.charCodeAt(e.index),i(t)<<12|i(r)<<8|i(n)<<4|i(o)):-4}}case 56:case 57:if(o||!e.options.webcompat||1&t)return-3;e.flags|=4096;default:return n}}function w(e,t,r){switch(t){case-1:return;case-2:e.report(r?2:1);case-3:e.report(r?3:14);case-4:e.report(7);case-5:e.report(104)}}function S(e,t){const{index:n}=e;let o=67174409,a="",i=r(e);for(;96!==i;){if(36===i&&123===e.source.charCodeAt(e.index+1)){r(e),o=67174408;break}if(92===i)if(i=r(e),i>126)a+=String.fromCodePoint(i);else{const{index:r,line:n,column:s}=e,c=x(e,1|t,i,1);if(c>=0)a+=String.fromCodePoint(c);else{if(-1!==c&&64&t){e.index=r,e.line=n,e.column=s,a=null,i=v(e,i),i<0&&(o=67174408);break}w(e,c,1)}}else e.index=e.end&&e.report(17),i=r(e)}return r(e),e.tokenValue=a,e.tokenRaw=e.source.slice(n+1,e.index-(67174409===o?1:2)),o}function v(e,t){for(;96!==t;){switch(t){case 36:{const r=e.index+1;if(r=e.end&&e.report(17),t=r(e)}return t}function C(e,t){return e.index>=e.end&&e.report(0),e.index--,e.column--,S(e,t)}!function(e){e[e.Empty=0]="Empty",e[e.Escape=1]="Escape",e[e.Class=2]="Class"}(m||(m={})),function(e){e[e.Empty=0]="Empty",e[e.IgnoreCase=1]="IgnoreCase",e[e.Global=2]="Global",e[e.Multiline=4]="Multiline",e[e.Unicode=16]="Unicode",e[e.Sticky=8]="Sticky",e[e.DotAll=32]="DotAll",e[e.Indices=64]="Indices",e[e.UnicodeSets=128]="UnicodeSets"}(b||(b={}));const q={0:"Unexpected token",30:"Unexpected token: '%0'",1:"Octal escape sequences are not allowed in strict mode",2:"Octal escape sequences are not allowed in template strings",3:"\\8 and \\9 are not allowed in template strings",4:"Private identifier #%0 is not defined",5:"Illegal Unicode escape sequence",6:"Invalid code point %0",7:"Invalid hexadecimal escape sequence",9:"Octal literals are not allowed in strict mode",8:"Decimal integer literals with a leading zero are forbidden in strict mode",10:"Expected number in radix %0",151:"Invalid left-hand side assignment to a destructible right-hand side",11:"Non-number found after exponent indicator",12:"Invalid BigIntLiteral",13:"No identifiers allowed directly after numeric literal",14:"Escapes \\8 or \\9 are not syntactically valid escapes",15:"Escapes \\8 or \\9 are not allowed in strict mode",16:"Unterminated string literal",17:"Unterminated template literal",18:"Multiline comment was not closed properly",19:"The identifier contained dynamic unicode escape that was not closed",20:"Illegal character '%0'",21:"Missing hexadecimal digits",22:"Invalid implicit octal",23:"Invalid line break in string literal",24:"Only unicode escapes are legal in identifier names",25:"Expected '%0'",26:"Invalid left-hand side in assignment",27:"Invalid left-hand side in async arrow",28:'Calls to super must be in the "constructor" method of a class expression or class declaration that has a superclass',29:"Member access on super must be in a method",31:"Await expression not allowed in formal parameter",32:"Yield expression not allowed in formal parameter",95:"Unexpected token: 'escaped keyword'",33:"Unary expressions as the left operand of an exponentiation expression must be disambiguated with parentheses",123:"Async functions can only be declared at the top level or inside a block",34:"Unterminated regular expression",35:"Unexpected regular expression flag",36:"Duplicate regular expression flag '%0'",37:"%0 functions must have exactly %1 argument%2",38:"Setter function argument must not be a rest parameter",39:"%0 declaration must have a name in this context",40:"Function name may not contain any reserved words or be eval or arguments in strict mode",41:"The rest operator is missing an argument",42:"A getter cannot be a generator",43:"A setter cannot be a generator",44:"A computed property name must be followed by a colon or paren",134:"Object literal keys that are strings or numbers must be a method or have a colon",46:"Found `* async x(){}` but this should be `async * x(){}`",45:"Getters and setters can not be generators",47:"'%0' can not be generator method",48:"No line break is allowed after '=>'",49:"The left-hand side of the arrow can only be destructed through assignment",50:"The binding declaration is not destructible",51:"Async arrow can not be followed by new expression",52:"Classes may not have a static property named 'prototype'",53:"Class constructor may not be a %0",54:"Duplicate constructor method in class",55:"Invalid increment/decrement operand",56:"Invalid use of `new` keyword on an increment/decrement expression",57:"`=>` is an invalid assignment target",58:"Rest element may not have a trailing comma",59:"Missing initializer in %0 declaration",60:"'for-%0' loop head declarations can not have an initializer",61:"Invalid left-hand side in for-%0 loop: Must have a single binding",62:"Invalid shorthand property initializer",63:"Property name __proto__ appears more than once in object literal",64:"Let is disallowed as a lexically bound name",65:"Invalid use of '%0' inside new expression",66:"Illegal 'use strict' directive in function with non-simple parameter list",67:'Identifier "let" disallowed as left-hand side expression in strict mode',68:"Illegal continue statement",69:"Illegal break statement",70:"Cannot have `let[...]` as a var name in strict mode",71:"Invalid destructuring assignment target",72:"Rest parameter may not have a default initializer",73:"The rest argument must the be last parameter",74:"Invalid rest argument",76:"In strict mode code, functions can only be declared at top level or inside a block",77:"In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement",78:"Without web compatibility enabled functions can not be declared at top level, inside a block, or as the body of an if statement",79:"Class declaration can't appear in single-statement context",80:"Invalid left-hand side in for-%0",81:"Invalid assignment in for-%0",82:"for await (... of ...) is only valid in async functions and async generators",83:"The first token after the template expression should be a continuation of the template",85:"`let` declaration not allowed here and `let` cannot be a regular var name in strict mode",84:"`let \n [` is a restricted production at the start of a statement",86:"Catch clause requires exactly one parameter, not more (and no trailing comma)",87:"Catch clause parameter does not support default values",88:"Missing catch or finally after try",89:"More than one default clause in switch statement",90:"Illegal newline after throw",91:"Strict mode code may not include a with statement",92:"Illegal return statement",93:"The left hand side of the for-header binding declaration is not destructible",94:"new.target only allowed within functions or static blocks",96:"'#' not followed by identifier",102:"Invalid keyword",101:"Can not use 'let' as a class name",100:"'A lexical declaration can't define a 'let' binding",99:"Can not use `let` as variable name in strict mode",97:"'%0' may not be used as an identifier in this context",98:"Await is only valid in async functions",103:"The %0 keyword can only be used with the module goal",104:"Unicode codepoint must not be greater than 0x10FFFF",105:"%0 source must be string",106:"Only a identifier or string can be used to indicate alias",107:"Only '*' or '{...}' can be imported after default",108:"Trailing decorator may be followed by method",109:"Decorators can't be used with a constructor",110:"Can not use `await` as identifier in module or async func",111:"Can not use `await` as identifier in module",112:"HTML comments are only allowed with web compatibility (Annex B)",113:"The identifier 'let' must not be in expression position in strict mode",114:"Cannot assign to `eval` and `arguments` in strict mode",115:"The left-hand side of a for-of loop may not start with 'let'",116:"Block body arrows can not be immediately invoked without a group",117:"Block body arrows can not be immediately accessed without a group",118:"Unexpected strict mode reserved word",119:"Unexpected eval or arguments in strict mode",120:"Decorators must not be followed by a semicolon",121:"Calling delete on expression not allowed in strict mode",122:"Pattern can not have a tail",124:"Can not have a `yield` expression on the left side of a ternary",125:"An arrow function can not have a postfix update operator",126:"Invalid object literal key character after generator star",127:"Private fields can not be deleted",129:"Classes may not have a field called constructor",128:"Classes may not have a private element named constructor",130:"A class field initializer or static block may not contain arguments",131:"Generators can only be declared at the top level or inside a block",132:"Async methods are a restricted production and cannot have a newline following it",133:"Unexpected character after object literal property name",135:"Invalid key token",136:"Label '%0' has already been declared",137:"continue statement must be nested within an iteration statement",138:"Undefined label '%0'",139:"Trailing comma is disallowed inside import(...) arguments",140:"Invalid binding in JSON import",141:"import() requires exactly one argument",142:"Cannot use new with import(...)",143:"... is not allowed in import()",144:"Expected '=>'",145:"Duplicate binding '%0'",146:"Duplicate private identifier #%0",147:"Cannot export a duplicate name '%0'",150:"Duplicate %0 for-binding",148:"Exported binding '%0' needs to refer to a top-level declared variable",149:"Unexpected private field",153:"Numeric separators are not allowed at the end of numeric literals",152:"Only one underscore is allowed as numeric separator",154:"JSX value should be either an expression or a quoted JSX text",155:"Expected corresponding JSX closing tag for %0",156:"Adjacent JSX elements must be wrapped in an enclosing tag",157:"JSX attributes must only be assigned a non-empty 'expression'",158:"'%0' has already been declared",159:"'%0' shadowed a catch clause binding",160:"Dot property must be an identifier",161:"Encountered invalid input after spread/rest argument",162:"Catch without try",163:"Finally without try",164:"Expected corresponding closing tag for JSX fragment",165:"Coalescing and logical operators used together in the same expression must be disambiguated with parentheses",166:"Invalid tagged template on optional chain",167:"Invalid optional chain from super property",168:"Invalid optional chain from new expression",169:'Cannot use "import.meta" outside a module',170:"Leading decorators must be attached to a class declaration",171:"An export name cannot include a lone surrogate, found %0",172:"A string literal cannot be used as an exported binding without `from`",173:"Private fields can't be accessed on super",174:"The only valid meta property for import is 'import.meta'",175:"'import.meta' must not contain escaped characters",176:'cannot use "await" as identifier inside an async function',177:'cannot use "await" in static blocks'};class E extends SyntaxError{start;end;range;loc;description;constructor(e,t,r,...n){const o=q[r].replace(/%(\d+)/g,((e,t)=>n[t]));super("["+e.line+":"+e.column+"-"+t.line+":"+t.column+"]: "+o),this.start=e.index,this.end=t.index,this.range=[e.index,t.index],this.loc={start:{line:e.line,column:e.column},end:{line:t.line,column:t.column}},this.description=o}}function N(e,t,n){let o=e.currentChar,a=0,s=9,l=64&n?0:1,u=0,d=0;if(64&n)a="."+L(e,o),o=e.currentChar,110===o&&e.report(12);else{if(48===o)if(o=r(e),120==(32|o)){for(n=136,o=r(e);4160&c[o];)95!==o?(d=1,a=16*a+i(o),u++,o=r(e)):(d||e.report(152),d=0,o=r(e));0!==u&&d||e.report(0===u?21:153)}else if(111==(32|o)){for(n=132,o=r(e);4128&c[o];)95!==o?(d=1,a=8*a+(o-48),u++,o=r(e)):(d||e.report(152),d=0,o=r(e));0!==u&&d||e.report(0===u?0:153)}else if(98==(32|o)){for(n=130,o=r(e);4224&c[o];)95!==o?(d=1,a=2*a+(o-48),u++,o=r(e)):(d||e.report(152),d=0,o=r(e));0!==u&&d||e.report(0===u?0:153)}else if(32&c[o])for(1&t&&e.report(1),n=1;16&c[o];){if(512&c[o]){n=32,l=0;break}a=8*a+(o-48),o=r(e)}else 512&c[o]?(1&t&&e.report(1),e.flags|=64,n=32):95===o&&e.report(0);if(48&n){if(l){for(;s>=0&&4112&c[o];)if(95!==o)d=0,a=10*a+(o-48),o=r(e),--s;else{if(o=r(e),95===o||32&n)throw new E(e.currentLocation,{index:e.index+1,line:e.line,column:e.column},152);d=1}if(d)throw new E(e.currentLocation,{index:e.index+1,line:e.line,column:e.column},153);if(s>=0&&!p(o)&&46!==o)return e.tokenValue=a,e.options.raw&&(e.tokenRaw=e.source.slice(e.tokenIndex,e.index)),134283266}a+=L(e,o),o=e.currentChar,46===o&&(95===r(e)&&e.report(0),n=64,a+="."+L(e,e.currentChar),o=e.currentChar)}}const g=e.index;let f=0;if(110===o&&128&n)f=1,o=r(e);else if(101==(32|o)){o=r(e),256&c[o]&&(o=r(e));const{index:t}=e;16&c[o]||e.report(11),a+=e.source.substring(g,t)+L(e,o),o=e.currentChar}return(e.index","(","{",".","...","}",")",";",",","[","]",":","?","'",'"',"++","--","=","<<=",">>=",">>>=","**=","+=","-=","*=","/=","%=","^=","|=","&=","||=","&&=","??=","typeof","delete","void","!","~","+","-","in","instanceof","*","%","/","**","&&","||","===","!==","==","!=","<=",">=","<",">","<<",">>",">>>","&","|","^","var","let","const","break","case","catch","class","continue","debugger","default","do","else","export","extends","finally","for","function","if","import","new","return","super","switch","this","throw","try","while","with","implements","interface","package","private","protected","public","static","yield","as","async","await","constructor","get","set","accessor","from","of","enum","eval","arguments","escaped keyword","escaped future reserved keyword","reserved if strict","#","BigIntLiteral","??","?.","WhiteSpace","Illegal","LineTerminator","PrivateField","Template","@","target","meta","LineFeed","Escaped","JSXText"],I={this:86111,function:86104,if:20569,return:20572,var:86088,else:20563,for:20567,new:86107,in:8673330,typeof:16863275,while:20578,case:20556,break:20555,try:20577,catch:20557,delete:16863276,throw:86112,switch:86110,continue:20559,default:20561,instanceof:8411187,do:20562,void:16863277,finally:20566,async:209005,await:209006,class:86094,const:86090,constructor:12399,debugger:20560,export:20564,extends:20565,false:86021,from:209011,get:209008,implements:36964,import:86106,interface:36965,let:241737,null:86023,of:471156,package:36966,private:36967,protected:36968,public:36969,set:209009,static:36970,super:86109,true:86022,with:20579,yield:241771,enum:86133,eval:537079926,as:77932,arguments:537079927,target:209029,meta:209030,accessor:12402};function V(e,t){!(1&e.flags)&&1048576&~e.getToken()&&e.report(30,A[255&e.getToken()]),B(e,t,1074790417)||e.options.onInsertedSemicolon?.(e.startIndex)}function D(e,t,r,n){return t-r<13&&"use strict"===n&&(!(1048576&~e.getToken())||1&e.flags)?1:0}function R(e,t,r){return e.getToken()!==r?0:(W(e,t),1)}function B(e,t,r){return e.getToken()===r&&(W(e,t),!0)}function U(e,t,r){e.getToken()!==r&&e.report(25,A[255&r]),W(e,t)}function P(e,t){switch(t.type){case"ArrayExpression":{t.type="ArrayPattern";const{elements:r}=t;for(let t=0,n=r.length;t0)d(t)||e.report(20,String.fromCodePoint(t)),e.currentChar=t,e.index++,e.column++;else if(!d(e.currentChar))break;r(e)}e.index<=e.end&&(e.tokenValue+=e.source.slice(i,e.index));const{length:s}=e.tokenValue;if(a&&s>=2&&s<=11){const r=z(I,e.tokenValue);return void 0===r?208897|(o?-2147483648:0):o?209006===r?2050&t?-2147483528:-2147483648|r:1&t?36970===r?-2147483527:36864&~r?20480&~r?-2147274630:262144&t&&!(8&t)?-2147483648|r:-2147483528:-2147483527:!(262144&t)||8&t||20480&~r?241771===r?262144&t?-2147274630:1024&t?-2147483528:-2147483648|r:209005===r?-2147274630:36864&~r?-2147483528:12288|r|-2147483648:-2147483648|r:r}return 208897|(o?-2147483648:0)}function Y(e){let t=r(e);if(92===t)return 130;const o=n(e);return o&&(t=o),p(t)||e.report(96),130}function Z(e){return 117!==e.source.charCodeAt(e.index+1)&&e.report(5),e.currentChar=e.source.charCodeAt(e.index+=2),e.column+=2,function(e){let t=0;const n=e.currentChar;if(123===n){const n=e.index-2;for(;64&c[r(e)];)if(t=t<<4|i(e.currentChar),t>1114111)throw new E({index:n,line:e.line,column:e.column},e.currentLocation,104);if(125!==e.currentChar)throw new E({index:n,line:e.line,column:e.column},e.currentLocation,7);return r(e),t}64&c[n]||e.report(7);const o=e.source.charCodeAt(e.index+1);64&c[o]||e.report(7);const a=e.source.charCodeAt(e.index+2);64&c[a]||e.report(7);const s=e.source.charCodeAt(e.index+3);64&c[s]||e.report(7);return t=i(n)<<12|i(o)<<8|i(a)<<4|i(s),e.currentChar=e.source.charCodeAt(e.index+=4),e.column+=4,t}(e)}const K=[128,128,128,128,128,128,128,128,128,127,135,127,127,129,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,127,16842798,134283267,130,208897,8391477,8390213,134283267,67174411,16,8391476,25233968,18,25233969,67108877,8457014,134283266,134283266,134283266,134283266,134283266,134283266,134283266,134283266,134283266,134283266,21,1074790417,8456256,1077936155,8390721,22,132,208897,208897,208897,208897,208897,208897,208897,208897,208897,208897,208897,208897,208897,208897,208897,208897,208897,208897,208897,208897,208897,208897,208897,208897,208897,208897,69271571,136,20,8389959,208897,131,4096,4096,4096,4096,4096,4096,4096,208897,4096,208897,208897,4096,208897,4096,208897,4096,208897,4096,4096,4096,208897,4096,4096,208897,4096,4096,2162700,8389702,1074790415,16842799,128];function W(e,t){e.flags=1^(1|e.flags),e.startIndex=e.index,e.startColumn=e.column,e.startLine=e.line,e.setToken(Q(e,t,0))}function Q(e,i,s){const c=0===e.index,{source:l}=e;let u=e.currentLocation;for(;e.index=e.end)return 8391476;const t=e.currentChar;return 61===t?(r(e),4194338):42!==t?8391476:61!==r(e)?8391735:(r(e),4194335)}case 8389959:return 61!==r(e)?8389959:(r(e),4194341);case 25233968:{r(e);const t=e.currentChar;return 43===t?(r(e),33619993):61===t?(r(e),4194336):25233968}case 25233969:{r(e);const t=e.currentChar;if(45===t){if(r(e),(1&s||c)&&62===e.currentChar){e.options.webcompat||e.report(112),r(e),s=f(e,l,s,i,3,u),u=e.tokenStart;continue}return 33619994}return 61===t?(r(e),4194337):25233969}case 8457014:if(r(e),e.index=48&&t<=57)return N(e,i,80);if(46===t){const t=e.index+1;if(t=48&&t<=57)))return r(e),67108990}return 22}}}else{if((8232^d)<=1){s=-5&s|1,a(e);continue}const o=n(e);if(o>0&&(d=o),t(d))return e.tokenValue="",$(e,i,0,0);if(160===(p=d)||65279===p||133===p||5760===p||p>=8192&&p<=8203||8239===p||8287===p||12288===p||8201===p||65519===p){r(e);continue}e.report(20,String.fromCodePoint(d))}}var p;return 1048576}const ee={AElig:"Æ",AMP:"&",Aacute:"Á",Abreve:"Ă",Acirc:"Â",Acy:"А",Afr:"𝔄",Agrave:"À",Alpha:"Α",Amacr:"Ā",And:"⩓",Aogon:"Ą",Aopf:"𝔸",ApplyFunction:"⁡",Aring:"Å",Ascr:"𝒜",Assign:"≔",Atilde:"Ã",Auml:"Ä",Backslash:"∖",Barv:"⫧",Barwed:"⌆",Bcy:"Б",Because:"∵",Bernoullis:"ℬ",Beta:"Β",Bfr:"𝔅",Bopf:"𝔹",Breve:"˘",Bscr:"ℬ",Bumpeq:"≎",CHcy:"Ч",COPY:"©",Cacute:"Ć",Cap:"⋒",CapitalDifferentialD:"ⅅ",Cayleys:"ℭ",Ccaron:"Č",Ccedil:"Ç",Ccirc:"Ĉ",Cconint:"∰",Cdot:"Ċ",Cedilla:"¸",CenterDot:"·",Cfr:"ℭ",Chi:"Χ",CircleDot:"⊙",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",Colon:"∷",Colone:"⩴",Congruent:"≡",Conint:"∯",ContourIntegral:"∮",Copf:"ℂ",Coproduct:"∐",CounterClockwiseContourIntegral:"∳",Cross:"⨯",Cscr:"𝒞",Cup:"⋓",CupCap:"≍",DD:"ⅅ",DDotrahd:"⤑",DJcy:"Ђ",DScy:"Ѕ",DZcy:"Џ",Dagger:"‡",Darr:"↡",Dashv:"⫤",Dcaron:"Ď",Dcy:"Д",Del:"∇",Delta:"Δ",Dfr:"𝔇",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",Diamond:"⋄",DifferentialD:"ⅆ",Dopf:"𝔻",Dot:"¨",DotDot:"⃜",DotEqual:"≐",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",DownBreve:"̑",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",DownTeeArrow:"↧",Downarrow:"⇓",Dscr:"𝒟",Dstrok:"Đ",ENG:"Ŋ",ETH:"Ð",Eacute:"É",Ecaron:"Ě",Ecirc:"Ê",Ecy:"Э",Edot:"Ė",Efr:"𝔈",Egrave:"È",Element:"∈",Emacr:"Ē",EmptySmallSquare:"◻",EmptyVerySmallSquare:"▫",Eogon:"Ę",Eopf:"𝔼",Epsilon:"Ε",Equal:"⩵",EqualTilde:"≂",Equilibrium:"⇌",Escr:"ℰ",Esim:"⩳",Eta:"Η",Euml:"Ë",Exists:"∃",ExponentialE:"ⅇ",Fcy:"Ф",Ffr:"𝔉",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",Fopf:"𝔽",ForAll:"∀",Fouriertrf:"ℱ",Fscr:"ℱ",GJcy:"Ѓ",GT:">",Gamma:"Γ",Gammad:"Ϝ",Gbreve:"Ğ",Gcedil:"Ģ",Gcirc:"Ĝ",Gcy:"Г",Gdot:"Ġ",Gfr:"𝔊",Gg:"⋙",Gopf:"𝔾",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",Gt:"≫",HARDcy:"Ъ",Hacek:"ˇ",Hat:"^",Hcirc:"Ĥ",Hfr:"ℌ",HilbertSpace:"ℋ",Hopf:"ℍ",HorizontalLine:"─",Hscr:"ℋ",Hstrok:"Ħ",HumpDownHump:"≎",HumpEqual:"≏",IEcy:"Е",IJlig:"IJ",IOcy:"Ё",Iacute:"Í",Icirc:"Î",Icy:"И",Idot:"İ",Ifr:"ℑ",Igrave:"Ì",Im:"ℑ",Imacr:"Ī",ImaginaryI:"ⅈ",Implies:"⇒",Int:"∬",Integral:"∫",Intersection:"⋂",InvisibleComma:"⁣",InvisibleTimes:"⁢",Iogon:"Į",Iopf:"𝕀",Iota:"Ι",Iscr:"ℐ",Itilde:"Ĩ",Iukcy:"І",Iuml:"Ï",Jcirc:"Ĵ",Jcy:"Й",Jfr:"𝔍",Jopf:"𝕁",Jscr:"𝒥",Jsercy:"Ј",Jukcy:"Є",KHcy:"Х",KJcy:"Ќ",Kappa:"Κ",Kcedil:"Ķ",Kcy:"К",Kfr:"𝔎",Kopf:"𝕂",Kscr:"𝒦",LJcy:"Љ",LT:"<",Lacute:"Ĺ",Lambda:"Λ",Lang:"⟪",Laplacetrf:"ℒ",Larr:"↞",Lcaron:"Ľ",Lcedil:"Ļ",Lcy:"Л",LeftAngleBracket:"⟨",LeftArrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",LeftRightArrow:"↔",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",Leftarrow:"⇐",Leftrightarrow:"⇔",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",LessLess:"⪡",LessSlantEqual:"⩽",LessTilde:"≲",Lfr:"𝔏",Ll:"⋘",Lleftarrow:"⇚",Lmidot:"Ŀ",LongLeftArrow:"⟵",LongLeftRightArrow:"⟷",LongRightArrow:"⟶",Longleftarrow:"⟸",Longleftrightarrow:"⟺",Longrightarrow:"⟹",Lopf:"𝕃",LowerLeftArrow:"↙",LowerRightArrow:"↘",Lscr:"ℒ",Lsh:"↰",Lstrok:"Ł",Lt:"≪",Map:"⤅",Mcy:"М",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",MinusPlus:"∓",Mopf:"𝕄",Mscr:"ℳ",Mu:"Μ",NJcy:"Њ",Nacute:"Ń",Ncaron:"Ň",Ncedil:"Ņ",Ncy:"Н",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:"\n",Nfr:"𝔑",NoBreak:"⁠",NonBreakingSpace:" ",Nopf:"ℕ",Not:"⫬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",Nscr:"𝒩",Ntilde:"Ñ",Nu:"Ν",OElig:"Œ",Oacute:"Ó",Ocirc:"Ô",Ocy:"О",Odblac:"Ő",Ofr:"𝔒",Ograve:"Ò",Omacr:"Ō",Omega:"Ω",Omicron:"Ο",Oopf:"𝕆",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",Or:"⩔",Oscr:"𝒪",Oslash:"Ø",Otilde:"Õ",Otimes:"⨷",Ouml:"Ö",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",PartialD:"∂",Pcy:"П",Pfr:"𝔓",Phi:"Φ",Pi:"Π",PlusMinus:"±",Poincareplane:"ℌ",Popf:"ℙ",Pr:"⪻",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",Prime:"″",Product:"∏",Proportion:"∷",Proportional:"∝",Pscr:"𝒫",Psi:"Ψ",QUOT:'"',Qfr:"𝔔",Qopf:"ℚ",Qscr:"𝒬",RBarr:"⤐",REG:"®",Racute:"Ŕ",Rang:"⟫",Rarr:"↠",Rarrtl:"⤖",Rcaron:"Ř",Rcedil:"Ŗ",Rcy:"Р",Re:"ℜ",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",Rfr:"ℜ",Rho:"Ρ",RightAngleBracket:"⟩",RightArrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",Rightarrow:"⇒",Ropf:"ℝ",RoundImplies:"⥰",Rrightarrow:"⇛",Rscr:"ℛ",Rsh:"↱",RuleDelayed:"⧴",SHCHcy:"Щ",SHcy:"Ш",SOFTcy:"Ь",Sacute:"Ś",Sc:"⪼",Scaron:"Š",Scedil:"Ş",Scirc:"Ŝ",Scy:"С",Sfr:"𝔖",ShortDownArrow:"↓",ShortLeftArrow:"←",ShortRightArrow:"→",ShortUpArrow:"↑",Sigma:"Σ",SmallCircle:"∘",Sopf:"𝕊",Sqrt:"√",Square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",Sscr:"𝒮",Star:"⋆",Sub:"⋐",Subset:"⋐",SubsetEqual:"⊆",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",SuchThat:"∋",Sum:"∑",Sup:"⋑",Superset:"⊃",SupersetEqual:"⊇",Supset:"⋑",THORN:"Þ",TRADE:"™",TSHcy:"Ћ",TScy:"Ц",Tab:"\t",Tau:"Τ",Tcaron:"Ť",Tcedil:"Ţ",Tcy:"Т",Tfr:"𝔗",Therefore:"∴",Theta:"Θ",ThickSpace:"  ",ThinSpace:" ",Tilde:"∼",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",Topf:"𝕋",TripleDot:"⃛",Tscr:"𝒯",Tstrok:"Ŧ",Uacute:"Ú",Uarr:"↟",Uarrocir:"⥉",Ubrcy:"Ў",Ubreve:"Ŭ",Ucirc:"Û",Ucy:"У",Udblac:"Ű",Ufr:"𝔘",Ugrave:"Ù",Umacr:"Ū",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",Uopf:"𝕌",UpArrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",UpDownArrow:"↕",UpEquilibrium:"⥮",UpTee:"⊥",UpTeeArrow:"↥",Uparrow:"⇑",Updownarrow:"⇕",UpperLeftArrow:"↖",UpperRightArrow:"↗",Upsi:"ϒ",Upsilon:"Υ",Uring:"Ů",Uscr:"𝒰",Utilde:"Ũ",Uuml:"Ü",VDash:"⊫",Vbar:"⫫",Vcy:"В",Vdash:"⊩",Vdashl:"⫦",Vee:"⋁",Verbar:"‖",Vert:"‖",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",Vopf:"𝕍",Vscr:"𝒱",Vvdash:"⊪",Wcirc:"Ŵ",Wedge:"⋀",Wfr:"𝔚",Wopf:"𝕎",Wscr:"𝒲",Xfr:"𝔛",Xi:"Ξ",Xopf:"𝕏",Xscr:"𝒳",YAcy:"Я",YIcy:"Ї",YUcy:"Ю",Yacute:"Ý",Ycirc:"Ŷ",Ycy:"Ы",Yfr:"𝔜",Yopf:"𝕐",Yscr:"𝒴",Yuml:"Ÿ",ZHcy:"Ж",Zacute:"Ź",Zcaron:"Ž",Zcy:"З",Zdot:"Ż",ZeroWidthSpace:"​",Zeta:"Ζ",Zfr:"ℨ",Zopf:"ℤ",Zscr:"𝒵",aacute:"á",abreve:"ă",ac:"∾",acE:"∾̳",acd:"∿",acirc:"â",acute:"´",acy:"а",aelig:"æ",af:"⁡",afr:"𝔞",agrave:"à",alefsym:"ℵ",aleph:"ℵ",alpha:"α",amacr:"ā",amalg:"⨿",amp:"&",and:"∧",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsd:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",aogon:"ą",aopf:"𝕒",ap:"≈",apE:"⩰",apacir:"⩯",ape:"≊",apid:"≋",apos:"'",approx:"≈",approxeq:"≊",aring:"å",ascr:"𝒶",ast:"*",asymp:"≈",asympeq:"≍",atilde:"ã",auml:"ä",awconint:"∳",awint:"⨑",bNot:"⫭",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",barvee:"⊽",barwed:"⌅",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",bcy:"б",bdquo:"„",becaus:"∵",because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",beta:"β",beth:"ℶ",between:"≬",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bnot:"⌐",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxDL:"╗",boxDR:"╔",boxDl:"╖",boxDr:"╓",boxH:"═",boxHD:"╦",boxHU:"╩",boxHd:"╤",boxHu:"╧",boxUL:"╝",boxUR:"╚",boxUl:"╜",boxUr:"╙",boxV:"║",boxVH:"╬",boxVL:"╣",boxVR:"╠",boxVh:"╫",boxVl:"╢",boxVr:"╟",boxbox:"⧉",boxdL:"╕",boxdR:"╒",boxdl:"┐",boxdr:"┌",boxh:"─",boxhD:"╥",boxhU:"╨",boxhd:"┬",boxhu:"┴",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxuL:"╛",boxuR:"╘",boxul:"┘",boxur:"└",boxv:"│",boxvH:"╪",boxvL:"╡",boxvR:"╞",boxvh:"┼",boxvl:"┤",boxvr:"├",bprime:"‵",breve:"˘",brvbar:"¦",bscr:"𝒷",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",bumpeq:"≏",cacute:"ć",cap:"∩",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",caps:"∩︀",caret:"⁁",caron:"ˇ",ccaps:"⩍",ccaron:"č",ccedil:"ç",ccirc:"ĉ",ccups:"⩌",ccupssm:"⩐",cdot:"ċ",cedil:"¸",cemptyv:"⦲",cent:"¢",centerdot:"·",cfr:"𝔠",chcy:"ч",check:"✓",checkmark:"✓",chi:"χ",cir:"○",cirE:"⧃",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledR:"®",circledS:"Ⓢ",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",clubs:"♣",clubsuit:"♣",colon:":",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",conint:"∮",copf:"𝕔",coprod:"∐",copy:"©",copysr:"℗",crarr:"↵",cross:"✗",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",cup:"∪",cupbrcap:"⩈",cupcap:"⩆",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",dArr:"⇓",dHar:"⥥",dagger:"†",daleth:"ℸ",darr:"↓",dash:"‐",dashv:"⊣",dbkarow:"⤏",dblac:"˝",dcaron:"ď",dcy:"д",dd:"ⅆ",ddagger:"‡",ddarr:"⇊",ddotseq:"⩷",deg:"°",delta:"δ",demptyv:"⦱",dfisht:"⥿",dfr:"𝔡",dharl:"⇃",dharr:"⇂",diam:"⋄",diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",dopf:"𝕕",dot:"˙",doteq:"≐",doteqdot:"≑",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",downarrow:"↓",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",dscr:"𝒹",dscy:"ѕ",dsol:"⧶",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",dzcy:"џ",dzigrarr:"⟿",eDDot:"⩷",eDot:"≑",eacute:"é",easter:"⩮",ecaron:"ě",ecir:"≖",ecirc:"ê",ecolon:"≕",ecy:"э",edot:"ė",ee:"ⅇ",efDot:"≒",efr:"𝔢",eg:"⪚",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",emacr:"ē",empty:"∅",emptyset:"∅",emptyv:"∅",emsp13:" ",emsp14:" ",emsp:" ",eng:"ŋ",ensp:" ",eogon:"ę",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",equals:"=",equest:"≟",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erDot:"≓",erarr:"⥱",escr:"ℯ",esdot:"≐",esim:"≂",eta:"η",eth:"ð",euml:"ë",euro:"€",excl:"!",exist:"∃",expectation:"ℰ",exponentiale:"ⅇ",fallingdotseq:"≒",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",ffr:"𝔣",filig:"fi",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",fopf:"𝕗",forall:"∀",fork:"⋔",forkv:"⫙",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",fscr:"𝒻",gE:"≧",gEl:"⪌",gacute:"ǵ",gamma:"γ",gammad:"ϝ",gap:"⪆",gbreve:"ğ",gcirc:"ĝ",gcy:"г",gdot:"ġ",ge:"≥",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",gfr:"𝔤",gg:"≫",ggg:"⋙",gimel:"ℷ",gjcy:"ѓ",gl:"≷",glE:"⪒",gla:"⪥",glj:"⪤",gnE:"≩",gnap:"⪊",gnapprox:"⪊",gne:"⪈",gneq:"⪈",gneqq:"≩",gnsim:"⋧",gopf:"𝕘",grave:"`",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",gt:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",hArr:"⇔",hairsp:" ",half:"½",hamilt:"ℋ",hardcy:"ъ",harr:"↔",harrcir:"⥈",harrw:"↭",hbar:"ℏ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",hfr:"𝔥",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",hopf:"𝕙",horbar:"―",hscr:"𝒽",hslash:"ℏ",hstrok:"ħ",hybull:"⁃",hyphen:"‐",iacute:"í",ic:"⁣",icirc:"î",icy:"и",iecy:"е",iexcl:"¡",iff:"⇔",ifr:"𝔦",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",ijlig:"ij",imacr:"ī",image:"ℑ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",in:"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",int:"∫",intcal:"⊺",integers:"ℤ",intercal:"⊺",intlarhk:"⨗",intprod:"⨼",iocy:"ё",iogon:"į",iopf:"𝕚",iota:"ι",iprod:"⨼",iquest:"¿",iscr:"𝒾",isin:"∈",isinE:"⋹",isindot:"⋵",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",itilde:"ĩ",iukcy:"і",iuml:"ï",jcirc:"ĵ",jcy:"й",jfr:"𝔧",jmath:"ȷ",jopf:"𝕛",jscr:"𝒿",jsercy:"ј",jukcy:"є",kappa:"κ",kappav:"ϰ",kcedil:"ķ",kcy:"к",kfr:"𝔨",kgreen:"ĸ",khcy:"х",kjcy:"ќ",kopf:"𝕜",kscr:"𝓀",lAarr:"⇚",lArr:"⇐",lAtail:"⤛",lBarr:"⤎",lE:"≦",lEg:"⪋",lHar:"⥢",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",lambda:"λ",lang:"⟨",langd:"⦑",langle:"⟨",lap:"⪅",laquo:"«",larr:"←",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",latail:"⤙",late:"⪭",lates:"⪭︀",lbarr:"⤌",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",lcaron:"ľ",lcedil:"ļ",lceil:"⌈",lcub:"{",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",le:"≤",leftarrow:"←",leftarrowtail:"↢",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",leftrightarrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",leftthreetimes:"⋋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",lessgtr:"≶",lesssim:"≲",lfisht:"⥼",lfloor:"⌊",lfr:"𝔩",lg:"≶",lgE:"⪑",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",ljcy:"љ",ll:"≪",llarr:"⇇",llcorner:"⌞",llhard:"⥫",lltri:"◺",lmidot:"ŀ",lmoust:"⎰",lmoustache:"⎰",lnE:"≨",lnap:"⪉",lnapprox:"⪉",lne:"⪇",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",longleftarrow:"⟵",longleftrightarrow:"⟷",longmapsto:"⟼",longrightarrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",lscr:"𝓁",lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",lstrok:"ł",lt:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltrPar:"⦖",ltri:"◃",ltrie:"⊴",ltrif:"◂",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",mDDot:"∺",macr:"¯",male:"♂",malt:"✠",maltese:"✠",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",mcy:"м",mdash:"—",measuredangle:"∡",mfr:"𝔪",mho:"℧",micro:"µ",mid:"∣",midast:"*",midcir:"⫰",middot:"·",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",mopf:"𝕞",mp:"∓",mscr:"𝓂",mstpos:"∾",mu:"μ",multimap:"⊸",mumap:"⊸",nGg:"⋙̸",nGt:"≫⃒",nGtv:"≫̸",nLeftarrow:"⇍",nLeftrightarrow:"⇎",nLl:"⋘̸",nLt:"≪⃒",nLtv:"≪̸",nRightarrow:"⇏",nVDash:"⊯",nVdash:"⊮",nabla:"∇",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",ncaron:"ň",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",ncy:"н",ndash:"–",ne:"≠",neArr:"⇗",nearhk:"⤤",nearr:"↗",nearrow:"↗",nedot:"≐̸",nequiv:"≢",nesear:"⤨",nesim:"≂̸",nexist:"∄",nexists:"∄",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",ngsim:"≵",ngt:"≯",ngtr:"≯",nhArr:"⇎",nharr:"↮",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",njcy:"њ",nlArr:"⇍",nlE:"≦̸",nlarr:"↚",nldr:"‥",nle:"≰",nleftarrow:"↚",nleftrightarrow:"↮",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nlsim:"≴",nlt:"≮",nltri:"⋪",nltrie:"⋬",nmid:"∤",nopf:"𝕟",not:"¬",notin:"∉",notinE:"⋹̸",notindot:"⋵̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrArr:"⇏",nrarr:"↛",nrarrc:"⤳̸",nrarrw:"↝̸",nrightarrow:"↛",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",nu:"ν",num:"#",numero:"№",numsp:" ",nvDash:"⊭",nvHarr:"⤄",nvap:"≍⃒",nvdash:"⊬",nvge:"≥⃒",nvgt:">⃒",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwArr:"⇖",nwarhk:"⤣",nwarr:"↖",nwarrow:"↖",nwnear:"⤧",oS:"Ⓢ",oacute:"ó",oast:"⊛",ocir:"⊚",ocirc:"ô",ocy:"о",odash:"⊝",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",oelig:"œ",ofcir:"⦿",ofr:"𝔬",ogon:"˛",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",omacr:"ō",omega:"ω",omicron:"ο",omid:"⦶",ominus:"⊖",oopf:"𝕠",opar:"⦷",operp:"⦹",oplus:"⊕",or:"∨",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oscr:"ℴ",oslash:"ø",osol:"⊘",otilde:"õ",otimes:"⊗",otimesas:"⨶",ouml:"ö",ovbar:"⌽",par:"∥",para:"¶",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",pfr:"𝔭",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",pointint:"⨕",popf:"𝕡",pound:"£",pr:"≺",prE:"⪳",prap:"⪷",prcue:"≼",pre:"⪯",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",prime:"′",primes:"ℙ",prnE:"⪵",prnap:"⪹",prnsim:"⋨",prod:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",propto:"∝",prsim:"≾",prurel:"⊰",pscr:"𝓅",psi:"ψ",puncsp:" ",qfr:"𝔮",qint:"⨌",qopf:"𝕢",qprime:"⁗",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",quot:'"',rAarr:"⇛",rArr:"⇒",rAtail:"⤜",rBarr:"⤏",rHar:"⥤",race:"∽̱",racute:"ŕ",radic:"√",raemptyv:"⦳",rang:"⟩",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",rarr:"→",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",rarrtl:"↣",rarrw:"↝",ratail:"⤚",ratio:"∶",rationals:"ℚ",rbarr:"⤍",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",rcaron:"ř",rcedil:"ŗ",rceil:"⌉",rcub:"}",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",reg:"®",rfisht:"⥽",rfloor:"⌋",rfr:"𝔯",rhard:"⇁",rharu:"⇀",rharul:"⥬",rho:"ρ",rhov:"ϱ",rightarrow:"→",rightarrowtail:"↣",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",rightthreetimes:"⋌",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",ropf:"𝕣",roplus:"⨮",rotimes:"⨵",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",rsaquo:"›",rscr:"𝓇",rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",ruluhar:"⥨",rx:"℞",sacute:"ś",sbquo:"‚",sc:"≻",scE:"⪴",scap:"⪸",scaron:"š",sccue:"≽",sce:"⪰",scedil:"ş",scirc:"ŝ",scnE:"⪶",scnap:"⪺",scnsim:"⋩",scpolint:"⨓",scsim:"≿",scy:"с",sdot:"⋅",sdotb:"⊡",sdote:"⩦",seArr:"⇘",searhk:"⤥",searr:"↘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",sfr:"𝔰",sfrown:"⌢",sharp:"♯",shchcy:"щ",shcy:"ш",shortmid:"∣",shortparallel:"∥",shy:"­",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",softcy:"ь",sol:"/",solb:"⧄",solbar:"⌿",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",square:"□",squarf:"▪",squf:"▪",srarr:"→",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",sub:"⊂",subE:"⫅",subdot:"⪽",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",subset:"⊂",subseteq:"⊆",subseteqq:"⫅",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",sum:"∑",sung:"♪",sup1:"¹",sup2:"²",sup3:"³",sup:"⊃",supE:"⫆",supdot:"⪾",supdsub:"⫘",supe:"⊇",supedot:"⫄",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",supset:"⊃",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swArr:"⇙",swarhk:"⤦",swarr:"↙",swarrow:"↙",swnwar:"⤪",szlig:"ß",target:"⌖",tau:"τ",tbrk:"⎴",tcaron:"ť",tcedil:"ţ",tcy:"т",tdot:"⃛",telrec:"⌕",tfr:"𝔱",there4:"∴",therefore:"∴",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",thinsp:" ",thkap:"≈",thksim:"∼",thorn:"þ",tilde:"˜",times:"×",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",trade:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",tscr:"𝓉",tscy:"ц",tshcy:"ћ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",uArr:"⇑",uHar:"⥣",uacute:"ú",uarr:"↑",ubrcy:"ў",ubreve:"ŭ",ucirc:"û",ucy:"у",udarr:"⇅",udblac:"ű",udhar:"⥮",ufisht:"⥾",ufr:"𝔲",ugrave:"ù",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",umacr:"ū",uml:"¨",uogon:"ų",uopf:"𝕦",uparrow:"↑",updownarrow:"↕",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",upsi:"υ",upsih:"ϒ",upsilon:"υ",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",uring:"ů",urtri:"◹",uscr:"𝓊",utdot:"⋰",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",uuml:"ü",uwangle:"⦧",vArr:"⇕",vBar:"⫨",vBarv:"⫩",vDash:"⊨",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",varr:"↕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",vcy:"в",vdash:"⊢",vee:"∨",veebar:"⊻",veeeq:"≚",vellip:"⋮",verbar:"|",vert:"|",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",vopf:"𝕧",vprop:"∝",vrtri:"⊳",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",vzigzag:"⦚",wcirc:"ŵ",wedbar:"⩟",wedge:"∧",wedgeq:"≙",weierp:"℘",wfr:"𝔴",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",xfr:"𝔵",xhArr:"⟺",xharr:"⟷",xi:"ξ",xlArr:"⟸",xlarr:"⟵",xmap:"⟼",xnis:"⋻",xodot:"⨀",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrArr:"⟹",xrarr:"⟶",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",yacute:"ý",yacy:"я",ycirc:"ŷ",ycy:"ы",yen:"¥",yfr:"𝔶",yicy:"ї",yopf:"𝕪",yscr:"𝓎",yucy:"ю",yuml:"ÿ",zacute:"ź",zcaron:"ž",zcy:"з",zdot:"ż",zeetrf:"ℨ",zeta:"ζ",zfr:"𝔷",zhcy:"ж",zigrarr:"⇝",zopf:"𝕫",zscr:"𝓏",zwj:"‍",zwnj:"‌"},te={0:65533,128:8364,130:8218,131:402,132:8222,133:8230,134:8224,135:8225,136:710,137:8240,138:352,139:8249,140:338,142:381,145:8216,146:8217,147:8220,148:8221,149:8226,150:8211,151:8212,152:732,153:8482,154:353,155:8250,156:339,158:382,159:376};function re(e){return e.replace(/&(?:[a-zA-Z]+|#[xX][\da-fA-F]+|#\d+);/g,(e=>{if("#"===e.charAt(1)){const t=e.charAt(2);return function(e){if(e>=55296&&e<=57343||e>1114111)return"�";return String.fromCodePoint(z(te,e)??e)}("X"===t||"x"===t?parseInt(e.slice(3),16):parseInt(e.slice(2),10))}return z(ee,e.slice(1,-1))??e}))}function ne(e,t){return e.startIndex=e.tokenIndex=e.index,e.startColumn=e.tokenColumn=e.column,e.startLine=e.tokenLine=e.line,e.setToken(8192&c[e.currentChar]?function(e){const t=e.currentChar;let n=r(e);const o=e.index;for(;n!==t;)e.index>=e.end&&e.report(16),n=r(e);n!==t&&e.report(16);e.tokenValue=e.source.slice(o,e.index),r(e),e.options.raw&&(e.tokenRaw=e.source.slice(e.tokenIndex,e.index));return 134283267}(e):Q(e,t,0)),e.getToken()}function oe(e){if(e.startIndex=e.tokenIndex=e.index,e.startColumn=e.tokenColumn=e.column,e.startLine=e.tokenLine=e.line,e.index>=e.end)return void e.setToken(1048576);if(60===e.currentChar)return r(e),void e.setToken(8456256);if(123===e.currentChar)return r(e),void e.setToken(2162700);let t=0;for(;e.indexe.declareUnboundVariable(t)))):(c&&e.report(172),r&&(n.forEach((t=>e.declareUnboundVariable(t))),a.forEach((t=>e.addBindingToExports(t))))),V(e,32|t);break}case 132:case 86094:a=bt(e,t,r,void 0,2);break;case 86104:a=rt(e,t,r,void 0,4,1,2,0,e.tokenStart);break;case 241737:a=xe(e,t,r,void 0,8,64);break;case 86090:a=xe(e,t,r,void 0,16,64);break;case 86088:a=we(e,t,r,void 0,64);break;case 209005:{const{tokenStart:n}=e;if(W(e,t),!(1&e.flags)&&86104===e.getToken()){a=rt(e,t,r,void 0,4,1,2,1,n);break}}default:e.report(30,A[255&e.getToken()])}const c={type:"ExportNamedDeclaration",declaration:a,specifiers:o,source:i,attributes:s};return e.finishNode(c,n)}(e,t,r);break;case 86106:n=function(e,t,r){const n=e.tokenStart;W(e,t);let o=null;const{tokenStart:a}=e;let i=[];if(134283267===e.getToken())o=tt(e,t);else{if(143360&e.getToken()){const n=Ce(e,t,r);if(i=[e.finishNode({type:"ImportDefaultSpecifier",local:n},a)],B(e,t,18))switch(e.getToken()){case 8391476:i.push(qe(e,t,r));break;case 2162700:Ee(e,t,r,i);break;default:e.report(107)}}else switch(e.getToken()){case 8391476:i=[qe(e,t,r)];break;case 2162700:Ee(e,t,r,i);break;case 67174411:return Le(e,t,void 0,n);case 67108877:return Ne(e,t,n);default:e.report(30,A[255&e.getToken()])}o=function(e,t){U(e,t,209011),134283267!==e.getToken()&&e.report(105,"Import");return tt(e,t)}(e,t)}const s=Me(e,t),c={type:"ImportDeclaration",specifiers:i,source:o,attributes:s};return V(e,32|t),e.finishNode(c,n)}(e,t,r);break;default:n=de(e,t,r,void 0,4,{})}return e.leadingDecorators?.decorators.length&&e.report(170),n}function de(e,t,r,n,o,a){const i=e.tokenStart;switch(e.getToken()){case 86104:return rt(e,t,r,n,o,1,0,0,i);case 132:case 86094:return bt(e,t,r,n,0);case 86090:return xe(e,t,r,n,16,0);case 241737:return function(e,t,r,n,o){const{tokenValue:a,tokenStart:i}=e,s=e.getToken();let c=et(e,t);if(2240512&e.getToken()){const o=Se(e,t,r,n,8,0);return V(e,32|t),e.finishNode({type:"VariableDeclaration",kind:"let",declarations:o},i)}e.assignable=1,1&t&&e.report(85);if(21===e.getToken())return he(e,t,r,n,o,{},a,c,s,0,i);if(10===e.getToken()){let r;e.options.lexical&&(r=se(e,t,a)),e.flags=128^(128|e.flags),c=gt(e,t,r,n,[c],0,i)}else c=Ge(e,t,n,c,0,0,i),c=De(e,t,n,0,0,i,c);18===e.getToken()&&(c=Ie(e,t,n,0,i,c));return ke(e,t,c,i)}(e,t,r,n,o);case 20564:e.report(103,"export");case 86106:switch(W(e,t),e.getToken()){case 67174411:return Le(e,t,n,i);case 67108877:return Ne(e,t,i);default:e.report(103,"import")}case 209005:return me(e,t,r,n,o,a,1);default:return ge(e,t,r,n,o,a,1)}}function ge(e,t,r,n,o,a,i){switch(e.getToken()){case 86088:return we(e,t,r,n,0);case 20572:return function(e,t,r){4096&t||e.report(92);const n=e.tokenStart;W(e,32|t);const o=1&e.flags||1048576&e.getToken()?null:Ve(e,t,r,0,1,e.tokenStart);return V(e,32|t),e.finishNode({type:"ReturnStatement",argument:o},n)}(e,t,n);case 20569:return function(e,t,r,n,o){const a=e.tokenStart;W(e,t),U(e,32|t,67174411),e.assignable=1;const i=Ve(e,t,n,0,1,e.tokenStart);U(e,32|t,16);const s=Te(e,t,r,n,o);let c=null;20563===e.getToken()&&(W(e,32|t),c=Te(e,t,r,n,o));return e.finishNode({type:"IfStatement",test:i,consequent:s,alternate:c},a)}(e,t,r,n,a);case 20567:return function(e,t,r,n,o){const a=e.tokenStart;W(e,t);const i=((2048&t)>0||(2&t)>0&&(8&t)>0)&&B(e,t,209006);U(e,32|t,67174411),r=r?.createChildScope(1);let s,c=null,l=null,u=0,p=null,d=86088===e.getToken()||241737===e.getToken()||86090===e.getToken();const{tokenStart:g}=e,f=e.getToken();if(d)241737===f?(p=et(e,t),2240512&e.getToken()?(8673330===e.getToken()?1&t&&e.report(67):p=e.finishNode({type:"VariableDeclaration",kind:"let",declarations:Se(e,131072|t,r,n,8,32)},g),e.assignable=1):1&t?e.report(67):(d=!1,e.assignable=1,p=Ge(e,t,n,p,0,0,g),471156===e.getToken()&&e.report(115))):(W(e,t),p=e.finishNode(86088===f?{type:"VariableDeclaration",kind:"var",declarations:Se(e,131072|t,r,n,4,32)}:{type:"VariableDeclaration",kind:"const",declarations:Se(e,131072|t,r,n,16,32)},g),e.assignable=1);else if(1074790417===f)i&&e.report(82);else if(2097152&~f)p=Oe(e,131072|t,n,1,0,1);else{const r=e.tokenStart;p=2162700===f?ct(e,t,void 0,n,1,0,0,2,32):ot(e,t,void 0,n,1,0,0,2,32),u=e.destructible,64&u&&e.report(63),e.assignable=16&u?2:1,p=Ge(e,131072|t,n,p,0,0,r)}if(!(262144&~e.getToken())){if(471156===e.getToken()){2&e.assignable&&e.report(80,i?"await":"of"),P(e,p),W(e,32|t),s=Ae(e,t,n,1,0,e.tokenStart),U(e,32|t,16);const c=ye(e,t,r,n,o);return e.finishNode({type:"ForOfStatement",left:p,right:s,body:c,await:i},a)}2&e.assignable&&e.report(80,"in"),P(e,p),W(e,32|t),i&&e.report(82),s=Ve(e,t,n,0,1,e.tokenStart),U(e,32|t,16);const c=ye(e,t,r,n,o);return e.finishNode({type:"ForInStatement",body:c,left:p,right:s},a)}i&&e.report(82);d||(8&u&&1077936155!==e.getToken()&&e.report(80,"loop"),p=De(e,131072|t,n,0,0,g,p));18===e.getToken()&&(p=Ie(e,t,n,0,g,p));U(e,32|t,1074790417),1074790417!==e.getToken()&&(c=Ve(e,t,n,0,1,e.tokenStart));U(e,32|t,1074790417),16!==e.getToken()&&(l=Ve(e,t,n,0,1,e.tokenStart));U(e,32|t,16);const k=ye(e,t,r,n,o);return e.finishNode({type:"ForStatement",init:p,test:c,update:l,body:k},a)}(e,t,r,n,a);case 20562:return function(e,t,r,n,o){const a=e.tokenStart;W(e,32|t);const i=ye(e,t,r,n,o);U(e,t,20578),U(e,32|t,67174411);const s=Ve(e,t,n,0,1,e.tokenStart);return U(e,32|t,16),B(e,32|t,1074790417),e.finishNode({type:"DoWhileStatement",body:i,test:s},a)}(e,t,r,n,a);case 20578:return function(e,t,r,n,o){const a=e.tokenStart;W(e,t),U(e,32|t,67174411);const i=Ve(e,t,n,0,1,e.tokenStart);U(e,32|t,16);const s=ye(e,t,r,n,o);return e.finishNode({type:"WhileStatement",test:i,body:s},a)}(e,t,r,n,a);case 86110:return function(e,t,r,n,o){const a=e.tokenStart;W(e,t),U(e,32|t,67174411);const i=Ve(e,t,n,0,1,e.tokenStart);U(e,t,16),U(e,t,2162700);const s=[];let c=0;r=r?.createChildScope(8);for(;1074790415!==e.getToken();){const{tokenStart:a}=e;let i=null;const l=[];for(B(e,32|t,20556)?i=Ve(e,t,n,0,1,e.tokenStart):(U(e,32|t,20561),c&&e.report(89),c=1),U(e,32|t,21);20556!==e.getToken()&&1074790415!==e.getToken()&&20561!==e.getToken();)l.push(de(e,4|t,r,n,2,{$:o}));s.push(e.finishNode({type:"SwitchCase",test:i,consequent:l},a))}return U(e,32|t,1074790415),e.finishNode({type:"SwitchStatement",discriminant:i,cases:s},a)}(e,t,r,n,a);case 1074790417:return function(e,t){const r=e.tokenStart;return W(e,32|t),e.finishNode({type:"EmptyStatement"},r)}(e,t);case 2162700:return fe(e,t,r?.createChildScope(),n,a,e.tokenStart);case 86112:return function(e,t,r){const n=e.tokenStart;W(e,32|t),1&e.flags&&e.report(90);const o=Ve(e,t,r,0,1,e.tokenStart);return V(e,32|t),e.finishNode({type:"ThrowStatement",argument:o},n)}(e,t,n);case 20555:return function(e,t,r){const n=e.tokenStart;W(e,32|t);let o=null;if(!(1&e.flags)&&143360&e.getToken()){const{tokenValue:n}=e;o=et(e,32|t),F(e,r,n,0)||e.report(138,n)}else 132&t||e.report(69);return V(e,32|t),e.finishNode({type:"BreakStatement",label:o},n)}(e,t,a);case 20559:return function(e,t,r){128&t||e.report(68);const n=e.tokenStart;W(e,t);let o=null;if(!(1&e.flags)&&143360&e.getToken()){const{tokenValue:n}=e;o=et(e,32|t),F(e,r,n,1)||e.report(138,n)}return V(e,32|t),e.finishNode({type:"ContinueStatement",label:o},n)}(e,t,a);case 20577:return function(e,t,r,n,o){const a=e.tokenStart;W(e,32|t);const i=r?.createChildScope(16),s=fe(e,t,i,n,{$:o}),{tokenStart:c}=e,l=B(e,32|t,20557)?function(e,t,r,n,o,a){let i=null,s=r;B(e,t,67174411)&&(r=r?.createChildScope(4),i=Ct(e,t,r,n,2097152&~e.getToken()?512:256,0),18===e.getToken()?e.report(86):1077936155===e.getToken()&&e.report(87),U(e,32|t,16));s=r?.createChildScope(32);const c=fe(e,t,s,n,{$:o});return e.finishNode({type:"CatchClause",param:i,body:c},a)}(e,t,r,n,o,c):null;let u=null;if(20566===e.getToken()){W(e,32|t);const a=r?.createChildScope(4);u=fe(e,t,a,n,{$:o})}l||u||e.report(88);return e.finishNode({type:"TryStatement",block:s,handler:l,finalizer:u},a)}(e,t,r,n,a);case 20579:return function(e,t,r,n,o){const a=e.tokenStart;W(e,t),1&t&&e.report(91);U(e,32|t,67174411);const i=Ve(e,t,n,0,1,e.tokenStart);U(e,32|t,16);const s=ge(e,t,r,n,2,o,0);return e.finishNode({type:"WithStatement",object:i,body:s},a)}(e,t,r,n,a);case 20560:return function(e,t){const r=e.tokenStart;return W(e,32|t),V(e,32|t),e.finishNode({type:"DebuggerStatement"},r)}(e,t);case 209005:return me(e,t,r,n,o,a,0);case 20557:e.report(162);case 20566:e.report(163);case 86104:e.report(1&t?76:e.options.webcompat?77:78);case 86094:e.report(79);default:return function(e,t,r,n,o,a,i){const{tokenValue:s,tokenStart:c}=e,l=e.getToken();let u;if(241737===l)u=et(e,t),1&t&&e.report(85),69271571===e.getToken()&&e.report(84);else u=Fe(e,t,n,2,0,1,0,1,e.tokenStart);if(143360&l&&21===e.getToken())return he(e,t,r,n,o,a,s,u,l,i,c);u=Ge(e,t,n,u,0,0,c),u=De(e,t,n,0,0,c,u),18===e.getToken()&&(u=Ie(e,t,n,0,c,u));return ke(e,t,u,c)}(e,t,r,n,o,a,i)}}function fe(e,t,r,n,o,a=e.tokenStart,i="BlockStatement"){const s=[];for(U(e,32|t,2162700);1074790415!==e.getToken();)s.push(de(e,t,r,n,2,{$:o}));return U(e,32|t,1074790415),e.finishNode({type:i,body:s},a)}function ke(e,t,r,n){return V(e,32|t),e.finishNode({type:"ExpressionStatement",expression:r},n)}function he(e,t,r,n,o,a,i,s,c,l,u){O(e,t,0,c,1),function(e,t,r){let n=t;for(;n;)n["$"+r]&&e.report(136,r),n=n.$;t["$"+r]=1}(e,a,i),W(e,32|t);const p=!l||1&t||!e.options.webcompat||86104!==e.getToken()?ge(e,t,r,n,o,a,l):rt(e,t,r?.createChildScope(),n,o,0,0,0,e.tokenStart);return e.finishNode({type:"LabeledStatement",label:s,body:p},u)}function me(e,t,r,n,o,a,i){const{tokenValue:s,tokenStart:c}=e,l=e.getToken();let u=et(e,t);if(21===e.getToken())return he(e,t,r,n,o,a,s,u,l,1,c);const p=1&e.flags;if(!p){if(86104===e.getToken())return i||e.report(123),rt(e,t,r,n,o,1,0,1,c);if(H(t,e.getToken()))return u=ht(e,t,n,1,c),18===e.getToken()&&(u=Ie(e,t,n,0,c,u)),ke(e,t,u,c)}return 67174411===e.getToken()?u=mt(e,t,n,u,1,1,0,p,c):(10===e.getToken()&&(M(e,t,l),36864&~l||(e.flags|=256),u=pt(e,2048|t,n,e.tokenValue,u,0,1,0,c)),e.assignable=1),u=Ge(e,t,n,u,0,0,c),u=De(e,t,n,0,0,c,u),e.assignable=1,18===e.getToken()&&(u=Ie(e,t,n,0,c,u)),ke(e,t,u,c)}function be(e,t,r,n,o){const a=e.startIndex;1074790417!==n&&(e.assignable=2,r=Ge(e,t,void 0,r,0,0,o),1074790417!==e.getToken()&&(r=De(e,t,void 0,0,0,o,r),18===e.getToken()&&(r=Ie(e,t,void 0,0,o,r))),V(e,32|t));const i={type:"ExpressionStatement",expression:r};return"Literal"===r.type&&"string"==typeof r.value&&(i.directive=e.source.slice(o.index+1,a-1)),e.finishNode(i,o)}function Te(e,t,r,n,o){const{tokenStart:a}=e;return 1&t||!e.options.webcompat||86104!==e.getToken()?ge(e,t,r,n,0,{$:o},0):rt(e,t,r?.createChildScope(),n,0,0,0,0,a)}function ye(e,t,r,n,o){return ge(e,131072^(131072|t)|128,r,n,0,{loop:1,$:o},0)}function xe(e,t,r,n,o,a){const i=e.tokenStart;W(e,t);const s=Se(e,t,r,n,o,a);return V(e,32|t),e.finishNode({type:"VariableDeclaration",kind:8&o?"let":"const",declarations:s},i)}function we(e,t,r,n,o){const a=e.tokenStart;W(e,t);const i=Se(e,t,r,n,4,o);return V(e,32|t),e.finishNode({type:"VariableDeclaration",kind:"var",declarations:i},a)}function Se(e,t,r,n,o,a){let i=1;const s=[ve(e,t,r,n,o,a)];for(;B(e,t,18);)i++,s.push(ve(e,t,r,n,o,a));return i>1&&32&a&&262144&e.getToken()&&e.report(61,A[255&e.getToken()]),s}function ve(e,t,r,n,o,a){const{tokenStart:i}=e,s=e.getToken();let c=null;const l=Ct(e,t,r,n,o,a);if(1077936155===e.getToken()){if(W(e,32|t),c=Ae(e,t,n,1,0,e.tokenStart),(32&a||!(2097152&s))&&(471156===e.getToken()||8673330===e.getToken()&&(2097152&s||!(4&o)||1&t)))throw new E(i,e.currentLocation,60,471156===e.getToken()?"of":"in")}else(16&o||(2097152&s)>0)&&262144&~e.getToken()&&e.report(59,16&o?"const":"destructuring");return e.finishNode({type:"VariableDeclarator",id:l,init:c},i)}function Ce(e,t,r){return H(t,e.getToken())||e.report(118),537079808&~e.getToken()||e.report(119),r?.addBlockName(t,e.tokenValue,8,0),et(e,t)}function qe(e,t,r){const{tokenStart:n}=e;if(W(e,t),U(e,t,77932),!(134217728&~e.getToken()))throw new E(n,e.currentLocation,30,A[255&e.getToken()]);return e.finishNode({type:"ImportNamespaceSpecifier",local:Ce(e,t,r)},n)}function Ee(e,t,r,n){for(W(e,t);143360&e.getToken()||134283267===e.getToken();){let{tokenValue:o,tokenStart:a}=e;const i=e.getToken(),s=_e(e,t);let c;B(e,t,77932)?(134217728&~e.getToken()&&18!==e.getToken()?O(e,t,16,e.getToken(),0):e.report(106),o=e.tokenValue,c=et(e,t)):"Identifier"===s.type?(O(e,t,16,i,0),c=s):e.report(25,A[108]),r?.addBlockName(t,o,8,0),n.push(e.finishNode({type:"ImportSpecifier",local:c,imported:s},a)),1074790415!==e.getToken()&&U(e,t,18)}return U(e,t,1074790415),n}function Ne(e,t,r){let n=Je(e,t,e.finishNode({type:"Identifier",name:"import"},r),r);return n=Ge(e,t,void 0,n,0,0,r),n=De(e,t,void 0,0,0,r,n),18===e.getToken()&&(n=Ie(e,t,void 0,0,r,n)),ke(e,t,n,r)}function Le(e,t,r,n){let o=He(e,t,r,0,n);return o=Ge(e,t,r,o,0,0,n),18===e.getToken()&&(o=Ie(e,t,r,0,n,o)),ke(e,t,o,n)}function Ae(e,t,r,n,o,a){let i=Fe(e,t,r,2,0,n,o,1,a);return i=Ge(e,t,r,i,o,0,a),De(e,t,r,o,0,a,i)}function Ie(e,t,r,n,o,a){const i=[a];for(;B(e,32|t,18);)i.push(Ae(e,t,r,1,n,e.tokenStart));return e.finishNode({type:"SequenceExpression",expressions:i},o)}function Ve(e,t,r,n,o,a){const i=Ae(e,t,r,o,n,a);return 18===e.getToken()?Ie(e,t,r,n,a,i):i}function De(e,t,r,n,o,a,i){const s=e.getToken();if(!(4194304&~s)){2&e.assignable&&e.report(26),(!o&&1077936155===s&&"ArrayExpression"===i.type||"ObjectExpression"===i.type)&&P(e,i),W(e,32|t);const c=Ae(e,t,r,1,n,e.tokenStart);return e.assignable=2,e.finishNode(o?{type:"AssignmentPattern",left:i,right:c}:{type:"AssignmentExpression",left:i,operator:A[255&s],right:c},a)}return 8388608&~s||(i=Ue(e,t,r,n,a,4,s,i)),B(e,32|t,22)&&(i=Be(e,t,r,i,a)),i}function Re(e,t,r,n,o,a,i){const s=e.getToken();W(e,32|t);const c=Ae(e,t,r,1,n,e.tokenStart);return i=e.finishNode(o?{type:"AssignmentPattern",left:i,right:c}:{type:"AssignmentExpression",left:i,operator:A[255&s],right:c},a),e.assignable=2,i}function Be(e,t,r,n,o){const a=Ae(e,131072^(131072|t),r,1,0,e.tokenStart);U(e,32|t,21),e.assignable=1;const i=Ae(e,t,r,1,0,e.tokenStart);return e.assignable=2,e.finishNode({type:"ConditionalExpression",test:n,consequent:a,alternate:i},o)}function Ue(e,t,r,n,o,a,i,s){const c=8673330&-((131072&t)>0);let l,u;for(e.assignable=2;8388608&e.getToken()&&(l=e.getToken(),u=3840&l,(524288&l&&268435456&i||524288&i&&268435456&l)&&e.report(165),!(u+((8391735===l)<<8)-((c===l)<<12)<=a));)W(e,32|t),s=e.finishNode({type:524288&l||268435456&l?"LogicalExpression":"BinaryExpression",left:s,right:Ue(e,t,r,n,e.tokenStart,u,l,Oe(e,t,r,0,n,1)),operator:A[255&l]},o);return 1077936155===e.getToken()&&e.report(26),s}function Pe(e,t,r,n,o,a,i){const{tokenStart:s}=e;U(e,32|t,2162700);const c=[];if(1074790415!==e.getToken()){for(;134283267===e.getToken();){const{index:r,tokenStart:n,tokenIndex:o,tokenValue:a}=e,s=e.getToken(),l=tt(e,t);if(D(e,r,o,a)){if(t|=1,128&e.flags)throw new E(n,e.currentLocation,66);if(64&e.flags)throw new E(n,e.currentLocation,9);if(4096&e.flags)throw new E(n,e.currentLocation,15);i?.reportScopeError()}c.push(be(e,t,l,s,n))}1&t&&(a&&(537079808&~a||e.report(119),36864&~a||e.report(40)),512&e.flags&&e.report(119),256&e.flags&&e.report(118))}for(e.flags=4928^(4928|e.flags),e.destructible=256^(256|e.destructible);1074790415!==e.getToken();)c.push(de(e,t,r,n,4,{}));return U(e,24&o?32|t:t,1074790415),e.flags&=-4289,1077936155===e.getToken()&&e.report(26),e.finishNode({type:"BlockStatement",body:c},s)}function Oe(e,t,r,n,o,a){const i=e.tokenStart;return Ge(e,t,r,Fe(e,t,r,2,0,n,o,a,i),o,0,i)}function Ge(e,t,r,n,o,a,i){if(33619968&~e.getToken()||1&e.flags){if(!(67108864&~e.getToken())){switch(t=131072^(131072|t),e.getToken()){case 67108877:{W(e,8^(262152|t)),16&t&&130===e.getToken()&&"super"===e.tokenValue&&e.report(173),e.assignable=1;const o=je(e,64|t,r);n=e.finishNode({type:"MemberExpression",object:n,computed:!1,property:o,optional:!1},i);break}case 69271571:{let a=!1;2048&~e.flags||(a=!0,e.flags=2048^(2048|e.flags)),W(e,32|t);const{tokenStart:s}=e,c=Ve(e,t,r,o,1,s);U(e,t,20),e.assignable=1,n=e.finishNode({type:"MemberExpression",object:n,computed:!0,property:c,optional:!1},i),a&&(e.flags|=2048);break}case 67174411:{if(!(1024&~e.flags))return e.flags=1024^(1024|e.flags),n;let a=!1;2048&~e.flags||(a=!0,e.flags=2048^(2048|e.flags));const s=Qe(e,t,r,o);e.assignable=2,n=e.finishNode({type:"CallExpression",callee:n,arguments:s,optional:!1},i),a&&(e.flags|=2048);break}case 67108990:W(e,8^(262152|t)),e.flags|=2048,e.assignable=2,n=function(e,t,r,n,o){let a,i=!1;69271571!==e.getToken()&&67174411!==e.getToken()||2048&~e.flags||(i=!0,e.flags=2048^(2048|e.flags));if(69271571===e.getToken()){W(e,32|t);const{tokenStart:i}=e,s=Ve(e,t,r,0,1,i);U(e,t,20),e.assignable=2,a=e.finishNode({type:"MemberExpression",object:n,computed:!0,optional:!0,property:s},o)}else if(67174411===e.getToken()){const i=Qe(e,t,r,0);e.assignable=2,a=e.finishNode({type:"CallExpression",callee:n,arguments:i,optional:!0},o)}else{const i=je(e,t,r);e.assignable=2,a=e.finishNode({type:"MemberExpression",object:n,computed:!1,optional:!0,property:i},o)}i&&(e.flags|=2048);return a}(e,t,r,n,i);break;default:2048&~e.flags||e.report(166),e.assignable=2,n=e.finishNode({type:"TaggedTemplateExpression",tag:n,quasi:67174408===e.getToken()?Ze(e,64|t,r):Ye(e,t)},i)}n=Ge(e,t,r,n,0,1,i)}}else n=function(e,t,r,n){2&e.assignable&&e.report(55);const o=e.getToken();return W(e,t),e.assignable=2,e.finishNode({type:"UpdateExpression",argument:r,operator:A[255&o],prefix:!1},n)}(e,t,n,i);return 0!==a||2048&~e.flags||(e.flags=2048^(2048|e.flags),n=e.finishNode({type:"ChainExpression",expression:n},i)),n}function je(e,t,r){return 143360&e.getToken()||-2147483528===e.getToken()||-2147483527===e.getToken()||130===e.getToken()||e.report(160),130===e.getToken()?St(e,t,r,0):et(e,t)}function Fe(e,t,r,n,o,a,i,s,c){if(!(143360&~e.getToken())){switch(e.getToken()){case 209006:return function(e,t,r,n,o,a){o&&(e.destructible|=128),524288&t&&e.report(177);const i=ut(e,t,r);if("ArrowFunctionExpression"===i.type||!(65536&e.getToken())){if(2048&t)throw new E(a,{index:e.startIndex,line:e.startLine,column:e.startColumn},176);if(2&t)throw new E(a,{index:e.startIndex,line:e.startLine,column:e.startColumn},110);if(8192&t&&2048&t)throw new E(a,{index:e.startIndex,line:e.startLine,column:e.startColumn},110);return i}if(8192&t)throw new E(a,{index:e.startIndex,line:e.startLine,column:e.startColumn},31);if(2048&t||2&t&&8&t){if(n)throw new E(a,{index:e.startIndex,line:e.startLine,column:e.startColumn},0);const o=Oe(e,t,r,0,0,1);return 8391735===e.getToken()&&e.report(33),e.assignable=2,e.finishNode({type:"AwaitExpression",argument:o},a)}if(2&t)throw new E(a,{index:e.startIndex,line:e.startLine,column:e.startColumn},98);return i}(e,t,r,o,i,c);case 241771:return function(e,t,r,n,o,a){if(n&&(e.destructible|=256),1024&t){W(e,32|t),8192&t&&e.report(32),o||e.report(26),22===e.getToken()&&e.report(124);let n=null,i=!1;return 1&e.flags?8391476===e.getToken()&&e.report(30,A[255&e.getToken()]):(i=B(e,32|t,8391476),(77824&e.getToken()||i)&&(n=Ae(e,t,r,1,0,e.tokenStart))),e.assignable=2,e.finishNode({type:"YieldExpression",argument:n,delegate:i},a)}return 1&t&&e.report(97,"yield"),ut(e,t,r)}(e,t,r,i,a,c);case 209005:return function(e,t,r,n,o,a,i,s){const c=e.getToken(),l=et(e,t),{flags:u}=e;if(!(1&u)){if(86104===e.getToken())return nt(e,t,r,1,n,s);if(H(t,e.getToken()))return o||e.report(0),36864&~e.getToken()||(e.flags|=256),ht(e,t,r,a,s)}return i||67174411!==e.getToken()?10===e.getToken()?(M(e,t,c),i&&e.report(51),36864&~c||(e.flags|=256),pt(e,t,r,e.tokenValue,l,i,a,0,s)):(e.assignable=1,l):mt(e,t,r,l,a,1,0,u,s)}(e,t,r,i,s,a,o,c)}const{tokenValue:l}=e,u=e.getToken(),p=et(e,64|t);return 10===e.getToken()?(s||e.report(0),M(e,t,u),36864&~u||(e.flags|=256),pt(e,t,r,l,p,o,a,0,c)):(!(16&t)||32768&t||8192&t||"arguments"!==e.tokenValue||e.report(130),73==(255&u)&&(1&t&&e.report(113),24&n&&e.report(100)),e.assignable=1&t&&!(537079808&~u)?2:1,p)}if(!(134217728&~e.getToken()))return tt(e,t);switch(e.getToken()){case 33619993:case 33619994:return function(e,t,r,n,o,a){n&&e.report(56),o||e.report(0);const i=e.getToken();W(e,32|t);const s=Oe(e,t,r,0,0,1);return 2&e.assignable&&e.report(55),e.assignable=2,e.finishNode({type:"UpdateExpression",argument:s,operator:A[255&i],prefix:!0},a)}(e,t,r,o,s,c);case 16863276:case 16842798:case 16842799:case 25233968:case 25233969:case 16863275:case 16863277:return function(e,t,r,n,o){n||e.report(0);const{tokenStart:a}=e,i=e.getToken();W(e,32|t);const s=Oe(e,t,r,0,o,1);var c;return 8391735===e.getToken()&&e.report(33),1&t&&16863276===i&&("Identifier"===s.type?e.report(121):(c=s).property&&"PrivateIdentifier"===c.property.type&&e.report(127)),e.assignable=2,e.finishNode({type:"UnaryExpression",operator:A[255&i],argument:s,prefix:!0},a)}(e,t,r,s,i);case 86104:return nt(e,t,r,0,i,c);case 2162700:return function(e,t,r,n,o){const a=ct(e,t,void 0,r,n,o,0,2,0);64&e.destructible&&e.report(63);8&e.destructible&&e.report(62);return a}(e,t,r,a?0:1,i);case 69271571:return function(e,t,r,n,o){const a=ot(e,t,void 0,r,n,o,0,2,0);64&e.destructible&&e.report(63);8&e.destructible&&e.report(62);return a}(e,t,r,a?0:1,i);case 67174411:return function(e,t,r,n,o,a,i){e.flags=128^(128|e.flags);const s=e.tokenStart;W(e,262176|t);const c=e.createScopeIfLexical()?.createChildScope(512);if(t=131072^(131072|t),B(e,t,16))return dt(e,t,c,r,[],n,0,i);let l,u=0;e.destructible&=-385;let p=[],d=0,g=0,f=0;const k=e.tokenStart;e.assignable=1;for(;16!==e.getToken();){const{tokenStart:n}=e,i=e.getToken();if(143360&i)c?.addBlockName(t,e.tokenValue,1,0),537079808&~i?36864&~i||(f=1):g=1,l=Fe(e,t,r,o,0,1,1,1,n),16===e.getToken()||18===e.getToken()?2&e.assignable&&(u|=16,g=1):(1077936155===e.getToken()?g=1:u|=16,l=Ge(e,t,r,l,1,0,n),16!==e.getToken()&&18!==e.getToken()&&(l=De(e,t,r,1,0,n,l)));else{if(2097152&~i){if(14===i){l=it(e,t,c,r,16,o,a,0,1,0),16&e.destructible&&e.report(74),g=1,!d||16!==e.getToken()&&18!==e.getToken()||p.push(l),u|=8;break}if(u|=16,l=Ae(e,t,r,1,1,n),!d||16!==e.getToken()&&18!==e.getToken()||p.push(l),18===e.getToken()&&(d||(d=1,p=[l])),d){for(;B(e,32|t,18);)p.push(Ae(e,t,r,1,1,e.tokenStart));e.assignable=2,l=e.finishNode({type:"SequenceExpression",expressions:p},k)}return U(e,t,16),e.destructible=u,e.options.preserveParens?e.finishNode({type:"ParenthesizedExpression",expression:l},s):l}l=2162700===i?ct(e,262144|t,c,r,0,1,0,o,a):ot(e,262144|t,c,r,0,1,0,o,a),u|=e.destructible,g=1,e.assignable=2,16!==e.getToken()&&18!==e.getToken()&&(8&u&&e.report(122),l=Ge(e,t,r,l,0,0,n),u|=16,16!==e.getToken()&&18!==e.getToken()&&(l=De(e,t,r,0,0,n,l)))}if(!d||16!==e.getToken()&&18!==e.getToken()||p.push(l),!B(e,32|t,18))break;if(d||(d=1,p=[l]),16===e.getToken()){u|=8;break}}d&&(e.assignable=2,l=e.finishNode({type:"SequenceExpression",expressions:p},k));U(e,t,16),16&u&&8&u&&e.report(151);if(u|=256&e.destructible?256:128&e.destructible?128:0,10===e.getToken())return 48&u&&e.report(49),2050&t&&128&u&&e.report(31),1025&t&&256&u&&e.report(32),g&&(e.flags|=128),f&&(e.flags|=256),dt(e,t,c,r,d?p:[l],n,0,i);64&u&&e.report(63);8&u&&e.report(144);return e.destructible=256^(256|e.destructible)|u,e.options.preserveParens?e.finishNode({type:"ParenthesizedExpression",expression:l},s):l}(e,64|t,r,a,1,0,c);case 86021:case 86022:case 86023:return function(e,t){const r=e.tokenStart,n=A[255&e.getToken()],o=86023===e.getToken()?null:"true"===n;return W(e,t),e.assignable=2,e.finishNode(e.options.raw?{type:"Literal",value:o,raw:n}:{type:"Literal",value:o},r)}(e,t);case 86111:return function(e,t){const{tokenStart:r}=e;return W(e,t),e.assignable=2,e.finishNode({type:"ThisExpression"},r)}(e,t);case 65540:return function(e,t){const{tokenRaw:r,tokenRegExp:n,tokenValue:o,tokenStart:a}=e;W(e,t),e.assignable=2;const i={type:"Literal",value:o,regex:n};e.options.raw&&(i.raw=r);return e.finishNode(i,a)}(e,t);case 132:case 86094:return function(e,t,r,n,o){let a=null,i=null;const s=Tt(e,t,r);t=16384^(16385|t),W(e,t),4096&e.getToken()&&20565!==e.getToken()&&(j(e,t,e.getToken())&&e.report(118),537079808&~e.getToken()||e.report(119),a=et(e,t));let c=t;B(e,32|t,20565)?(i=Oe(e,t,r,0,n,0),c|=512):c=512^(512|c);const l=xt(e,c,t,void 0,r,2,0,n);return e.assignable=2,e.finishNode({type:"ClassExpression",id:a,superClass:i,body:l,...e.options.next?{decorators:s}:null},o)}(e,t,r,i,c);case 86109:return function(e,t){const{tokenStart:r}=e;switch(W(e,t),e.getToken()){case 67108990:e.report(167);case 67174411:512&t||e.report(28),e.assignable=2;break;case 69271571:case 67108877:256&t||e.report(29),e.assignable=1;break;default:e.report(30,"super")}return e.finishNode({type:"Super"},r)}(e,t);case 67174409:return Ye(e,t);case 67174408:return Ze(e,t,r);case 86107:return function(e,t,r,n){const{tokenStart:o}=e,a=et(e,32|t),{tokenStart:i}=e;if(B(e,t,67108877)){if(65536&t&&209029===e.getToken())return e.assignable=2,function(e,t,r,n){const o=et(e,t);return e.finishNode({type:"MetaProperty",meta:r,property:o},n)}(e,t,a,o);e.report(94)}e.assignable=2,16842752&~e.getToken()||e.report(65,A[255&e.getToken()]);const s=Fe(e,t,r,2,1,0,n,1,i);t=131072^(131072|t),67108990===e.getToken()&&e.report(168);const c=kt(e,t,r,s,n,i);return e.assignable=2,e.finishNode({type:"NewExpression",callee:c,arguments:67174411===e.getToken()?Qe(e,t,r,n):[]},o)}(e,t,r,i);case 134283388:return $e(e,t);case 130:return St(e,t,r,0);case 86106:return function(e,t,r,n,o,a){let i=et(e,t);if(67108877===e.getToken())return Je(e,t,i,a);n&&e.report(142);return i=He(e,t,r,o,a),e.assignable=2,Ge(e,t,r,i,o,0,a)}(e,t,r,o,i,c);case 8456256:if(e.options.jsx)return Et(e,t,r,0,e.tokenStart);default:if(H(t,e.getToken()))return ut(e,t,r);e.report(30,A[255&e.getToken()])}}function Je(e,t,r,n){2&t||e.report(169),W(e,t);const o=e.getToken();return 209030!==o&&"meta"!==e.tokenValue?e.report(174):-2147483648&o&&e.report(175),e.assignable=2,e.finishNode({type:"MetaProperty",meta:r,property:et(e,t)},n)}function He(e,t,r,n,o){U(e,32|t,67174411),14===e.getToken()&&e.report(143);const a=Ae(e,t,r,1,n,e.tokenStart);let i=null;if(18===e.getToken()){if(U(e,t,18),16!==e.getToken()){i=Ae(e,131072^(131072|t),r,1,n,e.tokenStart)}B(e,t,18)}const s={type:"ImportExpression",source:a,options:i};return U(e,t,16),e.finishNode(s,o)}function Me(e,t){if(!B(e,t,20579))return[];U(e,t,2162700);const r=[],n=new Set;for(;1074790415!==e.getToken();){const o=e.tokenStart,a=Xe(e,t);U(e,t,21);const i=ze(e,t),s="Literal"===a.type?a.value:a.name;n.has(s)&&e.report(145,`${s}`),n.add(s),r.push(e.finishNode({type:"ImportAttribute",key:a,value:i},o)),1074790415!==e.getToken()&&U(e,t,18)}return U(e,t,1074790415),r}function ze(e,t){if(134283267===e.getToken())return tt(e,t);e.report(30,A[255&e.getToken()])}function Xe(e,t){return 134283267===e.getToken()?tt(e,t):143360&e.getToken()?et(e,t):void e.report(30,A[255&e.getToken()])}function _e(e,t){return 134283267===e.getToken()?(function(e,t){const r=t.length;for(let n=0;n56319||++n>=r||56320!=(64512&t.charCodeAt(n)))&&e.report(171,JSON.stringify(t.charAt(n--)))}}(e,e.tokenValue),tt(e,t)):143360&e.getToken()?et(e,t):void e.report(30,A[255&e.getToken()])}function $e(e,t){const{tokenRaw:r,tokenValue:n,tokenStart:o}=e;W(e,t),e.assignable=2;const a={type:"Literal",value:n,bigint:String(n)};return e.options.raw&&(a.raw=r),e.finishNode(a,o)}function Ye(e,t){e.assignable=2;const{tokenValue:r,tokenRaw:n,tokenStart:o}=e;U(e,t,67174409);const a=[Ke(e,r,n,o,!0)];return e.finishNode({type:"TemplateLiteral",expressions:[],quasis:a},o)}function Ze(e,t,r){t=131072^(131072|t);const{tokenValue:n,tokenRaw:o,tokenStart:a}=e;U(e,-65&t|32,67174408);const i=[Ke(e,n,o,a,!1)],s=[Ve(e,-65&t,r,0,1,e.tokenStart)];for(1074790415!==e.getToken()&&e.report(83);67174409!==e.setToken(C(e,t),!0);){const{tokenValue:n,tokenRaw:o,tokenStart:a}=e;U(e,-65&t|32,67174408),i.push(Ke(e,n,o,a,!1)),s.push(Ve(e,t,r,0,1,e.tokenStart)),1074790415!==e.getToken()&&e.report(83)}{const{tokenValue:r,tokenRaw:n,tokenStart:o}=e;U(e,t,67174409),i.push(Ke(e,r,n,o,!0))}return e.finishNode({type:"TemplateLiteral",expressions:s,quasis:i},a)}function Ke(e,t,r,n,o){const a=e.finishNode({type:"TemplateElement",value:{cooked:t,raw:r},tail:o},n),i=o?1:2;return e.options.ranges&&(a.start+=1,a.range[0]+=1,a.end-=i,a.range[1]-=i),e.options.loc&&(a.loc.start.column+=1,a.loc.end.column-=i),a}function We(e,t,r){const n=e.tokenStart;U(e,32|(t=131072^(131072|t)),14);const o=Ae(e,t,r,1,0,e.tokenStart);return e.assignable=1,e.finishNode({type:"SpreadElement",argument:o},n)}function Qe(e,t,r,n){W(e,32|t);const o=[];if(16===e.getToken())return W(e,64|t),o;for(;16!==e.getToken()&&(14===e.getToken()?o.push(We(e,t,r)):o.push(Ae(e,t,r,1,n,e.tokenStart)),18===e.getToken())&&(W(e,32|t),16!==e.getToken()););return U(e,64|t,16),o}function et(e,t){const{tokenValue:r,tokenStart:n}=e,o="await"===r&&!(-2147483648&e.getToken());return W(e,t|(o?32:0)),e.finishNode({type:"Identifier",name:r},n)}function tt(e,t){const{tokenValue:r,tokenRaw:n,tokenStart:o}=e;return 134283388===e.getToken()?$e(e,t):(W(e,t),e.assignable=2,e.finishNode(e.options.raw?{type:"Literal",value:r,raw:n}:{type:"Literal",value:r},o))}function rt(e,t,r,n,o,a,i,s,c){W(e,32|t);const l=a?R(e,t,8391476):0;let u,p=null,d=r?e.createScope():void 0;if(67174411===e.getToken())1&i||e.report(39,"Function");else{const n=!(4&o)||8&t&&2&t?64|(s?1024:0)|(l?1024:0):4;G(e,t,e.getToken()),r&&(4&n?r.addVarName(t,e.tokenValue,n):r.addBlockName(t,e.tokenValue,n,o),d=d?.createChildScope(128),i&&2&i&&e.declareUnboundVariable(e.tokenValue)),u=e.getToken(),143360&e.getToken()?p=et(e,t):e.report(30,A[255&e.getToken()])}{const e=28416;t=(t|e)^e|65536|(s?2048:0)|(l?1024:0)|(l?0:262144)}d=d?.createChildScope(256);const g=ft(e,-524289&t|8192,d,n,0,1),f=524428,k=Pe(e,36864|(t|f)^f,d?.createChildScope(64),n,8,u,d);return e.finishNode({type:"FunctionDeclaration",id:p,params:g,body:k,async:1===s,generator:1===l},c)}function nt(e,t,r,n,o,a){W(e,32|t);const i=R(e,t,8391476),s=(n?2048:0)|(i?1024:0);let c,l=null,u=e.createScopeIfLexical();const p=552704;143360&e.getToken()&&(G(e,(t|p)^p|s,e.getToken()),u=u?.createChildScope(128),c=e.getToken(),l=et(e,t)),t=(t|p)^p|65536|s|(i?0:262144),u=u?.createChildScope(256);const d=ft(e,-524289&t|8192,u,r,o,1),g=Pe(e,36864|-131229&t,u?.createChildScope(64),r,0,c,u);return e.assignable=2,e.finishNode({type:"FunctionExpression",id:l,params:d,body:g,async:1===n,generator:1===i},a)}function ot(e,t,r,n,o,a,i,s,c){const{tokenStart:l}=e;W(e,32|t);const u=[];let p=0;for(t=131072^(131072|t);20!==e.getToken();)if(B(e,32|t,18))u.push(null);else{let o;const{tokenStart:l,tokenValue:d}=e,g=e.getToken();if(143360&g)if(o=Fe(e,t,n,s,0,1,a,1,l),1077936155===e.getToken()){2&e.assignable&&e.report(26),W(e,32|t),r?.addVarOrBlock(t,d,s,c);const u=Ae(e,t,n,1,a,e.tokenStart);o=e.finishNode(i?{type:"AssignmentPattern",left:o,right:u}:{type:"AssignmentExpression",operator:"=",left:o,right:u},l),p|=256&e.destructible?256:128&e.destructible?128:0}else 18===e.getToken()||20===e.getToken()?(2&e.assignable?p|=16:r?.addVarOrBlock(t,d,s,c),p|=256&e.destructible?256:128&e.destructible?128:0):(p|=1&s?32:2&s?0:16,o=Ge(e,t,n,o,a,0,l),18!==e.getToken()&&20!==e.getToken()?(1077936155!==e.getToken()&&(p|=16),o=De(e,t,n,a,i,l,o)):1077936155!==e.getToken()&&(p|=2&e.assignable?16:32));else 2097152&g?(o=2162700===e.getToken()?ct(e,t,r,n,0,a,i,s,c):ot(e,t,r,n,0,a,i,s,c),p|=e.destructible,e.assignable=16&e.destructible?2:1,18===e.getToken()||20===e.getToken()?2&e.assignable&&(p|=16):8&e.destructible?e.report(71):(o=Ge(e,t,n,o,a,0,l),p=2&e.assignable?16:0,18!==e.getToken()&&20!==e.getToken()?o=De(e,t,n,a,i,l,o):1077936155!==e.getToken()&&(p|=2&e.assignable?16:32))):14===g?(o=it(e,t,r,n,20,s,c,0,a,i),p|=e.destructible,18!==e.getToken()&&20!==e.getToken()&&e.report(30,A[255&e.getToken()])):(o=Oe(e,t,n,1,0,1),18!==e.getToken()&&20!==e.getToken()?(o=De(e,t,n,a,i,l,o),3&s||67174411!==g||(p|=16)):2&e.assignable?p|=16:67174411===g&&(p|=1&e.assignable&&3&s?32:16));if(u.push(o),!B(e,32|t,18))break;if(20===e.getToken())break}U(e,t,20);const d=e.finishNode({type:i?"ArrayPattern":"ArrayExpression",elements:u},l);return!o&&4194304&e.getToken()?at(e,t,n,p,a,i,l,d):(e.destructible=p,d)}function at(e,t,r,n,o,a,i,s){1077936155!==e.getToken()&&e.report(26),W(e,32|t),16&n&&e.report(26),a||P(e,s);const{tokenStart:c}=e,l=Ae(e,t,r,1,o,c);return e.destructible=72^(72|n)|(128&e.destructible?128:0)|(256&e.destructible?256:0),e.finishNode(a?{type:"AssignmentPattern",left:s,right:l}:{type:"AssignmentExpression",left:s,operator:"=",right:l},i)}function it(e,t,r,n,o,a,i,s,c,l){const{tokenStart:u}=e;W(e,32|t);let p=null,d=0;const{tokenValue:g,tokenStart:f}=e;let k=e.getToken();if(143360&k)e.assignable=1,p=Fe(e,t,n,a,0,1,c,1,f),k=e.getToken(),p=Ge(e,t,n,p,c,0,f),18!==e.getToken()&&e.getToken()!==o&&(2&e.assignable&&1077936155===e.getToken()&&e.report(71),d|=16,p=De(e,t,n,c,l,f,p)),2&e.assignable?d|=16:k===o||18===k?r?.addVarOrBlock(t,g,a,i):d|=32,d|=128&e.destructible?128:0;else if(k===o)e.report(41);else{if(!(2097152&k)){d|=32,p=Oe(e,t,n,1,c,1);const{tokenStart:r}=e,a=e.getToken();return 1077936155===a?(2&e.assignable&&e.report(26),p=De(e,t,n,c,l,r,p),d|=16):(18===a?d|=16:a!==o&&(p=De(e,t,n,c,l,r,p)),d|=1&e.assignable?32:16),e.destructible=d,e.getToken()!==o&&18!==e.getToken()&&e.report(161),e.finishNode({type:l?"RestElement":"SpreadElement",argument:p},u)}p=2162700===e.getToken()?ct(e,t,r,n,1,c,l,a,i):ot(e,t,r,n,1,c,l,a,i),k=e.getToken(),1077936155!==k&&k!==o&&18!==k?(8&e.destructible&&e.report(71),p=Ge(e,t,n,p,c,0,f),d|=2&e.assignable?16:0,4194304&~e.getToken()?(8388608&~e.getToken()||(p=Ue(e,t,n,1,f,4,k,p)),B(e,32|t,22)&&(p=Be(e,t,n,p,f)),d|=2&e.assignable?16:32):(1077936155!==e.getToken()&&(d|=16),p=De(e,t,n,c,l,f,p))):d|=1074790415===o&&1077936155!==k?16:e.destructible}if(e.getToken()!==o)if(1&a&&(d|=s?16:32),B(e,32|t,1077936155)){16&d&&e.report(26),P(e,p);const r=Ae(e,t,n,1,c,e.tokenStart);p=e.finishNode(l?{type:"AssignmentPattern",left:p,right:r}:{type:"AssignmentExpression",left:p,operator:"=",right:r},f),d=16}else d|=16;return e.destructible=d,e.finishNode({type:l?"RestElement":"SpreadElement",argument:p},u)}function st(e,t,r,n,o,a){const i=11264|(64&n?0:16896);t=98560|((t|i)^i|(8&n?1024:0)|(16&n?2048:0)|(64&n?16384:0));let s=e.createScopeIfLexical(256);const c=function(e,t,r,n,o,a,i){U(e,t,67174411);const s=[];if(e.flags=128^(128|e.flags),16===e.getToken())return 512&o&&e.report(37,"Setter","one",""),W(e,t),s;256&o&&e.report(37,"Getter","no","s");512&o&&14===e.getToken()&&e.report(38);t=131072^(131072|t);let c=0,l=0;for(;18!==e.getToken();){let u=null;const{tokenStart:p}=e;if(143360&e.getToken()?(1&t||(36864&~e.getToken()||(e.flags|=256),537079808&~e.getToken()||(e.flags|=512)),u=qt(e,t,r,1|o,0)):(2162700===e.getToken()?u=ct(e,t,r,n,1,i,1,a,0):69271571===e.getToken()?u=ot(e,t,r,n,1,i,1,a,0):14===e.getToken()&&(u=it(e,t,r,n,16,a,0,0,i,1)),l=1,48&e.destructible&&e.report(50)),1077936155===e.getToken()){W(e,32|t),l=1;const r=Ae(e,t,n,1,0,e.tokenStart);u=e.finishNode({type:"AssignmentPattern",left:u,right:r},p)}if(c++,s.push(u),!B(e,t,18))break;if(16===e.getToken())break}512&o&&1!==c&&e.report(37,"Setter","one","");r?.reportScopeError(),l&&(e.flags|=128);return U(e,t,16),s}(e,-524289&t|8192,s,r,n,1,o);s=s?.createChildScope(64);const l=Pe(e,36864|-655373&t,s,r,0,void 0,s?.parent);return e.finishNode({type:"FunctionExpression",params:c,body:l,async:(16&n)>0,generator:(8&n)>0,id:null},a)}function ct(e,t,r,n,o,a,i,s,c){const{tokenStart:l}=e;W(e,t);const u=[];let p=0,d=0;for(t=131072^(131072|t);1074790415!==e.getToken();){const{tokenValue:o,tokenStart:l}=e,g=e.getToken();if(14===g)u.push(it(e,t,r,n,1074790415,s,c,0,a,i));else{let f,k=0,h=null;if(143360&e.getToken()||-2147483528===e.getToken()||-2147483527===e.getToken())if(-2147483527===e.getToken()&&(p|=16),h=et(e,t),18===e.getToken()||1074790415===e.getToken()||1077936155===e.getToken())if(k|=4,1&t&&!(537079808&~g)?p|=16:O(e,t,s,g,0),r?.addVarOrBlock(t,o,s,c),B(e,32|t,1077936155)){p|=8;const r=Ae(e,t,n,1,a,e.tokenStart);p|=256&e.destructible?256:128&e.destructible?128:0,f=e.finishNode({type:"AssignmentPattern",left:e.options.uniqueKeyInPattern?Object.assign({},h):h,right:r},l)}else p|=(209006===g?128:0)|(-2147483528===g?16:0),f=e.options.uniqueKeyInPattern?Object.assign({},h):h;else if(B(e,32|t,21)){const{tokenStart:l}=e;if("__proto__"===o&&d++,143360&e.getToken()){const o=e.getToken(),u=e.tokenValue;f=Fe(e,t,n,s,0,1,a,1,l);const d=e.getToken();f=Ge(e,t,n,f,a,0,l),18===e.getToken()||1074790415===e.getToken()?1077936155===d||1074790415===d||18===d?(p|=128&e.destructible?128:0,2&e.assignable?p|=16:143360&~o||r?.addVarOrBlock(t,u,s,c)):p|=1&e.assignable?32:16:4194304&~e.getToken()?(p|=16,8388608&~e.getToken()||(f=Ue(e,t,n,1,l,4,d,f)),B(e,32|t,22)&&(f=Be(e,t,n,f,l))):(2&e.assignable?p|=16:1077936155!==d?p|=32:r?.addVarOrBlock(t,u,s,c),f=De(e,t,n,a,i,l,f))}else 2097152&~e.getToken()?(f=Oe(e,t,n,1,a,1),p|=1&e.assignable?32:16,18===e.getToken()||1074790415===e.getToken()?2&e.assignable&&(p|=16):(f=Ge(e,t,n,f,a,0,l),p=2&e.assignable?16:0,18!==e.getToken()&&1074790415!==g&&(1077936155!==e.getToken()&&(p|=16),f=De(e,t,n,a,i,l,f)))):(f=69271571===e.getToken()?ot(e,t,r,n,0,a,i,s,c):ct(e,t,r,n,0,a,i,s,c),p=e.destructible,e.assignable=16&p?2:1,18===e.getToken()||1074790415===e.getToken()?2&e.assignable&&(p|=16):8&e.destructible?e.report(71):(f=Ge(e,t,n,f,a,0,l),p=2&e.assignable?16:0,4194304&~e.getToken()?(8388608&~e.getToken()||(f=Ue(e,t,n,1,l,4,g,f)),B(e,32|t,22)&&(f=Be(e,t,n,f,l)),p|=2&e.assignable?16:32):f=Re(e,t,n,a,i,l,f)))}else 69271571===e.getToken()?(p|=16,209005===g&&(k|=16),k|=2|(209008===g?256:209009===g?512:1),h=lt(e,t,n,a),p|=e.assignable,f=st(e,t,n,k,a,e.tokenStart)):143360&e.getToken()?(p|=16,-2147483528===g&&e.report(95),209005===g?(1&e.flags&&e.report(132),k|=17):209008===g?k|=256:209009===g?k|=512:e.report(0),h=et(e,t),f=st(e,t,n,k,a,e.tokenStart)):67174411===e.getToken()?(p|=16,k|=1,f=st(e,t,n,k,a,e.tokenStart)):8391476===e.getToken()?(p|=16,209008===g?e.report(42):209009===g?e.report(43):209005!==g&&e.report(30,A[52]),W(e,t),k|=9|(209005===g?16:0),143360&e.getToken()?h=et(e,t):134217728&~e.getToken()?69271571===e.getToken()?(k|=2,h=lt(e,t,n,a),p|=e.assignable):e.report(30,A[255&e.getToken()]):h=tt(e,t),f=st(e,t,n,k,a,e.tokenStart)):134217728&~e.getToken()?e.report(133):(209005===g&&(k|=16),k|=209008===g?256:209009===g?512:1,p|=16,h=tt(e,t),f=st(e,t,n,k,a,e.tokenStart));else if(134217728&~e.getToken())if(69271571===e.getToken())if(h=lt(e,t,n,a),p|=256&e.destructible?256:0,k|=2,21===e.getToken()){W(e,32|t);const{tokenStart:o,tokenValue:l}=e,u=e.getToken();if(143360&e.getToken()){f=Fe(e,t,n,s,0,1,a,1,o);const d=e.getToken();f=Ge(e,t,n,f,a,0,o),4194304&~e.getToken()?18===e.getToken()||1074790415===e.getToken()?1077936155===d||1074790415===d||18===d?2&e.assignable?p|=16:143360&~u||r?.addVarOrBlock(t,l,s,c):p|=1&e.assignable?32:16:(p|=16,f=De(e,t,n,a,i,o,f)):(p|=2&e.assignable?16:1077936155===d?0:32,f=Re(e,t,n,a,i,o,f))}else 2097152&~e.getToken()?(f=Oe(e,t,n,1,0,1),p|=1&e.assignable?32:16,18===e.getToken()||1074790415===e.getToken()?2&e.assignable&&(p|=16):(f=Ge(e,t,n,f,a,0,o),p=1&e.assignable?0:16,18!==e.getToken()&&1074790415!==e.getToken()&&(1077936155!==e.getToken()&&(p|=16),f=De(e,t,n,a,i,o,f)))):(f=69271571===e.getToken()?ot(e,t,r,n,0,a,i,s,c):ct(e,t,r,n,0,a,i,s,c),p=e.destructible,e.assignable=16&p?2:1,18===e.getToken()||1074790415===e.getToken()?2&e.assignable&&(p|=16):8&p?e.report(62):(f=Ge(e,t,n,f,a,0,o),p=2&e.assignable?16|p:0,4194304&~e.getToken()?(8388608&~e.getToken()||(f=Ue(e,t,n,1,o,4,g,f)),B(e,32|t,22)&&(f=Be(e,t,n,f,o)),p|=2&e.assignable?16:32):(1077936155!==e.getToken()&&(p|=16),f=Re(e,t,n,a,i,o,f))))}else 67174411===e.getToken()?(k|=1,f=st(e,t,n,k,a,e.tokenStart),p=16):e.report(44);else if(8391476===g)if(U(e,32|t,8391476),k|=8,143360&e.getToken()){const r=e.getToken();if(h=et(e,t),k|=1,67174411!==e.getToken())throw new E(e.tokenStart,e.currentLocation,209005===r?46:209008===r||209009===e.getToken()?45:47,A[255&r]);p|=16,f=st(e,t,n,k,a,e.tokenStart)}else 134217728&~e.getToken()?69271571===e.getToken()?(p|=16,k|=3,h=lt(e,t,n,a),f=st(e,t,n,k,a,e.tokenStart)):e.report(126):(p|=16,h=tt(e,t),k|=1,f=st(e,t,n,k,a,e.tokenStart));else e.report(30,A[255&g]);else if(h=tt(e,t),21===e.getToken()){U(e,32|t,21);const{tokenStart:l}=e;if("__proto__"===o&&d++,143360&e.getToken()){f=Fe(e,t,n,s,0,1,a,1,l);const{tokenValue:o}=e,u=e.getToken();f=Ge(e,t,n,f,a,0,l),18===e.getToken()||1074790415===e.getToken()?1077936155===u||1074790415===u||18===u?2&e.assignable?p|=16:r?.addVarOrBlock(t,o,s,c):p|=1&e.assignable?32:16:1077936155===e.getToken()?(2&e.assignable&&(p|=16),f=De(e,t,n,a,i,l,f)):(p|=16,f=De(e,t,n,a,i,l,f))}else 2097152&~e.getToken()?(f=Oe(e,t,n,1,0,1),p|=1&e.assignable?32:16,18===e.getToken()||1074790415===e.getToken()?2&e.assignable&&(p|=16):(f=Ge(e,t,n,f,a,0,l),p=1&e.assignable?0:16,18!==e.getToken()&&1074790415!==e.getToken()&&(1077936155!==e.getToken()&&(p|=16),f=De(e,t,n,a,i,l,f)))):(f=69271571===e.getToken()?ot(e,t,r,n,0,a,i,s,c):ct(e,t,r,n,0,a,i,s,c),p=e.destructible,e.assignable=16&p?2:1,18===e.getToken()||1074790415===e.getToken()?2&e.assignable&&(p|=16):8&~e.destructible&&(f=Ge(e,t,n,f,a,0,l),p=2&e.assignable?16:0,4194304&~e.getToken()?(8388608&~e.getToken()||(f=Ue(e,t,n,1,l,4,g,f)),B(e,32|t,22)&&(f=Be(e,t,n,f,l)),p|=2&e.assignable?16:32):f=Re(e,t,n,a,i,l,f)))}else 67174411===e.getToken()?(k|=1,f=st(e,t,n,k,a,e.tokenStart),p=16|e.assignable):e.report(134);p|=128&e.destructible?128:0,e.destructible=p,u.push(e.finishNode({type:"Property",key:h,value:f,kind:768&k?512&k?"set":"get":"init",computed:(2&k)>0,method:(1&k)>0,shorthand:(4&k)>0},l))}if(p|=e.destructible,18!==e.getToken())break;W(e,t)}U(e,t,1074790415),d>1&&(p|=64);const g=e.finishNode({type:i?"ObjectPattern":"ObjectExpression",properties:u},l);return!o&&4194304&e.getToken()?at(e,t,n,p,a,i,l,g):(e.destructible=p,g)}function lt(e,t,r,n){W(e,32|t);const o=Ae(e,131072^(131072|t),r,1,n,e.tokenStart);return U(e,t,20),o}function ut(e,t,r){const{tokenStart:n}=e,{tokenValue:o}=e;let a=0,i=0;537079808&~e.getToken()?36864&~e.getToken()||(i=1):a=1;const s=et(e,t);if(e.assignable=1,10===e.getToken()){const c=e.options.lexical?se(e,t,o):void 0;return a&&(e.flags|=128),i&&(e.flags|=256),gt(e,t,c,r,[s],0,n)}return s}function pt(e,t,r,n,o,a,i,s,c){i||e.report(57),a&&e.report(51),e.flags&=-129;return gt(e,t,e.options.lexical?se(e,t,n):void 0,r,[o],s,c)}function dt(e,t,r,n,o,a,i,s){a||e.report(57);for(let t=0;t0&&"constructor"===e.tokenValue&&e.report(109),1074790415===e.getToken()&&e.report(108),B(e,t,1074790417)?i.length>0&&e.report(120):d.push(wt(e,t,n,l,r,a,i,0,s,i.length>0?o:e.tokenStart))}return U(e,8&i?32|t:t,1074790415),l?.validatePrivateIdentifierRefs(),e.flags=-33&e.flags|p,e.finishNode({type:"ClassBody",body:d},c)}function wt(e,t,r,n,o,a,i,s,c,l){let u=s?32:0,p=null;const d=e.getToken();if(176128&d||-2147483528===d)switch(p=et(e,t),d){case 36970:if(!s&&67174411!==e.getToken()&&1048576&~e.getToken()&&1077936155!==e.getToken())return wt(e,t,r,n,o,a,i,1,c,l);break;case 209005:if(67174411!==e.getToken()&&!(1&e.flags)){if(!(1073741824&~e.getToken()))return vt(e,t,n,p,u,i,l);u|=16|(R(e,t,8391476)?8:0)}break;case 209008:if(67174411!==e.getToken()){if(!(1073741824&~e.getToken()))return vt(e,t,n,p,u,i,l);u|=256}break;case 209009:if(67174411!==e.getToken()){if(!(1073741824&~e.getToken()))return vt(e,t,n,p,u,i,l);u|=512}break;case 12402:if(67174411!==e.getToken()&&!(1&e.flags)){if(!(1073741824&~e.getToken()))return vt(e,t,n,p,u,i,l);e.options.next&&(u|=1024)}}else if(69271571===d)u|=2,p=lt(e,o,n,c);else if(134217728&~d)if(8391476===d)u|=8,W(e,t);else if(130===e.getToken())u|=8192,p=St(e,16|t,n,768);else if(1073741824&~e.getToken()){if(s&&2162700===d)return function(e,t,r,n,o){return r=r?.createChildScope(),fe(e,t=592128|5764^(5764|t),r,n,{},o,"StaticBlock")}(e,16|t,r,n,l);-2147483527===d?(p=et(e,t),67174411!==e.getToken()&&e.report(30,A[255&e.getToken()])):e.report(30,A[255&e.getToken()])}else u|=128;else p=tt(e,t);if(1816&u&&(143360&e.getToken()||-2147483528===e.getToken()||-2147483527===e.getToken()?p=et(e,t):134217728&~e.getToken()?69271571===e.getToken()?(u|=2,p=lt(e,t,n,0)):130===e.getToken()?(u|=8192,p=St(e,t,n,u)):e.report(135):p=tt(e,t)),2&u||("constructor"===e.tokenValue?(1073741824&~e.getToken()?32&u||67174411!==e.getToken()||(920&u?e.report(53,"accessor"):512&t||(32&e.flags?e.report(54):e.flags|=32)):e.report(129),u|=64):!(8192&u)&&32&u&&"prototype"===e.tokenValue&&e.report(52)),1024&u||67174411!==e.getToken()&&!(768&u))return vt(e,t,n,p,u,i,l);const g=st(e,16|t,n,u,c,e.tokenStart);return e.finishNode({type:"MethodDefinition",kind:!(32&u)&&64&u?"constructor":256&u?"get":512&u?"set":"method",static:(32&u)>0,computed:(2&u)>0,key:p,value:g,...e.options.next?{decorators:i}:null},l)}function St(e,t,r,n){const{tokenStart:o}=e;W(e,t);const{tokenValue:a}=e;return"constructor"===a&&e.report(128),e.options.lexical&&(r||e.report(4,a),n?r.addPrivateIdentifier(a,n):r.addPrivateIdentifierRef(a)),W(e,t),e.finishNode({type:"PrivateIdentifier",name:a},o)}function vt(e,t,r,n,o,a,i){let s=null;if(8&o&&e.report(0),1077936155===e.getToken()){W(e,32|t);const{tokenStart:n}=e;537079927===e.getToken()&&e.report(119);const a=11264|(64&o?0:16896);s=Fe(e,16|(t=65792|((t|a)^a|(8&o?1024:0)|(16&o?2048:0)|(64&o?16384:0))),r,2,0,1,0,1,n),!(1073741824&~e.getToken())&&4194304&~e.getToken()||(s=Ge(e,16|t,r,s,0,0,n),s=De(e,16|t,r,0,0,n,s))}return V(e,t),e.finishNode({type:1024&o?"AccessorProperty":"PropertyDefinition",key:n,value:s,static:(32&o)>0,computed:(2&o)>0,...e.options.next?{decorators:a}:null},i)}function Ct(e,t,r,n,o,a){if(143360&e.getToken()||!(1&t)&&-2147483527===e.getToken())return qt(e,t,r,o,a);2097152&~e.getToken()&&e.report(30,A[255&e.getToken()]);const i=69271571===e.getToken()?ot(e,t,r,n,1,0,1,o,a):ct(e,t,r,n,1,0,1,o,a);return 16&e.destructible&&e.report(50),32&e.destructible&&e.report(50),i}function qt(e,t,r,n,o){const a=e.getToken();1&t&&(537079808&~a?36864&~a&&-2147483527!==a||e.report(118):e.report(119)),20480&~a||e.report(102),241771===a&&(1024&t&&e.report(32),2&t&&e.report(111)),73==(255&a)&&24&n&&e.report(100),209006===a&&(2048&t&&e.report(176),2&t&&e.report(110));const{tokenValue:i,tokenStart:s}=e;return W(e,t),r?.addVarOrBlock(t,i,n,o),e.finishNode({type:"Identifier",name:i},s)}function Et(e,t,r,n,o){if(n||U(e,t,8456256),8390721===e.getToken()){const a=function(e,t){return oe(e),e.finishNode({type:"JSXOpeningFragment"},t)}(e,o),[i,s]=function(e,t,r,n){const o=[];for(;;){const a=Lt(e,t,r,n);if("JSXClosingFragment"===a.type)return[o,a];o.push(a)}}(e,t,r,n);return e.finishNode({type:"JSXFragment",openingFragment:a,children:i,closingFragment:s},o)}8457014===e.getToken()&&e.report(30,A[255&e.getToken()]);let a=null,i=[];const s=function(e,t,r,n,o){143360&~e.getToken()&&4096&~e.getToken()&&e.report(0);const a=It(e,t),i=function(e,t,r){const n=[];for(;8457014!==e.getToken()&&8390721!==e.getToken()&&1048576!==e.getToken();)n.push(Dt(e,t,r));return n}(e,t,r),s=8457014===e.getToken();s&&U(e,t,8457014);8390721!==e.getToken()&&e.report(25,A[65]);n||!s?oe(e):W(e,t);return e.finishNode({type:"JSXOpeningElement",name:a,attributes:i,selfClosing:s},o)}(e,t,r,n,o);if(!s.selfClosing){[i,a]=function(e,t,r,n){const o=[];for(;;){const a=Nt(e,t,r,n);if("JSXClosingElement"===a.type)return[o,a];o.push(a)}}(e,t,r,n);const o=J(a.name);J(s.name)!==o&&e.report(155,o)}return e.finishNode({type:"JSXElement",children:i,openingElement:s,closingElement:a},o)}function Nt(e,t,r,n){if(137===e.getToken())return At(e,t);if(2162700===e.getToken())return Bt(e,t,r,1,0);if(8456256===e.getToken()){const{tokenStart:o}=e;return W(e,t),8457014===e.getToken()?function(e,t,r,n){U(e,t,8457014);const o=It(e,t);return 8390721!==e.getToken()&&e.report(25,A[65]),r?oe(e):W(e,t),e.finishNode({type:"JSXClosingElement",name:o},n)}(e,t,n,o):Et(e,t,r,1,o)}e.report(0)}function Lt(e,t,r,n){if(137===e.getToken())return At(e,t);if(2162700===e.getToken())return Bt(e,t,r,1,0);if(8456256===e.getToken()){const{tokenStart:o}=e;return W(e,t),8457014===e.getToken()?function(e,t,r,n){return U(e,t,8457014),8390721!==e.getToken()&&e.report(25,A[65]),r?oe(e):W(e,t),e.finishNode({type:"JSXClosingFragment"},n)}(e,t,n,o):Et(e,t,r,1,o)}e.report(0)}function At(e,t){const r=e.tokenStart;W(e,t);const n={type:"JSXText",value:e.tokenValue};return e.options.raw&&(n.raw=e.tokenRaw),e.finishNode(n,r)}function It(e,t){const{tokenStart:r}=e;ae(e);let n=Ut(e,t);if(21===e.getToken())return Rt(e,t,n,r);for(;B(e,t,67108877);)ae(e),n=Vt(e,t,n,r);return n}function Vt(e,t,r,n){const o=Ut(e,t);return e.finishNode({type:"JSXMemberExpression",object:r,property:o},n)}function Dt(e,t,r){const{tokenStart:n}=e;if(2162700===e.getToken())return function(e,t,r){const n=e.tokenStart;W(e,t),U(e,t,14);const o=Ae(e,t,r,1,0,e.tokenStart);return U(e,t,1074790415),e.finishNode({type:"JSXSpreadAttribute",argument:o},n)}(e,t,r);ae(e);let o=null,a=Ut(e,t);if(21===e.getToken()&&(a=Rt(e,t,a,n)),1077936155===e.getToken()){switch(ne(e,t)){case 134283267:o=tt(e,t);break;case 8456256:o=Et(e,t,r,0,e.tokenStart);break;case 2162700:o=Bt(e,t,r,0,1);break;default:e.report(154)}}return e.finishNode({type:"JSXAttribute",value:o,name:a},n)}function Rt(e,t,r,n){U(e,t,21);const o=Ut(e,t);return e.finishNode({type:"JSXNamespacedName",namespace:r,name:o},n)}function Bt(e,t,r,n,o){const{tokenStart:a}=e;W(e,32|t);const{tokenStart:i}=e;if(14===e.getToken())return function(e,t,r,n){U(e,t,14);const o=Ae(e,t,r,1,0,e.tokenStart);return U(e,t,1074790415),e.finishNode({type:"JSXSpreadChild",expression:o},n)}(e,t,r,a);let s=null;return 1074790415===e.getToken()?(o&&e.report(157),s=function(e,t){return e.finishNode({type:"JSXEmptyExpression"},t,e.tokenStart)}(e,{index:e.startIndex,line:e.startLine,column:e.startColumn})):s=Ae(e,t,r,1,0,i),1074790415!==e.getToken()&&e.report(25,A[15]),n?oe(e):W(e,t),e.finishNode({type:"JSXExpressionContainer",expression:s},a)}function Ut(e,t){const r=e.tokenStart;143360&e.getToken()||e.report(30,A[255&e.getToken()]);const{tokenValue:n}=e;return W(e,t),e.finishNode({type:"JSXIdentifier",name:n},r)}const Pt="6.1.4";function Ot(e,t){return ue(e,t)}function Gt(e,t){return ue(e,t,3)}function jt(e,t){return ue(e,t)}export{jt as parse,Gt as parseModule,Ot as parseScript,Pt as version}; diff --git a/node_modules/meriyah/dist/meriyah.mjs b/node_modules/meriyah/dist/meriyah.mjs new file mode 100644 index 0000000..9a79954 --- /dev/null +++ b/node_modules/meriyah/dist/meriyah.mjs @@ -0,0 +1,9199 @@ +const unicodeLookup = ((compressed, lookup) => { + const result = new Uint32Array(69632); + let index = 0; + let subIndex = 0; + while (index < 2571) { + const inst = compressed[index++]; + if (inst < 0) { + subIndex -= inst; + } + else { + let code = compressed[index++]; + if (inst & 2) + code = lookup[code]; + if (inst & 1) { + result.fill(code, subIndex, subIndex += compressed[index++]); + } + else { + result[subIndex++] = code; + } + } + } + return result; +})([-1, 2, 26, 2, 27, 2, 5, -1, 0, 77595648, 3, 44, 2, 3, 0, 14, 2, 63, 2, 64, 3, 0, 3, 0, 3168796671, 0, 4294956992, 2, 1, 2, 0, 2, 41, 3, 0, 4, 0, 4294966523, 3, 0, 4, 2, 16, 2, 65, 2, 0, 0, 4294836735, 0, 3221225471, 0, 4294901942, 2, 66, 0, 134152192, 3, 0, 2, 0, 4294951935, 3, 0, 2, 0, 2683305983, 0, 2684354047, 2, 18, 2, 0, 0, 4294961151, 3, 0, 2, 2, 19, 2, 0, 0, 608174079, 2, 0, 2, 60, 2, 7, 2, 6, 0, 4286611199, 3, 0, 2, 2, 1, 3, 0, 3, 0, 4294901711, 2, 40, 0, 4089839103, 0, 2961209759, 0, 1342439375, 0, 4294543342, 0, 3547201023, 0, 1577204103, 0, 4194240, 0, 4294688750, 2, 2, 0, 80831, 0, 4261478351, 0, 4294549486, 2, 2, 0, 2967484831, 0, 196559, 0, 3594373100, 0, 3288319768, 0, 8469959, 0, 65472, 2, 3, 0, 4093640191, 0, 660618719, 0, 65487, 0, 4294828015, 0, 4092591615, 0, 1616920031, 0, 982991, 2, 3, 2, 0, 0, 2163244511, 0, 4227923919, 0, 4236247022, 2, 71, 0, 4284449919, 0, 851904, 2, 4, 2, 12, 0, 67076095, -1, 2, 72, 0, 1073741743, 0, 4093607775, -1, 0, 50331649, 0, 3265266687, 2, 33, 0, 4294844415, 0, 4278190047, 2, 20, 2, 137, -1, 3, 0, 2, 2, 23, 2, 0, 2, 10, 2, 0, 2, 15, 2, 22, 3, 0, 10, 2, 74, 2, 0, 2, 75, 2, 76, 2, 77, 2, 0, 2, 78, 2, 0, 2, 11, 0, 261632, 2, 25, 3, 0, 2, 2, 13, 2, 4, 3, 0, 18, 2, 79, 2, 5, 3, 0, 2, 2, 80, 0, 2151677951, 2, 29, 2, 9, 0, 909311, 3, 0, 2, 0, 814743551, 2, 49, 0, 67090432, 3, 0, 2, 2, 42, 2, 0, 2, 6, 2, 0, 2, 30, 2, 8, 0, 268374015, 2, 110, 2, 51, 2, 0, 2, 81, 0, 134153215, -1, 2, 7, 2, 0, 2, 8, 0, 2684354559, 0, 67044351, 0, 3221160064, 2, 17, -1, 3, 0, 2, 2, 53, 0, 1046528, 3, 0, 3, 2, 9, 2, 0, 2, 54, 0, 4294960127, 2, 10, 2, 6, 2, 11, 0, 4294377472, 2, 12, 3, 0, 16, 2, 13, 2, 0, 2, 82, 2, 10, 2, 0, 2, 83, 2, 84, 2, 85, 0, 12288, 2, 55, 0, 1048577, 2, 86, 2, 14, -1, 2, 14, 0, 131042, 2, 87, 2, 88, 2, 89, 2, 0, 2, 34, -83, 3, 0, 7, 0, 1046559, 2, 0, 2, 15, 2, 0, 0, 2147516671, 2, 21, 3, 90, 2, 2, 0, -16, 2, 91, 0, 524222462, 2, 4, 2, 0, 0, 4269801471, 2, 4, 3, 0, 2, 2, 28, 2, 16, 3, 0, 2, 2, 17, 2, 0, -1, 2, 18, -16, 3, 0, 206, -2, 3, 0, 692, 2, 73, -1, 2, 18, 2, 10, 3, 0, 8, 2, 93, 2, 133, 2, 0, 0, 3220242431, 3, 0, 3, 2, 19, 2, 94, 2, 95, 3, 0, 2, 2, 96, 2, 0, 2, 97, 2, 46, 2, 0, 0, 4351, 2, 0, 2, 9, 3, 0, 2, 0, 67043391, 0, 3909091327, 2, 0, 2, 24, 2, 9, 2, 20, 3, 0, 2, 0, 67076097, 2, 8, 2, 0, 2, 21, 0, 67059711, 0, 4236247039, 3, 0, 2, 0, 939524103, 0, 8191999, 2, 101, 2, 102, 2, 22, 2, 23, 3, 0, 3, 0, 67057663, 3, 0, 349, 2, 103, 2, 104, 2, 7, -264, 3, 0, 11, 2, 24, 3, 0, 2, 2, 32, -1, 0, 3774349439, 2, 105, 2, 106, 3, 0, 2, 2, 19, 2, 107, 3, 0, 10, 2, 10, 2, 18, 2, 0, 2, 47, 2, 0, 2, 31, 2, 108, 2, 25, 0, 1638399, 0, 57344, 2, 109, 3, 0, 3, 2, 20, 2, 26, 2, 27, 2, 5, 2, 28, 2, 0, 2, 8, 2, 111, -1, 2, 112, 2, 113, 2, 114, -1, 3, 0, 3, 2, 12, -2, 2, 0, 2, 29, -3, 0, 536870912, -4, 2, 20, 2, 0, 2, 36, 0, 1, 2, 0, 2, 67, 2, 6, 2, 12, 2, 10, 2, 0, 2, 115, -1, 3, 0, 4, 2, 10, 2, 23, 2, 116, 2, 7, 2, 0, 2, 117, 2, 0, 2, 118, 2, 119, 2, 120, 2, 0, 2, 9, 3, 0, 9, 2, 21, 2, 30, 2, 31, 2, 121, 2, 122, -2, 2, 123, 2, 124, 2, 30, 2, 21, 2, 8, -2, 2, 125, 2, 30, 2, 32, -2, 2, 0, 2, 39, -2, 0, 4277137519, 0, 2269118463, -1, 3, 20, 2, -1, 2, 33, 2, 38, 2, 0, 3, 30, 2, 2, 35, 2, 19, -3, 3, 0, 2, 2, 34, -1, 2, 0, 2, 35, 2, 0, 2, 35, 2, 0, 2, 48, 2, 0, 0, 4294950463, 2, 37, -7, 2, 0, 0, 203775, 2, 57, 0, 4026531840, 2, 20, 2, 43, 2, 36, 2, 18, 2, 37, 2, 18, 2, 126, 2, 21, 3, 0, 2, 2, 38, 0, 2151677888, 2, 0, 2, 12, 0, 4294901764, 2, 144, 2, 0, 2, 58, 2, 56, 0, 5242879, 3, 0, 2, 0, 402644511, -1, 2, 128, 2, 39, 0, 3, -1, 2, 129, 2, 130, 2, 0, 0, 67045375, 2, 40, 0, 4226678271, 0, 3766565279, 0, 2039759, 2, 132, 2, 41, 0, 1046437, 0, 6, 3, 0, 2, 0, 3288270847, 0, 3, 3, 0, 2, 0, 67043519, -5, 2, 0, 0, 4282384383, 0, 1056964609, -1, 3, 0, 2, 0, 67043345, -1, 2, 0, 2, 42, 2, 23, 2, 50, 2, 11, 2, 61, 2, 38, -5, 2, 0, 2, 12, -3, 3, 0, 2, 0, 2147484671, 2, 134, 0, 4190109695, 2, 52, -2, 2, 135, 0, 4244635647, 0, 27, 2, 0, 2, 8, 2, 43, 2, 0, 2, 68, 2, 18, 2, 0, 2, 42, -6, 2, 0, 2, 45, 2, 59, 2, 44, 2, 45, 2, 46, 2, 47, 0, 8388351, -2, 2, 136, 0, 3028287487, 2, 48, 2, 138, 0, 33259519, 2, 49, -9, 2, 21, 0, 4294836223, 0, 3355443199, 0, 134152199, -2, 2, 69, -2, 3, 0, 28, 2, 32, -3, 3, 0, 3, 2, 17, 3, 0, 6, 2, 50, -81, 2, 18, 3, 0, 2, 2, 36, 3, 0, 33, 2, 25, 2, 30, 3, 0, 124, 2, 12, 3, 0, 18, 2, 38, -213, 2, 0, 2, 32, -54, 3, 0, 17, 2, 42, 2, 8, 2, 23, 2, 0, 2, 8, 2, 23, 2, 51, 2, 0, 2, 21, 2, 52, 2, 139, 2, 25, -13, 2, 0, 2, 53, -6, 3, 0, 2, -4, 3, 0, 2, 0, 4294936575, 2, 0, 0, 4294934783, -2, 0, 196635, 3, 0, 191, 2, 54, 3, 0, 38, 2, 30, 2, 55, 2, 34, -278, 2, 140, 3, 0, 9, 2, 141, 2, 142, 2, 56, 3, 0, 11, 2, 7, -72, 3, 0, 3, 2, 143, 0, 1677656575, -130, 2, 26, -16, 2, 0, 2, 24, 2, 38, -16, 0, 4161266656, 0, 4071, 0, 15360, -4, 2, 57, -13, 3, 0, 2, 2, 58, 2, 0, 2, 145, 2, 146, 2, 62, 2, 0, 2, 147, 2, 148, 2, 149, 3, 0, 10, 2, 150, 2, 151, 2, 22, 3, 58, 2, 3, 152, 2, 3, 59, 2, 0, 4294954999, 2, 0, -16, 2, 0, 2, 92, 2, 0, 0, 2105343, 0, 4160749584, 0, 65534, -34, 2, 8, 2, 154, -6, 0, 4194303871, 0, 4294903771, 2, 0, 2, 60, 2, 100, -3, 2, 0, 0, 1073684479, 0, 17407, -9, 2, 18, 2, 17, 2, 0, 2, 32, -14, 2, 18, 2, 32, -6, 2, 18, 2, 12, -15, 2, 155, 3, 0, 6, 0, 8323103, -1, 3, 0, 2, 2, 61, -37, 2, 62, 2, 156, 2, 157, 2, 158, 2, 159, 2, 160, -105, 2, 26, -32, 3, 0, 1335, -1, 3, 0, 129, 2, 32, 3, 0, 6, 2, 10, 3, 0, 180, 2, 161, 3, 0, 233, 2, 162, 3, 0, 18, 2, 10, -77, 3, 0, 16, 2, 10, -47, 3, 0, 154, 2, 6, 3, 0, 130, 2, 25, -22250, 3, 0, 7, 2, 25, -6130, 3, 5, 2, -1, 0, 69207040, 3, 44, 2, 3, 0, 14, 2, 63, 2, 64, -3, 0, 3168731136, 0, 4294956864, 2, 1, 2, 0, 2, 41, 3, 0, 4, 0, 4294966275, 3, 0, 4, 2, 16, 2, 65, 2, 0, 2, 34, -1, 2, 18, 2, 66, -1, 2, 0, 0, 2047, 0, 4294885376, 3, 0, 2, 0, 3145727, 0, 2617294944, 0, 4294770688, 2, 25, 2, 67, 3, 0, 2, 0, 131135, 2, 98, 0, 70256639, 0, 71303167, 0, 272, 2, 42, 2, 6, 0, 32511, 2, 0, 2, 49, -1, 2, 99, 2, 68, 0, 4278255616, 0, 4294836227, 0, 4294549473, 0, 600178175, 0, 2952806400, 0, 268632067, 0, 4294543328, 0, 57540095, 0, 1577058304, 0, 1835008, 0, 4294688736, 2, 70, 2, 69, 0, 33554435, 2, 131, 2, 70, 0, 2952790016, 0, 131075, 0, 3594373096, 0, 67094296, 2, 69, -1, 0, 4294828000, 0, 603979263, 0, 654311424, 0, 3, 0, 4294828001, 0, 602930687, 0, 1610612736, 0, 393219, 0, 4294828016, 0, 671088639, 0, 2154840064, 0, 4227858435, 0, 4236247008, 2, 71, 2, 38, -1, 2, 4, 0, 917503, 2, 38, -1, 2, 72, 0, 537788335, 0, 4026531935, -1, 0, 1, -1, 2, 33, 2, 73, 0, 7936, -3, 2, 0, 0, 2147485695, 0, 1010761728, 0, 4292984930, 0, 16387, 2, 0, 2, 15, 2, 22, 3, 0, 10, 2, 74, 2, 0, 2, 75, 2, 76, 2, 77, 2, 0, 2, 78, 2, 0, 2, 12, -1, 2, 25, 3, 0, 2, 2, 13, 2, 4, 3, 0, 18, 2, 79, 2, 5, 3, 0, 2, 2, 80, 0, 2147745791, 3, 19, 2, 0, 122879, 2, 0, 2, 9, 0, 276824064, -2, 3, 0, 2, 2, 42, 2, 0, 0, 4294903295, 2, 0, 2, 30, 2, 8, -1, 2, 18, 2, 51, 2, 0, 2, 81, 2, 49, -1, 2, 21, 2, 0, 2, 29, -2, 0, 128, -2, 2, 28, 2, 9, 0, 8160, -1, 2, 127, 0, 4227907585, 2, 0, 2, 37, 2, 0, 2, 50, 0, 4227915776, 2, 10, 2, 6, 2, 11, -1, 0, 74440192, 3, 0, 6, -2, 3, 0, 8, 2, 13, 2, 0, 2, 82, 2, 10, 2, 0, 2, 83, 2, 84, 2, 85, -3, 2, 86, 2, 14, -3, 2, 87, 2, 88, 2, 89, 2, 0, 2, 34, -83, 3, 0, 7, 0, 817183, 2, 0, 2, 15, 2, 0, 0, 33023, 2, 21, 3, 90, 2, -17, 2, 91, 0, 524157950, 2, 4, 2, 0, 2, 92, 2, 4, 2, 0, 2, 22, 2, 28, 2, 16, 3, 0, 2, 2, 17, 2, 0, -1, 2, 18, -16, 3, 0, 206, -2, 3, 0, 692, 2, 73, -1, 2, 18, 2, 10, 3, 0, 8, 2, 93, 0, 3072, 2, 0, 0, 2147516415, 2, 10, 3, 0, 2, 2, 25, 2, 94, 2, 95, 3, 0, 2, 2, 96, 2, 0, 2, 97, 2, 46, 0, 4294965179, 0, 7, 2, 0, 2, 9, 2, 95, 2, 9, -1, 0, 1761345536, 2, 98, 0, 4294901823, 2, 38, 2, 20, 2, 99, 2, 35, 2, 100, 0, 2080440287, 2, 0, 2, 34, 2, 153, 0, 3296722943, 2, 0, 0, 1046675455, 0, 939524101, 0, 1837055, 2, 101, 2, 102, 2, 22, 2, 23, 3, 0, 3, 0, 7, 3, 0, 349, 2, 103, 2, 104, 2, 7, -264, 3, 0, 11, 2, 24, 3, 0, 2, 2, 32, -1, 0, 2700607615, 2, 105, 2, 106, 3, 0, 2, 2, 19, 2, 107, 3, 0, 10, 2, 10, 2, 18, 2, 0, 2, 47, 2, 0, 2, 31, 2, 108, -3, 2, 109, 3, 0, 3, 2, 20, -1, 3, 5, 2, 2, 110, 2, 0, 2, 8, 2, 111, -1, 2, 112, 2, 113, 2, 114, -1, 3, 0, 3, 2, 12, -2, 2, 0, 2, 29, -8, 2, 20, 2, 0, 2, 36, -1, 2, 0, 2, 67, 2, 6, 2, 30, 2, 10, 2, 0, 2, 115, -1, 3, 0, 4, 2, 10, 2, 18, 2, 116, 2, 7, 2, 0, 2, 117, 2, 0, 2, 118, 2, 119, 2, 120, 2, 0, 2, 9, 3, 0, 9, 2, 21, 2, 30, 2, 31, 2, 121, 2, 122, -2, 2, 123, 2, 124, 2, 30, 2, 21, 2, 8, -2, 2, 125, 2, 30, 2, 32, -2, 2, 0, 2, 39, -2, 0, 4277075969, 2, 30, -1, 3, 20, 2, -1, 2, 33, 2, 126, 2, 0, 3, 30, 2, 2, 35, 2, 19, -3, 3, 0, 2, 2, 34, -1, 2, 0, 2, 35, 2, 0, 2, 35, 2, 0, 2, 50, 2, 98, 0, 4294934591, 2, 37, -7, 2, 0, 0, 197631, 2, 57, -1, 2, 20, 2, 43, 2, 37, 2, 18, 0, 3, 2, 18, 2, 126, 2, 21, 2, 127, 2, 54, -1, 0, 2490368, 2, 127, 2, 25, 2, 18, 2, 34, 2, 127, 2, 38, 0, 4294901904, 0, 4718591, 2, 127, 2, 35, 0, 335544350, -1, 2, 128, 0, 2147487743, 0, 1, -1, 2, 129, 2, 130, 2, 8, -1, 2, 131, 2, 70, 0, 3758161920, 0, 3, 2, 132, 0, 12582911, 0, 655360, -1, 2, 0, 2, 29, 0, 2147485568, 0, 3, 2, 0, 2, 25, 0, 176, -5, 2, 0, 2, 17, 0, 251658240, -1, 2, 0, 2, 25, 0, 16, -1, 2, 0, 0, 16779263, -2, 2, 12, -1, 2, 38, -5, 2, 0, 2, 133, -3, 3, 0, 2, 2, 55, 2, 134, 0, 2147549183, 0, 2, -2, 2, 135, 2, 36, 0, 10, 0, 4294965249, 0, 67633151, 0, 4026597376, 2, 0, 0, 536871935, 2, 18, 2, 0, 2, 42, -6, 2, 0, 0, 1, 2, 59, 2, 17, 0, 1, 2, 46, 2, 25, -3, 2, 136, 2, 36, 2, 137, 2, 138, 0, 16778239, -10, 2, 35, 0, 4294836212, 2, 9, -3, 2, 69, -2, 3, 0, 28, 2, 32, -3, 3, 0, 3, 2, 17, 3, 0, 6, 2, 50, -81, 2, 18, 3, 0, 2, 2, 36, 3, 0, 33, 2, 25, 0, 126, 3, 0, 124, 2, 12, 3, 0, 18, 2, 38, -213, 2, 10, -55, 3, 0, 17, 2, 42, 2, 8, 2, 18, 2, 0, 2, 8, 2, 18, 2, 60, 2, 0, 2, 25, 2, 50, 2, 139, 2, 25, -13, 2, 0, 2, 73, -6, 3, 0, 2, -4, 3, 0, 2, 0, 67583, -1, 2, 107, -2, 0, 11, 3, 0, 191, 2, 54, 3, 0, 38, 2, 30, 2, 55, 2, 34, -278, 2, 140, 3, 0, 9, 2, 141, 2, 142, 2, 56, 3, 0, 11, 2, 7, -72, 3, 0, 3, 2, 143, 2, 144, -187, 3, 0, 2, 2, 58, 2, 0, 2, 145, 2, 146, 2, 62, 2, 0, 2, 147, 2, 148, 2, 149, 3, 0, 10, 2, 150, 2, 151, 2, 22, 3, 58, 2, 3, 152, 2, 3, 59, 2, 2, 153, -57, 2, 8, 2, 154, -7, 2, 18, 2, 0, 2, 60, -4, 2, 0, 0, 1065361407, 0, 16384, -9, 2, 18, 2, 60, 2, 0, 2, 133, -14, 2, 18, 2, 133, -6, 2, 18, 0, 81919, -15, 2, 155, 3, 0, 6, 2, 126, -1, 3, 0, 2, 0, 2063, -37, 2, 62, 2, 156, 2, 157, 2, 158, 2, 159, 2, 160, -138, 3, 0, 1335, -1, 3, 0, 129, 2, 32, 3, 0, 6, 2, 10, 3, 0, 180, 2, 161, 3, 0, 233, 2, 162, 3, 0, 18, 2, 10, -77, 3, 0, 16, 2, 10, -47, 3, 0, 154, 2, 6, 3, 0, 130, 2, 25, -28386], [4294967295, 4294967291, 4092460543, 4294828031, 4294967294, 134217726, 4294903807, 268435455, 2147483647, 1048575, 1073741823, 3892314111, 134217727, 1061158911, 536805376, 4294910143, 4294901759, 32767, 4294901760, 262143, 536870911, 8388607, 4160749567, 4294902783, 4294918143, 65535, 67043328, 2281701374, 4294967264, 2097151, 4194303, 255, 67108863, 4294967039, 511, 524287, 131071, 63, 127, 3238002687, 4294549487, 4290772991, 33554431, 4294901888, 4286578687, 67043329, 4294705152, 4294770687, 67043583, 1023, 15, 2047999, 67043343, 67051519, 16777215, 2147483648, 4294902000, 28, 4292870143, 4294966783, 16383, 67047423, 4294967279, 262083, 20511, 41943039, 493567, 4294959104, 603979775, 65536, 602799615, 805044223, 4294965206, 8191, 1031749119, 4294917631, 2134769663, 4286578493, 4282253311, 4294942719, 33540095, 4294905855, 2868854591, 1608515583, 265232348, 534519807, 2147614720, 1060109444, 4093640016, 17376, 2139062143, 224, 4169138175, 4294909951, 4286578688, 4294967292, 4294965759, 535511039, 4294966272, 4294967280, 32768, 8289918, 4294934399, 4294901775, 4294965375, 1602223615, 4294967259, 4294443008, 268369920, 4292804608, 4294967232, 486341884, 4294963199, 3087007615, 1073692671, 4128527, 4279238655, 4294902015, 4160684047, 4290246655, 469499899, 4294967231, 134086655, 4294966591, 2445279231, 3670015, 31, 4294967288, 4294705151, 3221208447, 4294902271, 4294549472, 4294921215, 4095, 4285526655, 4294966527, 4294966143, 64, 4294966719, 3774873592, 1877934080, 262151, 2555904, 536807423, 67043839, 3758096383, 3959414372, 3755993023, 2080374783, 4294835295, 4294967103, 4160749565, 4294934527, 4087, 2016, 2147446655, 184024726, 2862017156, 1593309078, 268434431, 268434414, 4294901763, 4294901761]); +const isIDContinue = (code) => (unicodeLookup[(code >>> 5) + 0] >>> code & 31 & 1) !== 0; +const isIDStart = (code) => (unicodeLookup[(code >>> 5) + 34816] >>> code & 31 & 1) !== 0; + +function advanceChar(parser) { + parser.column++; + return (parser.currentChar = parser.source.charCodeAt(++parser.index)); +} +function consumePossibleSurrogatePair(parser) { + const hi = parser.currentChar; + if ((hi & 0xfc00) !== 55296) + return 0; + const lo = parser.source.charCodeAt(parser.index + 1); + if ((lo & 0xfc00) !== 56320) + return 0; + return 65536 + ((hi & 0x3ff) << 10) + (lo & 0x3ff); +} +function consumeLineFeed(parser, state) { + parser.currentChar = parser.source.charCodeAt(++parser.index); + parser.flags |= 1; + if ((state & 4) === 0) { + parser.column = 0; + parser.line++; + } +} +function scanNewLine(parser) { + parser.flags |= 1; + parser.currentChar = parser.source.charCodeAt(++parser.index); + parser.column = 0; + parser.line++; +} +function isExoticECMAScriptWhitespace(ch) { + return (ch === 160 || + ch === 65279 || + ch === 133 || + ch === 5760 || + (ch >= 8192 && ch <= 8203) || + ch === 8239 || + ch === 8287 || + ch === 12288 || + ch === 8201 || + ch === 65519); +} +function toHex(code) { + return code < 65 ? code - 48 : (code - 65 + 10) & 0xf; +} +function convertTokenType(t) { + switch (t) { + case 134283266: + return 'NumericLiteral'; + case 134283267: + return 'StringLiteral'; + case 86021: + case 86022: + return 'BooleanLiteral'; + case 86023: + return 'NullLiteral'; + case 65540: + return 'RegularExpression'; + case 67174408: + case 67174409: + case 131: + return 'TemplateLiteral'; + default: + if ((t & 143360) === 143360) + return 'Identifier'; + if ((t & 4096) === 4096) + return 'Keyword'; + return 'Punctuator'; + } +} + +const CharTypes = [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 8 | 1024, + 0, + 0, + 8 | 2048, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 8192, + 0, + 1 | 2, + 0, + 0, + 8192, + 0, + 0, + 0, + 256, + 0, + 256 | 32768, + 0, + 0, + 2 | 16 | 128 | 32 | 64, + 2 | 16 | 128 | 32 | 64, + 2 | 16 | 32 | 64, + 2 | 16 | 32 | 64, + 2 | 16 | 32 | 64, + 2 | 16 | 32 | 64, + 2 | 16 | 32 | 64, + 2 | 16 | 32 | 64, + 2 | 16 | 512 | 64, + 2 | 16 | 512 | 64, + 0, + 0, + 16384, + 0, + 0, + 0, + 0, + 1 | 2 | 64, + 1 | 2 | 64, + 1 | 2 | 64, + 1 | 2 | 64, + 1 | 2 | 64, + 1 | 2 | 64, + 1 | 2, + 1 | 2, + 1 | 2, + 1 | 2, + 1 | 2, + 1 | 2, + 1 | 2, + 1 | 2, + 1 | 2, + 1 | 2, + 1 | 2, + 1 | 2, + 1 | 2, + 1 | 2, + 1 | 2, + 1 | 2, + 1 | 2, + 1 | 2, + 1 | 2, + 1 | 2, + 0, + 1, + 0, + 0, + 1 | 2 | 4096, + 0, + 1 | 2 | 4 | 64, + 1 | 2 | 4 | 64, + 1 | 2 | 4 | 64, + 1 | 2 | 4 | 64, + 1 | 2 | 4 | 64, + 1 | 2 | 4 | 64, + 1 | 2 | 4, + 1 | 2 | 4, + 1 | 2 | 4, + 1 | 2 | 4, + 1 | 2 | 4, + 1 | 2 | 4, + 1 | 2 | 4, + 1 | 2 | 4, + 1 | 2 | 4, + 1 | 2 | 4, + 1 | 2 | 4, + 1 | 2 | 4, + 1 | 2 | 4, + 1 | 2 | 4, + 1 | 2 | 4, + 1 | 2 | 4, + 1 | 2 | 4, + 1 | 2 | 4, + 1 | 2 | 4, + 1 | 2 | 4, + 16384, + 0, + 0, + 0, + 0 +]; +const isIdStart = [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 0, + 0, + 0, + 0, + 1, + 0, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 0, + 0, + 0, + 0, + 0 +]; +const isIdPart = [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 0, + 0, + 0, + 0, + 1, + 0, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 0, + 0, + 0, + 0, + 0 +]; +function isIdentifierStart(code) { + return code <= 0x7F + ? isIdStart[code] > 0 + : isIDStart(code); +} +function isIdentifierPart(code) { + return code <= 0x7F + ? isIdPart[code] > 0 + : isIDContinue(code) || (code === 8204 || code === 8205); +} + +const CommentTypes = ['SingleLine', 'MultiLine', 'HTMLOpen', 'HTMLClose', 'HashbangComment']; +function skipHashBang(parser) { + const { source } = parser; + if (parser.currentChar === 35 && source.charCodeAt(parser.index + 1) === 33) { + advanceChar(parser); + advanceChar(parser); + skipSingleLineComment(parser, source, 0, 4, parser.tokenStart); + } +} +function skipSingleHTMLComment(parser, source, state, context, type, start) { + if (context & 2) + parser.report(0); + return skipSingleLineComment(parser, source, state, type, start); +} +function skipSingleLineComment(parser, source, state, type, start) { + const { index } = parser; + parser.tokenIndex = parser.index; + parser.tokenLine = parser.line; + parser.tokenColumn = parser.column; + while (parser.index < parser.end) { + if (CharTypes[parser.currentChar] & 8) { + const isCR = parser.currentChar === 13; + scanNewLine(parser); + if (isCR && parser.index < parser.end && parser.currentChar === 10) + parser.currentChar = source.charCodeAt(++parser.index); + break; + } + else if ((parser.currentChar ^ 8232) <= 1) { + scanNewLine(parser); + break; + } + advanceChar(parser); + parser.tokenIndex = parser.index; + parser.tokenLine = parser.line; + parser.tokenColumn = parser.column; + } + if (parser.options.onComment) { + const loc = { + start: { + line: start.line, + column: start.column, + }, + end: { + line: parser.tokenLine, + column: parser.tokenColumn, + }, + }; + parser.options.onComment(CommentTypes[type & 0xff], source.slice(index, parser.tokenIndex), start.index, parser.tokenIndex, loc); + } + return state | 1; +} +function skipMultiLineComment(parser, source, state) { + const { index } = parser; + while (parser.index < parser.end) { + if (parser.currentChar < 0x2b) { + let skippedOneAsterisk = false; + while (parser.currentChar === 42) { + if (!skippedOneAsterisk) { + state &= -5; + skippedOneAsterisk = true; + } + if (advanceChar(parser) === 47) { + advanceChar(parser); + if (parser.options.onComment) { + const loc = { + start: { + line: parser.tokenLine, + column: parser.tokenColumn, + }, + end: { + line: parser.line, + column: parser.column, + }, + }; + parser.options.onComment(CommentTypes[1 & 0xff], source.slice(index, parser.index - 2), index - 2, parser.index, loc); + } + parser.tokenIndex = parser.index; + parser.tokenLine = parser.line; + parser.tokenColumn = parser.column; + return state; + } + } + if (skippedOneAsterisk) { + continue; + } + if (CharTypes[parser.currentChar] & 8) { + if (parser.currentChar === 13) { + state |= 1 | 4; + scanNewLine(parser); + } + else { + consumeLineFeed(parser, state); + state = (state & -5) | 1; + } + } + else { + advanceChar(parser); + } + } + else if ((parser.currentChar ^ 8232) <= 1) { + state = (state & -5) | 1; + scanNewLine(parser); + } + else { + state &= -5; + advanceChar(parser); + } + } + parser.report(18); +} + +var RegexState; +(function (RegexState) { + RegexState[RegexState["Empty"] = 0] = "Empty"; + RegexState[RegexState["Escape"] = 1] = "Escape"; + RegexState[RegexState["Class"] = 2] = "Class"; +})(RegexState || (RegexState = {})); +var RegexFlags; +(function (RegexFlags) { + RegexFlags[RegexFlags["Empty"] = 0] = "Empty"; + RegexFlags[RegexFlags["IgnoreCase"] = 1] = "IgnoreCase"; + RegexFlags[RegexFlags["Global"] = 2] = "Global"; + RegexFlags[RegexFlags["Multiline"] = 4] = "Multiline"; + RegexFlags[RegexFlags["Unicode"] = 16] = "Unicode"; + RegexFlags[RegexFlags["Sticky"] = 8] = "Sticky"; + RegexFlags[RegexFlags["DotAll"] = 32] = "DotAll"; + RegexFlags[RegexFlags["Indices"] = 64] = "Indices"; + RegexFlags[RegexFlags["UnicodeSets"] = 128] = "UnicodeSets"; +})(RegexFlags || (RegexFlags = {})); +function scanRegularExpression(parser) { + const bodyStart = parser.index; + let preparseState = RegexState.Empty; + loop: while (true) { + const ch = parser.currentChar; + advanceChar(parser); + if (preparseState & RegexState.Escape) { + preparseState &= ~RegexState.Escape; + } + else { + switch (ch) { + case 47: + if (!preparseState) + break loop; + else + break; + case 92: + preparseState |= RegexState.Escape; + break; + case 91: + preparseState |= RegexState.Class; + break; + case 93: + preparseState &= RegexState.Escape; + break; + } + } + if (ch === 13 || + ch === 10 || + ch === 8232 || + ch === 8233) { + parser.report(34); + } + if (parser.index >= parser.source.length) { + return parser.report(34); + } + } + const bodyEnd = parser.index - 1; + let mask = RegexFlags.Empty; + let char = parser.currentChar; + const { index: flagStart } = parser; + while (isIdentifierPart(char)) { + switch (char) { + case 103: + if (mask & RegexFlags.Global) + parser.report(36, 'g'); + mask |= RegexFlags.Global; + break; + case 105: + if (mask & RegexFlags.IgnoreCase) + parser.report(36, 'i'); + mask |= RegexFlags.IgnoreCase; + break; + case 109: + if (mask & RegexFlags.Multiline) + parser.report(36, 'm'); + mask |= RegexFlags.Multiline; + break; + case 117: + if (mask & RegexFlags.Unicode) + parser.report(36, 'u'); + if (mask & RegexFlags.UnicodeSets) + parser.report(36, 'vu'); + mask |= RegexFlags.Unicode; + break; + case 118: + if (mask & RegexFlags.Unicode) + parser.report(36, 'uv'); + if (mask & RegexFlags.UnicodeSets) + parser.report(36, 'v'); + mask |= RegexFlags.UnicodeSets; + break; + case 121: + if (mask & RegexFlags.Sticky) + parser.report(36, 'y'); + mask |= RegexFlags.Sticky; + break; + case 115: + if (mask & RegexFlags.DotAll) + parser.report(36, 's'); + mask |= RegexFlags.DotAll; + break; + case 100: + if (mask & RegexFlags.Indices) + parser.report(36, 'd'); + mask |= RegexFlags.Indices; + break; + default: + parser.report(35); + } + char = advanceChar(parser); + } + const flags = parser.source.slice(flagStart, parser.index); + const pattern = parser.source.slice(bodyStart, bodyEnd); + parser.tokenRegExp = { pattern, flags }; + if (parser.options.raw) + parser.tokenRaw = parser.source.slice(parser.tokenIndex, parser.index); + parser.tokenValue = validate(parser, pattern, flags); + return 65540; +} +function validate(parser, pattern, flags) { + try { + return new RegExp(pattern, flags); + } + catch { + try { + new RegExp(pattern, flags); + return null; + } + catch { + parser.report(34); + } + } +} + +function scanString(parser, context, quote) { + const { index: start } = parser; + let ret = ''; + let char = advanceChar(parser); + let marker = parser.index; + while ((CharTypes[char] & 8) === 0) { + if (char === quote) { + ret += parser.source.slice(marker, parser.index); + advanceChar(parser); + if (parser.options.raw) + parser.tokenRaw = parser.source.slice(start, parser.index); + parser.tokenValue = ret; + return 134283267; + } + if ((char & 8) === 8 && char === 92) { + ret += parser.source.slice(marker, parser.index); + char = advanceChar(parser); + if (char < 0x7f || char === 8232 || char === 8233) { + const code = parseEscape(parser, context, char); + if (code >= 0) + ret += String.fromCodePoint(code); + else + handleStringError(parser, code, 0); + } + else { + ret += String.fromCodePoint(char); + } + marker = parser.index + 1; + } + else if (char === 8232 || char === 8233) { + parser.column = -1; + parser.line++; + } + if (parser.index >= parser.end) + parser.report(16); + char = advanceChar(parser); + } + parser.report(16); +} +function parseEscape(parser, context, first, isTemplate = 0) { + switch (first) { + case 98: + return 8; + case 102: + return 12; + case 114: + return 13; + case 110: + return 10; + case 116: + return 9; + case 118: + return 11; + case 13: { + if (parser.index < parser.end) { + const nextChar = parser.source.charCodeAt(parser.index + 1); + if (nextChar === 10) { + parser.index = parser.index + 1; + parser.currentChar = nextChar; + } + } + } + case 10: + case 8232: + case 8233: + parser.column = -1; + parser.line++; + return -1; + case 48: + case 49: + case 50: + case 51: { + let code = first - 48; + let index = parser.index + 1; + let column = parser.column + 1; + if (index < parser.end) { + const next = parser.source.charCodeAt(index); + if ((CharTypes[next] & 32) === 0) { + if (code !== 0 || CharTypes[next] & 512) { + if (context & 1 || isTemplate) + return -2; + parser.flags |= 64; + } + } + else if (context & 1 || isTemplate) { + return -2; + } + else { + parser.currentChar = next; + code = (code << 3) | (next - 48); + index++; + column++; + if (index < parser.end) { + const next = parser.source.charCodeAt(index); + if (CharTypes[next] & 32) { + parser.currentChar = next; + code = (code << 3) | (next - 48); + index++; + column++; + } + } + parser.flags |= 64; + } + parser.index = index - 1; + parser.column = column - 1; + } + return code; + } + case 52: + case 53: + case 54: + case 55: { + if (isTemplate || context & 1) + return -2; + let code = first - 48; + const index = parser.index + 1; + const column = parser.column + 1; + if (index < parser.end) { + const next = parser.source.charCodeAt(index); + if (CharTypes[next] & 32) { + code = (code << 3) | (next - 48); + parser.currentChar = next; + parser.index = index; + parser.column = column; + } + } + parser.flags |= 64; + return code; + } + case 120: { + const ch1 = advanceChar(parser); + if ((CharTypes[ch1] & 64) === 0) + return -4; + const hi = toHex(ch1); + const ch2 = advanceChar(parser); + if ((CharTypes[ch2] & 64) === 0) + return -4; + const lo = toHex(ch2); + return (hi << 4) | lo; + } + case 117: { + const ch = advanceChar(parser); + if (parser.currentChar === 123) { + let code = 0; + while ((CharTypes[advanceChar(parser)] & 64) !== 0) { + code = (code << 4) | toHex(parser.currentChar); + if (code > 1114111) + return -5; + } + if (parser.currentChar < 1 || parser.currentChar !== 125) { + return -4; + } + return code; + } + else { + if ((CharTypes[ch] & 64) === 0) + return -4; + const ch2 = parser.source.charCodeAt(parser.index + 1); + if ((CharTypes[ch2] & 64) === 0) + return -4; + const ch3 = parser.source.charCodeAt(parser.index + 2); + if ((CharTypes[ch3] & 64) === 0) + return -4; + const ch4 = parser.source.charCodeAt(parser.index + 3); + if ((CharTypes[ch4] & 64) === 0) + return -4; + parser.index += 3; + parser.column += 3; + parser.currentChar = parser.source.charCodeAt(parser.index); + return (toHex(ch) << 12) | (toHex(ch2) << 8) | (toHex(ch3) << 4) | toHex(ch4); + } + } + case 56: + case 57: + if (isTemplate || !parser.options.webcompat || context & 1) + return -3; + parser.flags |= 4096; + default: + return first; + } +} +function handleStringError(parser, code, isTemplate) { + switch (code) { + case -1: + return; + case -2: + parser.report(isTemplate ? 2 : 1); + case -3: + parser.report(isTemplate ? 3 : 14); + case -4: + parser.report(7); + case -5: + parser.report(104); + } +} + +function scanTemplate(parser, context) { + const { index: start } = parser; + let token = 67174409; + let ret = ''; + let char = advanceChar(parser); + while (char !== 96) { + if (char === 36 && parser.source.charCodeAt(parser.index + 1) === 123) { + advanceChar(parser); + token = 67174408; + break; + } + else if (char === 92) { + char = advanceChar(parser); + if (char > 0x7e) { + ret += String.fromCodePoint(char); + } + else { + const { index, line, column } = parser; + const code = parseEscape(parser, context | 1, char, 1); + if (code >= 0) { + ret += String.fromCodePoint(code); + } + else if (code !== -1 && context & 64) { + parser.index = index; + parser.line = line; + parser.column = column; + ret = null; + char = scanBadTemplate(parser, char); + if (char < 0) + token = 67174408; + break; + } + else { + handleStringError(parser, code, 1); + } + } + } + else if (parser.index < parser.end) { + if (char === 13 && parser.source.charCodeAt(parser.index) === 10) { + ret += String.fromCodePoint(char); + parser.currentChar = parser.source.charCodeAt(++parser.index); + } + if (((char & 83) < 3 && char === 10) || (char ^ 8232) <= 1) { + parser.column = -1; + parser.line++; + } + ret += String.fromCodePoint(char); + } + if (parser.index >= parser.end) + parser.report(17); + char = advanceChar(parser); + } + advanceChar(parser); + parser.tokenValue = ret; + parser.tokenRaw = parser.source.slice(start + 1, parser.index - (token === 67174409 ? 1 : 2)); + return token; +} +function scanBadTemplate(parser, ch) { + while (ch !== 96) { + switch (ch) { + case 36: { + const index = parser.index + 1; + if (index < parser.end && parser.source.charCodeAt(index) === 123) { + parser.index = index; + parser.column++; + return -ch; + } + break; + } + case 10: + case 8232: + case 8233: + parser.column = -1; + parser.line++; + } + if (parser.index >= parser.end) + parser.report(17); + ch = advanceChar(parser); + } + return ch; +} +function scanTemplateTail(parser, context) { + if (parser.index >= parser.end) + parser.report(0); + parser.index--; + parser.column--; + return scanTemplate(parser, context); +} + +const errorMessages = { + [0]: 'Unexpected token', + [30]: "Unexpected token: '%0'", + [1]: 'Octal escape sequences are not allowed in strict mode', + [2]: 'Octal escape sequences are not allowed in template strings', + [3]: '\\8 and \\9 are not allowed in template strings', + [4]: 'Private identifier #%0 is not defined', + [5]: 'Illegal Unicode escape sequence', + [6]: 'Invalid code point %0', + [7]: 'Invalid hexadecimal escape sequence', + [9]: 'Octal literals are not allowed in strict mode', + [8]: 'Decimal integer literals with a leading zero are forbidden in strict mode', + [10]: 'Expected number in radix %0', + [151]: 'Invalid left-hand side assignment to a destructible right-hand side', + [11]: 'Non-number found after exponent indicator', + [12]: 'Invalid BigIntLiteral', + [13]: 'No identifiers allowed directly after numeric literal', + [14]: 'Escapes \\8 or \\9 are not syntactically valid escapes', + [15]: 'Escapes \\8 or \\9 are not allowed in strict mode', + [16]: 'Unterminated string literal', + [17]: 'Unterminated template literal', + [18]: 'Multiline comment was not closed properly', + [19]: 'The identifier contained dynamic unicode escape that was not closed', + [20]: "Illegal character '%0'", + [21]: 'Missing hexadecimal digits', + [22]: 'Invalid implicit octal', + [23]: 'Invalid line break in string literal', + [24]: 'Only unicode escapes are legal in identifier names', + [25]: "Expected '%0'", + [26]: 'Invalid left-hand side in assignment', + [27]: 'Invalid left-hand side in async arrow', + [28]: 'Calls to super must be in the "constructor" method of a class expression or class declaration that has a superclass', + [29]: 'Member access on super must be in a method', + [31]: 'Await expression not allowed in formal parameter', + [32]: 'Yield expression not allowed in formal parameter', + [95]: "Unexpected token: 'escaped keyword'", + [33]: 'Unary expressions as the left operand of an exponentiation expression must be disambiguated with parentheses', + [123]: 'Async functions can only be declared at the top level or inside a block', + [34]: 'Unterminated regular expression', + [35]: 'Unexpected regular expression flag', + [36]: "Duplicate regular expression flag '%0'", + [37]: '%0 functions must have exactly %1 argument%2', + [38]: 'Setter function argument must not be a rest parameter', + [39]: '%0 declaration must have a name in this context', + [40]: 'Function name may not contain any reserved words or be eval or arguments in strict mode', + [41]: 'The rest operator is missing an argument', + [42]: 'A getter cannot be a generator', + [43]: 'A setter cannot be a generator', + [44]: 'A computed property name must be followed by a colon or paren', + [134]: 'Object literal keys that are strings or numbers must be a method or have a colon', + [46]: 'Found `* async x(){}` but this should be `async * x(){}`', + [45]: 'Getters and setters can not be generators', + [47]: "'%0' can not be generator method", + [48]: "No line break is allowed after '=>'", + [49]: 'The left-hand side of the arrow can only be destructed through assignment', + [50]: 'The binding declaration is not destructible', + [51]: 'Async arrow can not be followed by new expression', + [52]: "Classes may not have a static property named 'prototype'", + [53]: 'Class constructor may not be a %0', + [54]: 'Duplicate constructor method in class', + [55]: 'Invalid increment/decrement operand', + [56]: 'Invalid use of `new` keyword on an increment/decrement expression', + [57]: '`=>` is an invalid assignment target', + [58]: 'Rest element may not have a trailing comma', + [59]: 'Missing initializer in %0 declaration', + [60]: "'for-%0' loop head declarations can not have an initializer", + [61]: 'Invalid left-hand side in for-%0 loop: Must have a single binding', + [62]: 'Invalid shorthand property initializer', + [63]: 'Property name __proto__ appears more than once in object literal', + [64]: 'Let is disallowed as a lexically bound name', + [65]: "Invalid use of '%0' inside new expression", + [66]: "Illegal 'use strict' directive in function with non-simple parameter list", + [67]: 'Identifier "let" disallowed as left-hand side expression in strict mode', + [68]: 'Illegal continue statement', + [69]: 'Illegal break statement', + [70]: 'Cannot have `let[...]` as a var name in strict mode', + [71]: 'Invalid destructuring assignment target', + [72]: 'Rest parameter may not have a default initializer', + [73]: 'The rest argument must the be last parameter', + [74]: 'Invalid rest argument', + [76]: 'In strict mode code, functions can only be declared at top level or inside a block', + [77]: 'In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement', + [78]: 'Without web compatibility enabled functions can not be declared at top level, inside a block, or as the body of an if statement', + [79]: "Class declaration can't appear in single-statement context", + [80]: 'Invalid left-hand side in for-%0', + [81]: 'Invalid assignment in for-%0', + [82]: 'for await (... of ...) is only valid in async functions and async generators', + [83]: 'The first token after the template expression should be a continuation of the template', + [85]: '`let` declaration not allowed here and `let` cannot be a regular var name in strict mode', + [84]: '`let \n [` is a restricted production at the start of a statement', + [86]: 'Catch clause requires exactly one parameter, not more (and no trailing comma)', + [87]: 'Catch clause parameter does not support default values', + [88]: 'Missing catch or finally after try', + [89]: 'More than one default clause in switch statement', + [90]: 'Illegal newline after throw', + [91]: 'Strict mode code may not include a with statement', + [92]: 'Illegal return statement', + [93]: 'The left hand side of the for-header binding declaration is not destructible', + [94]: 'new.target only allowed within functions or static blocks', + [96]: "'#' not followed by identifier", + [102]: 'Invalid keyword', + [101]: "Can not use 'let' as a class name", + [100]: "'A lexical declaration can't define a 'let' binding", + [99]: 'Can not use `let` as variable name in strict mode', + [97]: "'%0' may not be used as an identifier in this context", + [98]: 'Await is only valid in async functions', + [103]: 'The %0 keyword can only be used with the module goal', + [104]: 'Unicode codepoint must not be greater than 0x10FFFF', + [105]: '%0 source must be string', + [106]: 'Only a identifier or string can be used to indicate alias', + [107]: "Only '*' or '{...}' can be imported after default", + [108]: 'Trailing decorator may be followed by method', + [109]: "Decorators can't be used with a constructor", + [110]: 'Can not use `await` as identifier in module or async func', + [111]: 'Can not use `await` as identifier in module', + [112]: 'HTML comments are only allowed with web compatibility (Annex B)', + [113]: "The identifier 'let' must not be in expression position in strict mode", + [114]: 'Cannot assign to `eval` and `arguments` in strict mode', + [115]: "The left-hand side of a for-of loop may not start with 'let'", + [116]: 'Block body arrows can not be immediately invoked without a group', + [117]: 'Block body arrows can not be immediately accessed without a group', + [118]: 'Unexpected strict mode reserved word', + [119]: 'Unexpected eval or arguments in strict mode', + [120]: 'Decorators must not be followed by a semicolon', + [121]: 'Calling delete on expression not allowed in strict mode', + [122]: 'Pattern can not have a tail', + [124]: 'Can not have a `yield` expression on the left side of a ternary', + [125]: 'An arrow function can not have a postfix update operator', + [126]: 'Invalid object literal key character after generator star', + [127]: 'Private fields can not be deleted', + [129]: 'Classes may not have a field called constructor', + [128]: 'Classes may not have a private element named constructor', + [130]: 'A class field initializer or static block may not contain arguments', + [131]: 'Generators can only be declared at the top level or inside a block', + [132]: 'Async methods are a restricted production and cannot have a newline following it', + [133]: 'Unexpected character after object literal property name', + [135]: 'Invalid key token', + [136]: "Label '%0' has already been declared", + [137]: 'continue statement must be nested within an iteration statement', + [138]: "Undefined label '%0'", + [139]: 'Trailing comma is disallowed inside import(...) arguments', + [140]: 'Invalid binding in JSON import', + [141]: 'import() requires exactly one argument', + [142]: 'Cannot use new with import(...)', + [143]: '... is not allowed in import()', + [144]: "Expected '=>'", + [145]: "Duplicate binding '%0'", + [146]: 'Duplicate private identifier #%0', + [147]: "Cannot export a duplicate name '%0'", + [150]: 'Duplicate %0 for-binding', + [148]: "Exported binding '%0' needs to refer to a top-level declared variable", + [149]: 'Unexpected private field', + [153]: 'Numeric separators are not allowed at the end of numeric literals', + [152]: 'Only one underscore is allowed as numeric separator', + [154]: 'JSX value should be either an expression or a quoted JSX text', + [155]: 'Expected corresponding JSX closing tag for %0', + [156]: 'Adjacent JSX elements must be wrapped in an enclosing tag', + [157]: "JSX attributes must only be assigned a non-empty 'expression'", + [158]: "'%0' has already been declared", + [159]: "'%0' shadowed a catch clause binding", + [160]: 'Dot property must be an identifier', + [161]: 'Encountered invalid input after spread/rest argument', + [162]: 'Catch without try', + [163]: 'Finally without try', + [164]: 'Expected corresponding closing tag for JSX fragment', + [165]: 'Coalescing and logical operators used together in the same expression must be disambiguated with parentheses', + [166]: 'Invalid tagged template on optional chain', + [167]: 'Invalid optional chain from super property', + [168]: 'Invalid optional chain from new expression', + [169]: 'Cannot use "import.meta" outside a module', + [170]: 'Leading decorators must be attached to a class declaration', + [171]: 'An export name cannot include a lone surrogate, found %0', + [172]: 'A string literal cannot be used as an exported binding without `from`', + [173]: "Private fields can't be accessed on super", + [174]: "The only valid meta property for import is 'import.meta'", + [175]: "'import.meta' must not contain escaped characters", + [176]: 'cannot use "await" as identifier inside an async function', + [177]: 'cannot use "await" in static blocks', +}; +class ParseError extends SyntaxError { + start; + end; + range; + loc; + description; + constructor(start, end, type, ...params) { + const description = errorMessages[type].replace(/%(\d+)/g, (_, i) => params[i]); + const message = '[' + start.line + ':' + start.column + '-' + end.line + ':' + end.column + ']: ' + description; + super(message); + this.start = start.index; + this.end = end.index; + this.range = [start.index, end.index]; + this.loc = { + start: { line: start.line, column: start.column }, + end: { line: end.line, column: end.column }, + }; + this.description = description; + } +} + +function scanNumber(parser, context, kind) { + let char = parser.currentChar; + let value = 0; + let digit = 9; + let atStart = kind & 64 ? 0 : 1; + let digits = 0; + let allowSeparator = 0; + if (kind & 64) { + value = '.' + scanDecimalDigitsOrSeparator(parser, char); + char = parser.currentChar; + if (char === 110) + parser.report(12); + } + else { + if (char === 48) { + char = advanceChar(parser); + if ((char | 32) === 120) { + kind = 8 | 128; + char = advanceChar(parser); + while (CharTypes[char] & (64 | 4096)) { + if (char === 95) { + if (!allowSeparator) + parser.report(152); + allowSeparator = 0; + char = advanceChar(parser); + continue; + } + allowSeparator = 1; + value = value * 0x10 + toHex(char); + digits++; + char = advanceChar(parser); + } + if (digits === 0 || !allowSeparator) { + parser.report(digits === 0 ? 21 : 153); + } + } + else if ((char | 32) === 111) { + kind = 4 | 128; + char = advanceChar(parser); + while (CharTypes[char] & (32 | 4096)) { + if (char === 95) { + if (!allowSeparator) { + parser.report(152); + } + allowSeparator = 0; + char = advanceChar(parser); + continue; + } + allowSeparator = 1; + value = value * 8 + (char - 48); + digits++; + char = advanceChar(parser); + } + if (digits === 0 || !allowSeparator) { + parser.report(digits === 0 ? 0 : 153); + } + } + else if ((char | 32) === 98) { + kind = 2 | 128; + char = advanceChar(parser); + while (CharTypes[char] & (128 | 4096)) { + if (char === 95) { + if (!allowSeparator) { + parser.report(152); + } + allowSeparator = 0; + char = advanceChar(parser); + continue; + } + allowSeparator = 1; + value = value * 2 + (char - 48); + digits++; + char = advanceChar(parser); + } + if (digits === 0 || !allowSeparator) { + parser.report(digits === 0 ? 0 : 153); + } + } + else if (CharTypes[char] & 32) { + if (context & 1) + parser.report(1); + kind = 1; + while (CharTypes[char] & 16) { + if (CharTypes[char] & 512) { + kind = 32; + atStart = 0; + break; + } + value = value * 8 + (char - 48); + char = advanceChar(parser); + } + } + else if (CharTypes[char] & 512) { + if (context & 1) + parser.report(1); + parser.flags |= 64; + kind = 32; + } + else if (char === 95) { + parser.report(0); + } + } + if (kind & 48) { + if (atStart) { + while (digit >= 0 && CharTypes[char] & (16 | 4096)) { + if (char === 95) { + char = advanceChar(parser); + if (char === 95 || kind & 32) { + throw new ParseError(parser.currentLocation, { index: parser.index + 1, line: parser.line, column: parser.column }, 152); + } + allowSeparator = 1; + continue; + } + allowSeparator = 0; + value = 10 * value + (char - 48); + char = advanceChar(parser); + --digit; + } + if (allowSeparator) { + throw new ParseError(parser.currentLocation, { index: parser.index + 1, line: parser.line, column: parser.column }, 153); + } + if (digit >= 0 && !isIdentifierStart(char) && char !== 46) { + parser.tokenValue = value; + if (parser.options.raw) + parser.tokenRaw = parser.source.slice(parser.tokenIndex, parser.index); + return 134283266; + } + } + value += scanDecimalDigitsOrSeparator(parser, char); + char = parser.currentChar; + if (char === 46) { + if (advanceChar(parser) === 95) + parser.report(0); + kind = 64; + value += '.' + scanDecimalDigitsOrSeparator(parser, parser.currentChar); + char = parser.currentChar; + } + } + } + const end = parser.index; + let isBigInt = 0; + if (char === 110 && kind & 128) { + isBigInt = 1; + char = advanceChar(parser); + } + else { + if ((char | 32) === 101) { + char = advanceChar(parser); + if (CharTypes[char] & 256) + char = advanceChar(parser); + const { index } = parser; + if ((CharTypes[char] & 16) === 0) + parser.report(11); + value += parser.source.substring(end, index) + scanDecimalDigitsOrSeparator(parser, char); + char = parser.currentChar; + } + } + if ((parser.index < parser.end && CharTypes[char] & 16) || isIdentifierStart(char)) { + parser.report(13); + } + if (isBigInt) { + parser.tokenRaw = parser.source.slice(parser.tokenIndex, parser.index); + parser.tokenValue = BigInt(parser.tokenRaw.slice(0, -1).replaceAll('_', '')); + return 134283388; + } + parser.tokenValue = + kind & (1 | 2 | 8 | 4) + ? value + : kind & 32 + ? parseFloat(parser.source.substring(parser.tokenIndex, parser.index)) + : +value; + if (parser.options.raw) + parser.tokenRaw = parser.source.slice(parser.tokenIndex, parser.index); + return 134283266; +} +function scanDecimalDigitsOrSeparator(parser, char) { + let allowSeparator = 0; + let start = parser.index; + let ret = ''; + while (CharTypes[char] & (16 | 4096)) { + if (char === 95) { + const { index } = parser; + char = advanceChar(parser); + if (char === 95) { + throw new ParseError(parser.currentLocation, { index: parser.index + 1, line: parser.line, column: parser.column }, 152); + } + allowSeparator = 1; + ret += parser.source.substring(start, index); + start = parser.index; + continue; + } + allowSeparator = 0; + char = advanceChar(parser); + } + if (allowSeparator) { + throw new ParseError(parser.currentLocation, { index: parser.index + 1, line: parser.line, column: parser.column }, 153); + } + return ret + parser.source.substring(start, parser.index); +} + +const KeywordDescTable = [ + 'end of source', + 'identifier', 'number', 'string', 'regular expression', + 'false', 'true', 'null', + 'template continuation', 'template tail', + '=>', '(', '{', '.', '...', '}', ')', ';', ',', '[', ']', ':', '?', '\'', '"', + '++', '--', + '=', '<<=', '>>=', '>>>=', '**=', '+=', '-=', '*=', '/=', '%=', '^=', '|=', + '&=', '||=', '&&=', '??=', + 'typeof', 'delete', 'void', '!', '~', '+', '-', 'in', 'instanceof', '*', '%', '/', '**', '&&', + '||', '===', '!==', '==', '!=', '<=', '>=', '<', '>', '<<', '>>', '>>>', '&', '|', '^', + 'var', 'let', 'const', + 'break', 'case', 'catch', 'class', 'continue', 'debugger', 'default', 'do', 'else', 'export', + 'extends', 'finally', 'for', 'function', 'if', 'import', 'new', 'return', 'super', 'switch', + 'this', 'throw', 'try', 'while', 'with', + 'implements', 'interface', 'package', 'private', 'protected', 'public', 'static', 'yield', + 'as', 'async', 'await', 'constructor', 'get', 'set', 'accessor', 'from', 'of', + 'enum', 'eval', 'arguments', 'escaped keyword', 'escaped future reserved keyword', 'reserved if strict', '#', + 'BigIntLiteral', '??', '?.', 'WhiteSpace', 'Illegal', 'LineTerminator', 'PrivateField', + 'Template', '@', 'target', 'meta', 'LineFeed', 'Escaped', 'JSXText' +]; +const descKeywordTable = { + this: 86111, + function: 86104, + if: 20569, + return: 20572, + var: 86088, + else: 20563, + for: 20567, + new: 86107, + in: 8673330, + typeof: 16863275, + while: 20578, + case: 20556, + break: 20555, + try: 20577, + catch: 20557, + delete: 16863276, + throw: 86112, + switch: 86110, + continue: 20559, + default: 20561, + instanceof: 8411187, + do: 20562, + void: 16863277, + finally: 20566, + async: 209005, + await: 209006, + class: 86094, + const: 86090, + constructor: 12399, + debugger: 20560, + export: 20564, + extends: 20565, + false: 86021, + from: 209011, + get: 209008, + implements: 36964, + import: 86106, + interface: 36965, + let: 241737, + null: 86023, + of: 471156, + package: 36966, + private: 36967, + protected: 36968, + public: 36969, + set: 209009, + static: 36970, + super: 86109, + true: 86022, + with: 20579, + yield: 241771, + enum: 86133, + eval: 537079926, + as: 77932, + arguments: 537079927, + target: 209029, + meta: 209030, + accessor: 12402, +}; + +function matchOrInsertSemicolon(parser, context) { + if ((parser.flags & 1) === 0 && (parser.getToken() & 1048576) !== 1048576) { + parser.report(30, KeywordDescTable[parser.getToken() & 255]); + } + if (!consumeOpt(parser, context, 1074790417)) { + parser.options.onInsertedSemicolon?.(parser.startIndex); + } +} +function isValidStrictMode(parser, index, tokenIndex, tokenValue) { + if (index - tokenIndex < 13 && tokenValue === 'use strict') { + if ((parser.getToken() & 1048576) === 1048576 || parser.flags & 1) { + return 1; + } + } + return 0; +} +function optionalBit(parser, context, t) { + if (parser.getToken() !== t) + return 0; + nextToken(parser, context); + return 1; +} +function consumeOpt(parser, context, t) { + if (parser.getToken() !== t) + return false; + nextToken(parser, context); + return true; +} +function consume(parser, context, t) { + if (parser.getToken() !== t) + parser.report(25, KeywordDescTable[t & 255]); + nextToken(parser, context); +} +function reinterpretToPattern(parser, node) { + switch (node.type) { + case 'ArrayExpression': { + node.type = 'ArrayPattern'; + const { elements } = node; + for (let i = 0, n = elements.length; i < n; ++i) { + const element = elements[i]; + if (element) + reinterpretToPattern(parser, element); + } + return; + } + case 'ObjectExpression': { + node.type = 'ObjectPattern'; + const { properties } = node; + for (let i = 0, n = properties.length; i < n; ++i) { + reinterpretToPattern(parser, properties[i]); + } + return; + } + case 'AssignmentExpression': + node.type = 'AssignmentPattern'; + if (node.operator !== '=') + parser.report(71); + delete node.operator; + reinterpretToPattern(parser, node.left); + return; + case 'Property': + reinterpretToPattern(parser, node.value); + return; + case 'SpreadElement': + node.type = 'RestElement'; + reinterpretToPattern(parser, node.argument); + } +} +function validateBindingIdentifier(parser, context, kind, t, skipEvalArgCheck) { + if (context & 1) { + if ((t & 36864) === 36864) { + parser.report(118); + } + if (!skipEvalArgCheck && (t & 537079808) === 537079808) { + parser.report(119); + } + } + if ((t & 20480) === 20480 || t === -2147483528) { + parser.report(102); + } + if (kind & (8 | 16) && (t & 255) === (241737 & 255)) { + parser.report(100); + } + if (context & (2048 | 2) && t === 209006) { + parser.report(110); + } + if (context & (1024 | 1) && t === 241771) { + parser.report(97, 'yield'); + } +} +function validateFunctionName(parser, context, t) { + if (context & 1) { + if ((t & 36864) === 36864) { + parser.report(118); + } + if ((t & 537079808) === 537079808) { + parser.report(119); + } + if (t === -2147483527) { + parser.report(95); + } + if (t === -2147483528) { + parser.report(95); + } + } + if ((t & 20480) === 20480) { + parser.report(102); + } + if (context & (2048 | 2) && t === 209006) { + parser.report(110); + } + if (context & (1024 | 1) && t === 241771) { + parser.report(97, 'yield'); + } +} +function isStrictReservedWord(parser, context, t) { + if (t === 209006) { + if (context & (2048 | 2)) + parser.report(110); + parser.destructible |= 128; + } + if (t === 241771 && context & 1024) + parser.report(97, 'yield'); + return ((t & 20480) === 20480 || + (t & 36864) === 36864 || + t == -2147483527); +} +function isPropertyWithPrivateFieldKey(expr) { + return !expr.property ? false : expr.property.type === 'PrivateIdentifier'; +} +function isValidLabel(parser, labels, name, isIterationStatement) { + while (labels) { + if (labels['$' + name]) { + if (isIterationStatement) + parser.report(137); + return 1; + } + if (isIterationStatement && labels.loop) + isIterationStatement = 0; + labels = labels['$']; + } + return 0; +} +function validateAndDeclareLabel(parser, labels, name) { + let set = labels; + while (set) { + if (set['$' + name]) + parser.report(136, name); + set = set['$']; + } + labels['$' + name] = 1; +} +function isEqualTagName(elementName) { + switch (elementName.type) { + case 'JSXIdentifier': + return elementName.name; + case 'JSXNamespacedName': + return elementName.namespace + ':' + elementName.name; + case 'JSXMemberExpression': + return isEqualTagName(elementName.object) + '.' + isEqualTagName(elementName.property); + } +} +function isValidIdentifier(context, t) { + if (context & (1 | 1024)) { + if (context & 2 && t === 209006) + return false; + if (context & 1024 && t === 241771) + return false; + return (t & 12288) === 12288; + } + return (t & 12288) === 12288 || (t & 36864) === 36864; +} +function classifyIdentifier(parser, context, t) { + if ((t & 537079808) === 537079808) { + if (context & 1) + parser.report(119); + parser.flags |= 512; + } + if (!isValidIdentifier(context, t)) + parser.report(0); +} +function getOwnProperty(object, key) { + return Object.hasOwn(object, key) ? object[key] : undefined; +} + +function scanIdentifier(parser, context, isValidAsKeyword) { + while (isIdPart[advanceChar(parser)]) + ; + parser.tokenValue = parser.source.slice(parser.tokenIndex, parser.index); + return parser.currentChar !== 92 && parser.currentChar <= 0x7e + ? (getOwnProperty(descKeywordTable, parser.tokenValue) ?? 208897) + : scanIdentifierSlowCase(parser, context, 0, isValidAsKeyword); +} +function scanUnicodeIdentifier(parser, context) { + const cookedChar = scanIdentifierUnicodeEscape(parser); + if (!isIdentifierStart(cookedChar)) + parser.report(5); + parser.tokenValue = String.fromCodePoint(cookedChar); + return scanIdentifierSlowCase(parser, context, 1, CharTypes[cookedChar] & 4); +} +function scanIdentifierSlowCase(parser, context, hasEscape, isValidAsKeyword) { + let start = parser.index; + while (parser.index < parser.end) { + if (parser.currentChar === 92) { + parser.tokenValue += parser.source.slice(start, parser.index); + hasEscape = 1; + const code = scanIdentifierUnicodeEscape(parser); + if (!isIdentifierPart(code)) + parser.report(5); + isValidAsKeyword = isValidAsKeyword && CharTypes[code] & 4; + parser.tokenValue += String.fromCodePoint(code); + start = parser.index; + } + else { + const merged = consumePossibleSurrogatePair(parser); + if (merged > 0) { + if (!isIdentifierPart(merged)) { + parser.report(20, String.fromCodePoint(merged)); + } + parser.currentChar = merged; + parser.index++; + parser.column++; + } + else if (!isIdentifierPart(parser.currentChar)) { + break; + } + advanceChar(parser); + } + } + if (parser.index <= parser.end) { + parser.tokenValue += parser.source.slice(start, parser.index); + } + const { length } = parser.tokenValue; + if (isValidAsKeyword && length >= 2 && length <= 11) { + const token = getOwnProperty(descKeywordTable, parser.tokenValue); + if (token === void 0) + return 208897 | (hasEscape ? -2147483648 : 0); + if (!hasEscape) + return token; + if (token === 209006) { + if ((context & (2 | 2048)) === 0) { + return token | -2147483648; + } + return -2147483528; + } + if (context & 1) { + if (token === 36970) { + return -2147483527; + } + if ((token & 36864) === 36864) { + return -2147483527; + } + if ((token & 20480) === 20480) { + if (context & 262144 && (context & 8) === 0) { + return token | -2147483648; + } + else { + return -2147483528; + } + } + return 209018 | -2147483648; + } + if (context & 262144 && + (context & 8) === 0 && + (token & 20480) === 20480) { + return token | -2147483648; + } + if (token === 241771) { + return context & 262144 + ? 209018 | -2147483648 + : context & 1024 + ? -2147483528 + : token | -2147483648; + } + if (token === 209005) { + return 209018 | -2147483648; + } + if ((token & 36864) === 36864) { + return token | 12288 | -2147483648; + } + return -2147483528; + } + return 208897 | (hasEscape ? -2147483648 : 0); +} +function scanPrivateIdentifier(parser) { + let char = advanceChar(parser); + if (char === 92) + return 130; + const merged = consumePossibleSurrogatePair(parser); + if (merged) + char = merged; + if (!isIdentifierStart(char)) + parser.report(96); + return 130; +} +function scanIdentifierUnicodeEscape(parser) { + if (parser.source.charCodeAt(parser.index + 1) !== 117) { + parser.report(5); + } + parser.currentChar = parser.source.charCodeAt((parser.index += 2)); + parser.column += 2; + return scanUnicodeEscape(parser); +} +function scanUnicodeEscape(parser) { + let codePoint = 0; + const char = parser.currentChar; + if (char === 123) { + const begin = parser.index - 2; + while (CharTypes[advanceChar(parser)] & 64) { + codePoint = (codePoint << 4) | toHex(parser.currentChar); + if (codePoint > 1114111) + throw new ParseError({ index: begin, line: parser.line, column: parser.column }, parser.currentLocation, 104); + } + if (parser.currentChar !== 125) { + throw new ParseError({ index: begin, line: parser.line, column: parser.column }, parser.currentLocation, 7); + } + advanceChar(parser); + return codePoint; + } + if ((CharTypes[char] & 64) === 0) + parser.report(7); + const char2 = parser.source.charCodeAt(parser.index + 1); + if ((CharTypes[char2] & 64) === 0) + parser.report(7); + const char3 = parser.source.charCodeAt(parser.index + 2); + if ((CharTypes[char3] & 64) === 0) + parser.report(7); + const char4 = parser.source.charCodeAt(parser.index + 3); + if ((CharTypes[char4] & 64) === 0) + parser.report(7); + codePoint = (toHex(char) << 12) | (toHex(char2) << 8) | (toHex(char3) << 4) | toHex(char4); + parser.currentChar = parser.source.charCodeAt((parser.index += 4)); + parser.column += 4; + return codePoint; +} + +const TokenLookup = [ + 128, + 128, + 128, + 128, + 128, + 128, + 128, + 128, + 128, + 127, + 135, + 127, + 127, + 129, + 128, + 128, + 128, + 128, + 128, + 128, + 128, + 128, + 128, + 128, + 128, + 128, + 128, + 128, + 128, + 128, + 128, + 128, + 127, + 16842798, + 134283267, + 130, + 208897, + 8391477, + 8390213, + 134283267, + 67174411, + 16, + 8391476, + 25233968, + 18, + 25233969, + 67108877, + 8457014, + 134283266, + 134283266, + 134283266, + 134283266, + 134283266, + 134283266, + 134283266, + 134283266, + 134283266, + 134283266, + 21, + 1074790417, + 8456256, + 1077936155, + 8390721, + 22, + 132, + 208897, + 208897, + 208897, + 208897, + 208897, + 208897, + 208897, + 208897, + 208897, + 208897, + 208897, + 208897, + 208897, + 208897, + 208897, + 208897, + 208897, + 208897, + 208897, + 208897, + 208897, + 208897, + 208897, + 208897, + 208897, + 208897, + 69271571, + 136, + 20, + 8389959, + 208897, + 131, + 4096, + 4096, + 4096, + 4096, + 4096, + 4096, + 4096, + 208897, + 4096, + 208897, + 208897, + 4096, + 208897, + 4096, + 208897, + 4096, + 208897, + 4096, + 4096, + 4096, + 208897, + 4096, + 4096, + 208897, + 4096, + 4096, + 2162700, + 8389702, + 1074790415, + 16842799, + 128, +]; +function nextToken(parser, context) { + parser.flags = (parser.flags | 1) ^ 1; + parser.startIndex = parser.index; + parser.startColumn = parser.column; + parser.startLine = parser.line; + parser.setToken(scanSingleToken(parser, context, 0)); +} +function scanSingleToken(parser, context, state) { + const isStartOfLine = parser.index === 0; + const { source } = parser; + let start = parser.currentLocation; + while (parser.index < parser.end) { + parser.tokenIndex = parser.index; + parser.tokenColumn = parser.column; + parser.tokenLine = parser.line; + let char = parser.currentChar; + if (char <= 0x7e) { + const token = TokenLookup[char]; + switch (token) { + case 67174411: + case 16: + case 2162700: + case 1074790415: + case 69271571: + case 20: + case 21: + case 1074790417: + case 18: + case 16842799: + case 132: + case 128: + advanceChar(parser); + return token; + case 208897: + return scanIdentifier(parser, context, 0); + case 4096: + return scanIdentifier(parser, context, 1); + case 134283266: + return scanNumber(parser, context, 16 | 128); + case 134283267: + return scanString(parser, context, char); + case 131: + return scanTemplate(parser, context); + case 136: + return scanUnicodeIdentifier(parser, context); + case 130: + return scanPrivateIdentifier(parser); + case 127: + advanceChar(parser); + break; + case 129: + state |= 1 | 4; + scanNewLine(parser); + break; + case 135: + consumeLineFeed(parser, state); + state = (state & -5) | 1; + break; + case 8456256: { + const ch = advanceChar(parser); + if (parser.index < parser.end) { + if (ch === 60) { + if (parser.index < parser.end && advanceChar(parser) === 61) { + advanceChar(parser); + return 4194332; + } + return 8390978; + } + else if (ch === 61) { + advanceChar(parser); + return 8390718; + } + if (ch === 33) { + const index = parser.index + 1; + if (index + 1 < parser.end && + source.charCodeAt(index) === 45 && + source.charCodeAt(index + 1) == 45) { + parser.column += 3; + parser.currentChar = source.charCodeAt((parser.index += 3)); + state = skipSingleHTMLComment(parser, source, state, context, 2, parser.tokenStart); + start = parser.tokenStart; + continue; + } + return 8456256; + } + } + return 8456256; + } + case 1077936155: { + advanceChar(parser); + const ch = parser.currentChar; + if (ch === 61) { + if (advanceChar(parser) === 61) { + advanceChar(parser); + return 8390458; + } + return 8390460; + } + if (ch === 62) { + advanceChar(parser); + return 10; + } + return 1077936155; + } + case 16842798: + if (advanceChar(parser) !== 61) { + return 16842798; + } + if (advanceChar(parser) !== 61) { + return 8390461; + } + advanceChar(parser); + return 8390459; + case 8391477: + if (advanceChar(parser) !== 61) + return 8391477; + advanceChar(parser); + return 4194340; + case 8391476: { + advanceChar(parser); + if (parser.index >= parser.end) + return 8391476; + const ch = parser.currentChar; + if (ch === 61) { + advanceChar(parser); + return 4194338; + } + if (ch !== 42) + return 8391476; + if (advanceChar(parser) !== 61) + return 8391735; + advanceChar(parser); + return 4194335; + } + case 8389959: + if (advanceChar(parser) !== 61) + return 8389959; + advanceChar(parser); + return 4194341; + case 25233968: { + advanceChar(parser); + const ch = parser.currentChar; + if (ch === 43) { + advanceChar(parser); + return 33619993; + } + if (ch === 61) { + advanceChar(parser); + return 4194336; + } + return 25233968; + } + case 25233969: { + advanceChar(parser); + const ch = parser.currentChar; + if (ch === 45) { + advanceChar(parser); + if ((state & 1 || isStartOfLine) && parser.currentChar === 62) { + if (!parser.options.webcompat) + parser.report(112); + advanceChar(parser); + state = skipSingleHTMLComment(parser, source, state, context, 3, start); + start = parser.tokenStart; + continue; + } + return 33619994; + } + if (ch === 61) { + advanceChar(parser); + return 4194337; + } + return 25233969; + } + case 8457014: { + advanceChar(parser); + if (parser.index < parser.end) { + const ch = parser.currentChar; + if (ch === 47) { + advanceChar(parser); + state = skipSingleLineComment(parser, source, state, 0, parser.tokenStart); + start = parser.tokenStart; + continue; + } + if (ch === 42) { + advanceChar(parser); + state = skipMultiLineComment(parser, source, state); + start = parser.tokenStart; + continue; + } + if (context & 32) { + return scanRegularExpression(parser); + } + if (ch === 61) { + advanceChar(parser); + return 4259875; + } + } + return 8457014; + } + case 67108877: { + const next = advanceChar(parser); + if (next >= 48 && next <= 57) + return scanNumber(parser, context, 64 | 16); + if (next === 46) { + const index = parser.index + 1; + if (index < parser.end && source.charCodeAt(index) === 46) { + parser.column += 2; + parser.currentChar = source.charCodeAt((parser.index += 2)); + return 14; + } + } + return 67108877; + } + case 8389702: { + advanceChar(parser); + const ch = parser.currentChar; + if (ch === 124) { + advanceChar(parser); + if (parser.currentChar === 61) { + advanceChar(parser); + return 4194344; + } + return 8913465; + } + if (ch === 61) { + advanceChar(parser); + return 4194342; + } + return 8389702; + } + case 8390721: { + advanceChar(parser); + const ch = parser.currentChar; + if (ch === 61) { + advanceChar(parser); + return 8390719; + } + if (ch !== 62) + return 8390721; + advanceChar(parser); + if (parser.index < parser.end) { + const ch = parser.currentChar; + if (ch === 62) { + if (advanceChar(parser) === 61) { + advanceChar(parser); + return 4194334; + } + return 8390980; + } + if (ch === 61) { + advanceChar(parser); + return 4194333; + } + } + return 8390979; + } + case 8390213: { + advanceChar(parser); + const ch = parser.currentChar; + if (ch === 38) { + advanceChar(parser); + if (parser.currentChar === 61) { + advanceChar(parser); + return 4194345; + } + return 8913720; + } + if (ch === 61) { + advanceChar(parser); + return 4194343; + } + return 8390213; + } + case 22: { + let ch = advanceChar(parser); + if (ch === 63) { + advanceChar(parser); + if (parser.currentChar === 61) { + advanceChar(parser); + return 4194346; + } + return 276824445; + } + if (ch === 46) { + const index = parser.index + 1; + if (index < parser.end) { + ch = source.charCodeAt(index); + if (!(ch >= 48 && ch <= 57)) { + advanceChar(parser); + return 67108990; + } + } + } + return 22; + } + } + } + else { + if ((char ^ 8232) <= 1) { + state = (state & -5) | 1; + scanNewLine(parser); + continue; + } + const merged = consumePossibleSurrogatePair(parser); + if (merged > 0) + char = merged; + if (isIDStart(char)) { + parser.tokenValue = ''; + return scanIdentifierSlowCase(parser, context, 0, 0); + } + if (isExoticECMAScriptWhitespace(char)) { + advanceChar(parser); + continue; + } + parser.report(20, String.fromCodePoint(char)); + } + } + return 1048576; +} + +const entities = { + AElig: '\u00C6', + AMP: '\u0026', + Aacute: '\u00C1', + Abreve: '\u0102', + Acirc: '\u00C2', + Acy: '\u0410', + Afr: '\uD835\uDD04', + Agrave: '\u00C0', + Alpha: '\u0391', + Amacr: '\u0100', + And: '\u2A53', + Aogon: '\u0104', + Aopf: '\uD835\uDD38', + ApplyFunction: '\u2061', + Aring: '\u00C5', + Ascr: '\uD835\uDC9C', + Assign: '\u2254', + Atilde: '\u00C3', + Auml: '\u00C4', + Backslash: '\u2216', + Barv: '\u2AE7', + Barwed: '\u2306', + Bcy: '\u0411', + Because: '\u2235', + Bernoullis: '\u212C', + Beta: '\u0392', + Bfr: '\uD835\uDD05', + Bopf: '\uD835\uDD39', + Breve: '\u02D8', + Bscr: '\u212C', + Bumpeq: '\u224E', + CHcy: '\u0427', + COPY: '\u00A9', + Cacute: '\u0106', + Cap: '\u22D2', + CapitalDifferentialD: '\u2145', + Cayleys: '\u212D', + Ccaron: '\u010C', + Ccedil: '\u00C7', + Ccirc: '\u0108', + Cconint: '\u2230', + Cdot: '\u010A', + Cedilla: '\u00B8', + CenterDot: '\u00B7', + Cfr: '\u212D', + Chi: '\u03A7', + CircleDot: '\u2299', + CircleMinus: '\u2296', + CirclePlus: '\u2295', + CircleTimes: '\u2297', + ClockwiseContourIntegral: '\u2232', + CloseCurlyDoubleQuote: '\u201D', + CloseCurlyQuote: '\u2019', + Colon: '\u2237', + Colone: '\u2A74', + Congruent: '\u2261', + Conint: '\u222F', + ContourIntegral: '\u222E', + Copf: '\u2102', + Coproduct: '\u2210', + CounterClockwiseContourIntegral: '\u2233', + Cross: '\u2A2F', + Cscr: '\uD835\uDC9E', + Cup: '\u22D3', + CupCap: '\u224D', + DD: '\u2145', + DDotrahd: '\u2911', + DJcy: '\u0402', + DScy: '\u0405', + DZcy: '\u040F', + Dagger: '\u2021', + Darr: '\u21A1', + Dashv: '\u2AE4', + Dcaron: '\u010E', + Dcy: '\u0414', + Del: '\u2207', + Delta: '\u0394', + Dfr: '\uD835\uDD07', + DiacriticalAcute: '\u00B4', + DiacriticalDot: '\u02D9', + DiacriticalDoubleAcute: '\u02DD', + DiacriticalGrave: '\u0060', + DiacriticalTilde: '\u02DC', + Diamond: '\u22C4', + DifferentialD: '\u2146', + Dopf: '\uD835\uDD3B', + Dot: '\u00A8', + DotDot: '\u20DC', + DotEqual: '\u2250', + DoubleContourIntegral: '\u222F', + DoubleDot: '\u00A8', + DoubleDownArrow: '\u21D3', + DoubleLeftArrow: '\u21D0', + DoubleLeftRightArrow: '\u21D4', + DoubleLeftTee: '\u2AE4', + DoubleLongLeftArrow: '\u27F8', + DoubleLongLeftRightArrow: '\u27FA', + DoubleLongRightArrow: '\u27F9', + DoubleRightArrow: '\u21D2', + DoubleRightTee: '\u22A8', + DoubleUpArrow: '\u21D1', + DoubleUpDownArrow: '\u21D5', + DoubleVerticalBar: '\u2225', + DownArrow: '\u2193', + DownArrowBar: '\u2913', + DownArrowUpArrow: '\u21F5', + DownBreve: '\u0311', + DownLeftRightVector: '\u2950', + DownLeftTeeVector: '\u295E', + DownLeftVector: '\u21BD', + DownLeftVectorBar: '\u2956', + DownRightTeeVector: '\u295F', + DownRightVector: '\u21C1', + DownRightVectorBar: '\u2957', + DownTee: '\u22A4', + DownTeeArrow: '\u21A7', + Downarrow: '\u21D3', + Dscr: '\uD835\uDC9F', + Dstrok: '\u0110', + ENG: '\u014A', + ETH: '\u00D0', + Eacute: '\u00C9', + Ecaron: '\u011A', + Ecirc: '\u00CA', + Ecy: '\u042D', + Edot: '\u0116', + Efr: '\uD835\uDD08', + Egrave: '\u00C8', + Element: '\u2208', + Emacr: '\u0112', + EmptySmallSquare: '\u25FB', + EmptyVerySmallSquare: '\u25AB', + Eogon: '\u0118', + Eopf: '\uD835\uDD3C', + Epsilon: '\u0395', + Equal: '\u2A75', + EqualTilde: '\u2242', + Equilibrium: '\u21CC', + Escr: '\u2130', + Esim: '\u2A73', + Eta: '\u0397', + Euml: '\u00CB', + Exists: '\u2203', + ExponentialE: '\u2147', + Fcy: '\u0424', + Ffr: '\uD835\uDD09', + FilledSmallSquare: '\u25FC', + FilledVerySmallSquare: '\u25AA', + Fopf: '\uD835\uDD3D', + ForAll: '\u2200', + Fouriertrf: '\u2131', + Fscr: '\u2131', + GJcy: '\u0403', + GT: '\u003E', + Gamma: '\u0393', + Gammad: '\u03DC', + Gbreve: '\u011E', + Gcedil: '\u0122', + Gcirc: '\u011C', + Gcy: '\u0413', + Gdot: '\u0120', + Gfr: '\uD835\uDD0A', + Gg: '\u22D9', + Gopf: '\uD835\uDD3E', + GreaterEqual: '\u2265', + GreaterEqualLess: '\u22DB', + GreaterFullEqual: '\u2267', + GreaterGreater: '\u2AA2', + GreaterLess: '\u2277', + GreaterSlantEqual: '\u2A7E', + GreaterTilde: '\u2273', + Gscr: '\uD835\uDCA2', + Gt: '\u226B', + HARDcy: '\u042A', + Hacek: '\u02C7', + Hat: '\u005E', + Hcirc: '\u0124', + Hfr: '\u210C', + HilbertSpace: '\u210B', + Hopf: '\u210D', + HorizontalLine: '\u2500', + Hscr: '\u210B', + Hstrok: '\u0126', + HumpDownHump: '\u224E', + HumpEqual: '\u224F', + IEcy: '\u0415', + IJlig: '\u0132', + IOcy: '\u0401', + Iacute: '\u00CD', + Icirc: '\u00CE', + Icy: '\u0418', + Idot: '\u0130', + Ifr: '\u2111', + Igrave: '\u00CC', + Im: '\u2111', + Imacr: '\u012A', + ImaginaryI: '\u2148', + Implies: '\u21D2', + Int: '\u222C', + Integral: '\u222B', + Intersection: '\u22C2', + InvisibleComma: '\u2063', + InvisibleTimes: '\u2062', + Iogon: '\u012E', + Iopf: '\uD835\uDD40', + Iota: '\u0399', + Iscr: '\u2110', + Itilde: '\u0128', + Iukcy: '\u0406', + Iuml: '\u00CF', + Jcirc: '\u0134', + Jcy: '\u0419', + Jfr: '\uD835\uDD0D', + Jopf: '\uD835\uDD41', + Jscr: '\uD835\uDCA5', + Jsercy: '\u0408', + Jukcy: '\u0404', + KHcy: '\u0425', + KJcy: '\u040C', + Kappa: '\u039A', + Kcedil: '\u0136', + Kcy: '\u041A', + Kfr: '\uD835\uDD0E', + Kopf: '\uD835\uDD42', + Kscr: '\uD835\uDCA6', + LJcy: '\u0409', + LT: '\u003C', + Lacute: '\u0139', + Lambda: '\u039B', + Lang: '\u27EA', + Laplacetrf: '\u2112', + Larr: '\u219E', + Lcaron: '\u013D', + Lcedil: '\u013B', + Lcy: '\u041B', + LeftAngleBracket: '\u27E8', + LeftArrow: '\u2190', + LeftArrowBar: '\u21E4', + LeftArrowRightArrow: '\u21C6', + LeftCeiling: '\u2308', + LeftDoubleBracket: '\u27E6', + LeftDownTeeVector: '\u2961', + LeftDownVector: '\u21C3', + LeftDownVectorBar: '\u2959', + LeftFloor: '\u230A', + LeftRightArrow: '\u2194', + LeftRightVector: '\u294E', + LeftTee: '\u22A3', + LeftTeeArrow: '\u21A4', + LeftTeeVector: '\u295A', + LeftTriangle: '\u22B2', + LeftTriangleBar: '\u29CF', + LeftTriangleEqual: '\u22B4', + LeftUpDownVector: '\u2951', + LeftUpTeeVector: '\u2960', + LeftUpVector: '\u21BF', + LeftUpVectorBar: '\u2958', + LeftVector: '\u21BC', + LeftVectorBar: '\u2952', + Leftarrow: '\u21D0', + Leftrightarrow: '\u21D4', + LessEqualGreater: '\u22DA', + LessFullEqual: '\u2266', + LessGreater: '\u2276', + LessLess: '\u2AA1', + LessSlantEqual: '\u2A7D', + LessTilde: '\u2272', + Lfr: '\uD835\uDD0F', + Ll: '\u22D8', + Lleftarrow: '\u21DA', + Lmidot: '\u013F', + LongLeftArrow: '\u27F5', + LongLeftRightArrow: '\u27F7', + LongRightArrow: '\u27F6', + Longleftarrow: '\u27F8', + Longleftrightarrow: '\u27FA', + Longrightarrow: '\u27F9', + Lopf: '\uD835\uDD43', + LowerLeftArrow: '\u2199', + LowerRightArrow: '\u2198', + Lscr: '\u2112', + Lsh: '\u21B0', + Lstrok: '\u0141', + Lt: '\u226A', + Map: '\u2905', + Mcy: '\u041C', + MediumSpace: '\u205F', + Mellintrf: '\u2133', + Mfr: '\uD835\uDD10', + MinusPlus: '\u2213', + Mopf: '\uD835\uDD44', + Mscr: '\u2133', + Mu: '\u039C', + NJcy: '\u040A', + Nacute: '\u0143', + Ncaron: '\u0147', + Ncedil: '\u0145', + Ncy: '\u041D', + NegativeMediumSpace: '\u200B', + NegativeThickSpace: '\u200B', + NegativeThinSpace: '\u200B', + NegativeVeryThinSpace: '\u200B', + NestedGreaterGreater: '\u226B', + NestedLessLess: '\u226A', + NewLine: '\u000A', + Nfr: '\uD835\uDD11', + NoBreak: '\u2060', + NonBreakingSpace: '\u00A0', + Nopf: '\u2115', + Not: '\u2AEC', + NotCongruent: '\u2262', + NotCupCap: '\u226D', + NotDoubleVerticalBar: '\u2226', + NotElement: '\u2209', + NotEqual: '\u2260', + NotEqualTilde: '\u2242\u0338', + NotExists: '\u2204', + NotGreater: '\u226F', + NotGreaterEqual: '\u2271', + NotGreaterFullEqual: '\u2267\u0338', + NotGreaterGreater: '\u226B\u0338', + NotGreaterLess: '\u2279', + NotGreaterSlantEqual: '\u2A7E\u0338', + NotGreaterTilde: '\u2275', + NotHumpDownHump: '\u224E\u0338', + NotHumpEqual: '\u224F\u0338', + NotLeftTriangle: '\u22EA', + NotLeftTriangleBar: '\u29CF\u0338', + NotLeftTriangleEqual: '\u22EC', + NotLess: '\u226E', + NotLessEqual: '\u2270', + NotLessGreater: '\u2278', + NotLessLess: '\u226A\u0338', + NotLessSlantEqual: '\u2A7D\u0338', + NotLessTilde: '\u2274', + NotNestedGreaterGreater: '\u2AA2\u0338', + NotNestedLessLess: '\u2AA1\u0338', + NotPrecedes: '\u2280', + NotPrecedesEqual: '\u2AAF\u0338', + NotPrecedesSlantEqual: '\u22E0', + NotReverseElement: '\u220C', + NotRightTriangle: '\u22EB', + NotRightTriangleBar: '\u29D0\u0338', + NotRightTriangleEqual: '\u22ED', + NotSquareSubset: '\u228F\u0338', + NotSquareSubsetEqual: '\u22E2', + NotSquareSuperset: '\u2290\u0338', + NotSquareSupersetEqual: '\u22E3', + NotSubset: '\u2282\u20D2', + NotSubsetEqual: '\u2288', + NotSucceeds: '\u2281', + NotSucceedsEqual: '\u2AB0\u0338', + NotSucceedsSlantEqual: '\u22E1', + NotSucceedsTilde: '\u227F\u0338', + NotSuperset: '\u2283\u20D2', + NotSupersetEqual: '\u2289', + NotTilde: '\u2241', + NotTildeEqual: '\u2244', + NotTildeFullEqual: '\u2247', + NotTildeTilde: '\u2249', + NotVerticalBar: '\u2224', + Nscr: '\uD835\uDCA9', + Ntilde: '\u00D1', + Nu: '\u039D', + OElig: '\u0152', + Oacute: '\u00D3', + Ocirc: '\u00D4', + Ocy: '\u041E', + Odblac: '\u0150', + Ofr: '\uD835\uDD12', + Ograve: '\u00D2', + Omacr: '\u014C', + Omega: '\u03A9', + Omicron: '\u039F', + Oopf: '\uD835\uDD46', + OpenCurlyDoubleQuote: '\u201C', + OpenCurlyQuote: '\u2018', + Or: '\u2A54', + Oscr: '\uD835\uDCAA', + Oslash: '\u00D8', + Otilde: '\u00D5', + Otimes: '\u2A37', + Ouml: '\u00D6', + OverBar: '\u203E', + OverBrace: '\u23DE', + OverBracket: '\u23B4', + OverParenthesis: '\u23DC', + PartialD: '\u2202', + Pcy: '\u041F', + Pfr: '\uD835\uDD13', + Phi: '\u03A6', + Pi: '\u03A0', + PlusMinus: '\u00B1', + Poincareplane: '\u210C', + Popf: '\u2119', + Pr: '\u2ABB', + Precedes: '\u227A', + PrecedesEqual: '\u2AAF', + PrecedesSlantEqual: '\u227C', + PrecedesTilde: '\u227E', + Prime: '\u2033', + Product: '\u220F', + Proportion: '\u2237', + Proportional: '\u221D', + Pscr: '\uD835\uDCAB', + Psi: '\u03A8', + QUOT: '\u0022', + Qfr: '\uD835\uDD14', + Qopf: '\u211A', + Qscr: '\uD835\uDCAC', + RBarr: '\u2910', + REG: '\u00AE', + Racute: '\u0154', + Rang: '\u27EB', + Rarr: '\u21A0', + Rarrtl: '\u2916', + Rcaron: '\u0158', + Rcedil: '\u0156', + Rcy: '\u0420', + Re: '\u211C', + ReverseElement: '\u220B', + ReverseEquilibrium: '\u21CB', + ReverseUpEquilibrium: '\u296F', + Rfr: '\u211C', + Rho: '\u03A1', + RightAngleBracket: '\u27E9', + RightArrow: '\u2192', + RightArrowBar: '\u21E5', + RightArrowLeftArrow: '\u21C4', + RightCeiling: '\u2309', + RightDoubleBracket: '\u27E7', + RightDownTeeVector: '\u295D', + RightDownVector: '\u21C2', + RightDownVectorBar: '\u2955', + RightFloor: '\u230B', + RightTee: '\u22A2', + RightTeeArrow: '\u21A6', + RightTeeVector: '\u295B', + RightTriangle: '\u22B3', + RightTriangleBar: '\u29D0', + RightTriangleEqual: '\u22B5', + RightUpDownVector: '\u294F', + RightUpTeeVector: '\u295C', + RightUpVector: '\u21BE', + RightUpVectorBar: '\u2954', + RightVector: '\u21C0', + RightVectorBar: '\u2953', + Rightarrow: '\u21D2', + Ropf: '\u211D', + RoundImplies: '\u2970', + Rrightarrow: '\u21DB', + Rscr: '\u211B', + Rsh: '\u21B1', + RuleDelayed: '\u29F4', + SHCHcy: '\u0429', + SHcy: '\u0428', + SOFTcy: '\u042C', + Sacute: '\u015A', + Sc: '\u2ABC', + Scaron: '\u0160', + Scedil: '\u015E', + Scirc: '\u015C', + Scy: '\u0421', + Sfr: '\uD835\uDD16', + ShortDownArrow: '\u2193', + ShortLeftArrow: '\u2190', + ShortRightArrow: '\u2192', + ShortUpArrow: '\u2191', + Sigma: '\u03A3', + SmallCircle: '\u2218', + Sopf: '\uD835\uDD4A', + Sqrt: '\u221A', + Square: '\u25A1', + SquareIntersection: '\u2293', + SquareSubset: '\u228F', + SquareSubsetEqual: '\u2291', + SquareSuperset: '\u2290', + SquareSupersetEqual: '\u2292', + SquareUnion: '\u2294', + Sscr: '\uD835\uDCAE', + Star: '\u22C6', + Sub: '\u22D0', + Subset: '\u22D0', + SubsetEqual: '\u2286', + Succeeds: '\u227B', + SucceedsEqual: '\u2AB0', + SucceedsSlantEqual: '\u227D', + SucceedsTilde: '\u227F', + SuchThat: '\u220B', + Sum: '\u2211', + Sup: '\u22D1', + Superset: '\u2283', + SupersetEqual: '\u2287', + Supset: '\u22D1', + THORN: '\u00DE', + TRADE: '\u2122', + TSHcy: '\u040B', + TScy: '\u0426', + Tab: '\u0009', + Tau: '\u03A4', + Tcaron: '\u0164', + Tcedil: '\u0162', + Tcy: '\u0422', + Tfr: '\uD835\uDD17', + Therefore: '\u2234', + Theta: '\u0398', + ThickSpace: '\u205F\u200A', + ThinSpace: '\u2009', + Tilde: '\u223C', + TildeEqual: '\u2243', + TildeFullEqual: '\u2245', + TildeTilde: '\u2248', + Topf: '\uD835\uDD4B', + TripleDot: '\u20DB', + Tscr: '\uD835\uDCAF', + Tstrok: '\u0166', + Uacute: '\u00DA', + Uarr: '\u219F', + Uarrocir: '\u2949', + Ubrcy: '\u040E', + Ubreve: '\u016C', + Ucirc: '\u00DB', + Ucy: '\u0423', + Udblac: '\u0170', + Ufr: '\uD835\uDD18', + Ugrave: '\u00D9', + Umacr: '\u016A', + UnderBar: '\u005F', + UnderBrace: '\u23DF', + UnderBracket: '\u23B5', + UnderParenthesis: '\u23DD', + Union: '\u22C3', + UnionPlus: '\u228E', + Uogon: '\u0172', + Uopf: '\uD835\uDD4C', + UpArrow: '\u2191', + UpArrowBar: '\u2912', + UpArrowDownArrow: '\u21C5', + UpDownArrow: '\u2195', + UpEquilibrium: '\u296E', + UpTee: '\u22A5', + UpTeeArrow: '\u21A5', + Uparrow: '\u21D1', + Updownarrow: '\u21D5', + UpperLeftArrow: '\u2196', + UpperRightArrow: '\u2197', + Upsi: '\u03D2', + Upsilon: '\u03A5', + Uring: '\u016E', + Uscr: '\uD835\uDCB0', + Utilde: '\u0168', + Uuml: '\u00DC', + VDash: '\u22AB', + Vbar: '\u2AEB', + Vcy: '\u0412', + Vdash: '\u22A9', + Vdashl: '\u2AE6', + Vee: '\u22C1', + Verbar: '\u2016', + Vert: '\u2016', + VerticalBar: '\u2223', + VerticalLine: '\u007C', + VerticalSeparator: '\u2758', + VerticalTilde: '\u2240', + VeryThinSpace: '\u200A', + Vfr: '\uD835\uDD19', + Vopf: '\uD835\uDD4D', + Vscr: '\uD835\uDCB1', + Vvdash: '\u22AA', + Wcirc: '\u0174', + Wedge: '\u22C0', + Wfr: '\uD835\uDD1A', + Wopf: '\uD835\uDD4E', + Wscr: '\uD835\uDCB2', + Xfr: '\uD835\uDD1B', + Xi: '\u039E', + Xopf: '\uD835\uDD4F', + Xscr: '\uD835\uDCB3', + YAcy: '\u042F', + YIcy: '\u0407', + YUcy: '\u042E', + Yacute: '\u00DD', + Ycirc: '\u0176', + Ycy: '\u042B', + Yfr: '\uD835\uDD1C', + Yopf: '\uD835\uDD50', + Yscr: '\uD835\uDCB4', + Yuml: '\u0178', + ZHcy: '\u0416', + Zacute: '\u0179', + Zcaron: '\u017D', + Zcy: '\u0417', + Zdot: '\u017B', + ZeroWidthSpace: '\u200B', + Zeta: '\u0396', + Zfr: '\u2128', + Zopf: '\u2124', + Zscr: '\uD835\uDCB5', + aacute: '\u00E1', + abreve: '\u0103', + ac: '\u223E', + acE: '\u223E\u0333', + acd: '\u223F', + acirc: '\u00E2', + acute: '\u00B4', + acy: '\u0430', + aelig: '\u00E6', + af: '\u2061', + afr: '\uD835\uDD1E', + agrave: '\u00E0', + alefsym: '\u2135', + aleph: '\u2135', + alpha: '\u03B1', + amacr: '\u0101', + amalg: '\u2A3F', + amp: '\u0026', + and: '\u2227', + andand: '\u2A55', + andd: '\u2A5C', + andslope: '\u2A58', + andv: '\u2A5A', + ang: '\u2220', + ange: '\u29A4', + angle: '\u2220', + angmsd: '\u2221', + angmsdaa: '\u29A8', + angmsdab: '\u29A9', + angmsdac: '\u29AA', + angmsdad: '\u29AB', + angmsdae: '\u29AC', + angmsdaf: '\u29AD', + angmsdag: '\u29AE', + angmsdah: '\u29AF', + angrt: '\u221F', + angrtvb: '\u22BE', + angrtvbd: '\u299D', + angsph: '\u2222', + angst: '\u00C5', + angzarr: '\u237C', + aogon: '\u0105', + aopf: '\uD835\uDD52', + ap: '\u2248', + apE: '\u2A70', + apacir: '\u2A6F', + ape: '\u224A', + apid: '\u224B', + apos: '\u0027', + approx: '\u2248', + approxeq: '\u224A', + aring: '\u00E5', + ascr: '\uD835\uDCB6', + ast: '\u002A', + asymp: '\u2248', + asympeq: '\u224D', + atilde: '\u00E3', + auml: '\u00E4', + awconint: '\u2233', + awint: '\u2A11', + bNot: '\u2AED', + backcong: '\u224C', + backepsilon: '\u03F6', + backprime: '\u2035', + backsim: '\u223D', + backsimeq: '\u22CD', + barvee: '\u22BD', + barwed: '\u2305', + barwedge: '\u2305', + bbrk: '\u23B5', + bbrktbrk: '\u23B6', + bcong: '\u224C', + bcy: '\u0431', + bdquo: '\u201E', + becaus: '\u2235', + because: '\u2235', + bemptyv: '\u29B0', + bepsi: '\u03F6', + bernou: '\u212C', + beta: '\u03B2', + beth: '\u2136', + between: '\u226C', + bfr: '\uD835\uDD1F', + bigcap: '\u22C2', + bigcirc: '\u25EF', + bigcup: '\u22C3', + bigodot: '\u2A00', + bigoplus: '\u2A01', + bigotimes: '\u2A02', + bigsqcup: '\u2A06', + bigstar: '\u2605', + bigtriangledown: '\u25BD', + bigtriangleup: '\u25B3', + biguplus: '\u2A04', + bigvee: '\u22C1', + bigwedge: '\u22C0', + bkarow: '\u290D', + blacklozenge: '\u29EB', + blacksquare: '\u25AA', + blacktriangle: '\u25B4', + blacktriangledown: '\u25BE', + blacktriangleleft: '\u25C2', + blacktriangleright: '\u25B8', + blank: '\u2423', + blk12: '\u2592', + blk14: '\u2591', + blk34: '\u2593', + block: '\u2588', + bne: '\u003D\u20E5', + bnequiv: '\u2261\u20E5', + bnot: '\u2310', + bopf: '\uD835\uDD53', + bot: '\u22A5', + bottom: '\u22A5', + bowtie: '\u22C8', + boxDL: '\u2557', + boxDR: '\u2554', + boxDl: '\u2556', + boxDr: '\u2553', + boxH: '\u2550', + boxHD: '\u2566', + boxHU: '\u2569', + boxHd: '\u2564', + boxHu: '\u2567', + boxUL: '\u255D', + boxUR: '\u255A', + boxUl: '\u255C', + boxUr: '\u2559', + boxV: '\u2551', + boxVH: '\u256C', + boxVL: '\u2563', + boxVR: '\u2560', + boxVh: '\u256B', + boxVl: '\u2562', + boxVr: '\u255F', + boxbox: '\u29C9', + boxdL: '\u2555', + boxdR: '\u2552', + boxdl: '\u2510', + boxdr: '\u250C', + boxh: '\u2500', + boxhD: '\u2565', + boxhU: '\u2568', + boxhd: '\u252C', + boxhu: '\u2534', + boxminus: '\u229F', + boxplus: '\u229E', + boxtimes: '\u22A0', + boxuL: '\u255B', + boxuR: '\u2558', + boxul: '\u2518', + boxur: '\u2514', + boxv: '\u2502', + boxvH: '\u256A', + boxvL: '\u2561', + boxvR: '\u255E', + boxvh: '\u253C', + boxvl: '\u2524', + boxvr: '\u251C', + bprime: '\u2035', + breve: '\u02D8', + brvbar: '\u00A6', + bscr: '\uD835\uDCB7', + bsemi: '\u204F', + bsim: '\u223D', + bsime: '\u22CD', + bsol: '\u005C', + bsolb: '\u29C5', + bsolhsub: '\u27C8', + bull: '\u2022', + bullet: '\u2022', + bump: '\u224E', + bumpE: '\u2AAE', + bumpe: '\u224F', + bumpeq: '\u224F', + cacute: '\u0107', + cap: '\u2229', + capand: '\u2A44', + capbrcup: '\u2A49', + capcap: '\u2A4B', + capcup: '\u2A47', + capdot: '\u2A40', + caps: '\u2229\uFE00', + caret: '\u2041', + caron: '\u02C7', + ccaps: '\u2A4D', + ccaron: '\u010D', + ccedil: '\u00E7', + ccirc: '\u0109', + ccups: '\u2A4C', + ccupssm: '\u2A50', + cdot: '\u010B', + cedil: '\u00B8', + cemptyv: '\u29B2', + cent: '\u00A2', + centerdot: '\u00B7', + cfr: '\uD835\uDD20', + chcy: '\u0447', + check: '\u2713', + checkmark: '\u2713', + chi: '\u03C7', + cir: '\u25CB', + cirE: '\u29C3', + circ: '\u02C6', + circeq: '\u2257', + circlearrowleft: '\u21BA', + circlearrowright: '\u21BB', + circledR: '\u00AE', + circledS: '\u24C8', + circledast: '\u229B', + circledcirc: '\u229A', + circleddash: '\u229D', + cire: '\u2257', + cirfnint: '\u2A10', + cirmid: '\u2AEF', + cirscir: '\u29C2', + clubs: '\u2663', + clubsuit: '\u2663', + colon: '\u003A', + colone: '\u2254', + coloneq: '\u2254', + comma: '\u002C', + commat: '\u0040', + comp: '\u2201', + compfn: '\u2218', + complement: '\u2201', + complexes: '\u2102', + cong: '\u2245', + congdot: '\u2A6D', + conint: '\u222E', + copf: '\uD835\uDD54', + coprod: '\u2210', + copy: '\u00A9', + copysr: '\u2117', + crarr: '\u21B5', + cross: '\u2717', + cscr: '\uD835\uDCB8', + csub: '\u2ACF', + csube: '\u2AD1', + csup: '\u2AD0', + csupe: '\u2AD2', + ctdot: '\u22EF', + cudarrl: '\u2938', + cudarrr: '\u2935', + cuepr: '\u22DE', + cuesc: '\u22DF', + cularr: '\u21B6', + cularrp: '\u293D', + cup: '\u222A', + cupbrcap: '\u2A48', + cupcap: '\u2A46', + cupcup: '\u2A4A', + cupdot: '\u228D', + cupor: '\u2A45', + cups: '\u222A\uFE00', + curarr: '\u21B7', + curarrm: '\u293C', + curlyeqprec: '\u22DE', + curlyeqsucc: '\u22DF', + curlyvee: '\u22CE', + curlywedge: '\u22CF', + curren: '\u00A4', + curvearrowleft: '\u21B6', + curvearrowright: '\u21B7', + cuvee: '\u22CE', + cuwed: '\u22CF', + cwconint: '\u2232', + cwint: '\u2231', + cylcty: '\u232D', + dArr: '\u21D3', + dHar: '\u2965', + dagger: '\u2020', + daleth: '\u2138', + darr: '\u2193', + dash: '\u2010', + dashv: '\u22A3', + dbkarow: '\u290F', + dblac: '\u02DD', + dcaron: '\u010F', + dcy: '\u0434', + dd: '\u2146', + ddagger: '\u2021', + ddarr: '\u21CA', + ddotseq: '\u2A77', + deg: '\u00B0', + delta: '\u03B4', + demptyv: '\u29B1', + dfisht: '\u297F', + dfr: '\uD835\uDD21', + dharl: '\u21C3', + dharr: '\u21C2', + diam: '\u22C4', + diamond: '\u22C4', + diamondsuit: '\u2666', + diams: '\u2666', + die: '\u00A8', + digamma: '\u03DD', + disin: '\u22F2', + div: '\u00F7', + divide: '\u00F7', + divideontimes: '\u22C7', + divonx: '\u22C7', + djcy: '\u0452', + dlcorn: '\u231E', + dlcrop: '\u230D', + dollar: '\u0024', + dopf: '\uD835\uDD55', + dot: '\u02D9', + doteq: '\u2250', + doteqdot: '\u2251', + dotminus: '\u2238', + dotplus: '\u2214', + dotsquare: '\u22A1', + doublebarwedge: '\u2306', + downarrow: '\u2193', + downdownarrows: '\u21CA', + downharpoonleft: '\u21C3', + downharpoonright: '\u21C2', + drbkarow: '\u2910', + drcorn: '\u231F', + drcrop: '\u230C', + dscr: '\uD835\uDCB9', + dscy: '\u0455', + dsol: '\u29F6', + dstrok: '\u0111', + dtdot: '\u22F1', + dtri: '\u25BF', + dtrif: '\u25BE', + duarr: '\u21F5', + duhar: '\u296F', + dwangle: '\u29A6', + dzcy: '\u045F', + dzigrarr: '\u27FF', + eDDot: '\u2A77', + eDot: '\u2251', + eacute: '\u00E9', + easter: '\u2A6E', + ecaron: '\u011B', + ecir: '\u2256', + ecirc: '\u00EA', + ecolon: '\u2255', + ecy: '\u044D', + edot: '\u0117', + ee: '\u2147', + efDot: '\u2252', + efr: '\uD835\uDD22', + eg: '\u2A9A', + egrave: '\u00E8', + egs: '\u2A96', + egsdot: '\u2A98', + el: '\u2A99', + elinters: '\u23E7', + ell: '\u2113', + els: '\u2A95', + elsdot: '\u2A97', + emacr: '\u0113', + empty: '\u2205', + emptyset: '\u2205', + emptyv: '\u2205', + emsp13: '\u2004', + emsp14: '\u2005', + emsp: '\u2003', + eng: '\u014B', + ensp: '\u2002', + eogon: '\u0119', + eopf: '\uD835\uDD56', + epar: '\u22D5', + eparsl: '\u29E3', + eplus: '\u2A71', + epsi: '\u03B5', + epsilon: '\u03B5', + epsiv: '\u03F5', + eqcirc: '\u2256', + eqcolon: '\u2255', + eqsim: '\u2242', + eqslantgtr: '\u2A96', + eqslantless: '\u2A95', + equals: '\u003D', + equest: '\u225F', + equiv: '\u2261', + equivDD: '\u2A78', + eqvparsl: '\u29E5', + erDot: '\u2253', + erarr: '\u2971', + escr: '\u212F', + esdot: '\u2250', + esim: '\u2242', + eta: '\u03B7', + eth: '\u00F0', + euml: '\u00EB', + euro: '\u20AC', + excl: '\u0021', + exist: '\u2203', + expectation: '\u2130', + exponentiale: '\u2147', + fallingdotseq: '\u2252', + fcy: '\u0444', + female: '\u2640', + ffilig: '\uFB03', + fflig: '\uFB00', + ffllig: '\uFB04', + ffr: '\uD835\uDD23', + filig: '\uFB01', + fjlig: '\u0066\u006A', + flat: '\u266D', + fllig: '\uFB02', + fltns: '\u25B1', + fnof: '\u0192', + fopf: '\uD835\uDD57', + forall: '\u2200', + fork: '\u22D4', + forkv: '\u2AD9', + fpartint: '\u2A0D', + frac12: '\u00BD', + frac13: '\u2153', + frac14: '\u00BC', + frac15: '\u2155', + frac16: '\u2159', + frac18: '\u215B', + frac23: '\u2154', + frac25: '\u2156', + frac34: '\u00BE', + frac35: '\u2157', + frac38: '\u215C', + frac45: '\u2158', + frac56: '\u215A', + frac58: '\u215D', + frac78: '\u215E', + frasl: '\u2044', + frown: '\u2322', + fscr: '\uD835\uDCBB', + gE: '\u2267', + gEl: '\u2A8C', + gacute: '\u01F5', + gamma: '\u03B3', + gammad: '\u03DD', + gap: '\u2A86', + gbreve: '\u011F', + gcirc: '\u011D', + gcy: '\u0433', + gdot: '\u0121', + ge: '\u2265', + gel: '\u22DB', + geq: '\u2265', + geqq: '\u2267', + geqslant: '\u2A7E', + ges: '\u2A7E', + gescc: '\u2AA9', + gesdot: '\u2A80', + gesdoto: '\u2A82', + gesdotol: '\u2A84', + gesl: '\u22DB\uFE00', + gesles: '\u2A94', + gfr: '\uD835\uDD24', + gg: '\u226B', + ggg: '\u22D9', + gimel: '\u2137', + gjcy: '\u0453', + gl: '\u2277', + glE: '\u2A92', + gla: '\u2AA5', + glj: '\u2AA4', + gnE: '\u2269', + gnap: '\u2A8A', + gnapprox: '\u2A8A', + gne: '\u2A88', + gneq: '\u2A88', + gneqq: '\u2269', + gnsim: '\u22E7', + gopf: '\uD835\uDD58', + grave: '\u0060', + gscr: '\u210A', + gsim: '\u2273', + gsime: '\u2A8E', + gsiml: '\u2A90', + gt: '\u003E', + gtcc: '\u2AA7', + gtcir: '\u2A7A', + gtdot: '\u22D7', + gtlPar: '\u2995', + gtquest: '\u2A7C', + gtrapprox: '\u2A86', + gtrarr: '\u2978', + gtrdot: '\u22D7', + gtreqless: '\u22DB', + gtreqqless: '\u2A8C', + gtrless: '\u2277', + gtrsim: '\u2273', + gvertneqq: '\u2269\uFE00', + gvnE: '\u2269\uFE00', + hArr: '\u21D4', + hairsp: '\u200A', + half: '\u00BD', + hamilt: '\u210B', + hardcy: '\u044A', + harr: '\u2194', + harrcir: '\u2948', + harrw: '\u21AD', + hbar: '\u210F', + hcirc: '\u0125', + hearts: '\u2665', + heartsuit: '\u2665', + hellip: '\u2026', + hercon: '\u22B9', + hfr: '\uD835\uDD25', + hksearow: '\u2925', + hkswarow: '\u2926', + hoarr: '\u21FF', + homtht: '\u223B', + hookleftarrow: '\u21A9', + hookrightarrow: '\u21AA', + hopf: '\uD835\uDD59', + horbar: '\u2015', + hscr: '\uD835\uDCBD', + hslash: '\u210F', + hstrok: '\u0127', + hybull: '\u2043', + hyphen: '\u2010', + iacute: '\u00ED', + ic: '\u2063', + icirc: '\u00EE', + icy: '\u0438', + iecy: '\u0435', + iexcl: '\u00A1', + iff: '\u21D4', + ifr: '\uD835\uDD26', + igrave: '\u00EC', + ii: '\u2148', + iiiint: '\u2A0C', + iiint: '\u222D', + iinfin: '\u29DC', + iiota: '\u2129', + ijlig: '\u0133', + imacr: '\u012B', + image: '\u2111', + imagline: '\u2110', + imagpart: '\u2111', + imath: '\u0131', + imof: '\u22B7', + imped: '\u01B5', + in: '\u2208', + incare: '\u2105', + infin: '\u221E', + infintie: '\u29DD', + inodot: '\u0131', + int: '\u222B', + intcal: '\u22BA', + integers: '\u2124', + intercal: '\u22BA', + intlarhk: '\u2A17', + intprod: '\u2A3C', + iocy: '\u0451', + iogon: '\u012F', + iopf: '\uD835\uDD5A', + iota: '\u03B9', + iprod: '\u2A3C', + iquest: '\u00BF', + iscr: '\uD835\uDCBE', + isin: '\u2208', + isinE: '\u22F9', + isindot: '\u22F5', + isins: '\u22F4', + isinsv: '\u22F3', + isinv: '\u2208', + it: '\u2062', + itilde: '\u0129', + iukcy: '\u0456', + iuml: '\u00EF', + jcirc: '\u0135', + jcy: '\u0439', + jfr: '\uD835\uDD27', + jmath: '\u0237', + jopf: '\uD835\uDD5B', + jscr: '\uD835\uDCBF', + jsercy: '\u0458', + jukcy: '\u0454', + kappa: '\u03BA', + kappav: '\u03F0', + kcedil: '\u0137', + kcy: '\u043A', + kfr: '\uD835\uDD28', + kgreen: '\u0138', + khcy: '\u0445', + kjcy: '\u045C', + kopf: '\uD835\uDD5C', + kscr: '\uD835\uDCC0', + lAarr: '\u21DA', + lArr: '\u21D0', + lAtail: '\u291B', + lBarr: '\u290E', + lE: '\u2266', + lEg: '\u2A8B', + lHar: '\u2962', + lacute: '\u013A', + laemptyv: '\u29B4', + lagran: '\u2112', + lambda: '\u03BB', + lang: '\u27E8', + langd: '\u2991', + langle: '\u27E8', + lap: '\u2A85', + laquo: '\u00AB', + larr: '\u2190', + larrb: '\u21E4', + larrbfs: '\u291F', + larrfs: '\u291D', + larrhk: '\u21A9', + larrlp: '\u21AB', + larrpl: '\u2939', + larrsim: '\u2973', + larrtl: '\u21A2', + lat: '\u2AAB', + latail: '\u2919', + late: '\u2AAD', + lates: '\u2AAD\uFE00', + lbarr: '\u290C', + lbbrk: '\u2772', + lbrace: '\u007B', + lbrack: '\u005B', + lbrke: '\u298B', + lbrksld: '\u298F', + lbrkslu: '\u298D', + lcaron: '\u013E', + lcedil: '\u013C', + lceil: '\u2308', + lcub: '\u007B', + lcy: '\u043B', + ldca: '\u2936', + ldquo: '\u201C', + ldquor: '\u201E', + ldrdhar: '\u2967', + ldrushar: '\u294B', + ldsh: '\u21B2', + le: '\u2264', + leftarrow: '\u2190', + leftarrowtail: '\u21A2', + leftharpoondown: '\u21BD', + leftharpoonup: '\u21BC', + leftleftarrows: '\u21C7', + leftrightarrow: '\u2194', + leftrightarrows: '\u21C6', + leftrightharpoons: '\u21CB', + leftrightsquigarrow: '\u21AD', + leftthreetimes: '\u22CB', + leg: '\u22DA', + leq: '\u2264', + leqq: '\u2266', + leqslant: '\u2A7D', + les: '\u2A7D', + lescc: '\u2AA8', + lesdot: '\u2A7F', + lesdoto: '\u2A81', + lesdotor: '\u2A83', + lesg: '\u22DA\uFE00', + lesges: '\u2A93', + lessapprox: '\u2A85', + lessdot: '\u22D6', + lesseqgtr: '\u22DA', + lesseqqgtr: '\u2A8B', + lessgtr: '\u2276', + lesssim: '\u2272', + lfisht: '\u297C', + lfloor: '\u230A', + lfr: '\uD835\uDD29', + lg: '\u2276', + lgE: '\u2A91', + lhard: '\u21BD', + lharu: '\u21BC', + lharul: '\u296A', + lhblk: '\u2584', + ljcy: '\u0459', + ll: '\u226A', + llarr: '\u21C7', + llcorner: '\u231E', + llhard: '\u296B', + lltri: '\u25FA', + lmidot: '\u0140', + lmoust: '\u23B0', + lmoustache: '\u23B0', + lnE: '\u2268', + lnap: '\u2A89', + lnapprox: '\u2A89', + lne: '\u2A87', + lneq: '\u2A87', + lneqq: '\u2268', + lnsim: '\u22E6', + loang: '\u27EC', + loarr: '\u21FD', + lobrk: '\u27E6', + longleftarrow: '\u27F5', + longleftrightarrow: '\u27F7', + longmapsto: '\u27FC', + longrightarrow: '\u27F6', + looparrowleft: '\u21AB', + looparrowright: '\u21AC', + lopar: '\u2985', + lopf: '\uD835\uDD5D', + loplus: '\u2A2D', + lotimes: '\u2A34', + lowast: '\u2217', + lowbar: '\u005F', + loz: '\u25CA', + lozenge: '\u25CA', + lozf: '\u29EB', + lpar: '\u0028', + lparlt: '\u2993', + lrarr: '\u21C6', + lrcorner: '\u231F', + lrhar: '\u21CB', + lrhard: '\u296D', + lrm: '\u200E', + lrtri: '\u22BF', + lsaquo: '\u2039', + lscr: '\uD835\uDCC1', + lsh: '\u21B0', + lsim: '\u2272', + lsime: '\u2A8D', + lsimg: '\u2A8F', + lsqb: '\u005B', + lsquo: '\u2018', + lsquor: '\u201A', + lstrok: '\u0142', + lt: '\u003C', + ltcc: '\u2AA6', + ltcir: '\u2A79', + ltdot: '\u22D6', + lthree: '\u22CB', + ltimes: '\u22C9', + ltlarr: '\u2976', + ltquest: '\u2A7B', + ltrPar: '\u2996', + ltri: '\u25C3', + ltrie: '\u22B4', + ltrif: '\u25C2', + lurdshar: '\u294A', + luruhar: '\u2966', + lvertneqq: '\u2268\uFE00', + lvnE: '\u2268\uFE00', + mDDot: '\u223A', + macr: '\u00AF', + male: '\u2642', + malt: '\u2720', + maltese: '\u2720', + map: '\u21A6', + mapsto: '\u21A6', + mapstodown: '\u21A7', + mapstoleft: '\u21A4', + mapstoup: '\u21A5', + marker: '\u25AE', + mcomma: '\u2A29', + mcy: '\u043C', + mdash: '\u2014', + measuredangle: '\u2221', + mfr: '\uD835\uDD2A', + mho: '\u2127', + micro: '\u00B5', + mid: '\u2223', + midast: '\u002A', + midcir: '\u2AF0', + middot: '\u00B7', + minus: '\u2212', + minusb: '\u229F', + minusd: '\u2238', + minusdu: '\u2A2A', + mlcp: '\u2ADB', + mldr: '\u2026', + mnplus: '\u2213', + models: '\u22A7', + mopf: '\uD835\uDD5E', + mp: '\u2213', + mscr: '\uD835\uDCC2', + mstpos: '\u223E', + mu: '\u03BC', + multimap: '\u22B8', + mumap: '\u22B8', + nGg: '\u22D9\u0338', + nGt: '\u226B\u20D2', + nGtv: '\u226B\u0338', + nLeftarrow: '\u21CD', + nLeftrightarrow: '\u21CE', + nLl: '\u22D8\u0338', + nLt: '\u226A\u20D2', + nLtv: '\u226A\u0338', + nRightarrow: '\u21CF', + nVDash: '\u22AF', + nVdash: '\u22AE', + nabla: '\u2207', + nacute: '\u0144', + nang: '\u2220\u20D2', + nap: '\u2249', + napE: '\u2A70\u0338', + napid: '\u224B\u0338', + napos: '\u0149', + napprox: '\u2249', + natur: '\u266E', + natural: '\u266E', + naturals: '\u2115', + nbsp: '\u00A0', + nbump: '\u224E\u0338', + nbumpe: '\u224F\u0338', + ncap: '\u2A43', + ncaron: '\u0148', + ncedil: '\u0146', + ncong: '\u2247', + ncongdot: '\u2A6D\u0338', + ncup: '\u2A42', + ncy: '\u043D', + ndash: '\u2013', + ne: '\u2260', + neArr: '\u21D7', + nearhk: '\u2924', + nearr: '\u2197', + nearrow: '\u2197', + nedot: '\u2250\u0338', + nequiv: '\u2262', + nesear: '\u2928', + nesim: '\u2242\u0338', + nexist: '\u2204', + nexists: '\u2204', + nfr: '\uD835\uDD2B', + ngE: '\u2267\u0338', + nge: '\u2271', + ngeq: '\u2271', + ngeqq: '\u2267\u0338', + ngeqslant: '\u2A7E\u0338', + nges: '\u2A7E\u0338', + ngsim: '\u2275', + ngt: '\u226F', + ngtr: '\u226F', + nhArr: '\u21CE', + nharr: '\u21AE', + nhpar: '\u2AF2', + ni: '\u220B', + nis: '\u22FC', + nisd: '\u22FA', + niv: '\u220B', + njcy: '\u045A', + nlArr: '\u21CD', + nlE: '\u2266\u0338', + nlarr: '\u219A', + nldr: '\u2025', + nle: '\u2270', + nleftarrow: '\u219A', + nleftrightarrow: '\u21AE', + nleq: '\u2270', + nleqq: '\u2266\u0338', + nleqslant: '\u2A7D\u0338', + nles: '\u2A7D\u0338', + nless: '\u226E', + nlsim: '\u2274', + nlt: '\u226E', + nltri: '\u22EA', + nltrie: '\u22EC', + nmid: '\u2224', + nopf: '\uD835\uDD5F', + not: '\u00AC', + notin: '\u2209', + notinE: '\u22F9\u0338', + notindot: '\u22F5\u0338', + notinva: '\u2209', + notinvb: '\u22F7', + notinvc: '\u22F6', + notni: '\u220C', + notniva: '\u220C', + notnivb: '\u22FE', + notnivc: '\u22FD', + npar: '\u2226', + nparallel: '\u2226', + nparsl: '\u2AFD\u20E5', + npart: '\u2202\u0338', + npolint: '\u2A14', + npr: '\u2280', + nprcue: '\u22E0', + npre: '\u2AAF\u0338', + nprec: '\u2280', + npreceq: '\u2AAF\u0338', + nrArr: '\u21CF', + nrarr: '\u219B', + nrarrc: '\u2933\u0338', + nrarrw: '\u219D\u0338', + nrightarrow: '\u219B', + nrtri: '\u22EB', + nrtrie: '\u22ED', + nsc: '\u2281', + nsccue: '\u22E1', + nsce: '\u2AB0\u0338', + nscr: '\uD835\uDCC3', + nshortmid: '\u2224', + nshortparallel: '\u2226', + nsim: '\u2241', + nsime: '\u2244', + nsimeq: '\u2244', + nsmid: '\u2224', + nspar: '\u2226', + nsqsube: '\u22E2', + nsqsupe: '\u22E3', + nsub: '\u2284', + nsubE: '\u2AC5\u0338', + nsube: '\u2288', + nsubset: '\u2282\u20D2', + nsubseteq: '\u2288', + nsubseteqq: '\u2AC5\u0338', + nsucc: '\u2281', + nsucceq: '\u2AB0\u0338', + nsup: '\u2285', + nsupE: '\u2AC6\u0338', + nsupe: '\u2289', + nsupset: '\u2283\u20D2', + nsupseteq: '\u2289', + nsupseteqq: '\u2AC6\u0338', + ntgl: '\u2279', + ntilde: '\u00F1', + ntlg: '\u2278', + ntriangleleft: '\u22EA', + ntrianglelefteq: '\u22EC', + ntriangleright: '\u22EB', + ntrianglerighteq: '\u22ED', + nu: '\u03BD', + num: '\u0023', + numero: '\u2116', + numsp: '\u2007', + nvDash: '\u22AD', + nvHarr: '\u2904', + nvap: '\u224D\u20D2', + nvdash: '\u22AC', + nvge: '\u2265\u20D2', + nvgt: '\u003E\u20D2', + nvinfin: '\u29DE', + nvlArr: '\u2902', + nvle: '\u2264\u20D2', + nvlt: '\u003C\u20D2', + nvltrie: '\u22B4\u20D2', + nvrArr: '\u2903', + nvrtrie: '\u22B5\u20D2', + nvsim: '\u223C\u20D2', + nwArr: '\u21D6', + nwarhk: '\u2923', + nwarr: '\u2196', + nwarrow: '\u2196', + nwnear: '\u2927', + oS: '\u24C8', + oacute: '\u00F3', + oast: '\u229B', + ocir: '\u229A', + ocirc: '\u00F4', + ocy: '\u043E', + odash: '\u229D', + odblac: '\u0151', + odiv: '\u2A38', + odot: '\u2299', + odsold: '\u29BC', + oelig: '\u0153', + ofcir: '\u29BF', + ofr: '\uD835\uDD2C', + ogon: '\u02DB', + ograve: '\u00F2', + ogt: '\u29C1', + ohbar: '\u29B5', + ohm: '\u03A9', + oint: '\u222E', + olarr: '\u21BA', + olcir: '\u29BE', + olcross: '\u29BB', + oline: '\u203E', + olt: '\u29C0', + omacr: '\u014D', + omega: '\u03C9', + omicron: '\u03BF', + omid: '\u29B6', + ominus: '\u2296', + oopf: '\uD835\uDD60', + opar: '\u29B7', + operp: '\u29B9', + oplus: '\u2295', + or: '\u2228', + orarr: '\u21BB', + ord: '\u2A5D', + order: '\u2134', + orderof: '\u2134', + ordf: '\u00AA', + ordm: '\u00BA', + origof: '\u22B6', + oror: '\u2A56', + orslope: '\u2A57', + orv: '\u2A5B', + oscr: '\u2134', + oslash: '\u00F8', + osol: '\u2298', + otilde: '\u00F5', + otimes: '\u2297', + otimesas: '\u2A36', + ouml: '\u00F6', + ovbar: '\u233D', + par: '\u2225', + para: '\u00B6', + parallel: '\u2225', + parsim: '\u2AF3', + parsl: '\u2AFD', + part: '\u2202', + pcy: '\u043F', + percnt: '\u0025', + period: '\u002E', + permil: '\u2030', + perp: '\u22A5', + pertenk: '\u2031', + pfr: '\uD835\uDD2D', + phi: '\u03C6', + phiv: '\u03D5', + phmmat: '\u2133', + phone: '\u260E', + pi: '\u03C0', + pitchfork: '\u22D4', + piv: '\u03D6', + planck: '\u210F', + planckh: '\u210E', + plankv: '\u210F', + plus: '\u002B', + plusacir: '\u2A23', + plusb: '\u229E', + pluscir: '\u2A22', + plusdo: '\u2214', + plusdu: '\u2A25', + pluse: '\u2A72', + plusmn: '\u00B1', + plussim: '\u2A26', + plustwo: '\u2A27', + pm: '\u00B1', + pointint: '\u2A15', + popf: '\uD835\uDD61', + pound: '\u00A3', + pr: '\u227A', + prE: '\u2AB3', + prap: '\u2AB7', + prcue: '\u227C', + pre: '\u2AAF', + prec: '\u227A', + precapprox: '\u2AB7', + preccurlyeq: '\u227C', + preceq: '\u2AAF', + precnapprox: '\u2AB9', + precneqq: '\u2AB5', + precnsim: '\u22E8', + precsim: '\u227E', + prime: '\u2032', + primes: '\u2119', + prnE: '\u2AB5', + prnap: '\u2AB9', + prnsim: '\u22E8', + prod: '\u220F', + profalar: '\u232E', + profline: '\u2312', + profsurf: '\u2313', + prop: '\u221D', + propto: '\u221D', + prsim: '\u227E', + prurel: '\u22B0', + pscr: '\uD835\uDCC5', + psi: '\u03C8', + puncsp: '\u2008', + qfr: '\uD835\uDD2E', + qint: '\u2A0C', + qopf: '\uD835\uDD62', + qprime: '\u2057', + qscr: '\uD835\uDCC6', + quaternions: '\u210D', + quatint: '\u2A16', + quest: '\u003F', + questeq: '\u225F', + quot: '\u0022', + rAarr: '\u21DB', + rArr: '\u21D2', + rAtail: '\u291C', + rBarr: '\u290F', + rHar: '\u2964', + race: '\u223D\u0331', + racute: '\u0155', + radic: '\u221A', + raemptyv: '\u29B3', + rang: '\u27E9', + rangd: '\u2992', + range: '\u29A5', + rangle: '\u27E9', + raquo: '\u00BB', + rarr: '\u2192', + rarrap: '\u2975', + rarrb: '\u21E5', + rarrbfs: '\u2920', + rarrc: '\u2933', + rarrfs: '\u291E', + rarrhk: '\u21AA', + rarrlp: '\u21AC', + rarrpl: '\u2945', + rarrsim: '\u2974', + rarrtl: '\u21A3', + rarrw: '\u219D', + ratail: '\u291A', + ratio: '\u2236', + rationals: '\u211A', + rbarr: '\u290D', + rbbrk: '\u2773', + rbrace: '\u007D', + rbrack: '\u005D', + rbrke: '\u298C', + rbrksld: '\u298E', + rbrkslu: '\u2990', + rcaron: '\u0159', + rcedil: '\u0157', + rceil: '\u2309', + rcub: '\u007D', + rcy: '\u0440', + rdca: '\u2937', + rdldhar: '\u2969', + rdquo: '\u201D', + rdquor: '\u201D', + rdsh: '\u21B3', + real: '\u211C', + realine: '\u211B', + realpart: '\u211C', + reals: '\u211D', + rect: '\u25AD', + reg: '\u00AE', + rfisht: '\u297D', + rfloor: '\u230B', + rfr: '\uD835\uDD2F', + rhard: '\u21C1', + rharu: '\u21C0', + rharul: '\u296C', + rho: '\u03C1', + rhov: '\u03F1', + rightarrow: '\u2192', + rightarrowtail: '\u21A3', + rightharpoondown: '\u21C1', + rightharpoonup: '\u21C0', + rightleftarrows: '\u21C4', + rightleftharpoons: '\u21CC', + rightrightarrows: '\u21C9', + rightsquigarrow: '\u219D', + rightthreetimes: '\u22CC', + ring: '\u02DA', + risingdotseq: '\u2253', + rlarr: '\u21C4', + rlhar: '\u21CC', + rlm: '\u200F', + rmoust: '\u23B1', + rmoustache: '\u23B1', + rnmid: '\u2AEE', + roang: '\u27ED', + roarr: '\u21FE', + robrk: '\u27E7', + ropar: '\u2986', + ropf: '\uD835\uDD63', + roplus: '\u2A2E', + rotimes: '\u2A35', + rpar: '\u0029', + rpargt: '\u2994', + rppolint: '\u2A12', + rrarr: '\u21C9', + rsaquo: '\u203A', + rscr: '\uD835\uDCC7', + rsh: '\u21B1', + rsqb: '\u005D', + rsquo: '\u2019', + rsquor: '\u2019', + rthree: '\u22CC', + rtimes: '\u22CA', + rtri: '\u25B9', + rtrie: '\u22B5', + rtrif: '\u25B8', + rtriltri: '\u29CE', + ruluhar: '\u2968', + rx: '\u211E', + sacute: '\u015B', + sbquo: '\u201A', + sc: '\u227B', + scE: '\u2AB4', + scap: '\u2AB8', + scaron: '\u0161', + sccue: '\u227D', + sce: '\u2AB0', + scedil: '\u015F', + scirc: '\u015D', + scnE: '\u2AB6', + scnap: '\u2ABA', + scnsim: '\u22E9', + scpolint: '\u2A13', + scsim: '\u227F', + scy: '\u0441', + sdot: '\u22C5', + sdotb: '\u22A1', + sdote: '\u2A66', + seArr: '\u21D8', + searhk: '\u2925', + searr: '\u2198', + searrow: '\u2198', + sect: '\u00A7', + semi: '\u003B', + seswar: '\u2929', + setminus: '\u2216', + setmn: '\u2216', + sext: '\u2736', + sfr: '\uD835\uDD30', + sfrown: '\u2322', + sharp: '\u266F', + shchcy: '\u0449', + shcy: '\u0448', + shortmid: '\u2223', + shortparallel: '\u2225', + shy: '\u00AD', + sigma: '\u03C3', + sigmaf: '\u03C2', + sigmav: '\u03C2', + sim: '\u223C', + simdot: '\u2A6A', + sime: '\u2243', + simeq: '\u2243', + simg: '\u2A9E', + simgE: '\u2AA0', + siml: '\u2A9D', + simlE: '\u2A9F', + simne: '\u2246', + simplus: '\u2A24', + simrarr: '\u2972', + slarr: '\u2190', + smallsetminus: '\u2216', + smashp: '\u2A33', + smeparsl: '\u29E4', + smid: '\u2223', + smile: '\u2323', + smt: '\u2AAA', + smte: '\u2AAC', + smtes: '\u2AAC\uFE00', + softcy: '\u044C', + sol: '\u002F', + solb: '\u29C4', + solbar: '\u233F', + sopf: '\uD835\uDD64', + spades: '\u2660', + spadesuit: '\u2660', + spar: '\u2225', + sqcap: '\u2293', + sqcaps: '\u2293\uFE00', + sqcup: '\u2294', + sqcups: '\u2294\uFE00', + sqsub: '\u228F', + sqsube: '\u2291', + sqsubset: '\u228F', + sqsubseteq: '\u2291', + sqsup: '\u2290', + sqsupe: '\u2292', + sqsupset: '\u2290', + sqsupseteq: '\u2292', + squ: '\u25A1', + square: '\u25A1', + squarf: '\u25AA', + squf: '\u25AA', + srarr: '\u2192', + sscr: '\uD835\uDCC8', + ssetmn: '\u2216', + ssmile: '\u2323', + sstarf: '\u22C6', + star: '\u2606', + starf: '\u2605', + straightepsilon: '\u03F5', + straightphi: '\u03D5', + strns: '\u00AF', + sub: '\u2282', + subE: '\u2AC5', + subdot: '\u2ABD', + sube: '\u2286', + subedot: '\u2AC3', + submult: '\u2AC1', + subnE: '\u2ACB', + subne: '\u228A', + subplus: '\u2ABF', + subrarr: '\u2979', + subset: '\u2282', + subseteq: '\u2286', + subseteqq: '\u2AC5', + subsetneq: '\u228A', + subsetneqq: '\u2ACB', + subsim: '\u2AC7', + subsub: '\u2AD5', + subsup: '\u2AD3', + succ: '\u227B', + succapprox: '\u2AB8', + succcurlyeq: '\u227D', + succeq: '\u2AB0', + succnapprox: '\u2ABA', + succneqq: '\u2AB6', + succnsim: '\u22E9', + succsim: '\u227F', + sum: '\u2211', + sung: '\u266A', + sup1: '\u00B9', + sup2: '\u00B2', + sup3: '\u00B3', + sup: '\u2283', + supE: '\u2AC6', + supdot: '\u2ABE', + supdsub: '\u2AD8', + supe: '\u2287', + supedot: '\u2AC4', + suphsol: '\u27C9', + suphsub: '\u2AD7', + suplarr: '\u297B', + supmult: '\u2AC2', + supnE: '\u2ACC', + supne: '\u228B', + supplus: '\u2AC0', + supset: '\u2283', + supseteq: '\u2287', + supseteqq: '\u2AC6', + supsetneq: '\u228B', + supsetneqq: '\u2ACC', + supsim: '\u2AC8', + supsub: '\u2AD4', + supsup: '\u2AD6', + swArr: '\u21D9', + swarhk: '\u2926', + swarr: '\u2199', + swarrow: '\u2199', + swnwar: '\u292A', + szlig: '\u00DF', + target: '\u2316', + tau: '\u03C4', + tbrk: '\u23B4', + tcaron: '\u0165', + tcedil: '\u0163', + tcy: '\u0442', + tdot: '\u20DB', + telrec: '\u2315', + tfr: '\uD835\uDD31', + there4: '\u2234', + therefore: '\u2234', + theta: '\u03B8', + thetasym: '\u03D1', + thetav: '\u03D1', + thickapprox: '\u2248', + thicksim: '\u223C', + thinsp: '\u2009', + thkap: '\u2248', + thksim: '\u223C', + thorn: '\u00FE', + tilde: '\u02DC', + times: '\u00D7', + timesb: '\u22A0', + timesbar: '\u2A31', + timesd: '\u2A30', + tint: '\u222D', + toea: '\u2928', + top: '\u22A4', + topbot: '\u2336', + topcir: '\u2AF1', + topf: '\uD835\uDD65', + topfork: '\u2ADA', + tosa: '\u2929', + tprime: '\u2034', + trade: '\u2122', + triangle: '\u25B5', + triangledown: '\u25BF', + triangleleft: '\u25C3', + trianglelefteq: '\u22B4', + triangleq: '\u225C', + triangleright: '\u25B9', + trianglerighteq: '\u22B5', + tridot: '\u25EC', + trie: '\u225C', + triminus: '\u2A3A', + triplus: '\u2A39', + trisb: '\u29CD', + tritime: '\u2A3B', + trpezium: '\u23E2', + tscr: '\uD835\uDCC9', + tscy: '\u0446', + tshcy: '\u045B', + tstrok: '\u0167', + twixt: '\u226C', + twoheadleftarrow: '\u219E', + twoheadrightarrow: '\u21A0', + uArr: '\u21D1', + uHar: '\u2963', + uacute: '\u00FA', + uarr: '\u2191', + ubrcy: '\u045E', + ubreve: '\u016D', + ucirc: '\u00FB', + ucy: '\u0443', + udarr: '\u21C5', + udblac: '\u0171', + udhar: '\u296E', + ufisht: '\u297E', + ufr: '\uD835\uDD32', + ugrave: '\u00F9', + uharl: '\u21BF', + uharr: '\u21BE', + uhblk: '\u2580', + ulcorn: '\u231C', + ulcorner: '\u231C', + ulcrop: '\u230F', + ultri: '\u25F8', + umacr: '\u016B', + uml: '\u00A8', + uogon: '\u0173', + uopf: '\uD835\uDD66', + uparrow: '\u2191', + updownarrow: '\u2195', + upharpoonleft: '\u21BF', + upharpoonright: '\u21BE', + uplus: '\u228E', + upsi: '\u03C5', + upsih: '\u03D2', + upsilon: '\u03C5', + upuparrows: '\u21C8', + urcorn: '\u231D', + urcorner: '\u231D', + urcrop: '\u230E', + uring: '\u016F', + urtri: '\u25F9', + uscr: '\uD835\uDCCA', + utdot: '\u22F0', + utilde: '\u0169', + utri: '\u25B5', + utrif: '\u25B4', + uuarr: '\u21C8', + uuml: '\u00FC', + uwangle: '\u29A7', + vArr: '\u21D5', + vBar: '\u2AE8', + vBarv: '\u2AE9', + vDash: '\u22A8', + vangrt: '\u299C', + varepsilon: '\u03F5', + varkappa: '\u03F0', + varnothing: '\u2205', + varphi: '\u03D5', + varpi: '\u03D6', + varpropto: '\u221D', + varr: '\u2195', + varrho: '\u03F1', + varsigma: '\u03C2', + varsubsetneq: '\u228A\uFE00', + varsubsetneqq: '\u2ACB\uFE00', + varsupsetneq: '\u228B\uFE00', + varsupsetneqq: '\u2ACC\uFE00', + vartheta: '\u03D1', + vartriangleleft: '\u22B2', + vartriangleright: '\u22B3', + vcy: '\u0432', + vdash: '\u22A2', + vee: '\u2228', + veebar: '\u22BB', + veeeq: '\u225A', + vellip: '\u22EE', + verbar: '\u007C', + vert: '\u007C', + vfr: '\uD835\uDD33', + vltri: '\u22B2', + vnsub: '\u2282\u20D2', + vnsup: '\u2283\u20D2', + vopf: '\uD835\uDD67', + vprop: '\u221D', + vrtri: '\u22B3', + vscr: '\uD835\uDCCB', + vsubnE: '\u2ACB\uFE00', + vsubne: '\u228A\uFE00', + vsupnE: '\u2ACC\uFE00', + vsupne: '\u228B\uFE00', + vzigzag: '\u299A', + wcirc: '\u0175', + wedbar: '\u2A5F', + wedge: '\u2227', + wedgeq: '\u2259', + weierp: '\u2118', + wfr: '\uD835\uDD34', + wopf: '\uD835\uDD68', + wp: '\u2118', + wr: '\u2240', + wreath: '\u2240', + wscr: '\uD835\uDCCC', + xcap: '\u22C2', + xcirc: '\u25EF', + xcup: '\u22C3', + xdtri: '\u25BD', + xfr: '\uD835\uDD35', + xhArr: '\u27FA', + xharr: '\u27F7', + xi: '\u03BE', + xlArr: '\u27F8', + xlarr: '\u27F5', + xmap: '\u27FC', + xnis: '\u22FB', + xodot: '\u2A00', + xopf: '\uD835\uDD69', + xoplus: '\u2A01', + xotime: '\u2A02', + xrArr: '\u27F9', + xrarr: '\u27F6', + xscr: '\uD835\uDCCD', + xsqcup: '\u2A06', + xuplus: '\u2A04', + xutri: '\u25B3', + xvee: '\u22C1', + xwedge: '\u22C0', + yacute: '\u00FD', + yacy: '\u044F', + ycirc: '\u0177', + ycy: '\u044B', + yen: '\u00A5', + yfr: '\uD835\uDD36', + yicy: '\u0457', + yopf: '\uD835\uDD6A', + yscr: '\uD835\uDCCE', + yucy: '\u044E', + yuml: '\u00FF', + zacute: '\u017A', + zcaron: '\u017E', + zcy: '\u0437', + zdot: '\u017C', + zeetrf: '\u2128', + zeta: '\u03B6', + zfr: '\uD835\uDD37', + zhcy: '\u0436', + zigrarr: '\u21DD', + zopf: '\uD835\uDD6B', + zscr: '\uD835\uDCCF', + zwj: '\u200D', + zwnj: '\u200C', +}; +const decodeMap = { + '0': 65533, + '128': 8364, + '130': 8218, + '131': 402, + '132': 8222, + '133': 8230, + '134': 8224, + '135': 8225, + '136': 710, + '137': 8240, + '138': 352, + '139': 8249, + '140': 338, + '142': 381, + '145': 8216, + '146': 8217, + '147': 8220, + '148': 8221, + '149': 8226, + '150': 8211, + '151': 8212, + '152': 732, + '153': 8482, + '154': 353, + '155': 8250, + '156': 339, + '158': 382, + '159': 376, +}; +function decodeHTMLStrict(text) { + return text.replace(/&(?:[a-zA-Z]+|#[xX][\da-fA-F]+|#\d+);/g, (key) => { + if (key.charAt(1) === '#') { + const secondChar = key.charAt(2); + const codePoint = secondChar === 'X' || secondChar === 'x' ? parseInt(key.slice(3), 16) : parseInt(key.slice(2), 10); + return decodeCodePoint(codePoint); + } + return getOwnProperty(entities, key.slice(1, -1)) ?? key; + }); +} +function decodeCodePoint(codePoint) { + if ((codePoint >= 0xd800 && codePoint <= 0xdfff) || codePoint > 0x10ffff) { + return '\uFFFD'; + } + return String.fromCodePoint(getOwnProperty(decodeMap, codePoint) ?? codePoint); +} + +function scanJSXAttributeValue(parser, context) { + parser.startIndex = parser.tokenIndex = parser.index; + parser.startColumn = parser.tokenColumn = parser.column; + parser.startLine = parser.tokenLine = parser.line; + parser.setToken(CharTypes[parser.currentChar] & 8192 + ? scanJSXString(parser) + : scanSingleToken(parser, context, 0)); + return parser.getToken(); +} +function scanJSXString(parser) { + const quote = parser.currentChar; + let char = advanceChar(parser); + const start = parser.index; + while (char !== quote) { + if (parser.index >= parser.end) + parser.report(16); + char = advanceChar(parser); + } + if (char !== quote) + parser.report(16); + parser.tokenValue = parser.source.slice(start, parser.index); + advanceChar(parser); + if (parser.options.raw) + parser.tokenRaw = parser.source.slice(parser.tokenIndex, parser.index); + return 134283267; +} +function nextJSXToken(parser) { + parser.startIndex = parser.tokenIndex = parser.index; + parser.startColumn = parser.tokenColumn = parser.column; + parser.startLine = parser.tokenLine = parser.line; + if (parser.index >= parser.end) { + parser.setToken(1048576); + return; + } + if (parser.currentChar === 60) { + advanceChar(parser); + parser.setToken(8456256); + return; + } + if (parser.currentChar === 123) { + advanceChar(parser); + parser.setToken(2162700); + return; + } + let state = 0; + while (parser.index < parser.end) { + const type = CharTypes[parser.source.charCodeAt(parser.index)]; + if (type & 1024) { + state |= 1 | 4; + scanNewLine(parser); + } + else if (type & 2048) { + consumeLineFeed(parser, state); + state = (state & -5) | 1; + } + else { + advanceChar(parser); + } + if (CharTypes[parser.currentChar] & 16384) + break; + } + if (parser.tokenIndex === parser.index) + parser.report(0); + const raw = parser.source.slice(parser.tokenIndex, parser.index); + if (parser.options.raw) + parser.tokenRaw = raw; + parser.tokenValue = decodeHTMLStrict(raw); + parser.setToken(137); +} +function rescanJSXIdentifier(parser) { + if ((parser.getToken() & 143360) === 143360) { + const { index } = parser; + let char = parser.currentChar; + while (CharTypes[char] & (32768 | 2)) { + char = advanceChar(parser); + } + parser.tokenValue += parser.source.slice(index, parser.index); + parser.setToken(208897, true); + } + return parser.getToken(); +} + +class Scope { + parser; + type; + parent; + scopeError; + variableBindings = new Map(); + constructor(parser, type = 2, parent) { + this.parser = parser; + this.type = type; + this.parent = parent; + } + createChildScope(type) { + return new Scope(this.parser, type, this); + } + addVarOrBlock(context, name, kind, origin) { + if (kind & 4) { + this.addVarName(context, name, kind); + } + else { + this.addBlockName(context, name, kind, origin); + } + if (origin & 64) { + this.parser.declareUnboundVariable(name); + } + } + addVarName(context, name, kind) { + const { parser } = this; + let currentScope = this; + while (currentScope && (currentScope.type & 128) === 0) { + const { variableBindings } = currentScope; + const value = variableBindings.get(name); + if (value && value & 248) { + if (parser.options.webcompat && + (context & 1) === 0 && + ((kind & 128 && value & 68) || + (value & 128 && kind & 68))) ; + else { + parser.report(145, name); + } + } + if (currentScope === this) { + if (value && value & 1 && kind & 1) { + currentScope.recordScopeError(145, name); + } + } + if (value && + (value & 256 || (value & 512 && !parser.options.webcompat))) { + parser.report(145, name); + } + currentScope.variableBindings.set(name, kind); + currentScope = currentScope.parent; + } + } + hasVariable(name) { + return this.variableBindings.has(name); + } + addBlockName(context, name, kind, origin) { + const { parser } = this; + const value = this.variableBindings.get(name); + if (value && (value & 2) === 0) { + if (kind & 1) { + this.recordScopeError(145, name); + } + else if (parser.options.webcompat && + (context & 1) === 0 && + origin & 2 && + value === 64 && + kind === 64) ; + else { + parser.report(145, name); + } + } + if (this.type & 64 && + this.parent?.hasVariable(name) && + (this.parent.variableBindings.get(name) & 2) === 0) { + parser.report(145, name); + } + if (this.type & 512 && value && (value & 2) === 0) { + if (kind & 1) { + this.recordScopeError(145, name); + } + } + if (this.type & 32) { + if (this.parent.variableBindings.get(name) & 768) + parser.report(159, name); + } + this.variableBindings.set(name, kind); + } + recordScopeError(type, ...params) { + this.scopeError = { + type, + params, + start: this.parser.tokenStart, + end: this.parser.currentLocation, + }; + } + reportScopeError() { + const { scopeError } = this; + if (!scopeError) { + return; + } + throw new ParseError(scopeError.start, scopeError.end, scopeError.type, ...scopeError.params); + } +} +function createArrowHeadParsingScope(parser, context, value) { + const scope = parser.createScope().createChildScope(512); + scope.addBlockName(context, value, 1, 0); + return scope; +} + +class PrivateScope { + parser; + parent; + refs = Object.create(null); + privateIdentifiers = new Map(); + constructor(parser, parent) { + this.parser = parser; + this.parent = parent; + } + addPrivateIdentifier(name, kind) { + const { privateIdentifiers } = this; + let focusKind = kind & (32 | 768); + if (!(focusKind & 768)) + focusKind |= 768; + const value = privateIdentifiers.get(name); + if (this.hasPrivateIdentifier(name) && + ((value & 32) !== (focusKind & 32) || value & focusKind & 768)) { + this.parser.report(146, name); + } + privateIdentifiers.set(name, this.hasPrivateIdentifier(name) ? value | focusKind : focusKind); + } + addPrivateIdentifierRef(name) { + this.refs[name] ??= []; + this.refs[name].push(this.parser.tokenStart); + } + isPrivateIdentifierDefined(name) { + return this.hasPrivateIdentifier(name) || Boolean(this.parent?.isPrivateIdentifierDefined(name)); + } + validatePrivateIdentifierRefs() { + for (const name in this.refs) { + if (!this.isPrivateIdentifierDefined(name)) { + const { index, line, column } = this.refs[name][0]; + throw new ParseError({ index, line, column }, { index: index + name.length, line, column: column + name.length }, 4, name); + } + } + } + hasPrivateIdentifier(name) { + return this.privateIdentifiers.has(name); + } +} + +class Parser { + source; + options; + lastOnToken = null; + token = 1048576; + flags = 0; + index = 0; + line = 1; + column = 0; + startIndex = 0; + end = 0; + tokenIndex = 0; + startColumn = 0; + tokenColumn = 0; + tokenLine = 1; + startLine = 1; + tokenValue = ''; + tokenRaw = ''; + tokenRegExp = void 0; + currentChar = 0; + exportedNames = new Set(); + exportedBindings = new Set(); + assignable = 1; + destructible = 0; + leadingDecorators = { decorators: [] }; + constructor(source, options = {}) { + this.source = source; + this.options = options; + this.end = source.length; + this.currentChar = source.charCodeAt(0); + } + getToken() { + return this.token; + } + setToken(value, replaceLast = false) { + this.token = value; + const { onToken } = this.options; + if (onToken) { + if (value !== 1048576) { + const loc = { + start: { + line: this.tokenLine, + column: this.tokenColumn, + }, + end: { + line: this.line, + column: this.column, + }, + }; + if (!replaceLast && this.lastOnToken) { + onToken(...this.lastOnToken); + } + this.lastOnToken = [convertTokenType(value), this.tokenIndex, this.index, loc]; + } + else { + if (this.lastOnToken) { + onToken(...this.lastOnToken); + this.lastOnToken = null; + } + } + } + return value; + } + get tokenStart() { + return { + index: this.tokenIndex, + line: this.tokenLine, + column: this.tokenColumn, + }; + } + get currentLocation() { + return { index: this.index, line: this.line, column: this.column }; + } + finishNode(node, start, end) { + if (this.options.ranges) { + node.start = start.index; + const endIndex = end ? end.index : this.startIndex; + node.end = endIndex; + node.range = [start.index, endIndex]; + } + if (this.options.loc) { + node.loc = { + start: { + line: start.line, + column: start.column, + }, + end: end ? { line: end.line, column: end.column } : { line: this.startLine, column: this.startColumn }, + }; + if (this.options.source) { + node.loc.source = this.options.source; + } + } + return node; + } + addBindingToExports(name) { + this.exportedBindings.add(name); + } + declareUnboundVariable(name) { + const { exportedNames } = this; + if (exportedNames.has(name)) { + this.report(147, name); + } + exportedNames.add(name); + } + report(type, ...params) { + throw new ParseError(this.tokenStart, this.currentLocation, type, ...params); + } + createScopeIfLexical(type, parent) { + if (this.options.lexical) { + return this.createScope(type, parent); + } + return undefined; + } + createScope(type, parent) { + return new Scope(this, type, parent); + } + createPrivateScopeIfLexical(parent) { + if (this.options.lexical) { + return new PrivateScope(this, parent); + } + return undefined; + } +} +function pushComment(comments, options) { + return function (type, value, start, end, loc) { + const comment = { + type, + value, + }; + if (options.ranges) { + comment.start = start; + comment.end = end; + comment.range = [start, end]; + } + if (options.loc) { + comment.loc = loc; + } + comments.push(comment); + }; +} +function pushToken(tokens, options) { + return function (type, start, end, loc) { + const token = { + token: type, + }; + if (options.ranges) { + token.start = start; + token.end = end; + token.range = [start, end]; + } + if (options.loc) { + token.loc = loc; + } + tokens.push(token); + }; +} + +function normalizeOptions(rawOptions) { + const options = { ...rawOptions }; + if (options.onComment) { + options.onComment = Array.isArray(options.onComment) ? pushComment(options.onComment, options) : options.onComment; + } + if (options.onToken) { + options.onToken = Array.isArray(options.onToken) ? pushToken(options.onToken, options) : options.onToken; + } + return options; +} + +function parseSource(source, rawOptions = {}, context = 0) { + const options = normalizeOptions(rawOptions); + if (options.module) + context |= 2 | 1; + if (options.globalReturn) + context |= 4096; + if (options.impliedStrict) + context |= 1; + const parser = new Parser(source, options); + skipHashBang(parser); + const scope = parser.createScopeIfLexical(); + let body = []; + let sourceType = 'script'; + if (context & 2) { + sourceType = 'module'; + body = parseModuleItemList(parser, context | 8, scope); + if (scope) { + for (const name of parser.exportedBindings) { + if (!scope.hasVariable(name)) + parser.report(148, name); + } + } + } + else { + body = parseStatementList(parser, context | 8, scope); + } + return parser.finishNode({ + type: 'Program', + sourceType, + body, + }, { index: 0, line: 1, column: 0 }, parser.currentLocation); +} +function parseStatementList(parser, context, scope) { + nextToken(parser, context | 32 | 262144); + const statements = []; + while (parser.getToken() === 134283267) { + const { index, tokenValue, tokenStart, tokenIndex } = parser; + const token = parser.getToken(); + const expr = parseLiteral(parser, context); + if (isValidStrictMode(parser, index, tokenIndex, tokenValue)) { + context |= 1; + if (parser.flags & 64) { + throw new ParseError(parser.tokenStart, parser.currentLocation, 9); + } + if (parser.flags & 4096) { + throw new ParseError(parser.tokenStart, parser.currentLocation, 15); + } + } + statements.push(parseDirective(parser, context, expr, token, tokenStart)); + } + while (parser.getToken() !== 1048576) { + statements.push(parseStatementListItem(parser, context, scope, undefined, 4, {})); + } + return statements; +} +function parseModuleItemList(parser, context, scope) { + nextToken(parser, context | 32); + const statements = []; + while (parser.getToken() === 134283267) { + const { tokenStart } = parser; + const token = parser.getToken(); + statements.push(parseDirective(parser, context, parseLiteral(parser, context), token, tokenStart)); + } + while (parser.getToken() !== 1048576) { + statements.push(parseModuleItem(parser, context, scope)); + } + return statements; +} +function parseModuleItem(parser, context, scope) { + if (parser.getToken() === 132) { + Object.assign(parser.leadingDecorators, { + start: parser.tokenStart, + decorators: parseDecorators(parser, context, undefined), + }); + } + let moduleItem; + switch (parser.getToken()) { + case 20564: + moduleItem = parseExportDeclaration(parser, context, scope); + break; + case 86106: + moduleItem = parseImportDeclaration(parser, context, scope); + break; + default: + moduleItem = parseStatementListItem(parser, context, scope, undefined, 4, {}); + } + if (parser.leadingDecorators?.decorators.length) { + parser.report(170); + } + return moduleItem; +} +function parseStatementListItem(parser, context, scope, privateScope, origin, labels) { + const start = parser.tokenStart; + switch (parser.getToken()) { + case 86104: + return parseFunctionDeclaration(parser, context, scope, privateScope, origin, 1, 0, 0, start); + case 132: + case 86094: + return parseClassDeclaration(parser, context, scope, privateScope, 0); + case 86090: + return parseLexicalDeclaration(parser, context, scope, privateScope, 16, 0); + case 241737: + return parseLetIdentOrVarDeclarationStatement(parser, context, scope, privateScope, origin); + case 20564: + parser.report(103, 'export'); + case 86106: + nextToken(parser, context); + switch (parser.getToken()) { + case 67174411: + return parseImportCallDeclaration(parser, context, privateScope, start); + case 67108877: + return parseImportMetaDeclaration(parser, context, start); + default: + parser.report(103, 'import'); + } + case 209005: + return parseAsyncArrowOrAsyncFunctionDeclaration(parser, context, scope, privateScope, origin, labels, 1); + default: + return parseStatement(parser, context, scope, privateScope, origin, labels, 1); + } +} +function parseStatement(parser, context, scope, privateScope, origin, labels, allowFuncDecl) { + switch (parser.getToken()) { + case 86088: + return parseVariableStatement(parser, context, scope, privateScope, 0); + case 20572: + return parseReturnStatement(parser, context, privateScope); + case 20569: + return parseIfStatement(parser, context, scope, privateScope, labels); + case 20567: + return parseForStatement(parser, context, scope, privateScope, labels); + case 20562: + return parseDoWhileStatement(parser, context, scope, privateScope, labels); + case 20578: + return parseWhileStatement(parser, context, scope, privateScope, labels); + case 86110: + return parseSwitchStatement(parser, context, scope, privateScope, labels); + case 1074790417: + return parseEmptyStatement(parser, context); + case 2162700: + return parseBlock(parser, context, scope?.createChildScope(), privateScope, labels, parser.tokenStart); + case 86112: + return parseThrowStatement(parser, context, privateScope); + case 20555: + return parseBreakStatement(parser, context, labels); + case 20559: + return parseContinueStatement(parser, context, labels); + case 20577: + return parseTryStatement(parser, context, scope, privateScope, labels); + case 20579: + return parseWithStatement(parser, context, scope, privateScope, labels); + case 20560: + return parseDebuggerStatement(parser, context); + case 209005: + return parseAsyncArrowOrAsyncFunctionDeclaration(parser, context, scope, privateScope, origin, labels, 0); + case 20557: + parser.report(162); + case 20566: + parser.report(163); + case 86104: + parser.report(context & 1 + ? 76 + : !parser.options.webcompat + ? 78 + : 77); + case 86094: + parser.report(79); + default: + return parseExpressionOrLabelledStatement(parser, context, scope, privateScope, origin, labels, allowFuncDecl); + } +} +function parseExpressionOrLabelledStatement(parser, context, scope, privateScope, origin, labels, allowFuncDecl) { + const { tokenValue, tokenStart } = parser; + const token = parser.getToken(); + let expr; + switch (token) { + case 241737: + expr = parseIdentifier(parser, context); + if (context & 1) + parser.report(85); + if (parser.getToken() === 69271571) + parser.report(84); + break; + default: + expr = parsePrimaryExpression(parser, context, privateScope, 2, 0, 1, 0, 1, parser.tokenStart); + } + if (token & 143360 && parser.getToken() === 21) { + return parseLabelledStatement(parser, context, scope, privateScope, origin, labels, tokenValue, expr, token, allowFuncDecl, tokenStart); + } + expr = parseMemberOrUpdateExpression(parser, context, privateScope, expr, 0, 0, tokenStart); + expr = parseAssignmentExpression(parser, context, privateScope, 0, 0, tokenStart, expr); + if (parser.getToken() === 18) { + expr = parseSequenceExpression(parser, context, privateScope, 0, tokenStart, expr); + } + return parseExpressionStatement(parser, context, expr, tokenStart); +} +function parseBlock(parser, context, scope, privateScope, labels, start = parser.tokenStart, type = 'BlockStatement') { + const body = []; + consume(parser, context | 32, 2162700); + while (parser.getToken() !== 1074790415) { + body.push(parseStatementListItem(parser, context, scope, privateScope, 2, { $: labels })); + } + consume(parser, context | 32, 1074790415); + return parser.finishNode({ + type, + body, + }, start); +} +function parseReturnStatement(parser, context, privateScope) { + if ((context & 4096) === 0) + parser.report(92); + const start = parser.tokenStart; + nextToken(parser, context | 32); + const argument = parser.flags & 1 || parser.getToken() & 1048576 + ? null + : parseExpressions(parser, context, privateScope, 0, 1, parser.tokenStart); + matchOrInsertSemicolon(parser, context | 32); + return parser.finishNode({ + type: 'ReturnStatement', + argument, + }, start); +} +function parseExpressionStatement(parser, context, expression, start) { + matchOrInsertSemicolon(parser, context | 32); + return parser.finishNode({ + type: 'ExpressionStatement', + expression, + }, start); +} +function parseLabelledStatement(parser, context, scope, privateScope, origin, labels, value, expr, token, allowFuncDecl, start) { + validateBindingIdentifier(parser, context, 0, token, 1); + validateAndDeclareLabel(parser, labels, value); + nextToken(parser, context | 32); + const body = allowFuncDecl && + (context & 1) === 0 && + parser.options.webcompat && + parser.getToken() === 86104 + ? parseFunctionDeclaration(parser, context, scope?.createChildScope(), privateScope, origin, 0, 0, 0, parser.tokenStart) + : parseStatement(parser, context, scope, privateScope, origin, labels, allowFuncDecl); + return parser.finishNode({ + type: 'LabeledStatement', + label: expr, + body, + }, start); +} +function parseAsyncArrowOrAsyncFunctionDeclaration(parser, context, scope, privateScope, origin, labels, allowFuncDecl) { + const { tokenValue, tokenStart: start } = parser; + const token = parser.getToken(); + let expr = parseIdentifier(parser, context); + if (parser.getToken() === 21) { + return parseLabelledStatement(parser, context, scope, privateScope, origin, labels, tokenValue, expr, token, 1, start); + } + const asyncNewLine = parser.flags & 1; + if (!asyncNewLine) { + if (parser.getToken() === 86104) { + if (!allowFuncDecl) + parser.report(123); + return parseFunctionDeclaration(parser, context, scope, privateScope, origin, 1, 0, 1, start); + } + if (isValidIdentifier(context, parser.getToken())) { + expr = parseAsyncArrowAfterIdent(parser, context, privateScope, 1, start); + if (parser.getToken() === 18) + expr = parseSequenceExpression(parser, context, privateScope, 0, start, expr); + return parseExpressionStatement(parser, context, expr, start); + } + } + if (parser.getToken() === 67174411) { + expr = parseAsyncArrowOrCallExpression(parser, context, privateScope, expr, 1, 1, 0, asyncNewLine, start); + } + else { + if (parser.getToken() === 10) { + classifyIdentifier(parser, context, token); + if ((token & 36864) === 36864) { + parser.flags |= 256; + } + expr = parseArrowFromIdentifier(parser, context | 2048, privateScope, parser.tokenValue, expr, 0, 1, 0, start); + } + parser.assignable = 1; + } + expr = parseMemberOrUpdateExpression(parser, context, privateScope, expr, 0, 0, start); + expr = parseAssignmentExpression(parser, context, privateScope, 0, 0, start, expr); + parser.assignable = 1; + if (parser.getToken() === 18) { + expr = parseSequenceExpression(parser, context, privateScope, 0, start, expr); + } + return parseExpressionStatement(parser, context, expr, start); +} +function parseDirective(parser, context, expression, token, start) { + const endIndex = parser.startIndex; + if (token !== 1074790417) { + parser.assignable = 2; + expression = parseMemberOrUpdateExpression(parser, context, undefined, expression, 0, 0, start); + if (parser.getToken() !== 1074790417) { + expression = parseAssignmentExpression(parser, context, undefined, 0, 0, start, expression); + if (parser.getToken() === 18) { + expression = parseSequenceExpression(parser, context, undefined, 0, start, expression); + } + } + matchOrInsertSemicolon(parser, context | 32); + } + const node = { + type: 'ExpressionStatement', + expression, + }; + if (expression.type === 'Literal' && typeof expression.value === 'string') { + node.directive = parser.source.slice(start.index + 1, endIndex - 1); + } + return parser.finishNode(node, start); +} +function parseEmptyStatement(parser, context) { + const start = parser.tokenStart; + nextToken(parser, context | 32); + return parser.finishNode({ + type: 'EmptyStatement', + }, start); +} +function parseThrowStatement(parser, context, privateScope) { + const start = parser.tokenStart; + nextToken(parser, context | 32); + if (parser.flags & 1) + parser.report(90); + const argument = parseExpressions(parser, context, privateScope, 0, 1, parser.tokenStart); + matchOrInsertSemicolon(parser, context | 32); + return parser.finishNode({ + type: 'ThrowStatement', + argument, + }, start); +} +function parseIfStatement(parser, context, scope, privateScope, labels) { + const start = parser.tokenStart; + nextToken(parser, context); + consume(parser, context | 32, 67174411); + parser.assignable = 1; + const test = parseExpressions(parser, context, privateScope, 0, 1, parser.tokenStart); + consume(parser, context | 32, 16); + const consequent = parseConsequentOrAlternative(parser, context, scope, privateScope, labels); + let alternate = null; + if (parser.getToken() === 20563) { + nextToken(parser, context | 32); + alternate = parseConsequentOrAlternative(parser, context, scope, privateScope, labels); + } + return parser.finishNode({ + type: 'IfStatement', + test, + consequent, + alternate, + }, start); +} +function parseConsequentOrAlternative(parser, context, scope, privateScope, labels) { + const { tokenStart } = parser; + return context & 1 || + !parser.options.webcompat || + parser.getToken() !== 86104 + ? parseStatement(parser, context, scope, privateScope, 0, { $: labels }, 0) + : parseFunctionDeclaration(parser, context, scope?.createChildScope(), privateScope, 0, 0, 0, 0, tokenStart); +} +function parseSwitchStatement(parser, context, scope, privateScope, labels) { + const start = parser.tokenStart; + nextToken(parser, context); + consume(parser, context | 32, 67174411); + const discriminant = parseExpressions(parser, context, privateScope, 0, 1, parser.tokenStart); + consume(parser, context, 16); + consume(parser, context, 2162700); + const cases = []; + let seenDefault = 0; + scope = scope?.createChildScope(8); + while (parser.getToken() !== 1074790415) { + const { tokenStart } = parser; + let test = null; + const consequent = []; + if (consumeOpt(parser, context | 32, 20556)) { + test = parseExpressions(parser, context, privateScope, 0, 1, parser.tokenStart); + } + else { + consume(parser, context | 32, 20561); + if (seenDefault) + parser.report(89); + seenDefault = 1; + } + consume(parser, context | 32, 21); + while (parser.getToken() !== 20556 && + parser.getToken() !== 1074790415 && + parser.getToken() !== 20561) { + consequent.push(parseStatementListItem(parser, context | 4, scope, privateScope, 2, { + $: labels, + })); + } + cases.push(parser.finishNode({ + type: 'SwitchCase', + test, + consequent, + }, tokenStart)); + } + consume(parser, context | 32, 1074790415); + return parser.finishNode({ + type: 'SwitchStatement', + discriminant, + cases, + }, start); +} +function parseWhileStatement(parser, context, scope, privateScope, labels) { + const start = parser.tokenStart; + nextToken(parser, context); + consume(parser, context | 32, 67174411); + const test = parseExpressions(parser, context, privateScope, 0, 1, parser.tokenStart); + consume(parser, context | 32, 16); + const body = parseIterationStatementBody(parser, context, scope, privateScope, labels); + return parser.finishNode({ + type: 'WhileStatement', + test, + body, + }, start); +} +function parseIterationStatementBody(parser, context, scope, privateScope, labels) { + return parseStatement(parser, ((context | 131072) ^ 131072) | 128, scope, privateScope, 0, { loop: 1, $: labels }, 0); +} +function parseContinueStatement(parser, context, labels) { + if ((context & 128) === 0) + parser.report(68); + const start = parser.tokenStart; + nextToken(parser, context); + let label = null; + if ((parser.flags & 1) === 0 && parser.getToken() & 143360) { + const { tokenValue } = parser; + label = parseIdentifier(parser, context | 32); + if (!isValidLabel(parser, labels, tokenValue, 1)) + parser.report(138, tokenValue); + } + matchOrInsertSemicolon(parser, context | 32); + return parser.finishNode({ + type: 'ContinueStatement', + label, + }, start); +} +function parseBreakStatement(parser, context, labels) { + const start = parser.tokenStart; + nextToken(parser, context | 32); + let label = null; + if ((parser.flags & 1) === 0 && parser.getToken() & 143360) { + const { tokenValue } = parser; + label = parseIdentifier(parser, context | 32); + if (!isValidLabel(parser, labels, tokenValue, 0)) + parser.report(138, tokenValue); + } + else if ((context & (4 | 128)) === 0) { + parser.report(69); + } + matchOrInsertSemicolon(parser, context | 32); + return parser.finishNode({ + type: 'BreakStatement', + label, + }, start); +} +function parseWithStatement(parser, context, scope, privateScope, labels) { + const start = parser.tokenStart; + nextToken(parser, context); + if (context & 1) + parser.report(91); + consume(parser, context | 32, 67174411); + const object = parseExpressions(parser, context, privateScope, 0, 1, parser.tokenStart); + consume(parser, context | 32, 16); + const body = parseStatement(parser, context, scope, privateScope, 2, labels, 0); + return parser.finishNode({ + type: 'WithStatement', + object, + body, + }, start); +} +function parseDebuggerStatement(parser, context) { + const start = parser.tokenStart; + nextToken(parser, context | 32); + matchOrInsertSemicolon(parser, context | 32); + return parser.finishNode({ + type: 'DebuggerStatement', + }, start); +} +function parseTryStatement(parser, context, scope, privateScope, labels) { + const start = parser.tokenStart; + nextToken(parser, context | 32); + const firstScope = scope?.createChildScope(16); + const block = parseBlock(parser, context, firstScope, privateScope, { $: labels }); + const { tokenStart } = parser; + const handler = consumeOpt(parser, context | 32, 20557) + ? parseCatchBlock(parser, context, scope, privateScope, labels, tokenStart) + : null; + let finalizer = null; + if (parser.getToken() === 20566) { + nextToken(parser, context | 32); + const finalizerScope = scope?.createChildScope(4); + const block = parseBlock(parser, context, finalizerScope, privateScope, { $: labels }); + finalizer = block; + } + if (!handler && !finalizer) { + parser.report(88); + } + return parser.finishNode({ + type: 'TryStatement', + block, + handler, + finalizer, + }, start); +} +function parseCatchBlock(parser, context, scope, privateScope, labels, start) { + let param = null; + let additionalScope = scope; + if (consumeOpt(parser, context, 67174411)) { + scope = scope?.createChildScope(4); + param = parseBindingPattern(parser, context, scope, privateScope, (parser.getToken() & 2097152) === 2097152 + ? 256 + : 512, 0); + if (parser.getToken() === 18) { + parser.report(86); + } + else if (parser.getToken() === 1077936155) { + parser.report(87); + } + consume(parser, context | 32, 16); + } + additionalScope = scope?.createChildScope(32); + const body = parseBlock(parser, context, additionalScope, privateScope, { $: labels }); + return parser.finishNode({ + type: 'CatchClause', + param, + body, + }, start); +} +function parseStaticBlock(parser, context, scope, privateScope, start) { + scope = scope?.createChildScope(); + const ctorContext = 512 | 4096 | 1024 | 4 | 128; + context = + ((context | ctorContext) ^ ctorContext) | + 256 | + 2048 | + 524288 | + 65536; + return parseBlock(parser, context, scope, privateScope, {}, start, 'StaticBlock'); +} +function parseDoWhileStatement(parser, context, scope, privateScope, labels) { + const start = parser.tokenStart; + nextToken(parser, context | 32); + const body = parseIterationStatementBody(parser, context, scope, privateScope, labels); + consume(parser, context, 20578); + consume(parser, context | 32, 67174411); + const test = parseExpressions(parser, context, privateScope, 0, 1, parser.tokenStart); + consume(parser, context | 32, 16); + consumeOpt(parser, context | 32, 1074790417); + return parser.finishNode({ + type: 'DoWhileStatement', + body, + test, + }, start); +} +function parseLetIdentOrVarDeclarationStatement(parser, context, scope, privateScope, origin) { + const { tokenValue, tokenStart } = parser; + const token = parser.getToken(); + let expr = parseIdentifier(parser, context); + if (parser.getToken() & (143360 | 2097152)) { + const declarations = parseVariableDeclarationList(parser, context, scope, privateScope, 8, 0); + matchOrInsertSemicolon(parser, context | 32); + return parser.finishNode({ + type: 'VariableDeclaration', + kind: 'let', + declarations, + }, tokenStart); + } + parser.assignable = 1; + if (context & 1) + parser.report(85); + if (parser.getToken() === 21) { + return parseLabelledStatement(parser, context, scope, privateScope, origin, {}, tokenValue, expr, token, 0, tokenStart); + } + if (parser.getToken() === 10) { + let scope = void 0; + if (parser.options.lexical) + scope = createArrowHeadParsingScope(parser, context, tokenValue); + parser.flags = (parser.flags | 128) ^ 128; + expr = parseArrowFunctionExpression(parser, context, scope, privateScope, [expr], 0, tokenStart); + } + else { + expr = parseMemberOrUpdateExpression(parser, context, privateScope, expr, 0, 0, tokenStart); + expr = parseAssignmentExpression(parser, context, privateScope, 0, 0, tokenStart, expr); + } + if (parser.getToken() === 18) { + expr = parseSequenceExpression(parser, context, privateScope, 0, tokenStart, expr); + } + return parseExpressionStatement(parser, context, expr, tokenStart); +} +function parseLexicalDeclaration(parser, context, scope, privateScope, kind, origin) { + const start = parser.tokenStart; + nextToken(parser, context); + const declarations = parseVariableDeclarationList(parser, context, scope, privateScope, kind, origin); + matchOrInsertSemicolon(parser, context | 32); + return parser.finishNode({ + type: 'VariableDeclaration', + kind: kind & 8 ? 'let' : 'const', + declarations, + }, start); +} +function parseVariableStatement(parser, context, scope, privateScope, origin) { + const start = parser.tokenStart; + nextToken(parser, context); + const declarations = parseVariableDeclarationList(parser, context, scope, privateScope, 4, origin); + matchOrInsertSemicolon(parser, context | 32); + return parser.finishNode({ + type: 'VariableDeclaration', + kind: 'var', + declarations, + }, start); +} +function parseVariableDeclarationList(parser, context, scope, privateScope, kind, origin) { + let bindingCount = 1; + const list = [ + parseVariableDeclaration(parser, context, scope, privateScope, kind, origin), + ]; + while (consumeOpt(parser, context, 18)) { + bindingCount++; + list.push(parseVariableDeclaration(parser, context, scope, privateScope, kind, origin)); + } + if (bindingCount > 1 && origin & 32 && parser.getToken() & 262144) { + parser.report(61, KeywordDescTable[parser.getToken() & 255]); + } + return list; +} +function parseVariableDeclaration(parser, context, scope, privateScope, kind, origin) { + const { tokenStart } = parser; + const token = parser.getToken(); + let init = null; + const id = parseBindingPattern(parser, context, scope, privateScope, kind, origin); + if (parser.getToken() === 1077936155) { + nextToken(parser, context | 32); + init = parseExpression(parser, context, privateScope, 1, 0, parser.tokenStart); + if (origin & 32 || (token & 2097152) === 0) { + if (parser.getToken() === 471156 || + (parser.getToken() === 8673330 && + (token & 2097152 || (kind & 4) === 0 || context & 1))) { + throw new ParseError(tokenStart, parser.currentLocation, 60, parser.getToken() === 471156 ? 'of' : 'in'); + } + } + } + else if ((kind & 16 || (token & 2097152) > 0) && + (parser.getToken() & 262144) !== 262144) { + parser.report(59, kind & 16 ? 'const' : 'destructuring'); + } + return parser.finishNode({ + type: 'VariableDeclarator', + id, + init, + }, tokenStart); +} +function parseForStatement(parser, context, scope, privateScope, labels) { + const start = parser.tokenStart; + nextToken(parser, context); + const forAwait = ((context & 2048) > 0 || ((context & 2) > 0 && (context & 8) > 0)) && + consumeOpt(parser, context, 209006); + consume(parser, context | 32, 67174411); + scope = scope?.createChildScope(1); + let test = null; + let update = null; + let destructible = 0; + let init = null; + let isVarDecl = parser.getToken() === 86088 || + parser.getToken() === 241737 || + parser.getToken() === 86090; + let right; + const { tokenStart } = parser; + const token = parser.getToken(); + if (isVarDecl) { + if (token === 241737) { + init = parseIdentifier(parser, context); + if (parser.getToken() & (143360 | 2097152)) { + if (parser.getToken() === 8673330) { + if (context & 1) + parser.report(67); + } + else { + init = parser.finishNode({ + type: 'VariableDeclaration', + kind: 'let', + declarations: parseVariableDeclarationList(parser, context | 131072, scope, privateScope, 8, 32), + }, tokenStart); + } + parser.assignable = 1; + } + else if (context & 1) { + parser.report(67); + } + else { + isVarDecl = false; + parser.assignable = 1; + init = parseMemberOrUpdateExpression(parser, context, privateScope, init, 0, 0, tokenStart); + if (parser.getToken() === 471156) + parser.report(115); + } + } + else { + nextToken(parser, context); + init = parser.finishNode(token === 86088 + ? { + type: 'VariableDeclaration', + kind: 'var', + declarations: parseVariableDeclarationList(parser, context | 131072, scope, privateScope, 4, 32), + } + : { + type: 'VariableDeclaration', + kind: 'const', + declarations: parseVariableDeclarationList(parser, context | 131072, scope, privateScope, 16, 32), + }, tokenStart); + parser.assignable = 1; + } + } + else if (token === 1074790417) { + if (forAwait) + parser.report(82); + } + else if ((token & 2097152) === 2097152) { + const patternStart = parser.tokenStart; + init = + token === 2162700 + ? parseObjectLiteralOrPattern(parser, context, void 0, privateScope, 1, 0, 0, 2, 32) + : parseArrayExpressionOrPattern(parser, context, void 0, privateScope, 1, 0, 0, 2, 32); + destructible = parser.destructible; + if (destructible & 64) { + parser.report(63); + } + parser.assignable = + destructible & 16 ? 2 : 1; + init = parseMemberOrUpdateExpression(parser, context | 131072, privateScope, init, 0, 0, patternStart); + } + else { + init = parseLeftHandSideExpression(parser, context | 131072, privateScope, 1, 0, 1); + } + if ((parser.getToken() & 262144) === 262144) { + if (parser.getToken() === 471156) { + if (parser.assignable & 2) + parser.report(80, forAwait ? 'await' : 'of'); + reinterpretToPattern(parser, init); + nextToken(parser, context | 32); + right = parseExpression(parser, context, privateScope, 1, 0, parser.tokenStart); + consume(parser, context | 32, 16); + const body = parseIterationStatementBody(parser, context, scope, privateScope, labels); + return parser.finishNode({ + type: 'ForOfStatement', + left: init, + right, + body, + await: forAwait, + }, start); + } + if (parser.assignable & 2) + parser.report(80, 'in'); + reinterpretToPattern(parser, init); + nextToken(parser, context | 32); + if (forAwait) + parser.report(82); + right = parseExpressions(parser, context, privateScope, 0, 1, parser.tokenStart); + consume(parser, context | 32, 16); + const body = parseIterationStatementBody(parser, context, scope, privateScope, labels); + return parser.finishNode({ + type: 'ForInStatement', + body, + left: init, + right, + }, start); + } + if (forAwait) + parser.report(82); + if (!isVarDecl) { + if (destructible & 8 && parser.getToken() !== 1077936155) { + parser.report(80, 'loop'); + } + init = parseAssignmentExpression(parser, context | 131072, privateScope, 0, 0, tokenStart, init); + } + if (parser.getToken() === 18) + init = parseSequenceExpression(parser, context, privateScope, 0, tokenStart, init); + consume(parser, context | 32, 1074790417); + if (parser.getToken() !== 1074790417) + test = parseExpressions(parser, context, privateScope, 0, 1, parser.tokenStart); + consume(parser, context | 32, 1074790417); + if (parser.getToken() !== 16) + update = parseExpressions(parser, context, privateScope, 0, 1, parser.tokenStart); + consume(parser, context | 32, 16); + const body = parseIterationStatementBody(parser, context, scope, privateScope, labels); + return parser.finishNode({ + type: 'ForStatement', + init, + test, + update, + body, + }, start); +} +function parseRestrictedIdentifier(parser, context, scope) { + if (!isValidIdentifier(context, parser.getToken())) + parser.report(118); + if ((parser.getToken() & 537079808) === 537079808) + parser.report(119); + scope?.addBlockName(context, parser.tokenValue, 8, 0); + return parseIdentifier(parser, context); +} +function parseImportDeclaration(parser, context, scope) { + const start = parser.tokenStart; + nextToken(parser, context); + let source = null; + const { tokenStart } = parser; + let specifiers = []; + if (parser.getToken() === 134283267) { + source = parseLiteral(parser, context); + } + else { + if (parser.getToken() & 143360) { + const local = parseRestrictedIdentifier(parser, context, scope); + specifiers = [ + parser.finishNode({ + type: 'ImportDefaultSpecifier', + local, + }, tokenStart), + ]; + if (consumeOpt(parser, context, 18)) { + switch (parser.getToken()) { + case 8391476: + specifiers.push(parseImportNamespaceSpecifier(parser, context, scope)); + break; + case 2162700: + parseImportSpecifierOrNamedImports(parser, context, scope, specifiers); + break; + default: + parser.report(107); + } + } + } + else { + switch (parser.getToken()) { + case 8391476: + specifiers = [parseImportNamespaceSpecifier(parser, context, scope)]; + break; + case 2162700: + parseImportSpecifierOrNamedImports(parser, context, scope, specifiers); + break; + case 67174411: + return parseImportCallDeclaration(parser, context, undefined, start); + case 67108877: + return parseImportMetaDeclaration(parser, context, start); + default: + parser.report(30, KeywordDescTable[parser.getToken() & 255]); + } + } + source = parseModuleSpecifier(parser, context); + } + const attributes = parseImportAttributes(parser, context); + const node = { + type: 'ImportDeclaration', + specifiers, + source, + attributes, + }; + matchOrInsertSemicolon(parser, context | 32); + return parser.finishNode(node, start); +} +function parseImportNamespaceSpecifier(parser, context, scope) { + const { tokenStart } = parser; + nextToken(parser, context); + consume(parser, context, 77932); + if ((parser.getToken() & 134217728) === 134217728) { + throw new ParseError(tokenStart, parser.currentLocation, 30, KeywordDescTable[parser.getToken() & 255]); + } + return parser.finishNode({ + type: 'ImportNamespaceSpecifier', + local: parseRestrictedIdentifier(parser, context, scope), + }, tokenStart); +} +function parseModuleSpecifier(parser, context) { + consume(parser, context, 209011); + if (parser.getToken() !== 134283267) + parser.report(105, 'Import'); + return parseLiteral(parser, context); +} +function parseImportSpecifierOrNamedImports(parser, context, scope, specifiers) { + nextToken(parser, context); + while (parser.getToken() & 143360 || parser.getToken() === 134283267) { + let { tokenValue, tokenStart } = parser; + const token = parser.getToken(); + const imported = parseModuleExportName(parser, context); + let local; + if (consumeOpt(parser, context, 77932)) { + if ((parser.getToken() & 134217728) === 134217728 || + parser.getToken() === 18) { + parser.report(106); + } + else { + validateBindingIdentifier(parser, context, 16, parser.getToken(), 0); + } + tokenValue = parser.tokenValue; + local = parseIdentifier(parser, context); + } + else if (imported.type === 'Identifier') { + validateBindingIdentifier(parser, context, 16, token, 0); + local = imported; + } + else { + parser.report(25, KeywordDescTable[77932 & 255]); + } + scope?.addBlockName(context, tokenValue, 8, 0); + specifiers.push(parser.finishNode({ + type: 'ImportSpecifier', + local, + imported, + }, tokenStart)); + if (parser.getToken() !== 1074790415) + consume(parser, context, 18); + } + consume(parser, context, 1074790415); + return specifiers; +} +function parseImportMetaDeclaration(parser, context, start) { + let expr = parseImportMetaExpression(parser, context, parser.finishNode({ + type: 'Identifier', + name: 'import', + }, start), start); + expr = parseMemberOrUpdateExpression(parser, context, undefined, expr, 0, 0, start); + expr = parseAssignmentExpression(parser, context, undefined, 0, 0, start, expr); + if (parser.getToken() === 18) { + expr = parseSequenceExpression(parser, context, undefined, 0, start, expr); + } + return parseExpressionStatement(parser, context, expr, start); +} +function parseImportCallDeclaration(parser, context, privateScope, start) { + let expr = parseImportExpression(parser, context, privateScope, 0, start); + expr = parseMemberOrUpdateExpression(parser, context, privateScope, expr, 0, 0, start); + if (parser.getToken() === 18) { + expr = parseSequenceExpression(parser, context, privateScope, 0, start, expr); + } + return parseExpressionStatement(parser, context, expr, start); +} +function parseExportDeclaration(parser, context, scope) { + const start = parser.leadingDecorators.decorators.length ? parser.leadingDecorators.start : parser.tokenStart; + nextToken(parser, context | 32); + const specifiers = []; + let declaration = null; + let source = null; + let attributes = []; + if (consumeOpt(parser, context | 32, 20561)) { + switch (parser.getToken()) { + case 86104: { + declaration = parseFunctionDeclaration(parser, context, scope, undefined, 4, 1, 1, 0, parser.tokenStart); + break; + } + case 132: + case 86094: + declaration = parseClassDeclaration(parser, context, scope, undefined, 1); + break; + case 209005: { + const { tokenStart } = parser; + declaration = parseIdentifier(parser, context); + const { flags } = parser; + if ((flags & 1) === 0) { + if (parser.getToken() === 86104) { + declaration = parseFunctionDeclaration(parser, context, scope, undefined, 4, 1, 1, 1, tokenStart); + } + else { + if (parser.getToken() === 67174411) { + declaration = parseAsyncArrowOrCallExpression(parser, context, undefined, declaration, 1, 1, 0, flags, tokenStart); + declaration = parseMemberOrUpdateExpression(parser, context, undefined, declaration, 0, 0, tokenStart); + declaration = parseAssignmentExpression(parser, context, undefined, 0, 0, tokenStart, declaration); + } + else if (parser.getToken() & 143360) { + if (scope) + scope = createArrowHeadParsingScope(parser, context, parser.tokenValue); + declaration = parseIdentifier(parser, context); + declaration = parseArrowFunctionExpression(parser, context, scope, undefined, [declaration], 1, tokenStart); + } + } + } + break; + } + default: + declaration = parseExpression(parser, context, undefined, 1, 0, parser.tokenStart); + matchOrInsertSemicolon(parser, context | 32); + } + if (scope) + parser.declareUnboundVariable('default'); + return parser.finishNode({ + type: 'ExportDefaultDeclaration', + declaration, + }, start); + } + switch (parser.getToken()) { + case 8391476: { + nextToken(parser, context); + let exported = null; + const isNamedDeclaration = consumeOpt(parser, context, 77932); + if (isNamedDeclaration) { + if (scope) + parser.declareUnboundVariable(parser.tokenValue); + exported = parseModuleExportName(parser, context); + } + consume(parser, context, 209011); + if (parser.getToken() !== 134283267) + parser.report(105, 'Export'); + source = parseLiteral(parser, context); + const attributes = parseImportAttributes(parser, context); + const node = { + type: 'ExportAllDeclaration', + source, + exported, + attributes, + }; + matchOrInsertSemicolon(parser, context | 32); + return parser.finishNode(node, start); + } + case 2162700: { + nextToken(parser, context); + const tmpExportedNames = []; + const tmpExportedBindings = []; + let hasLiteralLocal = 0; + while (parser.getToken() & 143360 || parser.getToken() === 134283267) { + const { tokenStart, tokenValue } = parser; + const local = parseModuleExportName(parser, context); + if (local.type === 'Literal') { + hasLiteralLocal = 1; + } + let exported; + if (parser.getToken() === 77932) { + nextToken(parser, context); + if ((parser.getToken() & 143360) === 0 && parser.getToken() !== 134283267) { + parser.report(106); + } + if (scope) { + tmpExportedNames.push(parser.tokenValue); + tmpExportedBindings.push(tokenValue); + } + exported = parseModuleExportName(parser, context); + } + else { + if (scope) { + tmpExportedNames.push(parser.tokenValue); + tmpExportedBindings.push(parser.tokenValue); + } + exported = local; + } + specifiers.push(parser.finishNode({ + type: 'ExportSpecifier', + local, + exported, + }, tokenStart)); + if (parser.getToken() !== 1074790415) + consume(parser, context, 18); + } + consume(parser, context, 1074790415); + if (consumeOpt(parser, context, 209011)) { + if (parser.getToken() !== 134283267) + parser.report(105, 'Export'); + source = parseLiteral(parser, context); + attributes = parseImportAttributes(parser, context); + if (scope) { + tmpExportedNames.forEach((n) => parser.declareUnboundVariable(n)); + } + } + else { + if (hasLiteralLocal) { + parser.report(172); + } + if (scope) { + tmpExportedNames.forEach((n) => parser.declareUnboundVariable(n)); + tmpExportedBindings.forEach((b) => parser.addBindingToExports(b)); + } + } + matchOrInsertSemicolon(parser, context | 32); + break; + } + case 132: + case 86094: + declaration = parseClassDeclaration(parser, context, scope, undefined, 2); + break; + case 86104: + declaration = parseFunctionDeclaration(parser, context, scope, undefined, 4, 1, 2, 0, parser.tokenStart); + break; + case 241737: + declaration = parseLexicalDeclaration(parser, context, scope, undefined, 8, 64); + break; + case 86090: + declaration = parseLexicalDeclaration(parser, context, scope, undefined, 16, 64); + break; + case 86088: + declaration = parseVariableStatement(parser, context, scope, undefined, 64); + break; + case 209005: { + const { tokenStart } = parser; + nextToken(parser, context); + if ((parser.flags & 1) === 0 && parser.getToken() === 86104) { + declaration = parseFunctionDeclaration(parser, context, scope, undefined, 4, 1, 2, 1, tokenStart); + break; + } + } + default: + parser.report(30, KeywordDescTable[parser.getToken() & 255]); + } + const node = { + type: 'ExportNamedDeclaration', + declaration, + specifiers, + source, + attributes: attributes, + }; + return parser.finishNode(node, start); +} +function parseExpression(parser, context, privateScope, canAssign, inGroup, start) { + let expr = parsePrimaryExpression(parser, context, privateScope, 2, 0, canAssign, inGroup, 1, start); + expr = parseMemberOrUpdateExpression(parser, context, privateScope, expr, inGroup, 0, start); + return parseAssignmentExpression(parser, context, privateScope, inGroup, 0, start, expr); +} +function parseSequenceExpression(parser, context, privateScope, inGroup, start, expr) { + const expressions = [expr]; + while (consumeOpt(parser, context | 32, 18)) { + expressions.push(parseExpression(parser, context, privateScope, 1, inGroup, parser.tokenStart)); + } + return parser.finishNode({ + type: 'SequenceExpression', + expressions, + }, start); +} +function parseExpressions(parser, context, privateScope, inGroup, canAssign, start) { + const expr = parseExpression(parser, context, privateScope, canAssign, inGroup, start); + return parser.getToken() === 18 + ? parseSequenceExpression(parser, context, privateScope, inGroup, start, expr) + : expr; +} +function parseAssignmentExpression(parser, context, privateScope, inGroup, isPattern, start, left) { + const token = parser.getToken(); + if ((token & 4194304) === 4194304) { + if (parser.assignable & 2) + parser.report(26); + if ((!isPattern && token === 1077936155 && left.type === 'ArrayExpression') || + left.type === 'ObjectExpression') { + reinterpretToPattern(parser, left); + } + nextToken(parser, context | 32); + const right = parseExpression(parser, context, privateScope, 1, inGroup, parser.tokenStart); + parser.assignable = 2; + return parser.finishNode(isPattern + ? { + type: 'AssignmentPattern', + left, + right, + } + : { + type: 'AssignmentExpression', + left, + operator: KeywordDescTable[token & 255], + right, + }, start); + } + if ((token & 8388608) === 8388608) { + left = parseBinaryExpression(parser, context, privateScope, inGroup, start, 4, token, left); + } + if (consumeOpt(parser, context | 32, 22)) { + left = parseConditionalExpression(parser, context, privateScope, left, start); + } + return left; +} +function parseAssignmentExpressionOrPattern(parser, context, privateScope, inGroup, isPattern, start, left) { + const token = parser.getToken(); + nextToken(parser, context | 32); + const right = parseExpression(parser, context, privateScope, 1, inGroup, parser.tokenStart); + left = parser.finishNode(isPattern + ? { + type: 'AssignmentPattern', + left, + right, + } + : { + type: 'AssignmentExpression', + left, + operator: KeywordDescTable[token & 255], + right, + }, start); + parser.assignable = 2; + return left; +} +function parseConditionalExpression(parser, context, privateScope, test, start) { + const consequent = parseExpression(parser, (context | 131072) ^ 131072, privateScope, 1, 0, parser.tokenStart); + consume(parser, context | 32, 21); + parser.assignable = 1; + const alternate = parseExpression(parser, context, privateScope, 1, 0, parser.tokenStart); + parser.assignable = 2; + return parser.finishNode({ + type: 'ConditionalExpression', + test, + consequent, + alternate, + }, start); +} +function parseBinaryExpression(parser, context, privateScope, inGroup, start, minPrecedence, operator, left) { + const bit = -((context & 131072) > 0) & 8673330; + let t; + let precedence; + parser.assignable = 2; + while (parser.getToken() & 8388608) { + t = parser.getToken(); + precedence = t & 3840; + if ((t & 524288 && operator & 268435456) || (operator & 524288 && t & 268435456)) { + parser.report(165); + } + if (precedence + ((t === 8391735) << 8) - ((bit === t) << 12) <= minPrecedence) + break; + nextToken(parser, context | 32); + left = parser.finishNode({ + type: t & 524288 || t & 268435456 ? 'LogicalExpression' : 'BinaryExpression', + left, + right: parseBinaryExpression(parser, context, privateScope, inGroup, parser.tokenStart, precedence, t, parseLeftHandSideExpression(parser, context, privateScope, 0, inGroup, 1)), + operator: KeywordDescTable[t & 255], + }, start); + } + if (parser.getToken() === 1077936155) + parser.report(26); + return left; +} +function parseUnaryExpression(parser, context, privateScope, isLHS, inGroup) { + if (!isLHS) + parser.report(0); + const { tokenStart } = parser; + const unaryOperator = parser.getToken(); + nextToken(parser, context | 32); + const arg = parseLeftHandSideExpression(parser, context, privateScope, 0, inGroup, 1); + if (parser.getToken() === 8391735) + parser.report(33); + if (context & 1 && unaryOperator === 16863276) { + if (arg.type === 'Identifier') { + parser.report(121); + } + else if (isPropertyWithPrivateFieldKey(arg)) { + parser.report(127); + } + } + parser.assignable = 2; + return parser.finishNode({ + type: 'UnaryExpression', + operator: KeywordDescTable[unaryOperator & 255], + argument: arg, + prefix: true, + }, tokenStart); +} +function parseAsyncExpression(parser, context, privateScope, inGroup, isLHS, canAssign, inNew, start) { + const token = parser.getToken(); + const expr = parseIdentifier(parser, context); + const { flags } = parser; + if ((flags & 1) === 0) { + if (parser.getToken() === 86104) { + return parseFunctionExpression(parser, context, privateScope, 1, inGroup, start); + } + if (isValidIdentifier(context, parser.getToken())) { + if (!isLHS) + parser.report(0); + if ((parser.getToken() & 36864) === 36864) { + parser.flags |= 256; + } + return parseAsyncArrowAfterIdent(parser, context, privateScope, canAssign, start); + } + } + if (!inNew && parser.getToken() === 67174411) { + return parseAsyncArrowOrCallExpression(parser, context, privateScope, expr, canAssign, 1, 0, flags, start); + } + if (parser.getToken() === 10) { + classifyIdentifier(parser, context, token); + if (inNew) + parser.report(51); + if ((token & 36864) === 36864) { + parser.flags |= 256; + } + return parseArrowFromIdentifier(parser, context, privateScope, parser.tokenValue, expr, inNew, canAssign, 0, start); + } + parser.assignable = 1; + return expr; +} +function parseYieldExpressionOrIdentifier(parser, context, privateScope, inGroup, canAssign, start) { + if (inGroup) + parser.destructible |= 256; + if (context & 1024) { + nextToken(parser, context | 32); + if (context & 8192) + parser.report(32); + if (!canAssign) + parser.report(26); + if (parser.getToken() === 22) + parser.report(124); + let argument = null; + let delegate = false; + if ((parser.flags & 1) === 0) { + delegate = consumeOpt(parser, context | 32, 8391476); + if (parser.getToken() & (12288 | 65536) || delegate) { + argument = parseExpression(parser, context, privateScope, 1, 0, parser.tokenStart); + } + } + else if (parser.getToken() === 8391476) { + parser.report(30, KeywordDescTable[parser.getToken() & 255]); + } + parser.assignable = 2; + return parser.finishNode({ + type: 'YieldExpression', + argument, + delegate, + }, start); + } + if (context & 1) + parser.report(97, 'yield'); + return parseIdentifierOrArrow(parser, context, privateScope); +} +function parseAwaitExpressionOrIdentifier(parser, context, privateScope, inNew, inGroup, start) { + if (inGroup) + parser.destructible |= 128; + if (context & 524288) + parser.report(177); + const possibleIdentifierOrArrowFunc = parseIdentifierOrArrow(parser, context, privateScope); + const isIdentifier = possibleIdentifierOrArrowFunc.type === 'ArrowFunctionExpression' || + (parser.getToken() & 65536) === 0; + if (isIdentifier) { + if (context & 2048) + throw new ParseError(start, { index: parser.startIndex, line: parser.startLine, column: parser.startColumn }, 176); + if (context & 2) + throw new ParseError(start, { index: parser.startIndex, line: parser.startLine, column: parser.startColumn }, 110); + if (context & 8192 && context & 2048) + throw new ParseError(start, { index: parser.startIndex, line: parser.startLine, column: parser.startColumn }, 110); + return possibleIdentifierOrArrowFunc; + } + if (context & 8192) { + throw new ParseError(start, { index: parser.startIndex, line: parser.startLine, column: parser.startColumn }, 31); + } + if (context & 2048 || (context & 2 && context & 8)) { + if (inNew) + throw new ParseError(start, { index: parser.startIndex, line: parser.startLine, column: parser.startColumn }, 0); + const argument = parseLeftHandSideExpression(parser, context, privateScope, 0, 0, 1); + if (parser.getToken() === 8391735) + parser.report(33); + parser.assignable = 2; + return parser.finishNode({ + type: 'AwaitExpression', + argument, + }, start); + } + if (context & 2) + throw new ParseError(start, { index: parser.startIndex, line: parser.startLine, column: parser.startColumn }, 98); + return possibleIdentifierOrArrowFunc; +} +function parseFunctionBody(parser, context, scope, privateScope, origin, funcNameToken, functionScope) { + const { tokenStart } = parser; + consume(parser, context | 32, 2162700); + const body = []; + if (parser.getToken() !== 1074790415) { + while (parser.getToken() === 134283267) { + const { index, tokenStart, tokenIndex, tokenValue } = parser; + const token = parser.getToken(); + const expr = parseLiteral(parser, context); + if (isValidStrictMode(parser, index, tokenIndex, tokenValue)) { + context |= 1; + if (parser.flags & 128) { + throw new ParseError(tokenStart, parser.currentLocation, 66); + } + if (parser.flags & 64) { + throw new ParseError(tokenStart, parser.currentLocation, 9); + } + if (parser.flags & 4096) { + throw new ParseError(tokenStart, parser.currentLocation, 15); + } + functionScope?.reportScopeError(); + } + body.push(parseDirective(parser, context, expr, token, tokenStart)); + } + if (context & 1) { + if (funcNameToken) { + if ((funcNameToken & 537079808) === 537079808) { + parser.report(119); + } + if ((funcNameToken & 36864) === 36864) { + parser.report(40); + } + } + if (parser.flags & 512) + parser.report(119); + if (parser.flags & 256) + parser.report(118); + } + } + parser.flags = + (parser.flags | 512 | 256 | 64 | 4096) ^ + (512 | 256 | 64 | 4096); + parser.destructible = (parser.destructible | 256) ^ 256; + while (parser.getToken() !== 1074790415) { + body.push(parseStatementListItem(parser, context, scope, privateScope, 4, {})); + } + consume(parser, origin & (16 | 8) ? context | 32 : context, 1074790415); + parser.flags &= -4289; + if (parser.getToken() === 1077936155) + parser.report(26); + return parser.finishNode({ + type: 'BlockStatement', + body, + }, tokenStart); +} +function parseSuperExpression(parser, context) { + const { tokenStart } = parser; + nextToken(parser, context); + switch (parser.getToken()) { + case 67108990: + parser.report(167); + case 67174411: { + if ((context & 512) === 0) + parser.report(28); + parser.assignable = 2; + break; + } + case 69271571: + case 67108877: { + if ((context & 256) === 0) + parser.report(29); + parser.assignable = 1; + break; + } + default: + parser.report(30, 'super'); + } + return parser.finishNode({ type: 'Super' }, tokenStart); +} +function parseLeftHandSideExpression(parser, context, privateScope, canAssign, inGroup, isLHS) { + const start = parser.tokenStart; + const expression = parsePrimaryExpression(parser, context, privateScope, 2, 0, canAssign, inGroup, isLHS, start); + return parseMemberOrUpdateExpression(parser, context, privateScope, expression, inGroup, 0, start); +} +function parseUpdateExpression(parser, context, expr, start) { + if (parser.assignable & 2) + parser.report(55); + const token = parser.getToken(); + nextToken(parser, context); + parser.assignable = 2; + return parser.finishNode({ + type: 'UpdateExpression', + argument: expr, + operator: KeywordDescTable[token & 255], + prefix: false, + }, start); +} +function parseMemberOrUpdateExpression(parser, context, privateScope, expr, inGroup, inChain, start) { + if ((parser.getToken() & 33619968) === 33619968 && (parser.flags & 1) === 0) { + expr = parseUpdateExpression(parser, context, expr, start); + } + else if ((parser.getToken() & 67108864) === 67108864) { + context = (context | 131072) ^ 131072; + switch (parser.getToken()) { + case 67108877: { + nextToken(parser, (context | 262144 | 8) ^ 8); + if (context & 16 && parser.getToken() === 130 && parser.tokenValue === 'super') { + parser.report(173); + } + parser.assignable = 1; + const property = parsePropertyOrPrivatePropertyName(parser, context | 64, privateScope); + expr = parser.finishNode({ + type: 'MemberExpression', + object: expr, + computed: false, + property, + optional: false, + }, start); + break; + } + case 69271571: { + let restoreHasOptionalChaining = false; + if ((parser.flags & 2048) === 2048) { + restoreHasOptionalChaining = true; + parser.flags = (parser.flags | 2048) ^ 2048; + } + nextToken(parser, context | 32); + const { tokenStart } = parser; + const property = parseExpressions(parser, context, privateScope, inGroup, 1, tokenStart); + consume(parser, context, 20); + parser.assignable = 1; + expr = parser.finishNode({ + type: 'MemberExpression', + object: expr, + computed: true, + property, + optional: false, + }, start); + if (restoreHasOptionalChaining) { + parser.flags |= 2048; + } + break; + } + case 67174411: { + if ((parser.flags & 1024) === 1024) { + parser.flags = (parser.flags | 1024) ^ 1024; + return expr; + } + let restoreHasOptionalChaining = false; + if ((parser.flags & 2048) === 2048) { + restoreHasOptionalChaining = true; + parser.flags = (parser.flags | 2048) ^ 2048; + } + const args = parseArguments(parser, context, privateScope, inGroup); + parser.assignable = 2; + expr = parser.finishNode({ + type: 'CallExpression', + callee: expr, + arguments: args, + optional: false, + }, start); + if (restoreHasOptionalChaining) { + parser.flags |= 2048; + } + break; + } + case 67108990: { + nextToken(parser, (context | 262144 | 8) ^ 8); + parser.flags |= 2048; + parser.assignable = 2; + expr = parseOptionalChain(parser, context, privateScope, expr, start); + break; + } + default: + if ((parser.flags & 2048) === 2048) { + parser.report(166); + } + parser.assignable = 2; + expr = parser.finishNode({ + type: 'TaggedTemplateExpression', + tag: expr, + quasi: parser.getToken() === 67174408 + ? parseTemplate(parser, context | 64, privateScope) + : parseTemplateLiteral(parser, context), + }, start); + } + expr = parseMemberOrUpdateExpression(parser, context, privateScope, expr, 0, 1, start); + } + if (inChain === 0 && (parser.flags & 2048) === 2048) { + parser.flags = (parser.flags | 2048) ^ 2048; + expr = parser.finishNode({ + type: 'ChainExpression', + expression: expr, + }, start); + } + return expr; +} +function parseOptionalChain(parser, context, privateScope, expr, start) { + let restoreHasOptionalChaining = false; + let node; + if (parser.getToken() === 69271571 || parser.getToken() === 67174411) { + if ((parser.flags & 2048) === 2048) { + restoreHasOptionalChaining = true; + parser.flags = (parser.flags | 2048) ^ 2048; + } + } + if (parser.getToken() === 69271571) { + nextToken(parser, context | 32); + const { tokenStart } = parser; + const property = parseExpressions(parser, context, privateScope, 0, 1, tokenStart); + consume(parser, context, 20); + parser.assignable = 2; + node = parser.finishNode({ + type: 'MemberExpression', + object: expr, + computed: true, + optional: true, + property, + }, start); + } + else if (parser.getToken() === 67174411) { + const args = parseArguments(parser, context, privateScope, 0); + parser.assignable = 2; + node = parser.finishNode({ + type: 'CallExpression', + callee: expr, + arguments: args, + optional: true, + }, start); + } + else { + const property = parsePropertyOrPrivatePropertyName(parser, context, privateScope); + parser.assignable = 2; + node = parser.finishNode({ + type: 'MemberExpression', + object: expr, + computed: false, + optional: true, + property, + }, start); + } + if (restoreHasOptionalChaining) { + parser.flags |= 2048; + } + return node; +} +function parsePropertyOrPrivatePropertyName(parser, context, privateScope) { + if ((parser.getToken() & 143360) === 0 && + parser.getToken() !== -2147483528 && + parser.getToken() !== -2147483527 && + parser.getToken() !== 130) { + parser.report(160); + } + return parser.getToken() === 130 + ? parsePrivateIdentifier(parser, context, privateScope, 0) + : parseIdentifier(parser, context); +} +function parseUpdateExpressionPrefixed(parser, context, privateScope, inNew, isLHS, start) { + if (inNew) + parser.report(56); + if (!isLHS) + parser.report(0); + const token = parser.getToken(); + nextToken(parser, context | 32); + const arg = parseLeftHandSideExpression(parser, context, privateScope, 0, 0, 1); + if (parser.assignable & 2) { + parser.report(55); + } + parser.assignable = 2; + return parser.finishNode({ + type: 'UpdateExpression', + argument: arg, + operator: KeywordDescTable[token & 255], + prefix: true, + }, start); +} +function parsePrimaryExpression(parser, context, privateScope, kind, inNew, canAssign, inGroup, isLHS, start) { + if ((parser.getToken() & 143360) === 143360) { + switch (parser.getToken()) { + case 209006: + return parseAwaitExpressionOrIdentifier(parser, context, privateScope, inNew, inGroup, start); + case 241771: + return parseYieldExpressionOrIdentifier(parser, context, privateScope, inGroup, canAssign, start); + case 209005: + return parseAsyncExpression(parser, context, privateScope, inGroup, isLHS, canAssign, inNew, start); + } + const { tokenValue } = parser; + const token = parser.getToken(); + const expr = parseIdentifier(parser, context | 64); + if (parser.getToken() === 10) { + if (!isLHS) + parser.report(0); + classifyIdentifier(parser, context, token); + if ((token & 36864) === 36864) { + parser.flags |= 256; + } + return parseArrowFromIdentifier(parser, context, privateScope, tokenValue, expr, inNew, canAssign, 0, start); + } + if (context & 16 && + !(context & 32768) && + !(context & 8192) && + parser.tokenValue === 'arguments') + parser.report(130); + if ((token & 255) === (241737 & 255)) { + if (context & 1) + parser.report(113); + if (kind & (8 | 16)) + parser.report(100); + } + parser.assignable = + context & 1 && (token & 537079808) === 537079808 + ? 2 + : 1; + return expr; + } + if ((parser.getToken() & 134217728) === 134217728) { + return parseLiteral(parser, context); + } + switch (parser.getToken()) { + case 33619993: + case 33619994: + return parseUpdateExpressionPrefixed(parser, context, privateScope, inNew, isLHS, start); + case 16863276: + case 16842798: + case 16842799: + case 25233968: + case 25233969: + case 16863275: + case 16863277: + return parseUnaryExpression(parser, context, privateScope, isLHS, inGroup); + case 86104: + return parseFunctionExpression(parser, context, privateScope, 0, inGroup, start); + case 2162700: + return parseObjectLiteral(parser, context, privateScope, canAssign ? 0 : 1, inGroup); + case 69271571: + return parseArrayLiteral(parser, context, privateScope, canAssign ? 0 : 1, inGroup); + case 67174411: + return parseParenthesizedExpression(parser, context | 64, privateScope, canAssign, 1, 0, start); + case 86021: + case 86022: + case 86023: + return parseNullOrTrueOrFalseLiteral(parser, context); + case 86111: + return parseThisExpression(parser, context); + case 65540: + return parseRegExpLiteral(parser, context); + case 132: + case 86094: + return parseClassExpression(parser, context, privateScope, inGroup, start); + case 86109: + return parseSuperExpression(parser, context); + case 67174409: + return parseTemplateLiteral(parser, context); + case 67174408: + return parseTemplate(parser, context, privateScope); + case 86107: + return parseNewExpression(parser, context, privateScope, inGroup); + case 134283388: + return parseBigIntLiteral(parser, context); + case 130: + return parsePrivateIdentifier(parser, context, privateScope, 0); + case 86106: + return parseImportCallOrMetaExpression(parser, context, privateScope, inNew, inGroup, start); + case 8456256: + if (parser.options.jsx) + return parseJSXRootElementOrFragment(parser, context, privateScope, 0, parser.tokenStart); + default: + if (isValidIdentifier(context, parser.getToken())) + return parseIdentifierOrArrow(parser, context, privateScope); + parser.report(30, KeywordDescTable[parser.getToken() & 255]); + } +} +function parseImportCallOrMetaExpression(parser, context, privateScope, inNew, inGroup, start) { + let expr = parseIdentifier(parser, context); + if (parser.getToken() === 67108877) { + return parseImportMetaExpression(parser, context, expr, start); + } + if (inNew) + parser.report(142); + expr = parseImportExpression(parser, context, privateScope, inGroup, start); + parser.assignable = 2; + return parseMemberOrUpdateExpression(parser, context, privateScope, expr, inGroup, 0, start); +} +function parseImportMetaExpression(parser, context, meta, start) { + if ((context & 2) === 0) + parser.report(169); + nextToken(parser, context); + const token = parser.getToken(); + if (token !== 209030 && parser.tokenValue !== 'meta') { + parser.report(174); + } + else if (token & -2147483648) { + parser.report(175); + } + parser.assignable = 2; + return parser.finishNode({ + type: 'MetaProperty', + meta, + property: parseIdentifier(parser, context), + }, start); +} +function parseImportExpression(parser, context, privateScope, inGroup, start) { + consume(parser, context | 32, 67174411); + if (parser.getToken() === 14) + parser.report(143); + const source = parseExpression(parser, context, privateScope, 1, inGroup, parser.tokenStart); + let options = null; + if (parser.getToken() === 18) { + consume(parser, context, 18); + if (parser.getToken() !== 16) { + const expContext = (context | 131072) ^ 131072; + options = parseExpression(parser, expContext, privateScope, 1, inGroup, parser.tokenStart); + } + consumeOpt(parser, context, 18); + } + const node = { + type: 'ImportExpression', + source, + options, + }; + consume(parser, context, 16); + return parser.finishNode(node, start); +} +function parseImportAttributes(parser, context) { + if (!consumeOpt(parser, context, 20579)) + return []; + consume(parser, context, 2162700); + const attributes = []; + const keysContent = new Set(); + while (parser.getToken() !== 1074790415) { + const start = parser.tokenStart; + const key = parseIdentifierOrStringLiteral(parser, context); + consume(parser, context, 21); + const value = parseStringLiteral(parser, context); + const keyContent = key.type === 'Literal' ? key.value : key.name; + if (keysContent.has(keyContent)) { + parser.report(145, `${keyContent}`); + } + keysContent.add(keyContent); + attributes.push(parser.finishNode({ + type: 'ImportAttribute', + key, + value, + }, start)); + if (parser.getToken() !== 1074790415) { + consume(parser, context, 18); + } + } + consume(parser, context, 1074790415); + return attributes; +} +function parseStringLiteral(parser, context) { + if (parser.getToken() === 134283267) { + return parseLiteral(parser, context); + } + else { + parser.report(30, KeywordDescTable[parser.getToken() & 255]); + } +} +function parseIdentifierOrStringLiteral(parser, context) { + if (parser.getToken() === 134283267) { + return parseLiteral(parser, context); + } + else if (parser.getToken() & 143360) { + return parseIdentifier(parser, context); + } + else { + parser.report(30, KeywordDescTable[parser.getToken() & 255]); + } +} +function validateStringWellFormed(parser, str) { + const len = str.length; + for (let i = 0; i < len; i++) { + const code = str.charCodeAt(i); + if ((code & 0xfc00) !== 55296) + continue; + if (code > 56319 || ++i >= len || (str.charCodeAt(i) & 0xfc00) !== 56320) { + parser.report(171, JSON.stringify(str.charAt(i--))); + } + } +} +function parseModuleExportName(parser, context) { + if (parser.getToken() === 134283267) { + validateStringWellFormed(parser, parser.tokenValue); + return parseLiteral(parser, context); + } + else if (parser.getToken() & 143360) { + return parseIdentifier(parser, context); + } + else { + parser.report(30, KeywordDescTable[parser.getToken() & 255]); + } +} +function parseBigIntLiteral(parser, context) { + const { tokenRaw, tokenValue, tokenStart } = parser; + nextToken(parser, context); + parser.assignable = 2; + const node = { + type: 'Literal', + value: tokenValue, + bigint: String(tokenValue), + }; + if (parser.options.raw) { + node.raw = tokenRaw; + } + return parser.finishNode(node, tokenStart); +} +function parseTemplateLiteral(parser, context) { + parser.assignable = 2; + const { tokenValue, tokenRaw, tokenStart } = parser; + consume(parser, context, 67174409); + const quasis = [parseTemplateElement(parser, tokenValue, tokenRaw, tokenStart, true)]; + return parser.finishNode({ + type: 'TemplateLiteral', + expressions: [], + quasis, + }, tokenStart); +} +function parseTemplate(parser, context, privateScope) { + context = (context | 131072) ^ 131072; + const { tokenValue, tokenRaw, tokenStart } = parser; + consume(parser, (context & -65) | 32, 67174408); + const quasis = [parseTemplateElement(parser, tokenValue, tokenRaw, tokenStart, false)]; + const expressions = [ + parseExpressions(parser, context & -65, privateScope, 0, 1, parser.tokenStart), + ]; + if (parser.getToken() !== 1074790415) + parser.report(83); + while (parser.setToken(scanTemplateTail(parser, context), true) !== 67174409) { + const { tokenValue, tokenRaw, tokenStart } = parser; + consume(parser, (context & -65) | 32, 67174408); + quasis.push(parseTemplateElement(parser, tokenValue, tokenRaw, tokenStart, false)); + expressions.push(parseExpressions(parser, context, privateScope, 0, 1, parser.tokenStart)); + if (parser.getToken() !== 1074790415) + parser.report(83); + } + { + const { tokenValue, tokenRaw, tokenStart } = parser; + consume(parser, context, 67174409); + quasis.push(parseTemplateElement(parser, tokenValue, tokenRaw, tokenStart, true)); + } + return parser.finishNode({ + type: 'TemplateLiteral', + expressions, + quasis, + }, tokenStart); +} +function parseTemplateElement(parser, cooked, raw, start, tail) { + const node = parser.finishNode({ + type: 'TemplateElement', + value: { + cooked, + raw, + }, + tail, + }, start); + const tailSize = tail ? 1 : 2; + if (parser.options.ranges) { + node.start += 1; + node.range[0] += 1; + node.end -= tailSize; + node.range[1] -= tailSize; + } + if (parser.options.loc) { + node.loc.start.column += 1; + node.loc.end.column -= tailSize; + } + return node; +} +function parseSpreadElement(parser, context, privateScope) { + const start = parser.tokenStart; + context = (context | 131072) ^ 131072; + consume(parser, context | 32, 14); + const argument = parseExpression(parser, context, privateScope, 1, 0, parser.tokenStart); + parser.assignable = 1; + return parser.finishNode({ + type: 'SpreadElement', + argument, + }, start); +} +function parseArguments(parser, context, privateScope, inGroup) { + nextToken(parser, context | 32); + const args = []; + if (parser.getToken() === 16) { + nextToken(parser, context | 64); + return args; + } + while (parser.getToken() !== 16) { + if (parser.getToken() === 14) { + args.push(parseSpreadElement(parser, context, privateScope)); + } + else { + args.push(parseExpression(parser, context, privateScope, 1, inGroup, parser.tokenStart)); + } + if (parser.getToken() !== 18) + break; + nextToken(parser, context | 32); + if (parser.getToken() === 16) + break; + } + consume(parser, context | 64, 16); + return args; +} +function parseIdentifier(parser, context) { + const { tokenValue, tokenStart } = parser; + const allowRegex = tokenValue === 'await' && (parser.getToken() & -2147483648) === 0; + nextToken(parser, context | (allowRegex ? 32 : 0)); + return parser.finishNode({ + type: 'Identifier', + name: tokenValue, + }, tokenStart); +} +function parseLiteral(parser, context) { + const { tokenValue, tokenRaw, tokenStart } = parser; + if (parser.getToken() === 134283388) { + return parseBigIntLiteral(parser, context); + } + nextToken(parser, context); + parser.assignable = 2; + return parser.finishNode(parser.options.raw + ? { + type: 'Literal', + value: tokenValue, + raw: tokenRaw, + } + : { + type: 'Literal', + value: tokenValue, + }, tokenStart); +} +function parseNullOrTrueOrFalseLiteral(parser, context) { + const start = parser.tokenStart; + const raw = KeywordDescTable[parser.getToken() & 255]; + const value = parser.getToken() === 86023 ? null : raw === 'true'; + nextToken(parser, context); + parser.assignable = 2; + return parser.finishNode(parser.options.raw + ? { + type: 'Literal', + value, + raw, + } + : { + type: 'Literal', + value, + }, start); +} +function parseThisExpression(parser, context) { + const { tokenStart } = parser; + nextToken(parser, context); + parser.assignable = 2; + return parser.finishNode({ + type: 'ThisExpression', + }, tokenStart); +} +function parseFunctionDeclaration(parser, context, scope, privateScope, origin, allowGen, flags, isAsync, start) { + nextToken(parser, context | 32); + const isGenerator = allowGen ? optionalBit(parser, context, 8391476) : 0; + let id = null; + let funcNameToken; + let functionScope = scope ? parser.createScope() : void 0; + if (parser.getToken() === 67174411) { + if ((flags & 1) === 0) + parser.report(39, 'Function'); + } + else { + const kind = origin & 4 && ((context & 8) === 0 || (context & 2) === 0) + ? 4 + : 64 | (isAsync ? 1024 : 0) | (isGenerator ? 1024 : 0); + validateFunctionName(parser, context, parser.getToken()); + if (scope) { + if (kind & 4) { + scope.addVarName(context, parser.tokenValue, kind); + } + else { + scope.addBlockName(context, parser.tokenValue, kind, origin); + } + functionScope = functionScope?.createChildScope(128); + if (flags) { + if (flags & 2) { + parser.declareUnboundVariable(parser.tokenValue); + } + } + } + funcNameToken = parser.getToken(); + if (parser.getToken() & 143360) { + id = parseIdentifier(parser, context); + } + else { + parser.report(30, KeywordDescTable[parser.getToken() & 255]); + } + } + { + const modifierFlags = 256 | + 512 | + 1024 | + 2048 | + 8192 | + 16384; + context = + ((context | modifierFlags) ^ modifierFlags) | + 65536 | + (isAsync ? 2048 : 0) | + (isGenerator ? 1024 : 0) | + (isGenerator ? 0 : 262144); + } + functionScope = functionScope?.createChildScope(256); + const params = parseFormalParametersOrFormalList(parser, (context | 8192) & -524289, functionScope, privateScope, 0, 1); + const modifierFlags = 8 | 4 | 128 | 524288; + const body = parseFunctionBody(parser, ((context | modifierFlags) ^ modifierFlags) | 32768 | 4096, functionScope?.createChildScope(64), privateScope, 8, funcNameToken, functionScope); + return parser.finishNode({ + type: 'FunctionDeclaration', + id, + params, + body, + async: isAsync === 1, + generator: isGenerator === 1, + }, start); +} +function parseFunctionExpression(parser, context, privateScope, isAsync, inGroup, start) { + nextToken(parser, context | 32); + const isGenerator = optionalBit(parser, context, 8391476); + const generatorAndAsyncFlags = (isAsync ? 2048 : 0) | (isGenerator ? 1024 : 0); + let id = null; + let funcNameToken; + let scope = parser.createScopeIfLexical(); + const modifierFlags = 256 | + 512 | + 1024 | + 2048 | + 8192 | + 16384 | + 524288; + if (parser.getToken() & 143360) { + validateFunctionName(parser, ((context | modifierFlags) ^ modifierFlags) | generatorAndAsyncFlags, parser.getToken()); + scope = scope?.createChildScope(128); + funcNameToken = parser.getToken(); + id = parseIdentifier(parser, context); + } + context = + ((context | modifierFlags) ^ modifierFlags) | + 65536 | + generatorAndAsyncFlags | + (isGenerator ? 0 : 262144); + scope = scope?.createChildScope(256); + const params = parseFormalParametersOrFormalList(parser, (context | 8192) & -524289, scope, privateScope, inGroup, 1); + const body = parseFunctionBody(parser, (context & -131229) | + 32768 | + 4096, scope?.createChildScope(64), privateScope, 0, funcNameToken, scope); + parser.assignable = 2; + return parser.finishNode({ + type: 'FunctionExpression', + id, + params, + body, + async: isAsync === 1, + generator: isGenerator === 1, + }, start); +} +function parseArrayLiteral(parser, context, privateScope, skipInitializer, inGroup) { + const expr = parseArrayExpressionOrPattern(parser, context, void 0, privateScope, skipInitializer, inGroup, 0, 2, 0); + if (parser.destructible & 64) { + parser.report(63); + } + if (parser.destructible & 8) { + parser.report(62); + } + return expr; +} +function parseArrayExpressionOrPattern(parser, context, scope, privateScope, skipInitializer, inGroup, isPattern, kind, origin) { + const { tokenStart: start } = parser; + nextToken(parser, context | 32); + const elements = []; + let destructible = 0; + context = (context | 131072) ^ 131072; + while (parser.getToken() !== 20) { + if (consumeOpt(parser, context | 32, 18)) { + elements.push(null); + } + else { + let left; + const { tokenStart, tokenValue } = parser; + const token = parser.getToken(); + if (token & 143360) { + left = parsePrimaryExpression(parser, context, privateScope, kind, 0, 1, inGroup, 1, tokenStart); + if (parser.getToken() === 1077936155) { + if (parser.assignable & 2) + parser.report(26); + nextToken(parser, context | 32); + scope?.addVarOrBlock(context, tokenValue, kind, origin); + const right = parseExpression(parser, context, privateScope, 1, inGroup, parser.tokenStart); + left = parser.finishNode(isPattern + ? { + type: 'AssignmentPattern', + left, + right, + } + : { + type: 'AssignmentExpression', + operator: '=', + left, + right, + }, tokenStart); + destructible |= + parser.destructible & 256 + ? 256 + : 0 | (parser.destructible & 128) + ? 128 + : 0; + } + else if (parser.getToken() === 18 || parser.getToken() === 20) { + if (parser.assignable & 2) { + destructible |= 16; + } + else { + scope?.addVarOrBlock(context, tokenValue, kind, origin); + } + destructible |= + parser.destructible & 256 + ? 256 + : 0 | (parser.destructible & 128) + ? 128 + : 0; + } + else { + destructible |= + kind & 1 + ? 32 + : (kind & 2) === 0 + ? 16 + : 0; + left = parseMemberOrUpdateExpression(parser, context, privateScope, left, inGroup, 0, tokenStart); + if (parser.getToken() !== 18 && parser.getToken() !== 20) { + if (parser.getToken() !== 1077936155) + destructible |= 16; + left = parseAssignmentExpression(parser, context, privateScope, inGroup, isPattern, tokenStart, left); + } + else if (parser.getToken() !== 1077936155) { + destructible |= + parser.assignable & 2 + ? 16 + : 32; + } + } + } + else if (token & 2097152) { + left = + parser.getToken() === 2162700 + ? parseObjectLiteralOrPattern(parser, context, scope, privateScope, 0, inGroup, isPattern, kind, origin) + : parseArrayExpressionOrPattern(parser, context, scope, privateScope, 0, inGroup, isPattern, kind, origin); + destructible |= parser.destructible; + parser.assignable = + parser.destructible & 16 + ? 2 + : 1; + if (parser.getToken() === 18 || parser.getToken() === 20) { + if (parser.assignable & 2) { + destructible |= 16; + } + } + else if (parser.destructible & 8) { + parser.report(71); + } + else { + left = parseMemberOrUpdateExpression(parser, context, privateScope, left, inGroup, 0, tokenStart); + destructible = parser.assignable & 2 ? 16 : 0; + if (parser.getToken() !== 18 && parser.getToken() !== 20) { + left = parseAssignmentExpression(parser, context, privateScope, inGroup, isPattern, tokenStart, left); + } + else if (parser.getToken() !== 1077936155) { + destructible |= + parser.assignable & 2 + ? 16 + : 32; + } + } + } + else if (token === 14) { + left = parseSpreadOrRestElement(parser, context, scope, privateScope, 20, kind, origin, 0, inGroup, isPattern); + destructible |= parser.destructible; + if (parser.getToken() !== 18 && parser.getToken() !== 20) + parser.report(30, KeywordDescTable[parser.getToken() & 255]); + } + else { + left = parseLeftHandSideExpression(parser, context, privateScope, 1, 0, 1); + if (parser.getToken() !== 18 && parser.getToken() !== 20) { + left = parseAssignmentExpression(parser, context, privateScope, inGroup, isPattern, tokenStart, left); + if ((kind & (2 | 1)) === 0 && token === 67174411) + destructible |= 16; + } + else if (parser.assignable & 2) { + destructible |= 16; + } + else if (token === 67174411) { + destructible |= + parser.assignable & 1 && kind & (2 | 1) + ? 32 + : 16; + } + } + elements.push(left); + if (consumeOpt(parser, context | 32, 18)) { + if (parser.getToken() === 20) + break; + } + else + break; + } + } + consume(parser, context, 20); + const node = parser.finishNode({ + type: isPattern ? 'ArrayPattern' : 'ArrayExpression', + elements, + }, start); + if (!skipInitializer && parser.getToken() & 4194304) { + return parseArrayOrObjectAssignmentPattern(parser, context, privateScope, destructible, inGroup, isPattern, start, node); + } + parser.destructible = destructible; + return node; +} +function parseArrayOrObjectAssignmentPattern(parser, context, privateScope, destructible, inGroup, isPattern, start, node) { + if (parser.getToken() !== 1077936155) + parser.report(26); + nextToken(parser, context | 32); + if (destructible & 16) + parser.report(26); + if (!isPattern) + reinterpretToPattern(parser, node); + const { tokenStart } = parser; + const right = parseExpression(parser, context, privateScope, 1, inGroup, tokenStart); + parser.destructible = + ((destructible | 64 | 8) ^ + (8 | 64)) | + (parser.destructible & 128 ? 128 : 0) | + (parser.destructible & 256 ? 256 : 0); + return parser.finishNode(isPattern + ? { + type: 'AssignmentPattern', + left: node, + right, + } + : { + type: 'AssignmentExpression', + left: node, + operator: '=', + right, + }, start); +} +function parseSpreadOrRestElement(parser, context, scope, privateScope, closingToken, kind, origin, isAsync, inGroup, isPattern) { + const { tokenStart: start } = parser; + nextToken(parser, context | 32); + let argument = null; + let destructible = 0; + const { tokenValue, tokenStart } = parser; + let token = parser.getToken(); + if (token & 143360) { + parser.assignable = 1; + argument = parsePrimaryExpression(parser, context, privateScope, kind, 0, 1, inGroup, 1, tokenStart); + token = parser.getToken(); + argument = parseMemberOrUpdateExpression(parser, context, privateScope, argument, inGroup, 0, tokenStart); + if (parser.getToken() !== 18 && parser.getToken() !== closingToken) { + if (parser.assignable & 2 && parser.getToken() === 1077936155) + parser.report(71); + destructible |= 16; + argument = parseAssignmentExpression(parser, context, privateScope, inGroup, isPattern, tokenStart, argument); + } + if (parser.assignable & 2) { + destructible |= 16; + } + else if (token === closingToken || token === 18) { + scope?.addVarOrBlock(context, tokenValue, kind, origin); + } + else { + destructible |= 32; + } + destructible |= parser.destructible & 128 ? 128 : 0; + } + else if (token === closingToken) { + parser.report(41); + } + else if (token & 2097152) { + argument = + parser.getToken() === 2162700 + ? parseObjectLiteralOrPattern(parser, context, scope, privateScope, 1, inGroup, isPattern, kind, origin) + : parseArrayExpressionOrPattern(parser, context, scope, privateScope, 1, inGroup, isPattern, kind, origin); + token = parser.getToken(); + if (token !== 1077936155 && token !== closingToken && token !== 18) { + if (parser.destructible & 8) + parser.report(71); + argument = parseMemberOrUpdateExpression(parser, context, privateScope, argument, inGroup, 0, tokenStart); + destructible |= parser.assignable & 2 ? 16 : 0; + if ((parser.getToken() & 4194304) === 4194304) { + if (parser.getToken() !== 1077936155) + destructible |= 16; + argument = parseAssignmentExpression(parser, context, privateScope, inGroup, isPattern, tokenStart, argument); + } + else { + if ((parser.getToken() & 8388608) === 8388608) { + argument = parseBinaryExpression(parser, context, privateScope, 1, tokenStart, 4, token, argument); + } + if (consumeOpt(parser, context | 32, 22)) { + argument = parseConditionalExpression(parser, context, privateScope, argument, tokenStart); + } + destructible |= + parser.assignable & 2 + ? 16 + : 32; + } + } + else { + destructible |= + closingToken === 1074790415 && token !== 1077936155 + ? 16 + : parser.destructible; + } + } + else { + destructible |= 32; + argument = parseLeftHandSideExpression(parser, context, privateScope, 1, inGroup, 1); + const { tokenStart } = parser; + const token = parser.getToken(); + if (token === 1077936155) { + if (parser.assignable & 2) + parser.report(26); + argument = parseAssignmentExpression(parser, context, privateScope, inGroup, isPattern, tokenStart, argument); + destructible |= 16; + } + else { + if (token === 18) { + destructible |= 16; + } + else if (token !== closingToken) { + argument = parseAssignmentExpression(parser, context, privateScope, inGroup, isPattern, tokenStart, argument); + } + destructible |= + parser.assignable & 1 ? 32 : 16; + } + parser.destructible = destructible; + if (parser.getToken() !== closingToken && parser.getToken() !== 18) + parser.report(161); + return parser.finishNode({ + type: isPattern ? 'RestElement' : 'SpreadElement', + argument: argument, + }, start); + } + if (parser.getToken() !== closingToken) { + if (kind & 1) + destructible |= isAsync ? 16 : 32; + if (consumeOpt(parser, context | 32, 1077936155)) { + if (destructible & 16) + parser.report(26); + reinterpretToPattern(parser, argument); + const right = parseExpression(parser, context, privateScope, 1, inGroup, parser.tokenStart); + argument = parser.finishNode(isPattern + ? { + type: 'AssignmentPattern', + left: argument, + right, + } + : { + type: 'AssignmentExpression', + left: argument, + operator: '=', + right, + }, tokenStart); + destructible = 16; + } + else { + destructible |= 16; + } + } + parser.destructible = destructible; + return parser.finishNode({ + type: isPattern ? 'RestElement' : 'SpreadElement', + argument: argument, + }, start); +} +function parseMethodDefinition(parser, context, privateScope, kind, inGroup, start) { + const modifierFlags = 1024 | + 2048 | + 8192 | + ((kind & 64) === 0 ? 512 | 16384 : 0); + context = + ((context | modifierFlags) ^ modifierFlags) | + (kind & 8 ? 1024 : 0) | + (kind & 16 ? 2048 : 0) | + (kind & 64 ? 16384 : 0) | + 256 | + 32768 | + 65536; + let scope = parser.createScopeIfLexical(256); + const params = parseMethodFormals(parser, (context | 8192) & -524289, scope, privateScope, kind, 1, inGroup); + scope = scope?.createChildScope(64); + const body = parseFunctionBody(parser, (context & -655373) | + 32768 | + 4096, scope, privateScope, 0, void 0, scope?.parent); + return parser.finishNode({ + type: 'FunctionExpression', + params, + body, + async: (kind & 16) > 0, + generator: (kind & 8) > 0, + id: null, + }, start); +} +function parseObjectLiteral(parser, context, privateScope, skipInitializer, inGroup) { + const expr = parseObjectLiteralOrPattern(parser, context, void 0, privateScope, skipInitializer, inGroup, 0, 2, 0); + if (parser.destructible & 64) { + parser.report(63); + } + if (parser.destructible & 8) { + parser.report(62); + } + return expr; +} +function parseObjectLiteralOrPattern(parser, context, scope, privateScope, skipInitializer, inGroup, isPattern, kind, origin) { + const { tokenStart: start } = parser; + nextToken(parser, context); + const properties = []; + let destructible = 0; + let prototypeCount = 0; + context = (context | 131072) ^ 131072; + while (parser.getToken() !== 1074790415) { + const { tokenValue, tokenStart } = parser; + const token = parser.getToken(); + if (token === 14) { + properties.push(parseSpreadOrRestElement(parser, context, scope, privateScope, 1074790415, kind, origin, 0, inGroup, isPattern)); + } + else { + let state = 0; + let key = null; + let value; + if (parser.getToken() & 143360 || + parser.getToken() === -2147483528 || + parser.getToken() === -2147483527) { + if (parser.getToken() === -2147483527) + destructible |= 16; + key = parseIdentifier(parser, context); + if (parser.getToken() === 18 || + parser.getToken() === 1074790415 || + parser.getToken() === 1077936155) { + state |= 4; + if (context & 1 && (token & 537079808) === 537079808) { + destructible |= 16; + } + else { + validateBindingIdentifier(parser, context, kind, token, 0); + } + scope?.addVarOrBlock(context, tokenValue, kind, origin); + if (consumeOpt(parser, context | 32, 1077936155)) { + destructible |= 8; + const right = parseExpression(parser, context, privateScope, 1, inGroup, parser.tokenStart); + destructible |= + parser.destructible & 256 + ? 256 + : 0 | (parser.destructible & 128) + ? 128 + : 0; + value = parser.finishNode({ + type: 'AssignmentPattern', + left: parser.options.uniqueKeyInPattern ? Object.assign({}, key) : key, + right, + }, tokenStart); + } + else { + destructible |= + (token === 209006 ? 128 : 0) | + (token === -2147483528 ? 16 : 0); + value = parser.options.uniqueKeyInPattern ? Object.assign({}, key) : key; + } + } + else if (consumeOpt(parser, context | 32, 21)) { + const { tokenStart } = parser; + if (tokenValue === '__proto__') + prototypeCount++; + if (parser.getToken() & 143360) { + const tokenAfterColon = parser.getToken(); + const valueAfterColon = parser.tokenValue; + value = parsePrimaryExpression(parser, context, privateScope, kind, 0, 1, inGroup, 1, tokenStart); + const token = parser.getToken(); + value = parseMemberOrUpdateExpression(parser, context, privateScope, value, inGroup, 0, tokenStart); + if (parser.getToken() === 18 || parser.getToken() === 1074790415) { + if (token === 1077936155 || token === 1074790415 || token === 18) { + destructible |= parser.destructible & 128 ? 128 : 0; + if (parser.assignable & 2) { + destructible |= 16; + } + else if ((tokenAfterColon & 143360) === 143360) { + scope?.addVarOrBlock(context, valueAfterColon, kind, origin); + } + } + else { + destructible |= + parser.assignable & 1 + ? 32 + : 16; + } + } + else if ((parser.getToken() & 4194304) === 4194304) { + if (parser.assignable & 2) { + destructible |= 16; + } + else if (token !== 1077936155) { + destructible |= 32; + } + else { + scope?.addVarOrBlock(context, valueAfterColon, kind, origin); + } + value = parseAssignmentExpression(parser, context, privateScope, inGroup, isPattern, tokenStart, value); + } + else { + destructible |= 16; + if ((parser.getToken() & 8388608) === 8388608) { + value = parseBinaryExpression(parser, context, privateScope, 1, tokenStart, 4, token, value); + } + if (consumeOpt(parser, context | 32, 22)) { + value = parseConditionalExpression(parser, context, privateScope, value, tokenStart); + } + } + } + else if ((parser.getToken() & 2097152) === 2097152) { + value = + parser.getToken() === 69271571 + ? parseArrayExpressionOrPattern(parser, context, scope, privateScope, 0, inGroup, isPattern, kind, origin) + : parseObjectLiteralOrPattern(parser, context, scope, privateScope, 0, inGroup, isPattern, kind, origin); + destructible = parser.destructible; + parser.assignable = + destructible & 16 ? 2 : 1; + if (parser.getToken() === 18 || parser.getToken() === 1074790415) { + if (parser.assignable & 2) + destructible |= 16; + } + else if (parser.destructible & 8) { + parser.report(71); + } + else { + value = parseMemberOrUpdateExpression(parser, context, privateScope, value, inGroup, 0, tokenStart); + destructible = parser.assignable & 2 ? 16 : 0; + if ((parser.getToken() & 4194304) === 4194304) { + value = parseAssignmentExpressionOrPattern(parser, context, privateScope, inGroup, isPattern, tokenStart, value); + } + else { + if ((parser.getToken() & 8388608) === 8388608) { + value = parseBinaryExpression(parser, context, privateScope, 1, tokenStart, 4, token, value); + } + if (consumeOpt(parser, context | 32, 22)) { + value = parseConditionalExpression(parser, context, privateScope, value, tokenStart); + } + destructible |= + parser.assignable & 2 + ? 16 + : 32; + } + } + } + else { + value = parseLeftHandSideExpression(parser, context, privateScope, 1, inGroup, 1); + destructible |= + parser.assignable & 1 + ? 32 + : 16; + if (parser.getToken() === 18 || parser.getToken() === 1074790415) { + if (parser.assignable & 2) + destructible |= 16; + } + else { + value = parseMemberOrUpdateExpression(parser, context, privateScope, value, inGroup, 0, tokenStart); + destructible = parser.assignable & 2 ? 16 : 0; + if (parser.getToken() !== 18 && token !== 1074790415) { + if (parser.getToken() !== 1077936155) + destructible |= 16; + value = parseAssignmentExpression(parser, context, privateScope, inGroup, isPattern, tokenStart, value); + } + } + } + } + else if (parser.getToken() === 69271571) { + destructible |= 16; + if (token === 209005) + state |= 16; + state |= + (token === 209008 + ? 256 + : token === 209009 + ? 512 + : 1) | 2; + key = parseComputedPropertyName(parser, context, privateScope, inGroup); + destructible |= parser.assignable; + value = parseMethodDefinition(parser, context, privateScope, state, inGroup, parser.tokenStart); + } + else if (parser.getToken() & 143360) { + destructible |= 16; + if (token === -2147483528) + parser.report(95); + if (token === 209005) { + if (parser.flags & 1) + parser.report(132); + state |= 16 | 1; + } + else if (token === 209008) { + state |= 256; + } + else if (token === 209009) { + state |= 512; + } + else { + parser.report(0); + } + key = parseIdentifier(parser, context); + value = parseMethodDefinition(parser, context, privateScope, state, inGroup, parser.tokenStart); + } + else if (parser.getToken() === 67174411) { + destructible |= 16; + state |= 1; + value = parseMethodDefinition(parser, context, privateScope, state, inGroup, parser.tokenStart); + } + else if (parser.getToken() === 8391476) { + destructible |= 16; + if (token === 209008) { + parser.report(42); + } + else if (token === 209009) { + parser.report(43); + } + else if (token !== 209005) { + parser.report(30, KeywordDescTable[8391476 & 255]); + } + nextToken(parser, context); + state |= + 8 | 1 | (token === 209005 ? 16 : 0); + if (parser.getToken() & 143360) { + key = parseIdentifier(parser, context); + } + else if ((parser.getToken() & 134217728) === 134217728) { + key = parseLiteral(parser, context); + } + else if (parser.getToken() === 69271571) { + state |= 2; + key = parseComputedPropertyName(parser, context, privateScope, inGroup); + destructible |= parser.assignable; + } + else { + parser.report(30, KeywordDescTable[parser.getToken() & 255]); + } + value = parseMethodDefinition(parser, context, privateScope, state, inGroup, parser.tokenStart); + } + else if ((parser.getToken() & 134217728) === 134217728) { + if (token === 209005) + state |= 16; + state |= + token === 209008 + ? 256 + : token === 209009 + ? 512 + : 1; + destructible |= 16; + key = parseLiteral(parser, context); + value = parseMethodDefinition(parser, context, privateScope, state, inGroup, parser.tokenStart); + } + else { + parser.report(133); + } + } + else if ((parser.getToken() & 134217728) === 134217728) { + key = parseLiteral(parser, context); + if (parser.getToken() === 21) { + consume(parser, context | 32, 21); + const { tokenStart } = parser; + if (tokenValue === '__proto__') + prototypeCount++; + if (parser.getToken() & 143360) { + value = parsePrimaryExpression(parser, context, privateScope, kind, 0, 1, inGroup, 1, tokenStart); + const { tokenValue: valueAfterColon } = parser; + const token = parser.getToken(); + value = parseMemberOrUpdateExpression(parser, context, privateScope, value, inGroup, 0, tokenStart); + if (parser.getToken() === 18 || parser.getToken() === 1074790415) { + if (token === 1077936155 || token === 1074790415 || token === 18) { + if (parser.assignable & 2) { + destructible |= 16; + } + else { + scope?.addVarOrBlock(context, valueAfterColon, kind, origin); + } + } + else { + destructible |= + parser.assignable & 1 + ? 32 + : 16; + } + } + else if (parser.getToken() === 1077936155) { + if (parser.assignable & 2) + destructible |= 16; + value = parseAssignmentExpression(parser, context, privateScope, inGroup, isPattern, tokenStart, value); + } + else { + destructible |= 16; + value = parseAssignmentExpression(parser, context, privateScope, inGroup, isPattern, tokenStart, value); + } + } + else if ((parser.getToken() & 2097152) === 2097152) { + value = + parser.getToken() === 69271571 + ? parseArrayExpressionOrPattern(parser, context, scope, privateScope, 0, inGroup, isPattern, kind, origin) + : parseObjectLiteralOrPattern(parser, context, scope, privateScope, 0, inGroup, isPattern, kind, origin); + destructible = parser.destructible; + parser.assignable = + destructible & 16 ? 2 : 1; + if (parser.getToken() === 18 || parser.getToken() === 1074790415) { + if (parser.assignable & 2) { + destructible |= 16; + } + } + else if ((parser.destructible & 8) !== 8) { + value = parseMemberOrUpdateExpression(parser, context, privateScope, value, inGroup, 0, tokenStart); + destructible = parser.assignable & 2 ? 16 : 0; + if ((parser.getToken() & 4194304) === 4194304) { + value = parseAssignmentExpressionOrPattern(parser, context, privateScope, inGroup, isPattern, tokenStart, value); + } + else { + if ((parser.getToken() & 8388608) === 8388608) { + value = parseBinaryExpression(parser, context, privateScope, 1, tokenStart, 4, token, value); + } + if (consumeOpt(parser, context | 32, 22)) { + value = parseConditionalExpression(parser, context, privateScope, value, tokenStart); + } + destructible |= + parser.assignable & 2 + ? 16 + : 32; + } + } + } + else { + value = parseLeftHandSideExpression(parser, context, privateScope, 1, 0, 1); + destructible |= + parser.assignable & 1 + ? 32 + : 16; + if (parser.getToken() === 18 || parser.getToken() === 1074790415) { + if (parser.assignable & 2) { + destructible |= 16; + } + } + else { + value = parseMemberOrUpdateExpression(parser, context, privateScope, value, inGroup, 0, tokenStart); + destructible = parser.assignable & 1 ? 0 : 16; + if (parser.getToken() !== 18 && parser.getToken() !== 1074790415) { + if (parser.getToken() !== 1077936155) + destructible |= 16; + value = parseAssignmentExpression(parser, context, privateScope, inGroup, isPattern, tokenStart, value); + } + } + } + } + else if (parser.getToken() === 67174411) { + state |= 1; + value = parseMethodDefinition(parser, context, privateScope, state, inGroup, parser.tokenStart); + destructible = parser.assignable | 16; + } + else { + parser.report(134); + } + } + else if (parser.getToken() === 69271571) { + key = parseComputedPropertyName(parser, context, privateScope, inGroup); + destructible |= parser.destructible & 256 ? 256 : 0; + state |= 2; + if (parser.getToken() === 21) { + nextToken(parser, context | 32); + const { tokenStart, tokenValue } = parser; + const tokenAfterColon = parser.getToken(); + if (parser.getToken() & 143360) { + value = parsePrimaryExpression(parser, context, privateScope, kind, 0, 1, inGroup, 1, tokenStart); + const token = parser.getToken(); + value = parseMemberOrUpdateExpression(parser, context, privateScope, value, inGroup, 0, tokenStart); + if ((parser.getToken() & 4194304) === 4194304) { + destructible |= + parser.assignable & 2 + ? 16 + : token === 1077936155 + ? 0 + : 32; + value = parseAssignmentExpressionOrPattern(parser, context, privateScope, inGroup, isPattern, tokenStart, value); + } + else if (parser.getToken() === 18 || parser.getToken() === 1074790415) { + if (token === 1077936155 || token === 1074790415 || token === 18) { + if (parser.assignable & 2) { + destructible |= 16; + } + else if ((tokenAfterColon & 143360) === 143360) { + scope?.addVarOrBlock(context, tokenValue, kind, origin); + } + } + else { + destructible |= + parser.assignable & 1 + ? 32 + : 16; + } + } + else { + destructible |= 16; + value = parseAssignmentExpression(parser, context, privateScope, inGroup, isPattern, tokenStart, value); + } + } + else if ((parser.getToken() & 2097152) === 2097152) { + value = + parser.getToken() === 69271571 + ? parseArrayExpressionOrPattern(parser, context, scope, privateScope, 0, inGroup, isPattern, kind, origin) + : parseObjectLiteralOrPattern(parser, context, scope, privateScope, 0, inGroup, isPattern, kind, origin); + destructible = parser.destructible; + parser.assignable = + destructible & 16 ? 2 : 1; + if (parser.getToken() === 18 || parser.getToken() === 1074790415) { + if (parser.assignable & 2) + destructible |= 16; + } + else if (destructible & 8) { + parser.report(62); + } + else { + value = parseMemberOrUpdateExpression(parser, context, privateScope, value, inGroup, 0, tokenStart); + destructible = + parser.assignable & 2 ? destructible | 16 : 0; + if ((parser.getToken() & 4194304) === 4194304) { + if (parser.getToken() !== 1077936155) + destructible |= 16; + value = parseAssignmentExpressionOrPattern(parser, context, privateScope, inGroup, isPattern, tokenStart, value); + } + else { + if ((parser.getToken() & 8388608) === 8388608) { + value = parseBinaryExpression(parser, context, privateScope, 1, tokenStart, 4, token, value); + } + if (consumeOpt(parser, context | 32, 22)) { + value = parseConditionalExpression(parser, context, privateScope, value, tokenStart); + } + destructible |= + parser.assignable & 2 + ? 16 + : 32; + } + } + } + else { + value = parseLeftHandSideExpression(parser, context, privateScope, 1, 0, 1); + destructible |= + parser.assignable & 1 + ? 32 + : 16; + if (parser.getToken() === 18 || parser.getToken() === 1074790415) { + if (parser.assignable & 2) + destructible |= 16; + } + else { + value = parseMemberOrUpdateExpression(parser, context, privateScope, value, inGroup, 0, tokenStart); + destructible = parser.assignable & 1 ? 0 : 16; + if (parser.getToken() !== 18 && parser.getToken() !== 1074790415) { + if (parser.getToken() !== 1077936155) + destructible |= 16; + value = parseAssignmentExpression(parser, context, privateScope, inGroup, isPattern, tokenStart, value); + } + } + } + } + else if (parser.getToken() === 67174411) { + state |= 1; + value = parseMethodDefinition(parser, context, privateScope, state, inGroup, parser.tokenStart); + destructible = 16; + } + else { + parser.report(44); + } + } + else if (token === 8391476) { + consume(parser, context | 32, 8391476); + state |= 8; + if (parser.getToken() & 143360) { + const token = parser.getToken(); + key = parseIdentifier(parser, context); + state |= 1; + if (parser.getToken() === 67174411) { + destructible |= 16; + value = parseMethodDefinition(parser, context, privateScope, state, inGroup, parser.tokenStart); + } + else { + throw new ParseError(parser.tokenStart, parser.currentLocation, token === 209005 + ? 46 + : token === 209008 || parser.getToken() === 209009 + ? 45 + : 47, KeywordDescTable[token & 255]); + } + } + else if ((parser.getToken() & 134217728) === 134217728) { + destructible |= 16; + key = parseLiteral(parser, context); + state |= 1; + value = parseMethodDefinition(parser, context, privateScope, state, inGroup, parser.tokenStart); + } + else if (parser.getToken() === 69271571) { + destructible |= 16; + state |= 2 | 1; + key = parseComputedPropertyName(parser, context, privateScope, inGroup); + value = parseMethodDefinition(parser, context, privateScope, state, inGroup, parser.tokenStart); + } + else { + parser.report(126); + } + } + else { + parser.report(30, KeywordDescTable[token & 255]); + } + destructible |= parser.destructible & 128 ? 128 : 0; + parser.destructible = destructible; + properties.push(parser.finishNode({ + type: 'Property', + key: key, + value, + kind: !(state & 768) ? 'init' : state & 512 ? 'set' : 'get', + computed: (state & 2) > 0, + method: (state & 1) > 0, + shorthand: (state & 4) > 0, + }, tokenStart)); + } + destructible |= parser.destructible; + if (parser.getToken() !== 18) + break; + nextToken(parser, context); + } + consume(parser, context, 1074790415); + if (prototypeCount > 1) + destructible |= 64; + const node = parser.finishNode({ + type: isPattern ? 'ObjectPattern' : 'ObjectExpression', + properties, + }, start); + if (!skipInitializer && parser.getToken() & 4194304) { + return parseArrayOrObjectAssignmentPattern(parser, context, privateScope, destructible, inGroup, isPattern, start, node); + } + parser.destructible = destructible; + return node; +} +function parseMethodFormals(parser, context, scope, privateScope, kind, type, inGroup) { + consume(parser, context, 67174411); + const params = []; + parser.flags = (parser.flags | 128) ^ 128; + if (parser.getToken() === 16) { + if (kind & 512) { + parser.report(37, 'Setter', 'one', ''); + } + nextToken(parser, context); + return params; + } + if (kind & 256) { + parser.report(37, 'Getter', 'no', 's'); + } + if (kind & 512 && parser.getToken() === 14) { + parser.report(38); + } + context = (context | 131072) ^ 131072; + let setterArgs = 0; + let isNonSimpleParameterList = 0; + while (parser.getToken() !== 18) { + let left = null; + const { tokenStart } = parser; + if (parser.getToken() & 143360) { + if ((context & 1) === 0) { + if ((parser.getToken() & 36864) === 36864) { + parser.flags |= 256; + } + if ((parser.getToken() & 537079808) === 537079808) { + parser.flags |= 512; + } + } + left = parseAndClassifyIdentifier(parser, context, scope, kind | 1, 0); + } + else { + if (parser.getToken() === 2162700) { + left = parseObjectLiteralOrPattern(parser, context, scope, privateScope, 1, inGroup, 1, type, 0); + } + else if (parser.getToken() === 69271571) { + left = parseArrayExpressionOrPattern(parser, context, scope, privateScope, 1, inGroup, 1, type, 0); + } + else if (parser.getToken() === 14) { + left = parseSpreadOrRestElement(parser, context, scope, privateScope, 16, type, 0, 0, inGroup, 1); + } + isNonSimpleParameterList = 1; + if (parser.destructible & (32 | 16)) + parser.report(50); + } + if (parser.getToken() === 1077936155) { + nextToken(parser, context | 32); + isNonSimpleParameterList = 1; + const right = parseExpression(parser, context, privateScope, 1, 0, parser.tokenStart); + left = parser.finishNode({ + type: 'AssignmentPattern', + left: left, + right, + }, tokenStart); + } + setterArgs++; + params.push(left); + if (!consumeOpt(parser, context, 18)) + break; + if (parser.getToken() === 16) { + break; + } + } + if (kind & 512 && setterArgs !== 1) { + parser.report(37, 'Setter', 'one', ''); + } + scope?.reportScopeError(); + if (isNonSimpleParameterList) + parser.flags |= 128; + consume(parser, context, 16); + return params; +} +function parseComputedPropertyName(parser, context, privateScope, inGroup) { + nextToken(parser, context | 32); + const key = parseExpression(parser, (context | 131072) ^ 131072, privateScope, 1, inGroup, parser.tokenStart); + consume(parser, context, 20); + return key; +} +function parseParenthesizedExpression(parser, context, privateScope, canAssign, kind, origin, start) { + parser.flags = (parser.flags | 128) ^ 128; + const parenthesesStart = parser.tokenStart; + nextToken(parser, context | 32 | 262144); + const scope = parser.createScopeIfLexical()?.createChildScope(512); + context = (context | 131072) ^ 131072; + if (consumeOpt(parser, context, 16)) { + return parseParenthesizedArrow(parser, context, scope, privateScope, [], canAssign, 0, start); + } + let destructible = 0; + parser.destructible &= -385; + let expr; + let expressions = []; + let isSequence = 0; + let isNonSimpleParameterList = 0; + let hasStrictReserved = 0; + const tokenAfterParenthesesStart = parser.tokenStart; + parser.assignable = 1; + while (parser.getToken() !== 16) { + const { tokenStart } = parser; + const token = parser.getToken(); + if (token & 143360) { + scope?.addBlockName(context, parser.tokenValue, 1, 0); + if ((token & 537079808) === 537079808) { + isNonSimpleParameterList = 1; + } + else if ((token & 36864) === 36864) { + hasStrictReserved = 1; + } + expr = parsePrimaryExpression(parser, context, privateScope, kind, 0, 1, 1, 1, tokenStart); + if (parser.getToken() === 16 || parser.getToken() === 18) { + if (parser.assignable & 2) { + destructible |= 16; + isNonSimpleParameterList = 1; + } + } + else { + if (parser.getToken() === 1077936155) { + isNonSimpleParameterList = 1; + } + else { + destructible |= 16; + } + expr = parseMemberOrUpdateExpression(parser, context, privateScope, expr, 1, 0, tokenStart); + if (parser.getToken() !== 16 && parser.getToken() !== 18) { + expr = parseAssignmentExpression(parser, context, privateScope, 1, 0, tokenStart, expr); + } + } + } + else if ((token & 2097152) === 2097152) { + expr = + token === 2162700 + ? parseObjectLiteralOrPattern(parser, context | 262144, scope, privateScope, 0, 1, 0, kind, origin) + : parseArrayExpressionOrPattern(parser, context | 262144, scope, privateScope, 0, 1, 0, kind, origin); + destructible |= parser.destructible; + isNonSimpleParameterList = 1; + parser.assignable = 2; + if (parser.getToken() !== 16 && parser.getToken() !== 18) { + if (destructible & 8) + parser.report(122); + expr = parseMemberOrUpdateExpression(parser, context, privateScope, expr, 0, 0, tokenStart); + destructible |= 16; + if (parser.getToken() !== 16 && parser.getToken() !== 18) { + expr = parseAssignmentExpression(parser, context, privateScope, 0, 0, tokenStart, expr); + } + } + } + else if (token === 14) { + expr = parseSpreadOrRestElement(parser, context, scope, privateScope, 16, kind, origin, 0, 1, 0); + if (parser.destructible & 16) + parser.report(74); + isNonSimpleParameterList = 1; + if (isSequence && (parser.getToken() === 16 || parser.getToken() === 18)) { + expressions.push(expr); + } + destructible |= 8; + break; + } + else { + destructible |= 16; + expr = parseExpression(parser, context, privateScope, 1, 1, tokenStart); + if (isSequence && (parser.getToken() === 16 || parser.getToken() === 18)) { + expressions.push(expr); + } + if (parser.getToken() === 18) { + if (!isSequence) { + isSequence = 1; + expressions = [expr]; + } + } + if (isSequence) { + while (consumeOpt(parser, context | 32, 18)) { + expressions.push(parseExpression(parser, context, privateScope, 1, 1, parser.tokenStart)); + } + parser.assignable = 2; + expr = parser.finishNode({ + type: 'SequenceExpression', + expressions, + }, tokenAfterParenthesesStart); + } + consume(parser, context, 16); + parser.destructible = destructible; + return parser.options.preserveParens + ? parser.finishNode({ + type: 'ParenthesizedExpression', + expression: expr, + }, parenthesesStart) + : expr; + } + if (isSequence && (parser.getToken() === 16 || parser.getToken() === 18)) { + expressions.push(expr); + } + if (!consumeOpt(parser, context | 32, 18)) + break; + if (!isSequence) { + isSequence = 1; + expressions = [expr]; + } + if (parser.getToken() === 16) { + destructible |= 8; + break; + } + } + if (isSequence) { + parser.assignable = 2; + expr = parser.finishNode({ + type: 'SequenceExpression', + expressions, + }, tokenAfterParenthesesStart); + } + consume(parser, context, 16); + if (destructible & 16 && destructible & 8) + parser.report(151); + destructible |= + parser.destructible & 256 + ? 256 + : 0 | (parser.destructible & 128) + ? 128 + : 0; + if (parser.getToken() === 10) { + if (destructible & (32 | 16)) + parser.report(49); + if (context & (2048 | 2) && destructible & 128) + parser.report(31); + if (context & (1 | 1024) && destructible & 256) { + parser.report(32); + } + if (isNonSimpleParameterList) + parser.flags |= 128; + if (hasStrictReserved) + parser.flags |= 256; + return parseParenthesizedArrow(parser, context, scope, privateScope, isSequence ? expressions : [expr], canAssign, 0, start); + } + if (destructible & 64) { + parser.report(63); + } + if (destructible & 8) { + parser.report(144); + } + parser.destructible = ((parser.destructible | 256) ^ 256) | destructible; + return parser.options.preserveParens + ? parser.finishNode({ + type: 'ParenthesizedExpression', + expression: expr, + }, parenthesesStart) + : expr; +} +function parseIdentifierOrArrow(parser, context, privateScope) { + const { tokenStart: start } = parser; + const { tokenValue } = parser; + let isNonSimpleParameterList = 0; + let hasStrictReserved = 0; + if ((parser.getToken() & 537079808) === 537079808) { + isNonSimpleParameterList = 1; + } + else if ((parser.getToken() & 36864) === 36864) { + hasStrictReserved = 1; + } + const expr = parseIdentifier(parser, context); + parser.assignable = 1; + if (parser.getToken() === 10) { + const scope = parser.options.lexical ? createArrowHeadParsingScope(parser, context, tokenValue) : undefined; + if (isNonSimpleParameterList) + parser.flags |= 128; + if (hasStrictReserved) + parser.flags |= 256; + return parseArrowFunctionExpression(parser, context, scope, privateScope, [expr], 0, start); + } + return expr; +} +function parseArrowFromIdentifier(parser, context, privateScope, value, expr, inNew, canAssign, isAsync, start) { + if (!canAssign) + parser.report(57); + if (inNew) + parser.report(51); + parser.flags &= -129; + const scope = parser.options.lexical ? createArrowHeadParsingScope(parser, context, value) : void 0; + return parseArrowFunctionExpression(parser, context, scope, privateScope, [expr], isAsync, start); +} +function parseParenthesizedArrow(parser, context, scope, privateScope, params, canAssign, isAsync, start) { + if (!canAssign) + parser.report(57); + for (let i = 0; i < params.length; ++i) + reinterpretToPattern(parser, params[i]); + return parseArrowFunctionExpression(parser, context, scope, privateScope, params, isAsync, start); +} +function parseArrowFunctionExpression(parser, context, scope, privateScope, params, isAsync, start) { + if (parser.flags & 1) + parser.report(48); + consume(parser, context | 32, 10); + const modifierFlags = 1024 | 2048 | 8192 | 524288; + context = ((context | modifierFlags) ^ modifierFlags) | (isAsync ? 2048 : 0); + const expression = parser.getToken() !== 2162700; + let body; + scope?.reportScopeError(); + if (expression) { + parser.flags = + (parser.flags | 512 | 256 | 64 | 4096) ^ + (512 | 256 | 64 | 4096); + body = parseExpression(parser, context, privateScope, 1, 0, parser.tokenStart); + } + else { + scope = scope?.createChildScope(64); + const modifierFlags = 4 | 131072 | 8; + body = parseFunctionBody(parser, ((context | modifierFlags) ^ modifierFlags) | 4096, scope, privateScope, 16, void 0, void 0); + switch (parser.getToken()) { + case 69271571: + if ((parser.flags & 1) === 0) { + parser.report(116); + } + break; + case 67108877: + case 67174409: + case 22: + parser.report(117); + case 67174411: + if ((parser.flags & 1) === 0) { + parser.report(116); + } + parser.flags |= 1024; + break; + } + if ((parser.getToken() & 8388608) === 8388608 && (parser.flags & 1) === 0) + parser.report(30, KeywordDescTable[parser.getToken() & 255]); + if ((parser.getToken() & 33619968) === 33619968) + parser.report(125); + } + parser.assignable = 2; + return parser.finishNode({ + type: 'ArrowFunctionExpression', + params, + body, + async: isAsync === 1, + expression, + generator: false, + }, start); +} +function parseFormalParametersOrFormalList(parser, context, scope, privateScope, inGroup, kind) { + consume(parser, context, 67174411); + parser.flags = (parser.flags | 128) ^ 128; + const params = []; + if (consumeOpt(parser, context, 16)) + return params; + context = (context | 131072) ^ 131072; + let isNonSimpleParameterList = 0; + while (parser.getToken() !== 18) { + let left; + const { tokenStart } = parser; + const token = parser.getToken(); + if (token & 143360) { + if ((context & 1) === 0) { + if ((token & 36864) === 36864) { + parser.flags |= 256; + } + if ((token & 537079808) === 537079808) { + parser.flags |= 512; + } + } + left = parseAndClassifyIdentifier(parser, context, scope, kind | 1, 0); + } + else { + if (token === 2162700) { + left = parseObjectLiteralOrPattern(parser, context, scope, privateScope, 1, inGroup, 1, kind, 0); + } + else if (token === 69271571) { + left = parseArrayExpressionOrPattern(parser, context, scope, privateScope, 1, inGroup, 1, kind, 0); + } + else if (token === 14) { + left = parseSpreadOrRestElement(parser, context, scope, privateScope, 16, kind, 0, 0, inGroup, 1); + } + else { + parser.report(30, KeywordDescTable[token & 255]); + } + isNonSimpleParameterList = 1; + if (parser.destructible & (32 | 16)) { + parser.report(50); + } + } + if (parser.getToken() === 1077936155) { + nextToken(parser, context | 32); + isNonSimpleParameterList = 1; + const right = parseExpression(parser, context, privateScope, 1, inGroup, parser.tokenStart); + left = parser.finishNode({ + type: 'AssignmentPattern', + left, + right, + }, tokenStart); + } + params.push(left); + if (!consumeOpt(parser, context, 18)) + break; + if (parser.getToken() === 16) { + break; + } + } + if (isNonSimpleParameterList) + parser.flags |= 128; + if (isNonSimpleParameterList || context & 1) { + scope?.reportScopeError(); + } + consume(parser, context, 16); + return params; +} +function parseMemberExpressionNoCall(parser, context, privateScope, expr, inGroup, start) { + const token = parser.getToken(); + if (token & 67108864) { + if (token === 67108877) { + nextToken(parser, context | 262144); + parser.assignable = 1; + const property = parsePropertyOrPrivatePropertyName(parser, context, privateScope); + return parseMemberExpressionNoCall(parser, context, privateScope, parser.finishNode({ + type: 'MemberExpression', + object: expr, + computed: false, + property, + optional: false, + }, start), 0, start); + } + else if (token === 69271571) { + nextToken(parser, context | 32); + const { tokenStart } = parser; + const property = parseExpressions(parser, context, privateScope, inGroup, 1, tokenStart); + consume(parser, context, 20); + parser.assignable = 1; + return parseMemberExpressionNoCall(parser, context, privateScope, parser.finishNode({ + type: 'MemberExpression', + object: expr, + computed: true, + property, + optional: false, + }, start), 0, start); + } + else if (token === 67174408 || token === 67174409) { + parser.assignable = 2; + return parseMemberExpressionNoCall(parser, context, privateScope, parser.finishNode({ + type: 'TaggedTemplateExpression', + tag: expr, + quasi: parser.getToken() === 67174408 + ? parseTemplate(parser, context | 64, privateScope) + : parseTemplateLiteral(parser, context | 64), + }, start), 0, start); + } + } + return expr; +} +function parseNewExpression(parser, context, privateScope, inGroup) { + const { tokenStart: start } = parser; + const id = parseIdentifier(parser, context | 32); + const { tokenStart } = parser; + if (consumeOpt(parser, context, 67108877)) { + if (context & 65536 && parser.getToken() === 209029) { + parser.assignable = 2; + return parseMetaProperty(parser, context, id, start); + } + parser.report(94); + } + parser.assignable = 2; + if ((parser.getToken() & 16842752) === 16842752) { + parser.report(65, KeywordDescTable[parser.getToken() & 255]); + } + const expr = parsePrimaryExpression(parser, context, privateScope, 2, 1, 0, inGroup, 1, tokenStart); + context = (context | 131072) ^ 131072; + if (parser.getToken() === 67108990) + parser.report(168); + const callee = parseMemberExpressionNoCall(parser, context, privateScope, expr, inGroup, tokenStart); + parser.assignable = 2; + return parser.finishNode({ + type: 'NewExpression', + callee, + arguments: parser.getToken() === 67174411 ? parseArguments(parser, context, privateScope, inGroup) : [], + }, start); +} +function parseMetaProperty(parser, context, meta, start) { + const property = parseIdentifier(parser, context); + return parser.finishNode({ + type: 'MetaProperty', + meta, + property, + }, start); +} +function parseAsyncArrowAfterIdent(parser, context, privateScope, canAssign, start) { + if (parser.getToken() === 209006) + parser.report(31); + if (context & (1 | 1024) && parser.getToken() === 241771) { + parser.report(32); + } + classifyIdentifier(parser, context, parser.getToken()); + if ((parser.getToken() & 36864) === 36864) { + parser.flags |= 256; + } + return parseArrowFromIdentifier(parser, (context & -524289) | 2048, privateScope, parser.tokenValue, parseIdentifier(parser, context), 0, canAssign, 1, start); +} +function parseAsyncArrowOrCallExpression(parser, context, privateScope, callee, canAssign, kind, origin, flags, start) { + nextToken(parser, context | 32); + const scope = parser.createScopeIfLexical()?.createChildScope(512); + context = (context | 131072) ^ 131072; + if (consumeOpt(parser, context, 16)) { + if (parser.getToken() === 10) { + if (flags & 1) + parser.report(48); + return parseParenthesizedArrow(parser, context, scope, privateScope, [], canAssign, 1, start); + } + return parser.finishNode({ + type: 'CallExpression', + callee, + arguments: [], + optional: false, + }, start); + } + let destructible = 0; + let expr = null; + let isNonSimpleParameterList = 0; + parser.destructible = + (parser.destructible | 256 | 128) ^ + (256 | 128); + const params = []; + while (parser.getToken() !== 16) { + const { tokenStart } = parser; + const token = parser.getToken(); + if (token & 143360) { + scope?.addBlockName(context, parser.tokenValue, kind, 0); + if ((token & 537079808) === 537079808) { + parser.flags |= 512; + } + else if ((token & 36864) === 36864) { + parser.flags |= 256; + } + expr = parsePrimaryExpression(parser, context, privateScope, kind, 0, 1, 1, 1, tokenStart); + if (parser.getToken() === 16 || parser.getToken() === 18) { + if (parser.assignable & 2) { + destructible |= 16; + isNonSimpleParameterList = 1; + } + } + else { + if (parser.getToken() === 1077936155) { + isNonSimpleParameterList = 1; + } + else { + destructible |= 16; + } + expr = parseMemberOrUpdateExpression(parser, context, privateScope, expr, 1, 0, tokenStart); + if (parser.getToken() !== 16 && parser.getToken() !== 18) { + expr = parseAssignmentExpression(parser, context, privateScope, 1, 0, tokenStart, expr); + } + } + } + else if (token & 2097152) { + expr = + token === 2162700 + ? parseObjectLiteralOrPattern(parser, context, scope, privateScope, 0, 1, 0, kind, origin) + : parseArrayExpressionOrPattern(parser, context, scope, privateScope, 0, 1, 0, kind, origin); + destructible |= parser.destructible; + isNonSimpleParameterList = 1; + if (parser.getToken() !== 16 && parser.getToken() !== 18) { + if (destructible & 8) + parser.report(122); + expr = parseMemberOrUpdateExpression(parser, context, privateScope, expr, 0, 0, tokenStart); + destructible |= 16; + if ((parser.getToken() & 8388608) === 8388608) { + expr = parseBinaryExpression(parser, context, privateScope, 1, start, 4, token, expr); + } + if (consumeOpt(parser, context | 32, 22)) { + expr = parseConditionalExpression(parser, context, privateScope, expr, start); + } + } + } + else if (token === 14) { + expr = parseSpreadOrRestElement(parser, context, scope, privateScope, 16, kind, origin, 1, 1, 0); + destructible |= + (parser.getToken() === 16 ? 0 : 16) | parser.destructible; + isNonSimpleParameterList = 1; + } + else { + expr = parseExpression(parser, context, privateScope, 1, 0, tokenStart); + destructible = parser.assignable; + params.push(expr); + while (consumeOpt(parser, context | 32, 18)) { + params.push(parseExpression(parser, context, privateScope, 1, 0, tokenStart)); + } + destructible |= parser.assignable; + consume(parser, context, 16); + parser.destructible = destructible | 16; + parser.assignable = 2; + return parser.finishNode({ + type: 'CallExpression', + callee, + arguments: params, + optional: false, + }, start); + } + params.push(expr); + if (!consumeOpt(parser, context | 32, 18)) + break; + } + consume(parser, context, 16); + destructible |= + parser.destructible & 256 + ? 256 + : 0 | (parser.destructible & 128) + ? 128 + : 0; + if (parser.getToken() === 10) { + if (destructible & (32 | 16)) + parser.report(27); + if (parser.flags & 1 || flags & 1) + parser.report(48); + if (destructible & 128) + parser.report(31); + if (context & (1 | 1024) && destructible & 256) + parser.report(32); + if (isNonSimpleParameterList) + parser.flags |= 128; + return parseParenthesizedArrow(parser, context | 2048, scope, privateScope, params, canAssign, 1, start); + } + if (destructible & 64) { + parser.report(63); + } + if (destructible & 8) { + parser.report(62); + } + parser.assignable = 2; + return parser.finishNode({ + type: 'CallExpression', + callee, + arguments: params, + optional: false, + }, start); +} +function parseRegExpLiteral(parser, context) { + const { tokenRaw, tokenRegExp, tokenValue, tokenStart } = parser; + nextToken(parser, context); + parser.assignable = 2; + const node = { + type: 'Literal', + value: tokenValue, + regex: tokenRegExp, + }; + if (parser.options.raw) { + node.raw = tokenRaw; + } + return parser.finishNode(node, tokenStart); +} +function parseClassDeclaration(parser, context, scope, privateScope, flags) { + let start; + let decorators; + if (parser.leadingDecorators.decorators.length) { + if (parser.getToken() === 132) { + parser.report(30, '@'); + } + start = parser.leadingDecorators.start; + decorators = [...parser.leadingDecorators.decorators]; + parser.leadingDecorators.decorators.length = 0; + } + else { + start = parser.tokenStart; + decorators = parseDecorators(parser, context, privateScope); + } + context = (context | 16384 | 1) ^ 16384; + nextToken(parser, context); + let id = null; + let superClass = null; + const { tokenValue } = parser; + if (parser.getToken() & 4096 && parser.getToken() !== 20565) { + if (isStrictReservedWord(parser, context, parser.getToken())) { + parser.report(118); + } + if ((parser.getToken() & 537079808) === 537079808) { + parser.report(119); + } + if (scope) { + scope.addBlockName(context, tokenValue, 32, 0); + if (flags) { + if (flags & 2) { + parser.declareUnboundVariable(tokenValue); + } + } + } + id = parseIdentifier(parser, context); + } + else { + if ((flags & 1) === 0) + parser.report(39, 'Class'); + } + let inheritedContext = context; + if (consumeOpt(parser, context | 32, 20565)) { + superClass = parseLeftHandSideExpression(parser, context, privateScope, 0, 0, 0); + inheritedContext |= 512; + } + else { + inheritedContext = (inheritedContext | 512) ^ 512; + } + const body = parseClassBody(parser, inheritedContext, context, scope, privateScope, 2, 8, 0); + return parser.finishNode({ + type: 'ClassDeclaration', + id, + superClass, + body, + ...(parser.options.next ? { decorators } : null), + }, start); +} +function parseClassExpression(parser, context, privateScope, inGroup, start) { + let id = null; + let superClass = null; + const decorators = parseDecorators(parser, context, privateScope); + context = (context | 1 | 16384) ^ 16384; + nextToken(parser, context); + if (parser.getToken() & 4096 && parser.getToken() !== 20565) { + if (isStrictReservedWord(parser, context, parser.getToken())) + parser.report(118); + if ((parser.getToken() & 537079808) === 537079808) { + parser.report(119); + } + id = parseIdentifier(parser, context); + } + let inheritedContext = context; + if (consumeOpt(parser, context | 32, 20565)) { + superClass = parseLeftHandSideExpression(parser, context, privateScope, 0, inGroup, 0); + inheritedContext |= 512; + } + else { + inheritedContext = (inheritedContext | 512) ^ 512; + } + const body = parseClassBody(parser, inheritedContext, context, void 0, privateScope, 2, 0, inGroup); + parser.assignable = 2; + return parser.finishNode({ + type: 'ClassExpression', + id, + superClass, + body, + ...(parser.options.next ? { decorators } : null), + }, start); +} +function parseDecorators(parser, context, privateScope) { + const list = []; + if (parser.options.next) { + while (parser.getToken() === 132) { + list.push(parseDecoratorList(parser, context, privateScope)); + } + } + return list; +} +function parseDecoratorList(parser, context, privateScope) { + const start = parser.tokenStart; + nextToken(parser, context | 32); + let expression = parsePrimaryExpression(parser, context, privateScope, 2, 0, 1, 0, 1, start); + expression = parseMemberOrUpdateExpression(parser, context, privateScope, expression, 0, 0, parser.tokenStart); + return parser.finishNode({ + type: 'Decorator', + expression, + }, start); +} +function parseClassBody(parser, context, inheritedContext, scope, parentScope, kind, origin, inGroup) { + const { tokenStart } = parser; + const privateScope = parser.createPrivateScopeIfLexical(parentScope); + consume(parser, context | 32, 2162700); + const modifierFlags = 131072 | 524288; + context = (context | modifierFlags) ^ modifierFlags; + const hasConstr = parser.flags & 32; + parser.flags = (parser.flags | 32) ^ 32; + const body = []; + while (parser.getToken() !== 1074790415) { + const decoratorStart = parser.tokenStart; + const decorators = parseDecorators(parser, context, privateScope); + if (decorators.length > 0 && parser.tokenValue === 'constructor') { + parser.report(109); + } + if (parser.getToken() === 1074790415) + parser.report(108); + if (consumeOpt(parser, context, 1074790417)) { + if (decorators.length > 0) + parser.report(120); + continue; + } + body.push(parseClassElementList(parser, context, scope, privateScope, inheritedContext, kind, decorators, 0, inGroup, decorators.length > 0 ? decoratorStart : parser.tokenStart)); + } + consume(parser, origin & 8 ? context | 32 : context, 1074790415); + privateScope?.validatePrivateIdentifierRefs(); + parser.flags = (parser.flags & -33) | hasConstr; + return parser.finishNode({ + type: 'ClassBody', + body, + }, tokenStart); +} +function parseClassElementList(parser, context, scope, privateScope, inheritedContext, type, decorators, isStatic, inGroup, start) { + let kind = isStatic ? 32 : 0; + let key = null; + const token = parser.getToken(); + if (token & (143360 | 36864) || token === -2147483528) { + key = parseIdentifier(parser, context); + switch (token) { + case 36970: + if (!isStatic && + parser.getToken() !== 67174411 && + (parser.getToken() & 1048576) !== 1048576 && + parser.getToken() !== 1077936155) { + return parseClassElementList(parser, context, scope, privateScope, inheritedContext, type, decorators, 1, inGroup, start); + } + break; + case 209005: + if (parser.getToken() !== 67174411 && (parser.flags & 1) === 0) { + if ((parser.getToken() & 1073741824) === 1073741824) { + return parsePropertyDefinition(parser, context, privateScope, key, kind, decorators, start); + } + kind |= 16 | (optionalBit(parser, context, 8391476) ? 8 : 0); + } + break; + case 209008: + if (parser.getToken() !== 67174411) { + if ((parser.getToken() & 1073741824) === 1073741824) { + return parsePropertyDefinition(parser, context, privateScope, key, kind, decorators, start); + } + kind |= 256; + } + break; + case 209009: + if (parser.getToken() !== 67174411) { + if ((parser.getToken() & 1073741824) === 1073741824) { + return parsePropertyDefinition(parser, context, privateScope, key, kind, decorators, start); + } + kind |= 512; + } + break; + case 12402: + if (parser.getToken() !== 67174411 && (parser.flags & 1) === 0) { + if ((parser.getToken() & 1073741824) === 1073741824) { + return parsePropertyDefinition(parser, context, privateScope, key, kind, decorators, start); + } + if (parser.options.next) + kind |= 1024; + } + break; + } + } + else if (token === 69271571) { + kind |= 2; + key = parseComputedPropertyName(parser, inheritedContext, privateScope, inGroup); + } + else if ((token & 134217728) === 134217728) { + key = parseLiteral(parser, context); + } + else if (token === 8391476) { + kind |= 8; + nextToken(parser, context); + } + else if (parser.getToken() === 130) { + kind |= 8192; + key = parsePrivateIdentifier(parser, context | 16, privateScope, 768); + } + else if ((parser.getToken() & 1073741824) === 1073741824) { + kind |= 128; + } + else if (isStatic && token === 2162700) { + return parseStaticBlock(parser, context | 16, scope, privateScope, start); + } + else if (token === -2147483527) { + key = parseIdentifier(parser, context); + if (parser.getToken() !== 67174411) + parser.report(30, KeywordDescTable[parser.getToken() & 255]); + } + else { + parser.report(30, KeywordDescTable[parser.getToken() & 255]); + } + if (kind & (8 | 16 | 768 | 1024)) { + if (parser.getToken() & 143360 || + parser.getToken() === -2147483528 || + parser.getToken() === -2147483527) { + key = parseIdentifier(parser, context); + } + else if ((parser.getToken() & 134217728) === 134217728) { + key = parseLiteral(parser, context); + } + else if (parser.getToken() === 69271571) { + kind |= 2; + key = parseComputedPropertyName(parser, context, privateScope, 0); + } + else if (parser.getToken() === 130) { + kind |= 8192; + key = parsePrivateIdentifier(parser, context, privateScope, kind); + } + else + parser.report(135); + } + if ((kind & 2) === 0) { + if (parser.tokenValue === 'constructor') { + if ((parser.getToken() & 1073741824) === 1073741824) { + parser.report(129); + } + else if ((kind & 32) === 0 && parser.getToken() === 67174411) { + if (kind & (768 | 16 | 128 | 8)) { + parser.report(53, 'accessor'); + } + else if ((context & 512) === 0) { + if (parser.flags & 32) + parser.report(54); + else + parser.flags |= 32; + } + } + kind |= 64; + } + else if ((kind & 8192) === 0 && + kind & 32 && + parser.tokenValue === 'prototype') { + parser.report(52); + } + } + if (kind & 1024 || (parser.getToken() !== 67174411 && (kind & 768) === 0)) { + return parsePropertyDefinition(parser, context, privateScope, key, kind, decorators, start); + } + const value = parseMethodDefinition(parser, context | 16, privateScope, kind, inGroup, parser.tokenStart); + return parser.finishNode({ + type: 'MethodDefinition', + kind: (kind & 32) === 0 && kind & 64 + ? 'constructor' + : kind & 256 + ? 'get' + : kind & 512 + ? 'set' + : 'method', + static: (kind & 32) > 0, + computed: (kind & 2) > 0, + key, + value, + ...(parser.options.next ? { decorators } : null), + }, start); +} +function parsePrivateIdentifier(parser, context, privateScope, kind) { + const { tokenStart } = parser; + nextToken(parser, context); + const { tokenValue } = parser; + if (tokenValue === 'constructor') + parser.report(128); + if (parser.options.lexical) { + if (!privateScope) + parser.report(4, tokenValue); + if (kind) { + privateScope.addPrivateIdentifier(tokenValue, kind); + } + else { + privateScope.addPrivateIdentifierRef(tokenValue); + } + } + nextToken(parser, context); + return parser.finishNode({ + type: 'PrivateIdentifier', + name: tokenValue, + }, tokenStart); +} +function parsePropertyDefinition(parser, context, privateScope, key, state, decorators, start) { + let value = null; + if (state & 8) + parser.report(0); + if (parser.getToken() === 1077936155) { + nextToken(parser, context | 32); + const { tokenStart } = parser; + if (parser.getToken() === 537079927) + parser.report(119); + const modifierFlags = 1024 | + 2048 | + 8192 | + ((state & 64) === 0 ? 512 | 16384 : 0); + context = + ((context | modifierFlags) ^ modifierFlags) | + (state & 8 ? 1024 : 0) | + (state & 16 ? 2048 : 0) | + (state & 64 ? 16384 : 0) | + 256 | + 65536; + value = parsePrimaryExpression(parser, context | 16, privateScope, 2, 0, 1, 0, 1, tokenStart); + if ((parser.getToken() & 1073741824) !== 1073741824 || + (parser.getToken() & 4194304) === 4194304) { + value = parseMemberOrUpdateExpression(parser, context | 16, privateScope, value, 0, 0, tokenStart); + value = parseAssignmentExpression(parser, context | 16, privateScope, 0, 0, tokenStart, value); + } + } + matchOrInsertSemicolon(parser, context); + return parser.finishNode({ + type: state & 1024 ? 'AccessorProperty' : 'PropertyDefinition', + key, + value, + static: (state & 32) > 0, + computed: (state & 2) > 0, + ...(parser.options.next ? { decorators } : null), + }, start); +} +function parseBindingPattern(parser, context, scope, privateScope, type, origin) { + if (parser.getToken() & 143360 || + ((context & 1) === 0 && parser.getToken() === -2147483527)) + return parseAndClassifyIdentifier(parser, context, scope, type, origin); + if ((parser.getToken() & 2097152) !== 2097152) + parser.report(30, KeywordDescTable[parser.getToken() & 255]); + const left = parser.getToken() === 69271571 + ? parseArrayExpressionOrPattern(parser, context, scope, privateScope, 1, 0, 1, type, origin) + : parseObjectLiteralOrPattern(parser, context, scope, privateScope, 1, 0, 1, type, origin); + if (parser.destructible & 16) + parser.report(50); + if (parser.destructible & 32) + parser.report(50); + return left; +} +function parseAndClassifyIdentifier(parser, context, scope, kind, origin) { + const token = parser.getToken(); + if (context & 1) { + if ((token & 537079808) === 537079808) { + parser.report(119); + } + else if ((token & 36864) === 36864 || token === -2147483527) { + parser.report(118); + } + } + if ((token & 20480) === 20480) { + parser.report(102); + } + if (token === 241771) { + if (context & 1024) + parser.report(32); + if (context & 2) + parser.report(111); + } + if ((token & 255) === (241737 & 255)) { + if (kind & (8 | 16)) + parser.report(100); + } + if (token === 209006) { + if (context & 2048) + parser.report(176); + if (context & 2) + parser.report(110); + } + const { tokenValue, tokenStart: start } = parser; + nextToken(parser, context); + scope?.addVarOrBlock(context, tokenValue, kind, origin); + return parser.finishNode({ + type: 'Identifier', + name: tokenValue, + }, start); +} +function parseJSXRootElementOrFragment(parser, context, privateScope, inJSXChild, start) { + if (!inJSXChild) + consume(parser, context, 8456256); + if (parser.getToken() === 8390721) { + const openingFragment = parseJSXOpeningFragment(parser, start); + const [children, closingFragment] = parseJSXChildrenAndClosingFragment(parser, context, privateScope, inJSXChild); + return parser.finishNode({ + type: 'JSXFragment', + openingFragment, + children, + closingFragment, + }, start); + } + if (parser.getToken() === 8457014) + parser.report(30, KeywordDescTable[parser.getToken() & 255]); + let closingElement = null; + let children = []; + const openingElement = parseJSXOpeningElementOrSelfCloseElement(parser, context, privateScope, inJSXChild, start); + if (!openingElement.selfClosing) { + [children, closingElement] = parseJSXChildrenAndClosingElement(parser, context, privateScope, inJSXChild); + const close = isEqualTagName(closingElement.name); + if (isEqualTagName(openingElement.name) !== close) + parser.report(155, close); + } + return parser.finishNode({ + type: 'JSXElement', + children, + openingElement, + closingElement, + }, start); +} +function parseJSXOpeningFragment(parser, start) { + nextJSXToken(parser); + return parser.finishNode({ + type: 'JSXOpeningFragment', + }, start); +} +function parseJSXClosingElement(parser, context, inJSXChild, start) { + consume(parser, context, 8457014); + const name = parseJSXElementName(parser, context); + if (parser.getToken() !== 8390721) { + parser.report(25, KeywordDescTable[8390721 & 255]); + } + if (inJSXChild) { + nextJSXToken(parser); + } + else { + nextToken(parser, context); + } + return parser.finishNode({ + type: 'JSXClosingElement', + name, + }, start); +} +function parseJSXClosingFragment(parser, context, inJSXChild, start) { + consume(parser, context, 8457014); + if (parser.getToken() !== 8390721) { + parser.report(25, KeywordDescTable[8390721 & 255]); + } + if (inJSXChild) { + nextJSXToken(parser); + } + else { + nextToken(parser, context); + } + return parser.finishNode({ + type: 'JSXClosingFragment', + }, start); +} +function parseJSXChildrenAndClosingElement(parser, context, privateScope, inJSXChild) { + const children = []; + while (true) { + const child = parseJSXChildOrClosingElement(parser, context, privateScope, inJSXChild); + if (child.type === 'JSXClosingElement') { + return [children, child]; + } + children.push(child); + } +} +function parseJSXChildrenAndClosingFragment(parser, context, privateScope, inJSXChild) { + const children = []; + while (true) { + const child = parseJSXChildOrClosingFragment(parser, context, privateScope, inJSXChild); + if (child.type === 'JSXClosingFragment') { + return [children, child]; + } + children.push(child); + } +} +function parseJSXChildOrClosingElement(parser, context, privateScope, inJSXChild) { + if (parser.getToken() === 137) + return parseJSXText(parser, context); + if (parser.getToken() === 2162700) + return parseJSXExpressionContainer(parser, context, privateScope, 1, 0); + if (parser.getToken() === 8456256) { + const { tokenStart } = parser; + nextToken(parser, context); + if (parser.getToken() === 8457014) + return parseJSXClosingElement(parser, context, inJSXChild, tokenStart); + return parseJSXRootElementOrFragment(parser, context, privateScope, 1, tokenStart); + } + parser.report(0); +} +function parseJSXChildOrClosingFragment(parser, context, privateScope, inJSXChild) { + if (parser.getToken() === 137) + return parseJSXText(parser, context); + if (parser.getToken() === 2162700) + return parseJSXExpressionContainer(parser, context, privateScope, 1, 0); + if (parser.getToken() === 8456256) { + const { tokenStart } = parser; + nextToken(parser, context); + if (parser.getToken() === 8457014) + return parseJSXClosingFragment(parser, context, inJSXChild, tokenStart); + return parseJSXRootElementOrFragment(parser, context, privateScope, 1, tokenStart); + } + parser.report(0); +} +function parseJSXText(parser, context) { + const start = parser.tokenStart; + nextToken(parser, context); + const node = { + type: 'JSXText', + value: parser.tokenValue, + }; + if (parser.options.raw) { + node.raw = parser.tokenRaw; + } + return parser.finishNode(node, start); +} +function parseJSXOpeningElementOrSelfCloseElement(parser, context, privateScope, inJSXChild, start) { + if ((parser.getToken() & 143360) !== 143360 && + (parser.getToken() & 4096) !== 4096) + parser.report(0); + const tagName = parseJSXElementName(parser, context); + const attributes = parseJSXAttributes(parser, context, privateScope); + const selfClosing = parser.getToken() === 8457014; + if (selfClosing) + consume(parser, context, 8457014); + if (parser.getToken() !== 8390721) { + parser.report(25, KeywordDescTable[8390721 & 255]); + } + if (inJSXChild || !selfClosing) { + nextJSXToken(parser); + } + else { + nextToken(parser, context); + } + return parser.finishNode({ + type: 'JSXOpeningElement', + name: tagName, + attributes, + selfClosing, + }, start); +} +function parseJSXElementName(parser, context) { + const { tokenStart } = parser; + rescanJSXIdentifier(parser); + let key = parseJSXIdentifier(parser, context); + if (parser.getToken() === 21) + return parseJSXNamespacedName(parser, context, key, tokenStart); + while (consumeOpt(parser, context, 67108877)) { + rescanJSXIdentifier(parser); + key = parseJSXMemberExpression(parser, context, key, tokenStart); + } + return key; +} +function parseJSXMemberExpression(parser, context, object, start) { + const property = parseJSXIdentifier(parser, context); + return parser.finishNode({ + type: 'JSXMemberExpression', + object, + property, + }, start); +} +function parseJSXAttributes(parser, context, privateScope) { + const attributes = []; + while (parser.getToken() !== 8457014 && + parser.getToken() !== 8390721 && + parser.getToken() !== 1048576) { + attributes.push(parseJsxAttribute(parser, context, privateScope)); + } + return attributes; +} +function parseJSXSpreadAttribute(parser, context, privateScope) { + const start = parser.tokenStart; + nextToken(parser, context); + consume(parser, context, 14); + const expression = parseExpression(parser, context, privateScope, 1, 0, parser.tokenStart); + consume(parser, context, 1074790415); + return parser.finishNode({ + type: 'JSXSpreadAttribute', + argument: expression, + }, start); +} +function parseJsxAttribute(parser, context, privateScope) { + const { tokenStart } = parser; + if (parser.getToken() === 2162700) + return parseJSXSpreadAttribute(parser, context, privateScope); + rescanJSXIdentifier(parser); + let value = null; + let name = parseJSXIdentifier(parser, context); + if (parser.getToken() === 21) { + name = parseJSXNamespacedName(parser, context, name, tokenStart); + } + if (parser.getToken() === 1077936155) { + const token = scanJSXAttributeValue(parser, context); + switch (token) { + case 134283267: + value = parseLiteral(parser, context); + break; + case 8456256: + value = parseJSXRootElementOrFragment(parser, context, privateScope, 0, parser.tokenStart); + break; + case 2162700: + value = parseJSXExpressionContainer(parser, context, privateScope, 0, 1); + break; + default: + parser.report(154); + } + } + return parser.finishNode({ + type: 'JSXAttribute', + value, + name, + }, tokenStart); +} +function parseJSXNamespacedName(parser, context, namespace, start) { + consume(parser, context, 21); + const name = parseJSXIdentifier(parser, context); + return parser.finishNode({ + type: 'JSXNamespacedName', + namespace, + name, + }, start); +} +function parseJSXExpressionContainer(parser, context, privateScope, inJSXChild, isAttr) { + const { tokenStart: start } = parser; + nextToken(parser, context | 32); + const { tokenStart } = parser; + if (parser.getToken() === 14) + return parseJSXSpreadChild(parser, context, privateScope, start); + let expression = null; + if (parser.getToken() === 1074790415) { + if (isAttr) + parser.report(157); + expression = parseJSXEmptyExpression(parser, { + index: parser.startIndex, + line: parser.startLine, + column: parser.startColumn, + }); + } + else { + expression = parseExpression(parser, context, privateScope, 1, 0, tokenStart); + } + if (parser.getToken() !== 1074790415) { + parser.report(25, KeywordDescTable[1074790415 & 255]); + } + if (inJSXChild) { + nextJSXToken(parser); + } + else { + nextToken(parser, context); + } + return parser.finishNode({ + type: 'JSXExpressionContainer', + expression, + }, start); +} +function parseJSXSpreadChild(parser, context, privateScope, start) { + consume(parser, context, 14); + const expression = parseExpression(parser, context, privateScope, 1, 0, parser.tokenStart); + consume(parser, context, 1074790415); + return parser.finishNode({ + type: 'JSXSpreadChild', + expression, + }, start); +} +function parseJSXEmptyExpression(parser, start) { + return parser.finishNode({ + type: 'JSXEmptyExpression', + }, start, parser.tokenStart); +} +function parseJSXIdentifier(parser, context) { + const start = parser.tokenStart; + if (!(parser.getToken() & 143360)) { + parser.report(30, KeywordDescTable[parser.getToken() & 255]); + } + const { tokenValue } = parser; + nextToken(parser, context); + return parser.finishNode({ + type: 'JSXIdentifier', + name: tokenValue, + }, start); +} + +var version$1 = "6.1.4"; + +const version = version$1; +function parseScript(source, options) { + return parseSource(source, options); +} +function parseModule(source, options) { + return parseSource(source, options, 1 | 2); +} +function parse(source, options) { + return parseSource(source, options); +} + +export { parse, parseModule, parseScript, version }; diff --git a/node_modules/meriyah/dist/meriyah.umd.js b/node_modules/meriyah/dist/meriyah.umd.js new file mode 100644 index 0000000..eeac5d8 --- /dev/null +++ b/node_modules/meriyah/dist/meriyah.umd.js @@ -0,0 +1,9210 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : + typeof define === 'function' && define.amd ? define(['exports'], factory) : + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.meriyah = {})); +})(this, (function (exports) { 'use strict'; + + const unicodeLookup = ((compressed, lookup) => { + const result = new Uint32Array(69632); + let index = 0; + let subIndex = 0; + while (index < 2571) { + const inst = compressed[index++]; + if (inst < 0) { + subIndex -= inst; + } + else { + let code = compressed[index++]; + if (inst & 2) + code = lookup[code]; + if (inst & 1) { + result.fill(code, subIndex, subIndex += compressed[index++]); + } + else { + result[subIndex++] = code; + } + } + } + return result; + })([-1, 2, 26, 2, 27, 2, 5, -1, 0, 77595648, 3, 44, 2, 3, 0, 14, 2, 63, 2, 64, 3, 0, 3, 0, 3168796671, 0, 4294956992, 2, 1, 2, 0, 2, 41, 3, 0, 4, 0, 4294966523, 3, 0, 4, 2, 16, 2, 65, 2, 0, 0, 4294836735, 0, 3221225471, 0, 4294901942, 2, 66, 0, 134152192, 3, 0, 2, 0, 4294951935, 3, 0, 2, 0, 2683305983, 0, 2684354047, 2, 18, 2, 0, 0, 4294961151, 3, 0, 2, 2, 19, 2, 0, 0, 608174079, 2, 0, 2, 60, 2, 7, 2, 6, 0, 4286611199, 3, 0, 2, 2, 1, 3, 0, 3, 0, 4294901711, 2, 40, 0, 4089839103, 0, 2961209759, 0, 1342439375, 0, 4294543342, 0, 3547201023, 0, 1577204103, 0, 4194240, 0, 4294688750, 2, 2, 0, 80831, 0, 4261478351, 0, 4294549486, 2, 2, 0, 2967484831, 0, 196559, 0, 3594373100, 0, 3288319768, 0, 8469959, 0, 65472, 2, 3, 0, 4093640191, 0, 660618719, 0, 65487, 0, 4294828015, 0, 4092591615, 0, 1616920031, 0, 982991, 2, 3, 2, 0, 0, 2163244511, 0, 4227923919, 0, 4236247022, 2, 71, 0, 4284449919, 0, 851904, 2, 4, 2, 12, 0, 67076095, -1, 2, 72, 0, 1073741743, 0, 4093607775, -1, 0, 50331649, 0, 3265266687, 2, 33, 0, 4294844415, 0, 4278190047, 2, 20, 2, 137, -1, 3, 0, 2, 2, 23, 2, 0, 2, 10, 2, 0, 2, 15, 2, 22, 3, 0, 10, 2, 74, 2, 0, 2, 75, 2, 76, 2, 77, 2, 0, 2, 78, 2, 0, 2, 11, 0, 261632, 2, 25, 3, 0, 2, 2, 13, 2, 4, 3, 0, 18, 2, 79, 2, 5, 3, 0, 2, 2, 80, 0, 2151677951, 2, 29, 2, 9, 0, 909311, 3, 0, 2, 0, 814743551, 2, 49, 0, 67090432, 3, 0, 2, 2, 42, 2, 0, 2, 6, 2, 0, 2, 30, 2, 8, 0, 268374015, 2, 110, 2, 51, 2, 0, 2, 81, 0, 134153215, -1, 2, 7, 2, 0, 2, 8, 0, 2684354559, 0, 67044351, 0, 3221160064, 2, 17, -1, 3, 0, 2, 2, 53, 0, 1046528, 3, 0, 3, 2, 9, 2, 0, 2, 54, 0, 4294960127, 2, 10, 2, 6, 2, 11, 0, 4294377472, 2, 12, 3, 0, 16, 2, 13, 2, 0, 2, 82, 2, 10, 2, 0, 2, 83, 2, 84, 2, 85, 0, 12288, 2, 55, 0, 1048577, 2, 86, 2, 14, -1, 2, 14, 0, 131042, 2, 87, 2, 88, 2, 89, 2, 0, 2, 34, -83, 3, 0, 7, 0, 1046559, 2, 0, 2, 15, 2, 0, 0, 2147516671, 2, 21, 3, 90, 2, 2, 0, -16, 2, 91, 0, 524222462, 2, 4, 2, 0, 0, 4269801471, 2, 4, 3, 0, 2, 2, 28, 2, 16, 3, 0, 2, 2, 17, 2, 0, -1, 2, 18, -16, 3, 0, 206, -2, 3, 0, 692, 2, 73, -1, 2, 18, 2, 10, 3, 0, 8, 2, 93, 2, 133, 2, 0, 0, 3220242431, 3, 0, 3, 2, 19, 2, 94, 2, 95, 3, 0, 2, 2, 96, 2, 0, 2, 97, 2, 46, 2, 0, 0, 4351, 2, 0, 2, 9, 3, 0, 2, 0, 67043391, 0, 3909091327, 2, 0, 2, 24, 2, 9, 2, 20, 3, 0, 2, 0, 67076097, 2, 8, 2, 0, 2, 21, 0, 67059711, 0, 4236247039, 3, 0, 2, 0, 939524103, 0, 8191999, 2, 101, 2, 102, 2, 22, 2, 23, 3, 0, 3, 0, 67057663, 3, 0, 349, 2, 103, 2, 104, 2, 7, -264, 3, 0, 11, 2, 24, 3, 0, 2, 2, 32, -1, 0, 3774349439, 2, 105, 2, 106, 3, 0, 2, 2, 19, 2, 107, 3, 0, 10, 2, 10, 2, 18, 2, 0, 2, 47, 2, 0, 2, 31, 2, 108, 2, 25, 0, 1638399, 0, 57344, 2, 109, 3, 0, 3, 2, 20, 2, 26, 2, 27, 2, 5, 2, 28, 2, 0, 2, 8, 2, 111, -1, 2, 112, 2, 113, 2, 114, -1, 3, 0, 3, 2, 12, -2, 2, 0, 2, 29, -3, 0, 536870912, -4, 2, 20, 2, 0, 2, 36, 0, 1, 2, 0, 2, 67, 2, 6, 2, 12, 2, 10, 2, 0, 2, 115, -1, 3, 0, 4, 2, 10, 2, 23, 2, 116, 2, 7, 2, 0, 2, 117, 2, 0, 2, 118, 2, 119, 2, 120, 2, 0, 2, 9, 3, 0, 9, 2, 21, 2, 30, 2, 31, 2, 121, 2, 122, -2, 2, 123, 2, 124, 2, 30, 2, 21, 2, 8, -2, 2, 125, 2, 30, 2, 32, -2, 2, 0, 2, 39, -2, 0, 4277137519, 0, 2269118463, -1, 3, 20, 2, -1, 2, 33, 2, 38, 2, 0, 3, 30, 2, 2, 35, 2, 19, -3, 3, 0, 2, 2, 34, -1, 2, 0, 2, 35, 2, 0, 2, 35, 2, 0, 2, 48, 2, 0, 0, 4294950463, 2, 37, -7, 2, 0, 0, 203775, 2, 57, 0, 4026531840, 2, 20, 2, 43, 2, 36, 2, 18, 2, 37, 2, 18, 2, 126, 2, 21, 3, 0, 2, 2, 38, 0, 2151677888, 2, 0, 2, 12, 0, 4294901764, 2, 144, 2, 0, 2, 58, 2, 56, 0, 5242879, 3, 0, 2, 0, 402644511, -1, 2, 128, 2, 39, 0, 3, -1, 2, 129, 2, 130, 2, 0, 0, 67045375, 2, 40, 0, 4226678271, 0, 3766565279, 0, 2039759, 2, 132, 2, 41, 0, 1046437, 0, 6, 3, 0, 2, 0, 3288270847, 0, 3, 3, 0, 2, 0, 67043519, -5, 2, 0, 0, 4282384383, 0, 1056964609, -1, 3, 0, 2, 0, 67043345, -1, 2, 0, 2, 42, 2, 23, 2, 50, 2, 11, 2, 61, 2, 38, -5, 2, 0, 2, 12, -3, 3, 0, 2, 0, 2147484671, 2, 134, 0, 4190109695, 2, 52, -2, 2, 135, 0, 4244635647, 0, 27, 2, 0, 2, 8, 2, 43, 2, 0, 2, 68, 2, 18, 2, 0, 2, 42, -6, 2, 0, 2, 45, 2, 59, 2, 44, 2, 45, 2, 46, 2, 47, 0, 8388351, -2, 2, 136, 0, 3028287487, 2, 48, 2, 138, 0, 33259519, 2, 49, -9, 2, 21, 0, 4294836223, 0, 3355443199, 0, 134152199, -2, 2, 69, -2, 3, 0, 28, 2, 32, -3, 3, 0, 3, 2, 17, 3, 0, 6, 2, 50, -81, 2, 18, 3, 0, 2, 2, 36, 3, 0, 33, 2, 25, 2, 30, 3, 0, 124, 2, 12, 3, 0, 18, 2, 38, -213, 2, 0, 2, 32, -54, 3, 0, 17, 2, 42, 2, 8, 2, 23, 2, 0, 2, 8, 2, 23, 2, 51, 2, 0, 2, 21, 2, 52, 2, 139, 2, 25, -13, 2, 0, 2, 53, -6, 3, 0, 2, -4, 3, 0, 2, 0, 4294936575, 2, 0, 0, 4294934783, -2, 0, 196635, 3, 0, 191, 2, 54, 3, 0, 38, 2, 30, 2, 55, 2, 34, -278, 2, 140, 3, 0, 9, 2, 141, 2, 142, 2, 56, 3, 0, 11, 2, 7, -72, 3, 0, 3, 2, 143, 0, 1677656575, -130, 2, 26, -16, 2, 0, 2, 24, 2, 38, -16, 0, 4161266656, 0, 4071, 0, 15360, -4, 2, 57, -13, 3, 0, 2, 2, 58, 2, 0, 2, 145, 2, 146, 2, 62, 2, 0, 2, 147, 2, 148, 2, 149, 3, 0, 10, 2, 150, 2, 151, 2, 22, 3, 58, 2, 3, 152, 2, 3, 59, 2, 0, 4294954999, 2, 0, -16, 2, 0, 2, 92, 2, 0, 0, 2105343, 0, 4160749584, 0, 65534, -34, 2, 8, 2, 154, -6, 0, 4194303871, 0, 4294903771, 2, 0, 2, 60, 2, 100, -3, 2, 0, 0, 1073684479, 0, 17407, -9, 2, 18, 2, 17, 2, 0, 2, 32, -14, 2, 18, 2, 32, -6, 2, 18, 2, 12, -15, 2, 155, 3, 0, 6, 0, 8323103, -1, 3, 0, 2, 2, 61, -37, 2, 62, 2, 156, 2, 157, 2, 158, 2, 159, 2, 160, -105, 2, 26, -32, 3, 0, 1335, -1, 3, 0, 129, 2, 32, 3, 0, 6, 2, 10, 3, 0, 180, 2, 161, 3, 0, 233, 2, 162, 3, 0, 18, 2, 10, -77, 3, 0, 16, 2, 10, -47, 3, 0, 154, 2, 6, 3, 0, 130, 2, 25, -22250, 3, 0, 7, 2, 25, -6130, 3, 5, 2, -1, 0, 69207040, 3, 44, 2, 3, 0, 14, 2, 63, 2, 64, -3, 0, 3168731136, 0, 4294956864, 2, 1, 2, 0, 2, 41, 3, 0, 4, 0, 4294966275, 3, 0, 4, 2, 16, 2, 65, 2, 0, 2, 34, -1, 2, 18, 2, 66, -1, 2, 0, 0, 2047, 0, 4294885376, 3, 0, 2, 0, 3145727, 0, 2617294944, 0, 4294770688, 2, 25, 2, 67, 3, 0, 2, 0, 131135, 2, 98, 0, 70256639, 0, 71303167, 0, 272, 2, 42, 2, 6, 0, 32511, 2, 0, 2, 49, -1, 2, 99, 2, 68, 0, 4278255616, 0, 4294836227, 0, 4294549473, 0, 600178175, 0, 2952806400, 0, 268632067, 0, 4294543328, 0, 57540095, 0, 1577058304, 0, 1835008, 0, 4294688736, 2, 70, 2, 69, 0, 33554435, 2, 131, 2, 70, 0, 2952790016, 0, 131075, 0, 3594373096, 0, 67094296, 2, 69, -1, 0, 4294828000, 0, 603979263, 0, 654311424, 0, 3, 0, 4294828001, 0, 602930687, 0, 1610612736, 0, 393219, 0, 4294828016, 0, 671088639, 0, 2154840064, 0, 4227858435, 0, 4236247008, 2, 71, 2, 38, -1, 2, 4, 0, 917503, 2, 38, -1, 2, 72, 0, 537788335, 0, 4026531935, -1, 0, 1, -1, 2, 33, 2, 73, 0, 7936, -3, 2, 0, 0, 2147485695, 0, 1010761728, 0, 4292984930, 0, 16387, 2, 0, 2, 15, 2, 22, 3, 0, 10, 2, 74, 2, 0, 2, 75, 2, 76, 2, 77, 2, 0, 2, 78, 2, 0, 2, 12, -1, 2, 25, 3, 0, 2, 2, 13, 2, 4, 3, 0, 18, 2, 79, 2, 5, 3, 0, 2, 2, 80, 0, 2147745791, 3, 19, 2, 0, 122879, 2, 0, 2, 9, 0, 276824064, -2, 3, 0, 2, 2, 42, 2, 0, 0, 4294903295, 2, 0, 2, 30, 2, 8, -1, 2, 18, 2, 51, 2, 0, 2, 81, 2, 49, -1, 2, 21, 2, 0, 2, 29, -2, 0, 128, -2, 2, 28, 2, 9, 0, 8160, -1, 2, 127, 0, 4227907585, 2, 0, 2, 37, 2, 0, 2, 50, 0, 4227915776, 2, 10, 2, 6, 2, 11, -1, 0, 74440192, 3, 0, 6, -2, 3, 0, 8, 2, 13, 2, 0, 2, 82, 2, 10, 2, 0, 2, 83, 2, 84, 2, 85, -3, 2, 86, 2, 14, -3, 2, 87, 2, 88, 2, 89, 2, 0, 2, 34, -83, 3, 0, 7, 0, 817183, 2, 0, 2, 15, 2, 0, 0, 33023, 2, 21, 3, 90, 2, -17, 2, 91, 0, 524157950, 2, 4, 2, 0, 2, 92, 2, 4, 2, 0, 2, 22, 2, 28, 2, 16, 3, 0, 2, 2, 17, 2, 0, -1, 2, 18, -16, 3, 0, 206, -2, 3, 0, 692, 2, 73, -1, 2, 18, 2, 10, 3, 0, 8, 2, 93, 0, 3072, 2, 0, 0, 2147516415, 2, 10, 3, 0, 2, 2, 25, 2, 94, 2, 95, 3, 0, 2, 2, 96, 2, 0, 2, 97, 2, 46, 0, 4294965179, 0, 7, 2, 0, 2, 9, 2, 95, 2, 9, -1, 0, 1761345536, 2, 98, 0, 4294901823, 2, 38, 2, 20, 2, 99, 2, 35, 2, 100, 0, 2080440287, 2, 0, 2, 34, 2, 153, 0, 3296722943, 2, 0, 0, 1046675455, 0, 939524101, 0, 1837055, 2, 101, 2, 102, 2, 22, 2, 23, 3, 0, 3, 0, 7, 3, 0, 349, 2, 103, 2, 104, 2, 7, -264, 3, 0, 11, 2, 24, 3, 0, 2, 2, 32, -1, 0, 2700607615, 2, 105, 2, 106, 3, 0, 2, 2, 19, 2, 107, 3, 0, 10, 2, 10, 2, 18, 2, 0, 2, 47, 2, 0, 2, 31, 2, 108, -3, 2, 109, 3, 0, 3, 2, 20, -1, 3, 5, 2, 2, 110, 2, 0, 2, 8, 2, 111, -1, 2, 112, 2, 113, 2, 114, -1, 3, 0, 3, 2, 12, -2, 2, 0, 2, 29, -8, 2, 20, 2, 0, 2, 36, -1, 2, 0, 2, 67, 2, 6, 2, 30, 2, 10, 2, 0, 2, 115, -1, 3, 0, 4, 2, 10, 2, 18, 2, 116, 2, 7, 2, 0, 2, 117, 2, 0, 2, 118, 2, 119, 2, 120, 2, 0, 2, 9, 3, 0, 9, 2, 21, 2, 30, 2, 31, 2, 121, 2, 122, -2, 2, 123, 2, 124, 2, 30, 2, 21, 2, 8, -2, 2, 125, 2, 30, 2, 32, -2, 2, 0, 2, 39, -2, 0, 4277075969, 2, 30, -1, 3, 20, 2, -1, 2, 33, 2, 126, 2, 0, 3, 30, 2, 2, 35, 2, 19, -3, 3, 0, 2, 2, 34, -1, 2, 0, 2, 35, 2, 0, 2, 35, 2, 0, 2, 50, 2, 98, 0, 4294934591, 2, 37, -7, 2, 0, 0, 197631, 2, 57, -1, 2, 20, 2, 43, 2, 37, 2, 18, 0, 3, 2, 18, 2, 126, 2, 21, 2, 127, 2, 54, -1, 0, 2490368, 2, 127, 2, 25, 2, 18, 2, 34, 2, 127, 2, 38, 0, 4294901904, 0, 4718591, 2, 127, 2, 35, 0, 335544350, -1, 2, 128, 0, 2147487743, 0, 1, -1, 2, 129, 2, 130, 2, 8, -1, 2, 131, 2, 70, 0, 3758161920, 0, 3, 2, 132, 0, 12582911, 0, 655360, -1, 2, 0, 2, 29, 0, 2147485568, 0, 3, 2, 0, 2, 25, 0, 176, -5, 2, 0, 2, 17, 0, 251658240, -1, 2, 0, 2, 25, 0, 16, -1, 2, 0, 0, 16779263, -2, 2, 12, -1, 2, 38, -5, 2, 0, 2, 133, -3, 3, 0, 2, 2, 55, 2, 134, 0, 2147549183, 0, 2, -2, 2, 135, 2, 36, 0, 10, 0, 4294965249, 0, 67633151, 0, 4026597376, 2, 0, 0, 536871935, 2, 18, 2, 0, 2, 42, -6, 2, 0, 0, 1, 2, 59, 2, 17, 0, 1, 2, 46, 2, 25, -3, 2, 136, 2, 36, 2, 137, 2, 138, 0, 16778239, -10, 2, 35, 0, 4294836212, 2, 9, -3, 2, 69, -2, 3, 0, 28, 2, 32, -3, 3, 0, 3, 2, 17, 3, 0, 6, 2, 50, -81, 2, 18, 3, 0, 2, 2, 36, 3, 0, 33, 2, 25, 0, 126, 3, 0, 124, 2, 12, 3, 0, 18, 2, 38, -213, 2, 10, -55, 3, 0, 17, 2, 42, 2, 8, 2, 18, 2, 0, 2, 8, 2, 18, 2, 60, 2, 0, 2, 25, 2, 50, 2, 139, 2, 25, -13, 2, 0, 2, 73, -6, 3, 0, 2, -4, 3, 0, 2, 0, 67583, -1, 2, 107, -2, 0, 11, 3, 0, 191, 2, 54, 3, 0, 38, 2, 30, 2, 55, 2, 34, -278, 2, 140, 3, 0, 9, 2, 141, 2, 142, 2, 56, 3, 0, 11, 2, 7, -72, 3, 0, 3, 2, 143, 2, 144, -187, 3, 0, 2, 2, 58, 2, 0, 2, 145, 2, 146, 2, 62, 2, 0, 2, 147, 2, 148, 2, 149, 3, 0, 10, 2, 150, 2, 151, 2, 22, 3, 58, 2, 3, 152, 2, 3, 59, 2, 2, 153, -57, 2, 8, 2, 154, -7, 2, 18, 2, 0, 2, 60, -4, 2, 0, 0, 1065361407, 0, 16384, -9, 2, 18, 2, 60, 2, 0, 2, 133, -14, 2, 18, 2, 133, -6, 2, 18, 0, 81919, -15, 2, 155, 3, 0, 6, 2, 126, -1, 3, 0, 2, 0, 2063, -37, 2, 62, 2, 156, 2, 157, 2, 158, 2, 159, 2, 160, -138, 3, 0, 1335, -1, 3, 0, 129, 2, 32, 3, 0, 6, 2, 10, 3, 0, 180, 2, 161, 3, 0, 233, 2, 162, 3, 0, 18, 2, 10, -77, 3, 0, 16, 2, 10, -47, 3, 0, 154, 2, 6, 3, 0, 130, 2, 25, -28386], [4294967295, 4294967291, 4092460543, 4294828031, 4294967294, 134217726, 4294903807, 268435455, 2147483647, 1048575, 1073741823, 3892314111, 134217727, 1061158911, 536805376, 4294910143, 4294901759, 32767, 4294901760, 262143, 536870911, 8388607, 4160749567, 4294902783, 4294918143, 65535, 67043328, 2281701374, 4294967264, 2097151, 4194303, 255, 67108863, 4294967039, 511, 524287, 131071, 63, 127, 3238002687, 4294549487, 4290772991, 33554431, 4294901888, 4286578687, 67043329, 4294705152, 4294770687, 67043583, 1023, 15, 2047999, 67043343, 67051519, 16777215, 2147483648, 4294902000, 28, 4292870143, 4294966783, 16383, 67047423, 4294967279, 262083, 20511, 41943039, 493567, 4294959104, 603979775, 65536, 602799615, 805044223, 4294965206, 8191, 1031749119, 4294917631, 2134769663, 4286578493, 4282253311, 4294942719, 33540095, 4294905855, 2868854591, 1608515583, 265232348, 534519807, 2147614720, 1060109444, 4093640016, 17376, 2139062143, 224, 4169138175, 4294909951, 4286578688, 4294967292, 4294965759, 535511039, 4294966272, 4294967280, 32768, 8289918, 4294934399, 4294901775, 4294965375, 1602223615, 4294967259, 4294443008, 268369920, 4292804608, 4294967232, 486341884, 4294963199, 3087007615, 1073692671, 4128527, 4279238655, 4294902015, 4160684047, 4290246655, 469499899, 4294967231, 134086655, 4294966591, 2445279231, 3670015, 31, 4294967288, 4294705151, 3221208447, 4294902271, 4294549472, 4294921215, 4095, 4285526655, 4294966527, 4294966143, 64, 4294966719, 3774873592, 1877934080, 262151, 2555904, 536807423, 67043839, 3758096383, 3959414372, 3755993023, 2080374783, 4294835295, 4294967103, 4160749565, 4294934527, 4087, 2016, 2147446655, 184024726, 2862017156, 1593309078, 268434431, 268434414, 4294901763, 4294901761]); + const isIDContinue = (code) => (unicodeLookup[(code >>> 5) + 0] >>> code & 31 & 1) !== 0; + const isIDStart = (code) => (unicodeLookup[(code >>> 5) + 34816] >>> code & 31 & 1) !== 0; + + function advanceChar(parser) { + parser.column++; + return (parser.currentChar = parser.source.charCodeAt(++parser.index)); + } + function consumePossibleSurrogatePair(parser) { + const hi = parser.currentChar; + if ((hi & 0xfc00) !== 55296) + return 0; + const lo = parser.source.charCodeAt(parser.index + 1); + if ((lo & 0xfc00) !== 56320) + return 0; + return 65536 + ((hi & 0x3ff) << 10) + (lo & 0x3ff); + } + function consumeLineFeed(parser, state) { + parser.currentChar = parser.source.charCodeAt(++parser.index); + parser.flags |= 1; + if ((state & 4) === 0) { + parser.column = 0; + parser.line++; + } + } + function scanNewLine(parser) { + parser.flags |= 1; + parser.currentChar = parser.source.charCodeAt(++parser.index); + parser.column = 0; + parser.line++; + } + function isExoticECMAScriptWhitespace(ch) { + return (ch === 160 || + ch === 65279 || + ch === 133 || + ch === 5760 || + (ch >= 8192 && ch <= 8203) || + ch === 8239 || + ch === 8287 || + ch === 12288 || + ch === 8201 || + ch === 65519); + } + function toHex(code) { + return code < 65 ? code - 48 : (code - 65 + 10) & 0xf; + } + function convertTokenType(t) { + switch (t) { + case 134283266: + return 'NumericLiteral'; + case 134283267: + return 'StringLiteral'; + case 86021: + case 86022: + return 'BooleanLiteral'; + case 86023: + return 'NullLiteral'; + case 65540: + return 'RegularExpression'; + case 67174408: + case 67174409: + case 131: + return 'TemplateLiteral'; + default: + if ((t & 143360) === 143360) + return 'Identifier'; + if ((t & 4096) === 4096) + return 'Keyword'; + return 'Punctuator'; + } + } + + const CharTypes = [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 8 | 1024, + 0, + 0, + 8 | 2048, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 8192, + 0, + 1 | 2, + 0, + 0, + 8192, + 0, + 0, + 0, + 256, + 0, + 256 | 32768, + 0, + 0, + 2 | 16 | 128 | 32 | 64, + 2 | 16 | 128 | 32 | 64, + 2 | 16 | 32 | 64, + 2 | 16 | 32 | 64, + 2 | 16 | 32 | 64, + 2 | 16 | 32 | 64, + 2 | 16 | 32 | 64, + 2 | 16 | 32 | 64, + 2 | 16 | 512 | 64, + 2 | 16 | 512 | 64, + 0, + 0, + 16384, + 0, + 0, + 0, + 0, + 1 | 2 | 64, + 1 | 2 | 64, + 1 | 2 | 64, + 1 | 2 | 64, + 1 | 2 | 64, + 1 | 2 | 64, + 1 | 2, + 1 | 2, + 1 | 2, + 1 | 2, + 1 | 2, + 1 | 2, + 1 | 2, + 1 | 2, + 1 | 2, + 1 | 2, + 1 | 2, + 1 | 2, + 1 | 2, + 1 | 2, + 1 | 2, + 1 | 2, + 1 | 2, + 1 | 2, + 1 | 2, + 1 | 2, + 0, + 1, + 0, + 0, + 1 | 2 | 4096, + 0, + 1 | 2 | 4 | 64, + 1 | 2 | 4 | 64, + 1 | 2 | 4 | 64, + 1 | 2 | 4 | 64, + 1 | 2 | 4 | 64, + 1 | 2 | 4 | 64, + 1 | 2 | 4, + 1 | 2 | 4, + 1 | 2 | 4, + 1 | 2 | 4, + 1 | 2 | 4, + 1 | 2 | 4, + 1 | 2 | 4, + 1 | 2 | 4, + 1 | 2 | 4, + 1 | 2 | 4, + 1 | 2 | 4, + 1 | 2 | 4, + 1 | 2 | 4, + 1 | 2 | 4, + 1 | 2 | 4, + 1 | 2 | 4, + 1 | 2 | 4, + 1 | 2 | 4, + 1 | 2 | 4, + 1 | 2 | 4, + 16384, + 0, + 0, + 0, + 0 + ]; + const isIdStart = [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 0, + 0, + 0, + 0, + 1, + 0, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 0, + 0, + 0, + 0, + 0 + ]; + const isIdPart = [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 0, + 0, + 0, + 0, + 1, + 0, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 0, + 0, + 0, + 0, + 0 + ]; + function isIdentifierStart(code) { + return code <= 0x7F + ? isIdStart[code] > 0 + : isIDStart(code); + } + function isIdentifierPart(code) { + return code <= 0x7F + ? isIdPart[code] > 0 + : isIDContinue(code) || (code === 8204 || code === 8205); + } + + const CommentTypes = ['SingleLine', 'MultiLine', 'HTMLOpen', 'HTMLClose', 'HashbangComment']; + function skipHashBang(parser) { + const { source } = parser; + if (parser.currentChar === 35 && source.charCodeAt(parser.index + 1) === 33) { + advanceChar(parser); + advanceChar(parser); + skipSingleLineComment(parser, source, 0, 4, parser.tokenStart); + } + } + function skipSingleHTMLComment(parser, source, state, context, type, start) { + if (context & 2) + parser.report(0); + return skipSingleLineComment(parser, source, state, type, start); + } + function skipSingleLineComment(parser, source, state, type, start) { + const { index } = parser; + parser.tokenIndex = parser.index; + parser.tokenLine = parser.line; + parser.tokenColumn = parser.column; + while (parser.index < parser.end) { + if (CharTypes[parser.currentChar] & 8) { + const isCR = parser.currentChar === 13; + scanNewLine(parser); + if (isCR && parser.index < parser.end && parser.currentChar === 10) + parser.currentChar = source.charCodeAt(++parser.index); + break; + } + else if ((parser.currentChar ^ 8232) <= 1) { + scanNewLine(parser); + break; + } + advanceChar(parser); + parser.tokenIndex = parser.index; + parser.tokenLine = parser.line; + parser.tokenColumn = parser.column; + } + if (parser.options.onComment) { + const loc = { + start: { + line: start.line, + column: start.column, + }, + end: { + line: parser.tokenLine, + column: parser.tokenColumn, + }, + }; + parser.options.onComment(CommentTypes[type & 0xff], source.slice(index, parser.tokenIndex), start.index, parser.tokenIndex, loc); + } + return state | 1; + } + function skipMultiLineComment(parser, source, state) { + const { index } = parser; + while (parser.index < parser.end) { + if (parser.currentChar < 0x2b) { + let skippedOneAsterisk = false; + while (parser.currentChar === 42) { + if (!skippedOneAsterisk) { + state &= -5; + skippedOneAsterisk = true; + } + if (advanceChar(parser) === 47) { + advanceChar(parser); + if (parser.options.onComment) { + const loc = { + start: { + line: parser.tokenLine, + column: parser.tokenColumn, + }, + end: { + line: parser.line, + column: parser.column, + }, + }; + parser.options.onComment(CommentTypes[1 & 0xff], source.slice(index, parser.index - 2), index - 2, parser.index, loc); + } + parser.tokenIndex = parser.index; + parser.tokenLine = parser.line; + parser.tokenColumn = parser.column; + return state; + } + } + if (skippedOneAsterisk) { + continue; + } + if (CharTypes[parser.currentChar] & 8) { + if (parser.currentChar === 13) { + state |= 1 | 4; + scanNewLine(parser); + } + else { + consumeLineFeed(parser, state); + state = (state & -5) | 1; + } + } + else { + advanceChar(parser); + } + } + else if ((parser.currentChar ^ 8232) <= 1) { + state = (state & -5) | 1; + scanNewLine(parser); + } + else { + state &= -5; + advanceChar(parser); + } + } + parser.report(18); + } + + var RegexState; + (function (RegexState) { + RegexState[RegexState["Empty"] = 0] = "Empty"; + RegexState[RegexState["Escape"] = 1] = "Escape"; + RegexState[RegexState["Class"] = 2] = "Class"; + })(RegexState || (RegexState = {})); + var RegexFlags; + (function (RegexFlags) { + RegexFlags[RegexFlags["Empty"] = 0] = "Empty"; + RegexFlags[RegexFlags["IgnoreCase"] = 1] = "IgnoreCase"; + RegexFlags[RegexFlags["Global"] = 2] = "Global"; + RegexFlags[RegexFlags["Multiline"] = 4] = "Multiline"; + RegexFlags[RegexFlags["Unicode"] = 16] = "Unicode"; + RegexFlags[RegexFlags["Sticky"] = 8] = "Sticky"; + RegexFlags[RegexFlags["DotAll"] = 32] = "DotAll"; + RegexFlags[RegexFlags["Indices"] = 64] = "Indices"; + RegexFlags[RegexFlags["UnicodeSets"] = 128] = "UnicodeSets"; + })(RegexFlags || (RegexFlags = {})); + function scanRegularExpression(parser) { + const bodyStart = parser.index; + let preparseState = RegexState.Empty; + loop: while (true) { + const ch = parser.currentChar; + advanceChar(parser); + if (preparseState & RegexState.Escape) { + preparseState &= ~RegexState.Escape; + } + else { + switch (ch) { + case 47: + if (!preparseState) + break loop; + else + break; + case 92: + preparseState |= RegexState.Escape; + break; + case 91: + preparseState |= RegexState.Class; + break; + case 93: + preparseState &= RegexState.Escape; + break; + } + } + if (ch === 13 || + ch === 10 || + ch === 8232 || + ch === 8233) { + parser.report(34); + } + if (parser.index >= parser.source.length) { + return parser.report(34); + } + } + const bodyEnd = parser.index - 1; + let mask = RegexFlags.Empty; + let char = parser.currentChar; + const { index: flagStart } = parser; + while (isIdentifierPart(char)) { + switch (char) { + case 103: + if (mask & RegexFlags.Global) + parser.report(36, 'g'); + mask |= RegexFlags.Global; + break; + case 105: + if (mask & RegexFlags.IgnoreCase) + parser.report(36, 'i'); + mask |= RegexFlags.IgnoreCase; + break; + case 109: + if (mask & RegexFlags.Multiline) + parser.report(36, 'm'); + mask |= RegexFlags.Multiline; + break; + case 117: + if (mask & RegexFlags.Unicode) + parser.report(36, 'u'); + if (mask & RegexFlags.UnicodeSets) + parser.report(36, 'vu'); + mask |= RegexFlags.Unicode; + break; + case 118: + if (mask & RegexFlags.Unicode) + parser.report(36, 'uv'); + if (mask & RegexFlags.UnicodeSets) + parser.report(36, 'v'); + mask |= RegexFlags.UnicodeSets; + break; + case 121: + if (mask & RegexFlags.Sticky) + parser.report(36, 'y'); + mask |= RegexFlags.Sticky; + break; + case 115: + if (mask & RegexFlags.DotAll) + parser.report(36, 's'); + mask |= RegexFlags.DotAll; + break; + case 100: + if (mask & RegexFlags.Indices) + parser.report(36, 'd'); + mask |= RegexFlags.Indices; + break; + default: + parser.report(35); + } + char = advanceChar(parser); + } + const flags = parser.source.slice(flagStart, parser.index); + const pattern = parser.source.slice(bodyStart, bodyEnd); + parser.tokenRegExp = { pattern, flags }; + if (parser.options.raw) + parser.tokenRaw = parser.source.slice(parser.tokenIndex, parser.index); + parser.tokenValue = validate(parser, pattern, flags); + return 65540; + } + function validate(parser, pattern, flags) { + try { + return new RegExp(pattern, flags); + } + catch { + try { + new RegExp(pattern, flags); + return null; + } + catch { + parser.report(34); + } + } + } + + function scanString(parser, context, quote) { + const { index: start } = parser; + let ret = ''; + let char = advanceChar(parser); + let marker = parser.index; + while ((CharTypes[char] & 8) === 0) { + if (char === quote) { + ret += parser.source.slice(marker, parser.index); + advanceChar(parser); + if (parser.options.raw) + parser.tokenRaw = parser.source.slice(start, parser.index); + parser.tokenValue = ret; + return 134283267; + } + if ((char & 8) === 8 && char === 92) { + ret += parser.source.slice(marker, parser.index); + char = advanceChar(parser); + if (char < 0x7f || char === 8232 || char === 8233) { + const code = parseEscape(parser, context, char); + if (code >= 0) + ret += String.fromCodePoint(code); + else + handleStringError(parser, code, 0); + } + else { + ret += String.fromCodePoint(char); + } + marker = parser.index + 1; + } + else if (char === 8232 || char === 8233) { + parser.column = -1; + parser.line++; + } + if (parser.index >= parser.end) + parser.report(16); + char = advanceChar(parser); + } + parser.report(16); + } + function parseEscape(parser, context, first, isTemplate = 0) { + switch (first) { + case 98: + return 8; + case 102: + return 12; + case 114: + return 13; + case 110: + return 10; + case 116: + return 9; + case 118: + return 11; + case 13: { + if (parser.index < parser.end) { + const nextChar = parser.source.charCodeAt(parser.index + 1); + if (nextChar === 10) { + parser.index = parser.index + 1; + parser.currentChar = nextChar; + } + } + } + case 10: + case 8232: + case 8233: + parser.column = -1; + parser.line++; + return -1; + case 48: + case 49: + case 50: + case 51: { + let code = first - 48; + let index = parser.index + 1; + let column = parser.column + 1; + if (index < parser.end) { + const next = parser.source.charCodeAt(index); + if ((CharTypes[next] & 32) === 0) { + if (code !== 0 || CharTypes[next] & 512) { + if (context & 1 || isTemplate) + return -2; + parser.flags |= 64; + } + } + else if (context & 1 || isTemplate) { + return -2; + } + else { + parser.currentChar = next; + code = (code << 3) | (next - 48); + index++; + column++; + if (index < parser.end) { + const next = parser.source.charCodeAt(index); + if (CharTypes[next] & 32) { + parser.currentChar = next; + code = (code << 3) | (next - 48); + index++; + column++; + } + } + parser.flags |= 64; + } + parser.index = index - 1; + parser.column = column - 1; + } + return code; + } + case 52: + case 53: + case 54: + case 55: { + if (isTemplate || context & 1) + return -2; + let code = first - 48; + const index = parser.index + 1; + const column = parser.column + 1; + if (index < parser.end) { + const next = parser.source.charCodeAt(index); + if (CharTypes[next] & 32) { + code = (code << 3) | (next - 48); + parser.currentChar = next; + parser.index = index; + parser.column = column; + } + } + parser.flags |= 64; + return code; + } + case 120: { + const ch1 = advanceChar(parser); + if ((CharTypes[ch1] & 64) === 0) + return -4; + const hi = toHex(ch1); + const ch2 = advanceChar(parser); + if ((CharTypes[ch2] & 64) === 0) + return -4; + const lo = toHex(ch2); + return (hi << 4) | lo; + } + case 117: { + const ch = advanceChar(parser); + if (parser.currentChar === 123) { + let code = 0; + while ((CharTypes[advanceChar(parser)] & 64) !== 0) { + code = (code << 4) | toHex(parser.currentChar); + if (code > 1114111) + return -5; + } + if (parser.currentChar < 1 || parser.currentChar !== 125) { + return -4; + } + return code; + } + else { + if ((CharTypes[ch] & 64) === 0) + return -4; + const ch2 = parser.source.charCodeAt(parser.index + 1); + if ((CharTypes[ch2] & 64) === 0) + return -4; + const ch3 = parser.source.charCodeAt(parser.index + 2); + if ((CharTypes[ch3] & 64) === 0) + return -4; + const ch4 = parser.source.charCodeAt(parser.index + 3); + if ((CharTypes[ch4] & 64) === 0) + return -4; + parser.index += 3; + parser.column += 3; + parser.currentChar = parser.source.charCodeAt(parser.index); + return (toHex(ch) << 12) | (toHex(ch2) << 8) | (toHex(ch3) << 4) | toHex(ch4); + } + } + case 56: + case 57: + if (isTemplate || !parser.options.webcompat || context & 1) + return -3; + parser.flags |= 4096; + default: + return first; + } + } + function handleStringError(parser, code, isTemplate) { + switch (code) { + case -1: + return; + case -2: + parser.report(isTemplate ? 2 : 1); + case -3: + parser.report(isTemplate ? 3 : 14); + case -4: + parser.report(7); + case -5: + parser.report(104); + } + } + + function scanTemplate(parser, context) { + const { index: start } = parser; + let token = 67174409; + let ret = ''; + let char = advanceChar(parser); + while (char !== 96) { + if (char === 36 && parser.source.charCodeAt(parser.index + 1) === 123) { + advanceChar(parser); + token = 67174408; + break; + } + else if (char === 92) { + char = advanceChar(parser); + if (char > 0x7e) { + ret += String.fromCodePoint(char); + } + else { + const { index, line, column } = parser; + const code = parseEscape(parser, context | 1, char, 1); + if (code >= 0) { + ret += String.fromCodePoint(code); + } + else if (code !== -1 && context & 64) { + parser.index = index; + parser.line = line; + parser.column = column; + ret = null; + char = scanBadTemplate(parser, char); + if (char < 0) + token = 67174408; + break; + } + else { + handleStringError(parser, code, 1); + } + } + } + else if (parser.index < parser.end) { + if (char === 13 && parser.source.charCodeAt(parser.index) === 10) { + ret += String.fromCodePoint(char); + parser.currentChar = parser.source.charCodeAt(++parser.index); + } + if (((char & 83) < 3 && char === 10) || (char ^ 8232) <= 1) { + parser.column = -1; + parser.line++; + } + ret += String.fromCodePoint(char); + } + if (parser.index >= parser.end) + parser.report(17); + char = advanceChar(parser); + } + advanceChar(parser); + parser.tokenValue = ret; + parser.tokenRaw = parser.source.slice(start + 1, parser.index - (token === 67174409 ? 1 : 2)); + return token; + } + function scanBadTemplate(parser, ch) { + while (ch !== 96) { + switch (ch) { + case 36: { + const index = parser.index + 1; + if (index < parser.end && parser.source.charCodeAt(index) === 123) { + parser.index = index; + parser.column++; + return -ch; + } + break; + } + case 10: + case 8232: + case 8233: + parser.column = -1; + parser.line++; + } + if (parser.index >= parser.end) + parser.report(17); + ch = advanceChar(parser); + } + return ch; + } + function scanTemplateTail(parser, context) { + if (parser.index >= parser.end) + parser.report(0); + parser.index--; + parser.column--; + return scanTemplate(parser, context); + } + + const errorMessages = { + [0]: 'Unexpected token', + [30]: "Unexpected token: '%0'", + [1]: 'Octal escape sequences are not allowed in strict mode', + [2]: 'Octal escape sequences are not allowed in template strings', + [3]: '\\8 and \\9 are not allowed in template strings', + [4]: 'Private identifier #%0 is not defined', + [5]: 'Illegal Unicode escape sequence', + [6]: 'Invalid code point %0', + [7]: 'Invalid hexadecimal escape sequence', + [9]: 'Octal literals are not allowed in strict mode', + [8]: 'Decimal integer literals with a leading zero are forbidden in strict mode', + [10]: 'Expected number in radix %0', + [151]: 'Invalid left-hand side assignment to a destructible right-hand side', + [11]: 'Non-number found after exponent indicator', + [12]: 'Invalid BigIntLiteral', + [13]: 'No identifiers allowed directly after numeric literal', + [14]: 'Escapes \\8 or \\9 are not syntactically valid escapes', + [15]: 'Escapes \\8 or \\9 are not allowed in strict mode', + [16]: 'Unterminated string literal', + [17]: 'Unterminated template literal', + [18]: 'Multiline comment was not closed properly', + [19]: 'The identifier contained dynamic unicode escape that was not closed', + [20]: "Illegal character '%0'", + [21]: 'Missing hexadecimal digits', + [22]: 'Invalid implicit octal', + [23]: 'Invalid line break in string literal', + [24]: 'Only unicode escapes are legal in identifier names', + [25]: "Expected '%0'", + [26]: 'Invalid left-hand side in assignment', + [27]: 'Invalid left-hand side in async arrow', + [28]: 'Calls to super must be in the "constructor" method of a class expression or class declaration that has a superclass', + [29]: 'Member access on super must be in a method', + [31]: 'Await expression not allowed in formal parameter', + [32]: 'Yield expression not allowed in formal parameter', + [95]: "Unexpected token: 'escaped keyword'", + [33]: 'Unary expressions as the left operand of an exponentiation expression must be disambiguated with parentheses', + [123]: 'Async functions can only be declared at the top level or inside a block', + [34]: 'Unterminated regular expression', + [35]: 'Unexpected regular expression flag', + [36]: "Duplicate regular expression flag '%0'", + [37]: '%0 functions must have exactly %1 argument%2', + [38]: 'Setter function argument must not be a rest parameter', + [39]: '%0 declaration must have a name in this context', + [40]: 'Function name may not contain any reserved words or be eval or arguments in strict mode', + [41]: 'The rest operator is missing an argument', + [42]: 'A getter cannot be a generator', + [43]: 'A setter cannot be a generator', + [44]: 'A computed property name must be followed by a colon or paren', + [134]: 'Object literal keys that are strings or numbers must be a method or have a colon', + [46]: 'Found `* async x(){}` but this should be `async * x(){}`', + [45]: 'Getters and setters can not be generators', + [47]: "'%0' can not be generator method", + [48]: "No line break is allowed after '=>'", + [49]: 'The left-hand side of the arrow can only be destructed through assignment', + [50]: 'The binding declaration is not destructible', + [51]: 'Async arrow can not be followed by new expression', + [52]: "Classes may not have a static property named 'prototype'", + [53]: 'Class constructor may not be a %0', + [54]: 'Duplicate constructor method in class', + [55]: 'Invalid increment/decrement operand', + [56]: 'Invalid use of `new` keyword on an increment/decrement expression', + [57]: '`=>` is an invalid assignment target', + [58]: 'Rest element may not have a trailing comma', + [59]: 'Missing initializer in %0 declaration', + [60]: "'for-%0' loop head declarations can not have an initializer", + [61]: 'Invalid left-hand side in for-%0 loop: Must have a single binding', + [62]: 'Invalid shorthand property initializer', + [63]: 'Property name __proto__ appears more than once in object literal', + [64]: 'Let is disallowed as a lexically bound name', + [65]: "Invalid use of '%0' inside new expression", + [66]: "Illegal 'use strict' directive in function with non-simple parameter list", + [67]: 'Identifier "let" disallowed as left-hand side expression in strict mode', + [68]: 'Illegal continue statement', + [69]: 'Illegal break statement', + [70]: 'Cannot have `let[...]` as a var name in strict mode', + [71]: 'Invalid destructuring assignment target', + [72]: 'Rest parameter may not have a default initializer', + [73]: 'The rest argument must the be last parameter', + [74]: 'Invalid rest argument', + [76]: 'In strict mode code, functions can only be declared at top level or inside a block', + [77]: 'In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement', + [78]: 'Without web compatibility enabled functions can not be declared at top level, inside a block, or as the body of an if statement', + [79]: "Class declaration can't appear in single-statement context", + [80]: 'Invalid left-hand side in for-%0', + [81]: 'Invalid assignment in for-%0', + [82]: 'for await (... of ...) is only valid in async functions and async generators', + [83]: 'The first token after the template expression should be a continuation of the template', + [85]: '`let` declaration not allowed here and `let` cannot be a regular var name in strict mode', + [84]: '`let \n [` is a restricted production at the start of a statement', + [86]: 'Catch clause requires exactly one parameter, not more (and no trailing comma)', + [87]: 'Catch clause parameter does not support default values', + [88]: 'Missing catch or finally after try', + [89]: 'More than one default clause in switch statement', + [90]: 'Illegal newline after throw', + [91]: 'Strict mode code may not include a with statement', + [92]: 'Illegal return statement', + [93]: 'The left hand side of the for-header binding declaration is not destructible', + [94]: 'new.target only allowed within functions or static blocks', + [96]: "'#' not followed by identifier", + [102]: 'Invalid keyword', + [101]: "Can not use 'let' as a class name", + [100]: "'A lexical declaration can't define a 'let' binding", + [99]: 'Can not use `let` as variable name in strict mode', + [97]: "'%0' may not be used as an identifier in this context", + [98]: 'Await is only valid in async functions', + [103]: 'The %0 keyword can only be used with the module goal', + [104]: 'Unicode codepoint must not be greater than 0x10FFFF', + [105]: '%0 source must be string', + [106]: 'Only a identifier or string can be used to indicate alias', + [107]: "Only '*' or '{...}' can be imported after default", + [108]: 'Trailing decorator may be followed by method', + [109]: "Decorators can't be used with a constructor", + [110]: 'Can not use `await` as identifier in module or async func', + [111]: 'Can not use `await` as identifier in module', + [112]: 'HTML comments are only allowed with web compatibility (Annex B)', + [113]: "The identifier 'let' must not be in expression position in strict mode", + [114]: 'Cannot assign to `eval` and `arguments` in strict mode', + [115]: "The left-hand side of a for-of loop may not start with 'let'", + [116]: 'Block body arrows can not be immediately invoked without a group', + [117]: 'Block body arrows can not be immediately accessed without a group', + [118]: 'Unexpected strict mode reserved word', + [119]: 'Unexpected eval or arguments in strict mode', + [120]: 'Decorators must not be followed by a semicolon', + [121]: 'Calling delete on expression not allowed in strict mode', + [122]: 'Pattern can not have a tail', + [124]: 'Can not have a `yield` expression on the left side of a ternary', + [125]: 'An arrow function can not have a postfix update operator', + [126]: 'Invalid object literal key character after generator star', + [127]: 'Private fields can not be deleted', + [129]: 'Classes may not have a field called constructor', + [128]: 'Classes may not have a private element named constructor', + [130]: 'A class field initializer or static block may not contain arguments', + [131]: 'Generators can only be declared at the top level or inside a block', + [132]: 'Async methods are a restricted production and cannot have a newline following it', + [133]: 'Unexpected character after object literal property name', + [135]: 'Invalid key token', + [136]: "Label '%0' has already been declared", + [137]: 'continue statement must be nested within an iteration statement', + [138]: "Undefined label '%0'", + [139]: 'Trailing comma is disallowed inside import(...) arguments', + [140]: 'Invalid binding in JSON import', + [141]: 'import() requires exactly one argument', + [142]: 'Cannot use new with import(...)', + [143]: '... is not allowed in import()', + [144]: "Expected '=>'", + [145]: "Duplicate binding '%0'", + [146]: 'Duplicate private identifier #%0', + [147]: "Cannot export a duplicate name '%0'", + [150]: 'Duplicate %0 for-binding', + [148]: "Exported binding '%0' needs to refer to a top-level declared variable", + [149]: 'Unexpected private field', + [153]: 'Numeric separators are not allowed at the end of numeric literals', + [152]: 'Only one underscore is allowed as numeric separator', + [154]: 'JSX value should be either an expression or a quoted JSX text', + [155]: 'Expected corresponding JSX closing tag for %0', + [156]: 'Adjacent JSX elements must be wrapped in an enclosing tag', + [157]: "JSX attributes must only be assigned a non-empty 'expression'", + [158]: "'%0' has already been declared", + [159]: "'%0' shadowed a catch clause binding", + [160]: 'Dot property must be an identifier', + [161]: 'Encountered invalid input after spread/rest argument', + [162]: 'Catch without try', + [163]: 'Finally without try', + [164]: 'Expected corresponding closing tag for JSX fragment', + [165]: 'Coalescing and logical operators used together in the same expression must be disambiguated with parentheses', + [166]: 'Invalid tagged template on optional chain', + [167]: 'Invalid optional chain from super property', + [168]: 'Invalid optional chain from new expression', + [169]: 'Cannot use "import.meta" outside a module', + [170]: 'Leading decorators must be attached to a class declaration', + [171]: 'An export name cannot include a lone surrogate, found %0', + [172]: 'A string literal cannot be used as an exported binding without `from`', + [173]: "Private fields can't be accessed on super", + [174]: "The only valid meta property for import is 'import.meta'", + [175]: "'import.meta' must not contain escaped characters", + [176]: 'cannot use "await" as identifier inside an async function', + [177]: 'cannot use "await" in static blocks', + }; + class ParseError extends SyntaxError { + start; + end; + range; + loc; + description; + constructor(start, end, type, ...params) { + const description = errorMessages[type].replace(/%(\d+)/g, (_, i) => params[i]); + const message = '[' + start.line + ':' + start.column + '-' + end.line + ':' + end.column + ']: ' + description; + super(message); + this.start = start.index; + this.end = end.index; + this.range = [start.index, end.index]; + this.loc = { + start: { line: start.line, column: start.column }, + end: { line: end.line, column: end.column }, + }; + this.description = description; + } + } + + function scanNumber(parser, context, kind) { + let char = parser.currentChar; + let value = 0; + let digit = 9; + let atStart = kind & 64 ? 0 : 1; + let digits = 0; + let allowSeparator = 0; + if (kind & 64) { + value = '.' + scanDecimalDigitsOrSeparator(parser, char); + char = parser.currentChar; + if (char === 110) + parser.report(12); + } + else { + if (char === 48) { + char = advanceChar(parser); + if ((char | 32) === 120) { + kind = 8 | 128; + char = advanceChar(parser); + while (CharTypes[char] & (64 | 4096)) { + if (char === 95) { + if (!allowSeparator) + parser.report(152); + allowSeparator = 0; + char = advanceChar(parser); + continue; + } + allowSeparator = 1; + value = value * 0x10 + toHex(char); + digits++; + char = advanceChar(parser); + } + if (digits === 0 || !allowSeparator) { + parser.report(digits === 0 ? 21 : 153); + } + } + else if ((char | 32) === 111) { + kind = 4 | 128; + char = advanceChar(parser); + while (CharTypes[char] & (32 | 4096)) { + if (char === 95) { + if (!allowSeparator) { + parser.report(152); + } + allowSeparator = 0; + char = advanceChar(parser); + continue; + } + allowSeparator = 1; + value = value * 8 + (char - 48); + digits++; + char = advanceChar(parser); + } + if (digits === 0 || !allowSeparator) { + parser.report(digits === 0 ? 0 : 153); + } + } + else if ((char | 32) === 98) { + kind = 2 | 128; + char = advanceChar(parser); + while (CharTypes[char] & (128 | 4096)) { + if (char === 95) { + if (!allowSeparator) { + parser.report(152); + } + allowSeparator = 0; + char = advanceChar(parser); + continue; + } + allowSeparator = 1; + value = value * 2 + (char - 48); + digits++; + char = advanceChar(parser); + } + if (digits === 0 || !allowSeparator) { + parser.report(digits === 0 ? 0 : 153); + } + } + else if (CharTypes[char] & 32) { + if (context & 1) + parser.report(1); + kind = 1; + while (CharTypes[char] & 16) { + if (CharTypes[char] & 512) { + kind = 32; + atStart = 0; + break; + } + value = value * 8 + (char - 48); + char = advanceChar(parser); + } + } + else if (CharTypes[char] & 512) { + if (context & 1) + parser.report(1); + parser.flags |= 64; + kind = 32; + } + else if (char === 95) { + parser.report(0); + } + } + if (kind & 48) { + if (atStart) { + while (digit >= 0 && CharTypes[char] & (16 | 4096)) { + if (char === 95) { + char = advanceChar(parser); + if (char === 95 || kind & 32) { + throw new ParseError(parser.currentLocation, { index: parser.index + 1, line: parser.line, column: parser.column }, 152); + } + allowSeparator = 1; + continue; + } + allowSeparator = 0; + value = 10 * value + (char - 48); + char = advanceChar(parser); + --digit; + } + if (allowSeparator) { + throw new ParseError(parser.currentLocation, { index: parser.index + 1, line: parser.line, column: parser.column }, 153); + } + if (digit >= 0 && !isIdentifierStart(char) && char !== 46) { + parser.tokenValue = value; + if (parser.options.raw) + parser.tokenRaw = parser.source.slice(parser.tokenIndex, parser.index); + return 134283266; + } + } + value += scanDecimalDigitsOrSeparator(parser, char); + char = parser.currentChar; + if (char === 46) { + if (advanceChar(parser) === 95) + parser.report(0); + kind = 64; + value += '.' + scanDecimalDigitsOrSeparator(parser, parser.currentChar); + char = parser.currentChar; + } + } + } + const end = parser.index; + let isBigInt = 0; + if (char === 110 && kind & 128) { + isBigInt = 1; + char = advanceChar(parser); + } + else { + if ((char | 32) === 101) { + char = advanceChar(parser); + if (CharTypes[char] & 256) + char = advanceChar(parser); + const { index } = parser; + if ((CharTypes[char] & 16) === 0) + parser.report(11); + value += parser.source.substring(end, index) + scanDecimalDigitsOrSeparator(parser, char); + char = parser.currentChar; + } + } + if ((parser.index < parser.end && CharTypes[char] & 16) || isIdentifierStart(char)) { + parser.report(13); + } + if (isBigInt) { + parser.tokenRaw = parser.source.slice(parser.tokenIndex, parser.index); + parser.tokenValue = BigInt(parser.tokenRaw.slice(0, -1).replaceAll('_', '')); + return 134283388; + } + parser.tokenValue = + kind & (1 | 2 | 8 | 4) + ? value + : kind & 32 + ? parseFloat(parser.source.substring(parser.tokenIndex, parser.index)) + : +value; + if (parser.options.raw) + parser.tokenRaw = parser.source.slice(parser.tokenIndex, parser.index); + return 134283266; + } + function scanDecimalDigitsOrSeparator(parser, char) { + let allowSeparator = 0; + let start = parser.index; + let ret = ''; + while (CharTypes[char] & (16 | 4096)) { + if (char === 95) { + const { index } = parser; + char = advanceChar(parser); + if (char === 95) { + throw new ParseError(parser.currentLocation, { index: parser.index + 1, line: parser.line, column: parser.column }, 152); + } + allowSeparator = 1; + ret += parser.source.substring(start, index); + start = parser.index; + continue; + } + allowSeparator = 0; + char = advanceChar(parser); + } + if (allowSeparator) { + throw new ParseError(parser.currentLocation, { index: parser.index + 1, line: parser.line, column: parser.column }, 153); + } + return ret + parser.source.substring(start, parser.index); + } + + const KeywordDescTable = [ + 'end of source', + 'identifier', 'number', 'string', 'regular expression', + 'false', 'true', 'null', + 'template continuation', 'template tail', + '=>', '(', '{', '.', '...', '}', ')', ';', ',', '[', ']', ':', '?', '\'', '"', + '++', '--', + '=', '<<=', '>>=', '>>>=', '**=', '+=', '-=', '*=', '/=', '%=', '^=', '|=', + '&=', '||=', '&&=', '??=', + 'typeof', 'delete', 'void', '!', '~', '+', '-', 'in', 'instanceof', '*', '%', '/', '**', '&&', + '||', '===', '!==', '==', '!=', '<=', '>=', '<', '>', '<<', '>>', '>>>', '&', '|', '^', + 'var', 'let', 'const', + 'break', 'case', 'catch', 'class', 'continue', 'debugger', 'default', 'do', 'else', 'export', + 'extends', 'finally', 'for', 'function', 'if', 'import', 'new', 'return', 'super', 'switch', + 'this', 'throw', 'try', 'while', 'with', + 'implements', 'interface', 'package', 'private', 'protected', 'public', 'static', 'yield', + 'as', 'async', 'await', 'constructor', 'get', 'set', 'accessor', 'from', 'of', + 'enum', 'eval', 'arguments', 'escaped keyword', 'escaped future reserved keyword', 'reserved if strict', '#', + 'BigIntLiteral', '??', '?.', 'WhiteSpace', 'Illegal', 'LineTerminator', 'PrivateField', + 'Template', '@', 'target', 'meta', 'LineFeed', 'Escaped', 'JSXText' + ]; + const descKeywordTable = { + this: 86111, + function: 86104, + if: 20569, + return: 20572, + var: 86088, + else: 20563, + for: 20567, + new: 86107, + in: 8673330, + typeof: 16863275, + while: 20578, + case: 20556, + break: 20555, + try: 20577, + catch: 20557, + delete: 16863276, + throw: 86112, + switch: 86110, + continue: 20559, + default: 20561, + instanceof: 8411187, + do: 20562, + void: 16863277, + finally: 20566, + async: 209005, + await: 209006, + class: 86094, + const: 86090, + constructor: 12399, + debugger: 20560, + export: 20564, + extends: 20565, + false: 86021, + from: 209011, + get: 209008, + implements: 36964, + import: 86106, + interface: 36965, + let: 241737, + null: 86023, + of: 471156, + package: 36966, + private: 36967, + protected: 36968, + public: 36969, + set: 209009, + static: 36970, + super: 86109, + true: 86022, + with: 20579, + yield: 241771, + enum: 86133, + eval: 537079926, + as: 77932, + arguments: 537079927, + target: 209029, + meta: 209030, + accessor: 12402, + }; + + function matchOrInsertSemicolon(parser, context) { + if ((parser.flags & 1) === 0 && (parser.getToken() & 1048576) !== 1048576) { + parser.report(30, KeywordDescTable[parser.getToken() & 255]); + } + if (!consumeOpt(parser, context, 1074790417)) { + parser.options.onInsertedSemicolon?.(parser.startIndex); + } + } + function isValidStrictMode(parser, index, tokenIndex, tokenValue) { + if (index - tokenIndex < 13 && tokenValue === 'use strict') { + if ((parser.getToken() & 1048576) === 1048576 || parser.flags & 1) { + return 1; + } + } + return 0; + } + function optionalBit(parser, context, t) { + if (parser.getToken() !== t) + return 0; + nextToken(parser, context); + return 1; + } + function consumeOpt(parser, context, t) { + if (parser.getToken() !== t) + return false; + nextToken(parser, context); + return true; + } + function consume(parser, context, t) { + if (parser.getToken() !== t) + parser.report(25, KeywordDescTable[t & 255]); + nextToken(parser, context); + } + function reinterpretToPattern(parser, node) { + switch (node.type) { + case 'ArrayExpression': { + node.type = 'ArrayPattern'; + const { elements } = node; + for (let i = 0, n = elements.length; i < n; ++i) { + const element = elements[i]; + if (element) + reinterpretToPattern(parser, element); + } + return; + } + case 'ObjectExpression': { + node.type = 'ObjectPattern'; + const { properties } = node; + for (let i = 0, n = properties.length; i < n; ++i) { + reinterpretToPattern(parser, properties[i]); + } + return; + } + case 'AssignmentExpression': + node.type = 'AssignmentPattern'; + if (node.operator !== '=') + parser.report(71); + delete node.operator; + reinterpretToPattern(parser, node.left); + return; + case 'Property': + reinterpretToPattern(parser, node.value); + return; + case 'SpreadElement': + node.type = 'RestElement'; + reinterpretToPattern(parser, node.argument); + } + } + function validateBindingIdentifier(parser, context, kind, t, skipEvalArgCheck) { + if (context & 1) { + if ((t & 36864) === 36864) { + parser.report(118); + } + if (!skipEvalArgCheck && (t & 537079808) === 537079808) { + parser.report(119); + } + } + if ((t & 20480) === 20480 || t === -2147483528) { + parser.report(102); + } + if (kind & (8 | 16) && (t & 255) === (241737 & 255)) { + parser.report(100); + } + if (context & (2048 | 2) && t === 209006) { + parser.report(110); + } + if (context & (1024 | 1) && t === 241771) { + parser.report(97, 'yield'); + } + } + function validateFunctionName(parser, context, t) { + if (context & 1) { + if ((t & 36864) === 36864) { + parser.report(118); + } + if ((t & 537079808) === 537079808) { + parser.report(119); + } + if (t === -2147483527) { + parser.report(95); + } + if (t === -2147483528) { + parser.report(95); + } + } + if ((t & 20480) === 20480) { + parser.report(102); + } + if (context & (2048 | 2) && t === 209006) { + parser.report(110); + } + if (context & (1024 | 1) && t === 241771) { + parser.report(97, 'yield'); + } + } + function isStrictReservedWord(parser, context, t) { + if (t === 209006) { + if (context & (2048 | 2)) + parser.report(110); + parser.destructible |= 128; + } + if (t === 241771 && context & 1024) + parser.report(97, 'yield'); + return ((t & 20480) === 20480 || + (t & 36864) === 36864 || + t == -2147483527); + } + function isPropertyWithPrivateFieldKey(expr) { + return !expr.property ? false : expr.property.type === 'PrivateIdentifier'; + } + function isValidLabel(parser, labels, name, isIterationStatement) { + while (labels) { + if (labels['$' + name]) { + if (isIterationStatement) + parser.report(137); + return 1; + } + if (isIterationStatement && labels.loop) + isIterationStatement = 0; + labels = labels['$']; + } + return 0; + } + function validateAndDeclareLabel(parser, labels, name) { + let set = labels; + while (set) { + if (set['$' + name]) + parser.report(136, name); + set = set['$']; + } + labels['$' + name] = 1; + } + function isEqualTagName(elementName) { + switch (elementName.type) { + case 'JSXIdentifier': + return elementName.name; + case 'JSXNamespacedName': + return elementName.namespace + ':' + elementName.name; + case 'JSXMemberExpression': + return isEqualTagName(elementName.object) + '.' + isEqualTagName(elementName.property); + } + } + function isValidIdentifier(context, t) { + if (context & (1 | 1024)) { + if (context & 2 && t === 209006) + return false; + if (context & 1024 && t === 241771) + return false; + return (t & 12288) === 12288; + } + return (t & 12288) === 12288 || (t & 36864) === 36864; + } + function classifyIdentifier(parser, context, t) { + if ((t & 537079808) === 537079808) { + if (context & 1) + parser.report(119); + parser.flags |= 512; + } + if (!isValidIdentifier(context, t)) + parser.report(0); + } + function getOwnProperty(object, key) { + return Object.hasOwn(object, key) ? object[key] : undefined; + } + + function scanIdentifier(parser, context, isValidAsKeyword) { + while (isIdPart[advanceChar(parser)]) + ; + parser.tokenValue = parser.source.slice(parser.tokenIndex, parser.index); + return parser.currentChar !== 92 && parser.currentChar <= 0x7e + ? (getOwnProperty(descKeywordTable, parser.tokenValue) ?? 208897) + : scanIdentifierSlowCase(parser, context, 0, isValidAsKeyword); + } + function scanUnicodeIdentifier(parser, context) { + const cookedChar = scanIdentifierUnicodeEscape(parser); + if (!isIdentifierStart(cookedChar)) + parser.report(5); + parser.tokenValue = String.fromCodePoint(cookedChar); + return scanIdentifierSlowCase(parser, context, 1, CharTypes[cookedChar] & 4); + } + function scanIdentifierSlowCase(parser, context, hasEscape, isValidAsKeyword) { + let start = parser.index; + while (parser.index < parser.end) { + if (parser.currentChar === 92) { + parser.tokenValue += parser.source.slice(start, parser.index); + hasEscape = 1; + const code = scanIdentifierUnicodeEscape(parser); + if (!isIdentifierPart(code)) + parser.report(5); + isValidAsKeyword = isValidAsKeyword && CharTypes[code] & 4; + parser.tokenValue += String.fromCodePoint(code); + start = parser.index; + } + else { + const merged = consumePossibleSurrogatePair(parser); + if (merged > 0) { + if (!isIdentifierPart(merged)) { + parser.report(20, String.fromCodePoint(merged)); + } + parser.currentChar = merged; + parser.index++; + parser.column++; + } + else if (!isIdentifierPart(parser.currentChar)) { + break; + } + advanceChar(parser); + } + } + if (parser.index <= parser.end) { + parser.tokenValue += parser.source.slice(start, parser.index); + } + const { length } = parser.tokenValue; + if (isValidAsKeyword && length >= 2 && length <= 11) { + const token = getOwnProperty(descKeywordTable, parser.tokenValue); + if (token === void 0) + return 208897 | (hasEscape ? -2147483648 : 0); + if (!hasEscape) + return token; + if (token === 209006) { + if ((context & (2 | 2048)) === 0) { + return token | -2147483648; + } + return -2147483528; + } + if (context & 1) { + if (token === 36970) { + return -2147483527; + } + if ((token & 36864) === 36864) { + return -2147483527; + } + if ((token & 20480) === 20480) { + if (context & 262144 && (context & 8) === 0) { + return token | -2147483648; + } + else { + return -2147483528; + } + } + return 209018 | -2147483648; + } + if (context & 262144 && + (context & 8) === 0 && + (token & 20480) === 20480) { + return token | -2147483648; + } + if (token === 241771) { + return context & 262144 + ? 209018 | -2147483648 + : context & 1024 + ? -2147483528 + : token | -2147483648; + } + if (token === 209005) { + return 209018 | -2147483648; + } + if ((token & 36864) === 36864) { + return token | 12288 | -2147483648; + } + return -2147483528; + } + return 208897 | (hasEscape ? -2147483648 : 0); + } + function scanPrivateIdentifier(parser) { + let char = advanceChar(parser); + if (char === 92) + return 130; + const merged = consumePossibleSurrogatePair(parser); + if (merged) + char = merged; + if (!isIdentifierStart(char)) + parser.report(96); + return 130; + } + function scanIdentifierUnicodeEscape(parser) { + if (parser.source.charCodeAt(parser.index + 1) !== 117) { + parser.report(5); + } + parser.currentChar = parser.source.charCodeAt((parser.index += 2)); + parser.column += 2; + return scanUnicodeEscape(parser); + } + function scanUnicodeEscape(parser) { + let codePoint = 0; + const char = parser.currentChar; + if (char === 123) { + const begin = parser.index - 2; + while (CharTypes[advanceChar(parser)] & 64) { + codePoint = (codePoint << 4) | toHex(parser.currentChar); + if (codePoint > 1114111) + throw new ParseError({ index: begin, line: parser.line, column: parser.column }, parser.currentLocation, 104); + } + if (parser.currentChar !== 125) { + throw new ParseError({ index: begin, line: parser.line, column: parser.column }, parser.currentLocation, 7); + } + advanceChar(parser); + return codePoint; + } + if ((CharTypes[char] & 64) === 0) + parser.report(7); + const char2 = parser.source.charCodeAt(parser.index + 1); + if ((CharTypes[char2] & 64) === 0) + parser.report(7); + const char3 = parser.source.charCodeAt(parser.index + 2); + if ((CharTypes[char3] & 64) === 0) + parser.report(7); + const char4 = parser.source.charCodeAt(parser.index + 3); + if ((CharTypes[char4] & 64) === 0) + parser.report(7); + codePoint = (toHex(char) << 12) | (toHex(char2) << 8) | (toHex(char3) << 4) | toHex(char4); + parser.currentChar = parser.source.charCodeAt((parser.index += 4)); + parser.column += 4; + return codePoint; + } + + const TokenLookup = [ + 128, + 128, + 128, + 128, + 128, + 128, + 128, + 128, + 128, + 127, + 135, + 127, + 127, + 129, + 128, + 128, + 128, + 128, + 128, + 128, + 128, + 128, + 128, + 128, + 128, + 128, + 128, + 128, + 128, + 128, + 128, + 128, + 127, + 16842798, + 134283267, + 130, + 208897, + 8391477, + 8390213, + 134283267, + 67174411, + 16, + 8391476, + 25233968, + 18, + 25233969, + 67108877, + 8457014, + 134283266, + 134283266, + 134283266, + 134283266, + 134283266, + 134283266, + 134283266, + 134283266, + 134283266, + 134283266, + 21, + 1074790417, + 8456256, + 1077936155, + 8390721, + 22, + 132, + 208897, + 208897, + 208897, + 208897, + 208897, + 208897, + 208897, + 208897, + 208897, + 208897, + 208897, + 208897, + 208897, + 208897, + 208897, + 208897, + 208897, + 208897, + 208897, + 208897, + 208897, + 208897, + 208897, + 208897, + 208897, + 208897, + 69271571, + 136, + 20, + 8389959, + 208897, + 131, + 4096, + 4096, + 4096, + 4096, + 4096, + 4096, + 4096, + 208897, + 4096, + 208897, + 208897, + 4096, + 208897, + 4096, + 208897, + 4096, + 208897, + 4096, + 4096, + 4096, + 208897, + 4096, + 4096, + 208897, + 4096, + 4096, + 2162700, + 8389702, + 1074790415, + 16842799, + 128, + ]; + function nextToken(parser, context) { + parser.flags = (parser.flags | 1) ^ 1; + parser.startIndex = parser.index; + parser.startColumn = parser.column; + parser.startLine = parser.line; + parser.setToken(scanSingleToken(parser, context, 0)); + } + function scanSingleToken(parser, context, state) { + const isStartOfLine = parser.index === 0; + const { source } = parser; + let start = parser.currentLocation; + while (parser.index < parser.end) { + parser.tokenIndex = parser.index; + parser.tokenColumn = parser.column; + parser.tokenLine = parser.line; + let char = parser.currentChar; + if (char <= 0x7e) { + const token = TokenLookup[char]; + switch (token) { + case 67174411: + case 16: + case 2162700: + case 1074790415: + case 69271571: + case 20: + case 21: + case 1074790417: + case 18: + case 16842799: + case 132: + case 128: + advanceChar(parser); + return token; + case 208897: + return scanIdentifier(parser, context, 0); + case 4096: + return scanIdentifier(parser, context, 1); + case 134283266: + return scanNumber(parser, context, 16 | 128); + case 134283267: + return scanString(parser, context, char); + case 131: + return scanTemplate(parser, context); + case 136: + return scanUnicodeIdentifier(parser, context); + case 130: + return scanPrivateIdentifier(parser); + case 127: + advanceChar(parser); + break; + case 129: + state |= 1 | 4; + scanNewLine(parser); + break; + case 135: + consumeLineFeed(parser, state); + state = (state & -5) | 1; + break; + case 8456256: { + const ch = advanceChar(parser); + if (parser.index < parser.end) { + if (ch === 60) { + if (parser.index < parser.end && advanceChar(parser) === 61) { + advanceChar(parser); + return 4194332; + } + return 8390978; + } + else if (ch === 61) { + advanceChar(parser); + return 8390718; + } + if (ch === 33) { + const index = parser.index + 1; + if (index + 1 < parser.end && + source.charCodeAt(index) === 45 && + source.charCodeAt(index + 1) == 45) { + parser.column += 3; + parser.currentChar = source.charCodeAt((parser.index += 3)); + state = skipSingleHTMLComment(parser, source, state, context, 2, parser.tokenStart); + start = parser.tokenStart; + continue; + } + return 8456256; + } + } + return 8456256; + } + case 1077936155: { + advanceChar(parser); + const ch = parser.currentChar; + if (ch === 61) { + if (advanceChar(parser) === 61) { + advanceChar(parser); + return 8390458; + } + return 8390460; + } + if (ch === 62) { + advanceChar(parser); + return 10; + } + return 1077936155; + } + case 16842798: + if (advanceChar(parser) !== 61) { + return 16842798; + } + if (advanceChar(parser) !== 61) { + return 8390461; + } + advanceChar(parser); + return 8390459; + case 8391477: + if (advanceChar(parser) !== 61) + return 8391477; + advanceChar(parser); + return 4194340; + case 8391476: { + advanceChar(parser); + if (parser.index >= parser.end) + return 8391476; + const ch = parser.currentChar; + if (ch === 61) { + advanceChar(parser); + return 4194338; + } + if (ch !== 42) + return 8391476; + if (advanceChar(parser) !== 61) + return 8391735; + advanceChar(parser); + return 4194335; + } + case 8389959: + if (advanceChar(parser) !== 61) + return 8389959; + advanceChar(parser); + return 4194341; + case 25233968: { + advanceChar(parser); + const ch = parser.currentChar; + if (ch === 43) { + advanceChar(parser); + return 33619993; + } + if (ch === 61) { + advanceChar(parser); + return 4194336; + } + return 25233968; + } + case 25233969: { + advanceChar(parser); + const ch = parser.currentChar; + if (ch === 45) { + advanceChar(parser); + if ((state & 1 || isStartOfLine) && parser.currentChar === 62) { + if (!parser.options.webcompat) + parser.report(112); + advanceChar(parser); + state = skipSingleHTMLComment(parser, source, state, context, 3, start); + start = parser.tokenStart; + continue; + } + return 33619994; + } + if (ch === 61) { + advanceChar(parser); + return 4194337; + } + return 25233969; + } + case 8457014: { + advanceChar(parser); + if (parser.index < parser.end) { + const ch = parser.currentChar; + if (ch === 47) { + advanceChar(parser); + state = skipSingleLineComment(parser, source, state, 0, parser.tokenStart); + start = parser.tokenStart; + continue; + } + if (ch === 42) { + advanceChar(parser); + state = skipMultiLineComment(parser, source, state); + start = parser.tokenStart; + continue; + } + if (context & 32) { + return scanRegularExpression(parser); + } + if (ch === 61) { + advanceChar(parser); + return 4259875; + } + } + return 8457014; + } + case 67108877: { + const next = advanceChar(parser); + if (next >= 48 && next <= 57) + return scanNumber(parser, context, 64 | 16); + if (next === 46) { + const index = parser.index + 1; + if (index < parser.end && source.charCodeAt(index) === 46) { + parser.column += 2; + parser.currentChar = source.charCodeAt((parser.index += 2)); + return 14; + } + } + return 67108877; + } + case 8389702: { + advanceChar(parser); + const ch = parser.currentChar; + if (ch === 124) { + advanceChar(parser); + if (parser.currentChar === 61) { + advanceChar(parser); + return 4194344; + } + return 8913465; + } + if (ch === 61) { + advanceChar(parser); + return 4194342; + } + return 8389702; + } + case 8390721: { + advanceChar(parser); + const ch = parser.currentChar; + if (ch === 61) { + advanceChar(parser); + return 8390719; + } + if (ch !== 62) + return 8390721; + advanceChar(parser); + if (parser.index < parser.end) { + const ch = parser.currentChar; + if (ch === 62) { + if (advanceChar(parser) === 61) { + advanceChar(parser); + return 4194334; + } + return 8390980; + } + if (ch === 61) { + advanceChar(parser); + return 4194333; + } + } + return 8390979; + } + case 8390213: { + advanceChar(parser); + const ch = parser.currentChar; + if (ch === 38) { + advanceChar(parser); + if (parser.currentChar === 61) { + advanceChar(parser); + return 4194345; + } + return 8913720; + } + if (ch === 61) { + advanceChar(parser); + return 4194343; + } + return 8390213; + } + case 22: { + let ch = advanceChar(parser); + if (ch === 63) { + advanceChar(parser); + if (parser.currentChar === 61) { + advanceChar(parser); + return 4194346; + } + return 276824445; + } + if (ch === 46) { + const index = parser.index + 1; + if (index < parser.end) { + ch = source.charCodeAt(index); + if (!(ch >= 48 && ch <= 57)) { + advanceChar(parser); + return 67108990; + } + } + } + return 22; + } + } + } + else { + if ((char ^ 8232) <= 1) { + state = (state & -5) | 1; + scanNewLine(parser); + continue; + } + const merged = consumePossibleSurrogatePair(parser); + if (merged > 0) + char = merged; + if (isIDStart(char)) { + parser.tokenValue = ''; + return scanIdentifierSlowCase(parser, context, 0, 0); + } + if (isExoticECMAScriptWhitespace(char)) { + advanceChar(parser); + continue; + } + parser.report(20, String.fromCodePoint(char)); + } + } + return 1048576; + } + + const entities = { + AElig: '\u00C6', + AMP: '\u0026', + Aacute: '\u00C1', + Abreve: '\u0102', + Acirc: '\u00C2', + Acy: '\u0410', + Afr: '\uD835\uDD04', + Agrave: '\u00C0', + Alpha: '\u0391', + Amacr: '\u0100', + And: '\u2A53', + Aogon: '\u0104', + Aopf: '\uD835\uDD38', + ApplyFunction: '\u2061', + Aring: '\u00C5', + Ascr: '\uD835\uDC9C', + Assign: '\u2254', + Atilde: '\u00C3', + Auml: '\u00C4', + Backslash: '\u2216', + Barv: '\u2AE7', + Barwed: '\u2306', + Bcy: '\u0411', + Because: '\u2235', + Bernoullis: '\u212C', + Beta: '\u0392', + Bfr: '\uD835\uDD05', + Bopf: '\uD835\uDD39', + Breve: '\u02D8', + Bscr: '\u212C', + Bumpeq: '\u224E', + CHcy: '\u0427', + COPY: '\u00A9', + Cacute: '\u0106', + Cap: '\u22D2', + CapitalDifferentialD: '\u2145', + Cayleys: '\u212D', + Ccaron: '\u010C', + Ccedil: '\u00C7', + Ccirc: '\u0108', + Cconint: '\u2230', + Cdot: '\u010A', + Cedilla: '\u00B8', + CenterDot: '\u00B7', + Cfr: '\u212D', + Chi: '\u03A7', + CircleDot: '\u2299', + CircleMinus: '\u2296', + CirclePlus: '\u2295', + CircleTimes: '\u2297', + ClockwiseContourIntegral: '\u2232', + CloseCurlyDoubleQuote: '\u201D', + CloseCurlyQuote: '\u2019', + Colon: '\u2237', + Colone: '\u2A74', + Congruent: '\u2261', + Conint: '\u222F', + ContourIntegral: '\u222E', + Copf: '\u2102', + Coproduct: '\u2210', + CounterClockwiseContourIntegral: '\u2233', + Cross: '\u2A2F', + Cscr: '\uD835\uDC9E', + Cup: '\u22D3', + CupCap: '\u224D', + DD: '\u2145', + DDotrahd: '\u2911', + DJcy: '\u0402', + DScy: '\u0405', + DZcy: '\u040F', + Dagger: '\u2021', + Darr: '\u21A1', + Dashv: '\u2AE4', + Dcaron: '\u010E', + Dcy: '\u0414', + Del: '\u2207', + Delta: '\u0394', + Dfr: '\uD835\uDD07', + DiacriticalAcute: '\u00B4', + DiacriticalDot: '\u02D9', + DiacriticalDoubleAcute: '\u02DD', + DiacriticalGrave: '\u0060', + DiacriticalTilde: '\u02DC', + Diamond: '\u22C4', + DifferentialD: '\u2146', + Dopf: '\uD835\uDD3B', + Dot: '\u00A8', + DotDot: '\u20DC', + DotEqual: '\u2250', + DoubleContourIntegral: '\u222F', + DoubleDot: '\u00A8', + DoubleDownArrow: '\u21D3', + DoubleLeftArrow: '\u21D0', + DoubleLeftRightArrow: '\u21D4', + DoubleLeftTee: '\u2AE4', + DoubleLongLeftArrow: '\u27F8', + DoubleLongLeftRightArrow: '\u27FA', + DoubleLongRightArrow: '\u27F9', + DoubleRightArrow: '\u21D2', + DoubleRightTee: '\u22A8', + DoubleUpArrow: '\u21D1', + DoubleUpDownArrow: '\u21D5', + DoubleVerticalBar: '\u2225', + DownArrow: '\u2193', + DownArrowBar: '\u2913', + DownArrowUpArrow: '\u21F5', + DownBreve: '\u0311', + DownLeftRightVector: '\u2950', + DownLeftTeeVector: '\u295E', + DownLeftVector: '\u21BD', + DownLeftVectorBar: '\u2956', + DownRightTeeVector: '\u295F', + DownRightVector: '\u21C1', + DownRightVectorBar: '\u2957', + DownTee: '\u22A4', + DownTeeArrow: '\u21A7', + Downarrow: '\u21D3', + Dscr: '\uD835\uDC9F', + Dstrok: '\u0110', + ENG: '\u014A', + ETH: '\u00D0', + Eacute: '\u00C9', + Ecaron: '\u011A', + Ecirc: '\u00CA', + Ecy: '\u042D', + Edot: '\u0116', + Efr: '\uD835\uDD08', + Egrave: '\u00C8', + Element: '\u2208', + Emacr: '\u0112', + EmptySmallSquare: '\u25FB', + EmptyVerySmallSquare: '\u25AB', + Eogon: '\u0118', + Eopf: '\uD835\uDD3C', + Epsilon: '\u0395', + Equal: '\u2A75', + EqualTilde: '\u2242', + Equilibrium: '\u21CC', + Escr: '\u2130', + Esim: '\u2A73', + Eta: '\u0397', + Euml: '\u00CB', + Exists: '\u2203', + ExponentialE: '\u2147', + Fcy: '\u0424', + Ffr: '\uD835\uDD09', + FilledSmallSquare: '\u25FC', + FilledVerySmallSquare: '\u25AA', + Fopf: '\uD835\uDD3D', + ForAll: '\u2200', + Fouriertrf: '\u2131', + Fscr: '\u2131', + GJcy: '\u0403', + GT: '\u003E', + Gamma: '\u0393', + Gammad: '\u03DC', + Gbreve: '\u011E', + Gcedil: '\u0122', + Gcirc: '\u011C', + Gcy: '\u0413', + Gdot: '\u0120', + Gfr: '\uD835\uDD0A', + Gg: '\u22D9', + Gopf: '\uD835\uDD3E', + GreaterEqual: '\u2265', + GreaterEqualLess: '\u22DB', + GreaterFullEqual: '\u2267', + GreaterGreater: '\u2AA2', + GreaterLess: '\u2277', + GreaterSlantEqual: '\u2A7E', + GreaterTilde: '\u2273', + Gscr: '\uD835\uDCA2', + Gt: '\u226B', + HARDcy: '\u042A', + Hacek: '\u02C7', + Hat: '\u005E', + Hcirc: '\u0124', + Hfr: '\u210C', + HilbertSpace: '\u210B', + Hopf: '\u210D', + HorizontalLine: '\u2500', + Hscr: '\u210B', + Hstrok: '\u0126', + HumpDownHump: '\u224E', + HumpEqual: '\u224F', + IEcy: '\u0415', + IJlig: '\u0132', + IOcy: '\u0401', + Iacute: '\u00CD', + Icirc: '\u00CE', + Icy: '\u0418', + Idot: '\u0130', + Ifr: '\u2111', + Igrave: '\u00CC', + Im: '\u2111', + Imacr: '\u012A', + ImaginaryI: '\u2148', + Implies: '\u21D2', + Int: '\u222C', + Integral: '\u222B', + Intersection: '\u22C2', + InvisibleComma: '\u2063', + InvisibleTimes: '\u2062', + Iogon: '\u012E', + Iopf: '\uD835\uDD40', + Iota: '\u0399', + Iscr: '\u2110', + Itilde: '\u0128', + Iukcy: '\u0406', + Iuml: '\u00CF', + Jcirc: '\u0134', + Jcy: '\u0419', + Jfr: '\uD835\uDD0D', + Jopf: '\uD835\uDD41', + Jscr: '\uD835\uDCA5', + Jsercy: '\u0408', + Jukcy: '\u0404', + KHcy: '\u0425', + KJcy: '\u040C', + Kappa: '\u039A', + Kcedil: '\u0136', + Kcy: '\u041A', + Kfr: '\uD835\uDD0E', + Kopf: '\uD835\uDD42', + Kscr: '\uD835\uDCA6', + LJcy: '\u0409', + LT: '\u003C', + Lacute: '\u0139', + Lambda: '\u039B', + Lang: '\u27EA', + Laplacetrf: '\u2112', + Larr: '\u219E', + Lcaron: '\u013D', + Lcedil: '\u013B', + Lcy: '\u041B', + LeftAngleBracket: '\u27E8', + LeftArrow: '\u2190', + LeftArrowBar: '\u21E4', + LeftArrowRightArrow: '\u21C6', + LeftCeiling: '\u2308', + LeftDoubleBracket: '\u27E6', + LeftDownTeeVector: '\u2961', + LeftDownVector: '\u21C3', + LeftDownVectorBar: '\u2959', + LeftFloor: '\u230A', + LeftRightArrow: '\u2194', + LeftRightVector: '\u294E', + LeftTee: '\u22A3', + LeftTeeArrow: '\u21A4', + LeftTeeVector: '\u295A', + LeftTriangle: '\u22B2', + LeftTriangleBar: '\u29CF', + LeftTriangleEqual: '\u22B4', + LeftUpDownVector: '\u2951', + LeftUpTeeVector: '\u2960', + LeftUpVector: '\u21BF', + LeftUpVectorBar: '\u2958', + LeftVector: '\u21BC', + LeftVectorBar: '\u2952', + Leftarrow: '\u21D0', + Leftrightarrow: '\u21D4', + LessEqualGreater: '\u22DA', + LessFullEqual: '\u2266', + LessGreater: '\u2276', + LessLess: '\u2AA1', + LessSlantEqual: '\u2A7D', + LessTilde: '\u2272', + Lfr: '\uD835\uDD0F', + Ll: '\u22D8', + Lleftarrow: '\u21DA', + Lmidot: '\u013F', + LongLeftArrow: '\u27F5', + LongLeftRightArrow: '\u27F7', + LongRightArrow: '\u27F6', + Longleftarrow: '\u27F8', + Longleftrightarrow: '\u27FA', + Longrightarrow: '\u27F9', + Lopf: '\uD835\uDD43', + LowerLeftArrow: '\u2199', + LowerRightArrow: '\u2198', + Lscr: '\u2112', + Lsh: '\u21B0', + Lstrok: '\u0141', + Lt: '\u226A', + Map: '\u2905', + Mcy: '\u041C', + MediumSpace: '\u205F', + Mellintrf: '\u2133', + Mfr: '\uD835\uDD10', + MinusPlus: '\u2213', + Mopf: '\uD835\uDD44', + Mscr: '\u2133', + Mu: '\u039C', + NJcy: '\u040A', + Nacute: '\u0143', + Ncaron: '\u0147', + Ncedil: '\u0145', + Ncy: '\u041D', + NegativeMediumSpace: '\u200B', + NegativeThickSpace: '\u200B', + NegativeThinSpace: '\u200B', + NegativeVeryThinSpace: '\u200B', + NestedGreaterGreater: '\u226B', + NestedLessLess: '\u226A', + NewLine: '\u000A', + Nfr: '\uD835\uDD11', + NoBreak: '\u2060', + NonBreakingSpace: '\u00A0', + Nopf: '\u2115', + Not: '\u2AEC', + NotCongruent: '\u2262', + NotCupCap: '\u226D', + NotDoubleVerticalBar: '\u2226', + NotElement: '\u2209', + NotEqual: '\u2260', + NotEqualTilde: '\u2242\u0338', + NotExists: '\u2204', + NotGreater: '\u226F', + NotGreaterEqual: '\u2271', + NotGreaterFullEqual: '\u2267\u0338', + NotGreaterGreater: '\u226B\u0338', + NotGreaterLess: '\u2279', + NotGreaterSlantEqual: '\u2A7E\u0338', + NotGreaterTilde: '\u2275', + NotHumpDownHump: '\u224E\u0338', + NotHumpEqual: '\u224F\u0338', + NotLeftTriangle: '\u22EA', + NotLeftTriangleBar: '\u29CF\u0338', + NotLeftTriangleEqual: '\u22EC', + NotLess: '\u226E', + NotLessEqual: '\u2270', + NotLessGreater: '\u2278', + NotLessLess: '\u226A\u0338', + NotLessSlantEqual: '\u2A7D\u0338', + NotLessTilde: '\u2274', + NotNestedGreaterGreater: '\u2AA2\u0338', + NotNestedLessLess: '\u2AA1\u0338', + NotPrecedes: '\u2280', + NotPrecedesEqual: '\u2AAF\u0338', + NotPrecedesSlantEqual: '\u22E0', + NotReverseElement: '\u220C', + NotRightTriangle: '\u22EB', + NotRightTriangleBar: '\u29D0\u0338', + NotRightTriangleEqual: '\u22ED', + NotSquareSubset: '\u228F\u0338', + NotSquareSubsetEqual: '\u22E2', + NotSquareSuperset: '\u2290\u0338', + NotSquareSupersetEqual: '\u22E3', + NotSubset: '\u2282\u20D2', + NotSubsetEqual: '\u2288', + NotSucceeds: '\u2281', + NotSucceedsEqual: '\u2AB0\u0338', + NotSucceedsSlantEqual: '\u22E1', + NotSucceedsTilde: '\u227F\u0338', + NotSuperset: '\u2283\u20D2', + NotSupersetEqual: '\u2289', + NotTilde: '\u2241', + NotTildeEqual: '\u2244', + NotTildeFullEqual: '\u2247', + NotTildeTilde: '\u2249', + NotVerticalBar: '\u2224', + Nscr: '\uD835\uDCA9', + Ntilde: '\u00D1', + Nu: '\u039D', + OElig: '\u0152', + Oacute: '\u00D3', + Ocirc: '\u00D4', + Ocy: '\u041E', + Odblac: '\u0150', + Ofr: '\uD835\uDD12', + Ograve: '\u00D2', + Omacr: '\u014C', + Omega: '\u03A9', + Omicron: '\u039F', + Oopf: '\uD835\uDD46', + OpenCurlyDoubleQuote: '\u201C', + OpenCurlyQuote: '\u2018', + Or: '\u2A54', + Oscr: '\uD835\uDCAA', + Oslash: '\u00D8', + Otilde: '\u00D5', + Otimes: '\u2A37', + Ouml: '\u00D6', + OverBar: '\u203E', + OverBrace: '\u23DE', + OverBracket: '\u23B4', + OverParenthesis: '\u23DC', + PartialD: '\u2202', + Pcy: '\u041F', + Pfr: '\uD835\uDD13', + Phi: '\u03A6', + Pi: '\u03A0', + PlusMinus: '\u00B1', + Poincareplane: '\u210C', + Popf: '\u2119', + Pr: '\u2ABB', + Precedes: '\u227A', + PrecedesEqual: '\u2AAF', + PrecedesSlantEqual: '\u227C', + PrecedesTilde: '\u227E', + Prime: '\u2033', + Product: '\u220F', + Proportion: '\u2237', + Proportional: '\u221D', + Pscr: '\uD835\uDCAB', + Psi: '\u03A8', + QUOT: '\u0022', + Qfr: '\uD835\uDD14', + Qopf: '\u211A', + Qscr: '\uD835\uDCAC', + RBarr: '\u2910', + REG: '\u00AE', + Racute: '\u0154', + Rang: '\u27EB', + Rarr: '\u21A0', + Rarrtl: '\u2916', + Rcaron: '\u0158', + Rcedil: '\u0156', + Rcy: '\u0420', + Re: '\u211C', + ReverseElement: '\u220B', + ReverseEquilibrium: '\u21CB', + ReverseUpEquilibrium: '\u296F', + Rfr: '\u211C', + Rho: '\u03A1', + RightAngleBracket: '\u27E9', + RightArrow: '\u2192', + RightArrowBar: '\u21E5', + RightArrowLeftArrow: '\u21C4', + RightCeiling: '\u2309', + RightDoubleBracket: '\u27E7', + RightDownTeeVector: '\u295D', + RightDownVector: '\u21C2', + RightDownVectorBar: '\u2955', + RightFloor: '\u230B', + RightTee: '\u22A2', + RightTeeArrow: '\u21A6', + RightTeeVector: '\u295B', + RightTriangle: '\u22B3', + RightTriangleBar: '\u29D0', + RightTriangleEqual: '\u22B5', + RightUpDownVector: '\u294F', + RightUpTeeVector: '\u295C', + RightUpVector: '\u21BE', + RightUpVectorBar: '\u2954', + RightVector: '\u21C0', + RightVectorBar: '\u2953', + Rightarrow: '\u21D2', + Ropf: '\u211D', + RoundImplies: '\u2970', + Rrightarrow: '\u21DB', + Rscr: '\u211B', + Rsh: '\u21B1', + RuleDelayed: '\u29F4', + SHCHcy: '\u0429', + SHcy: '\u0428', + SOFTcy: '\u042C', + Sacute: '\u015A', + Sc: '\u2ABC', + Scaron: '\u0160', + Scedil: '\u015E', + Scirc: '\u015C', + Scy: '\u0421', + Sfr: '\uD835\uDD16', + ShortDownArrow: '\u2193', + ShortLeftArrow: '\u2190', + ShortRightArrow: '\u2192', + ShortUpArrow: '\u2191', + Sigma: '\u03A3', + SmallCircle: '\u2218', + Sopf: '\uD835\uDD4A', + Sqrt: '\u221A', + Square: '\u25A1', + SquareIntersection: '\u2293', + SquareSubset: '\u228F', + SquareSubsetEqual: '\u2291', + SquareSuperset: '\u2290', + SquareSupersetEqual: '\u2292', + SquareUnion: '\u2294', + Sscr: '\uD835\uDCAE', + Star: '\u22C6', + Sub: '\u22D0', + Subset: '\u22D0', + SubsetEqual: '\u2286', + Succeeds: '\u227B', + SucceedsEqual: '\u2AB0', + SucceedsSlantEqual: '\u227D', + SucceedsTilde: '\u227F', + SuchThat: '\u220B', + Sum: '\u2211', + Sup: '\u22D1', + Superset: '\u2283', + SupersetEqual: '\u2287', + Supset: '\u22D1', + THORN: '\u00DE', + TRADE: '\u2122', + TSHcy: '\u040B', + TScy: '\u0426', + Tab: '\u0009', + Tau: '\u03A4', + Tcaron: '\u0164', + Tcedil: '\u0162', + Tcy: '\u0422', + Tfr: '\uD835\uDD17', + Therefore: '\u2234', + Theta: '\u0398', + ThickSpace: '\u205F\u200A', + ThinSpace: '\u2009', + Tilde: '\u223C', + TildeEqual: '\u2243', + TildeFullEqual: '\u2245', + TildeTilde: '\u2248', + Topf: '\uD835\uDD4B', + TripleDot: '\u20DB', + Tscr: '\uD835\uDCAF', + Tstrok: '\u0166', + Uacute: '\u00DA', + Uarr: '\u219F', + Uarrocir: '\u2949', + Ubrcy: '\u040E', + Ubreve: '\u016C', + Ucirc: '\u00DB', + Ucy: '\u0423', + Udblac: '\u0170', + Ufr: '\uD835\uDD18', + Ugrave: '\u00D9', + Umacr: '\u016A', + UnderBar: '\u005F', + UnderBrace: '\u23DF', + UnderBracket: '\u23B5', + UnderParenthesis: '\u23DD', + Union: '\u22C3', + UnionPlus: '\u228E', + Uogon: '\u0172', + Uopf: '\uD835\uDD4C', + UpArrow: '\u2191', + UpArrowBar: '\u2912', + UpArrowDownArrow: '\u21C5', + UpDownArrow: '\u2195', + UpEquilibrium: '\u296E', + UpTee: '\u22A5', + UpTeeArrow: '\u21A5', + Uparrow: '\u21D1', + Updownarrow: '\u21D5', + UpperLeftArrow: '\u2196', + UpperRightArrow: '\u2197', + Upsi: '\u03D2', + Upsilon: '\u03A5', + Uring: '\u016E', + Uscr: '\uD835\uDCB0', + Utilde: '\u0168', + Uuml: '\u00DC', + VDash: '\u22AB', + Vbar: '\u2AEB', + Vcy: '\u0412', + Vdash: '\u22A9', + Vdashl: '\u2AE6', + Vee: '\u22C1', + Verbar: '\u2016', + Vert: '\u2016', + VerticalBar: '\u2223', + VerticalLine: '\u007C', + VerticalSeparator: '\u2758', + VerticalTilde: '\u2240', + VeryThinSpace: '\u200A', + Vfr: '\uD835\uDD19', + Vopf: '\uD835\uDD4D', + Vscr: '\uD835\uDCB1', + Vvdash: '\u22AA', + Wcirc: '\u0174', + Wedge: '\u22C0', + Wfr: '\uD835\uDD1A', + Wopf: '\uD835\uDD4E', + Wscr: '\uD835\uDCB2', + Xfr: '\uD835\uDD1B', + Xi: '\u039E', + Xopf: '\uD835\uDD4F', + Xscr: '\uD835\uDCB3', + YAcy: '\u042F', + YIcy: '\u0407', + YUcy: '\u042E', + Yacute: '\u00DD', + Ycirc: '\u0176', + Ycy: '\u042B', + Yfr: '\uD835\uDD1C', + Yopf: '\uD835\uDD50', + Yscr: '\uD835\uDCB4', + Yuml: '\u0178', + ZHcy: '\u0416', + Zacute: '\u0179', + Zcaron: '\u017D', + Zcy: '\u0417', + Zdot: '\u017B', + ZeroWidthSpace: '\u200B', + Zeta: '\u0396', + Zfr: '\u2128', + Zopf: '\u2124', + Zscr: '\uD835\uDCB5', + aacute: '\u00E1', + abreve: '\u0103', + ac: '\u223E', + acE: '\u223E\u0333', + acd: '\u223F', + acirc: '\u00E2', + acute: '\u00B4', + acy: '\u0430', + aelig: '\u00E6', + af: '\u2061', + afr: '\uD835\uDD1E', + agrave: '\u00E0', + alefsym: '\u2135', + aleph: '\u2135', + alpha: '\u03B1', + amacr: '\u0101', + amalg: '\u2A3F', + amp: '\u0026', + and: '\u2227', + andand: '\u2A55', + andd: '\u2A5C', + andslope: '\u2A58', + andv: '\u2A5A', + ang: '\u2220', + ange: '\u29A4', + angle: '\u2220', + angmsd: '\u2221', + angmsdaa: '\u29A8', + angmsdab: '\u29A9', + angmsdac: '\u29AA', + angmsdad: '\u29AB', + angmsdae: '\u29AC', + angmsdaf: '\u29AD', + angmsdag: '\u29AE', + angmsdah: '\u29AF', + angrt: '\u221F', + angrtvb: '\u22BE', + angrtvbd: '\u299D', + angsph: '\u2222', + angst: '\u00C5', + angzarr: '\u237C', + aogon: '\u0105', + aopf: '\uD835\uDD52', + ap: '\u2248', + apE: '\u2A70', + apacir: '\u2A6F', + ape: '\u224A', + apid: '\u224B', + apos: '\u0027', + approx: '\u2248', + approxeq: '\u224A', + aring: '\u00E5', + ascr: '\uD835\uDCB6', + ast: '\u002A', + asymp: '\u2248', + asympeq: '\u224D', + atilde: '\u00E3', + auml: '\u00E4', + awconint: '\u2233', + awint: '\u2A11', + bNot: '\u2AED', + backcong: '\u224C', + backepsilon: '\u03F6', + backprime: '\u2035', + backsim: '\u223D', + backsimeq: '\u22CD', + barvee: '\u22BD', + barwed: '\u2305', + barwedge: '\u2305', + bbrk: '\u23B5', + bbrktbrk: '\u23B6', + bcong: '\u224C', + bcy: '\u0431', + bdquo: '\u201E', + becaus: '\u2235', + because: '\u2235', + bemptyv: '\u29B0', + bepsi: '\u03F6', + bernou: '\u212C', + beta: '\u03B2', + beth: '\u2136', + between: '\u226C', + bfr: '\uD835\uDD1F', + bigcap: '\u22C2', + bigcirc: '\u25EF', + bigcup: '\u22C3', + bigodot: '\u2A00', + bigoplus: '\u2A01', + bigotimes: '\u2A02', + bigsqcup: '\u2A06', + bigstar: '\u2605', + bigtriangledown: '\u25BD', + bigtriangleup: '\u25B3', + biguplus: '\u2A04', + bigvee: '\u22C1', + bigwedge: '\u22C0', + bkarow: '\u290D', + blacklozenge: '\u29EB', + blacksquare: '\u25AA', + blacktriangle: '\u25B4', + blacktriangledown: '\u25BE', + blacktriangleleft: '\u25C2', + blacktriangleright: '\u25B8', + blank: '\u2423', + blk12: '\u2592', + blk14: '\u2591', + blk34: '\u2593', + block: '\u2588', + bne: '\u003D\u20E5', + bnequiv: '\u2261\u20E5', + bnot: '\u2310', + bopf: '\uD835\uDD53', + bot: '\u22A5', + bottom: '\u22A5', + bowtie: '\u22C8', + boxDL: '\u2557', + boxDR: '\u2554', + boxDl: '\u2556', + boxDr: '\u2553', + boxH: '\u2550', + boxHD: '\u2566', + boxHU: '\u2569', + boxHd: '\u2564', + boxHu: '\u2567', + boxUL: '\u255D', + boxUR: '\u255A', + boxUl: '\u255C', + boxUr: '\u2559', + boxV: '\u2551', + boxVH: '\u256C', + boxVL: '\u2563', + boxVR: '\u2560', + boxVh: '\u256B', + boxVl: '\u2562', + boxVr: '\u255F', + boxbox: '\u29C9', + boxdL: '\u2555', + boxdR: '\u2552', + boxdl: '\u2510', + boxdr: '\u250C', + boxh: '\u2500', + boxhD: '\u2565', + boxhU: '\u2568', + boxhd: '\u252C', + boxhu: '\u2534', + boxminus: '\u229F', + boxplus: '\u229E', + boxtimes: '\u22A0', + boxuL: '\u255B', + boxuR: '\u2558', + boxul: '\u2518', + boxur: '\u2514', + boxv: '\u2502', + boxvH: '\u256A', + boxvL: '\u2561', + boxvR: '\u255E', + boxvh: '\u253C', + boxvl: '\u2524', + boxvr: '\u251C', + bprime: '\u2035', + breve: '\u02D8', + brvbar: '\u00A6', + bscr: '\uD835\uDCB7', + bsemi: '\u204F', + bsim: '\u223D', + bsime: '\u22CD', + bsol: '\u005C', + bsolb: '\u29C5', + bsolhsub: '\u27C8', + bull: '\u2022', + bullet: '\u2022', + bump: '\u224E', + bumpE: '\u2AAE', + bumpe: '\u224F', + bumpeq: '\u224F', + cacute: '\u0107', + cap: '\u2229', + capand: '\u2A44', + capbrcup: '\u2A49', + capcap: '\u2A4B', + capcup: '\u2A47', + capdot: '\u2A40', + caps: '\u2229\uFE00', + caret: '\u2041', + caron: '\u02C7', + ccaps: '\u2A4D', + ccaron: '\u010D', + ccedil: '\u00E7', + ccirc: '\u0109', + ccups: '\u2A4C', + ccupssm: '\u2A50', + cdot: '\u010B', + cedil: '\u00B8', + cemptyv: '\u29B2', + cent: '\u00A2', + centerdot: '\u00B7', + cfr: '\uD835\uDD20', + chcy: '\u0447', + check: '\u2713', + checkmark: '\u2713', + chi: '\u03C7', + cir: '\u25CB', + cirE: '\u29C3', + circ: '\u02C6', + circeq: '\u2257', + circlearrowleft: '\u21BA', + circlearrowright: '\u21BB', + circledR: '\u00AE', + circledS: '\u24C8', + circledast: '\u229B', + circledcirc: '\u229A', + circleddash: '\u229D', + cire: '\u2257', + cirfnint: '\u2A10', + cirmid: '\u2AEF', + cirscir: '\u29C2', + clubs: '\u2663', + clubsuit: '\u2663', + colon: '\u003A', + colone: '\u2254', + coloneq: '\u2254', + comma: '\u002C', + commat: '\u0040', + comp: '\u2201', + compfn: '\u2218', + complement: '\u2201', + complexes: '\u2102', + cong: '\u2245', + congdot: '\u2A6D', + conint: '\u222E', + copf: '\uD835\uDD54', + coprod: '\u2210', + copy: '\u00A9', + copysr: '\u2117', + crarr: '\u21B5', + cross: '\u2717', + cscr: '\uD835\uDCB8', + csub: '\u2ACF', + csube: '\u2AD1', + csup: '\u2AD0', + csupe: '\u2AD2', + ctdot: '\u22EF', + cudarrl: '\u2938', + cudarrr: '\u2935', + cuepr: '\u22DE', + cuesc: '\u22DF', + cularr: '\u21B6', + cularrp: '\u293D', + cup: '\u222A', + cupbrcap: '\u2A48', + cupcap: '\u2A46', + cupcup: '\u2A4A', + cupdot: '\u228D', + cupor: '\u2A45', + cups: '\u222A\uFE00', + curarr: '\u21B7', + curarrm: '\u293C', + curlyeqprec: '\u22DE', + curlyeqsucc: '\u22DF', + curlyvee: '\u22CE', + curlywedge: '\u22CF', + curren: '\u00A4', + curvearrowleft: '\u21B6', + curvearrowright: '\u21B7', + cuvee: '\u22CE', + cuwed: '\u22CF', + cwconint: '\u2232', + cwint: '\u2231', + cylcty: '\u232D', + dArr: '\u21D3', + dHar: '\u2965', + dagger: '\u2020', + daleth: '\u2138', + darr: '\u2193', + dash: '\u2010', + dashv: '\u22A3', + dbkarow: '\u290F', + dblac: '\u02DD', + dcaron: '\u010F', + dcy: '\u0434', + dd: '\u2146', + ddagger: '\u2021', + ddarr: '\u21CA', + ddotseq: '\u2A77', + deg: '\u00B0', + delta: '\u03B4', + demptyv: '\u29B1', + dfisht: '\u297F', + dfr: '\uD835\uDD21', + dharl: '\u21C3', + dharr: '\u21C2', + diam: '\u22C4', + diamond: '\u22C4', + diamondsuit: '\u2666', + diams: '\u2666', + die: '\u00A8', + digamma: '\u03DD', + disin: '\u22F2', + div: '\u00F7', + divide: '\u00F7', + divideontimes: '\u22C7', + divonx: '\u22C7', + djcy: '\u0452', + dlcorn: '\u231E', + dlcrop: '\u230D', + dollar: '\u0024', + dopf: '\uD835\uDD55', + dot: '\u02D9', + doteq: '\u2250', + doteqdot: '\u2251', + dotminus: '\u2238', + dotplus: '\u2214', + dotsquare: '\u22A1', + doublebarwedge: '\u2306', + downarrow: '\u2193', + downdownarrows: '\u21CA', + downharpoonleft: '\u21C3', + downharpoonright: '\u21C2', + drbkarow: '\u2910', + drcorn: '\u231F', + drcrop: '\u230C', + dscr: '\uD835\uDCB9', + dscy: '\u0455', + dsol: '\u29F6', + dstrok: '\u0111', + dtdot: '\u22F1', + dtri: '\u25BF', + dtrif: '\u25BE', + duarr: '\u21F5', + duhar: '\u296F', + dwangle: '\u29A6', + dzcy: '\u045F', + dzigrarr: '\u27FF', + eDDot: '\u2A77', + eDot: '\u2251', + eacute: '\u00E9', + easter: '\u2A6E', + ecaron: '\u011B', + ecir: '\u2256', + ecirc: '\u00EA', + ecolon: '\u2255', + ecy: '\u044D', + edot: '\u0117', + ee: '\u2147', + efDot: '\u2252', + efr: '\uD835\uDD22', + eg: '\u2A9A', + egrave: '\u00E8', + egs: '\u2A96', + egsdot: '\u2A98', + el: '\u2A99', + elinters: '\u23E7', + ell: '\u2113', + els: '\u2A95', + elsdot: '\u2A97', + emacr: '\u0113', + empty: '\u2205', + emptyset: '\u2205', + emptyv: '\u2205', + emsp13: '\u2004', + emsp14: '\u2005', + emsp: '\u2003', + eng: '\u014B', + ensp: '\u2002', + eogon: '\u0119', + eopf: '\uD835\uDD56', + epar: '\u22D5', + eparsl: '\u29E3', + eplus: '\u2A71', + epsi: '\u03B5', + epsilon: '\u03B5', + epsiv: '\u03F5', + eqcirc: '\u2256', + eqcolon: '\u2255', + eqsim: '\u2242', + eqslantgtr: '\u2A96', + eqslantless: '\u2A95', + equals: '\u003D', + equest: '\u225F', + equiv: '\u2261', + equivDD: '\u2A78', + eqvparsl: '\u29E5', + erDot: '\u2253', + erarr: '\u2971', + escr: '\u212F', + esdot: '\u2250', + esim: '\u2242', + eta: '\u03B7', + eth: '\u00F0', + euml: '\u00EB', + euro: '\u20AC', + excl: '\u0021', + exist: '\u2203', + expectation: '\u2130', + exponentiale: '\u2147', + fallingdotseq: '\u2252', + fcy: '\u0444', + female: '\u2640', + ffilig: '\uFB03', + fflig: '\uFB00', + ffllig: '\uFB04', + ffr: '\uD835\uDD23', + filig: '\uFB01', + fjlig: '\u0066\u006A', + flat: '\u266D', + fllig: '\uFB02', + fltns: '\u25B1', + fnof: '\u0192', + fopf: '\uD835\uDD57', + forall: '\u2200', + fork: '\u22D4', + forkv: '\u2AD9', + fpartint: '\u2A0D', + frac12: '\u00BD', + frac13: '\u2153', + frac14: '\u00BC', + frac15: '\u2155', + frac16: '\u2159', + frac18: '\u215B', + frac23: '\u2154', + frac25: '\u2156', + frac34: '\u00BE', + frac35: '\u2157', + frac38: '\u215C', + frac45: '\u2158', + frac56: '\u215A', + frac58: '\u215D', + frac78: '\u215E', + frasl: '\u2044', + frown: '\u2322', + fscr: '\uD835\uDCBB', + gE: '\u2267', + gEl: '\u2A8C', + gacute: '\u01F5', + gamma: '\u03B3', + gammad: '\u03DD', + gap: '\u2A86', + gbreve: '\u011F', + gcirc: '\u011D', + gcy: '\u0433', + gdot: '\u0121', + ge: '\u2265', + gel: '\u22DB', + geq: '\u2265', + geqq: '\u2267', + geqslant: '\u2A7E', + ges: '\u2A7E', + gescc: '\u2AA9', + gesdot: '\u2A80', + gesdoto: '\u2A82', + gesdotol: '\u2A84', + gesl: '\u22DB\uFE00', + gesles: '\u2A94', + gfr: '\uD835\uDD24', + gg: '\u226B', + ggg: '\u22D9', + gimel: '\u2137', + gjcy: '\u0453', + gl: '\u2277', + glE: '\u2A92', + gla: '\u2AA5', + glj: '\u2AA4', + gnE: '\u2269', + gnap: '\u2A8A', + gnapprox: '\u2A8A', + gne: '\u2A88', + gneq: '\u2A88', + gneqq: '\u2269', + gnsim: '\u22E7', + gopf: '\uD835\uDD58', + grave: '\u0060', + gscr: '\u210A', + gsim: '\u2273', + gsime: '\u2A8E', + gsiml: '\u2A90', + gt: '\u003E', + gtcc: '\u2AA7', + gtcir: '\u2A7A', + gtdot: '\u22D7', + gtlPar: '\u2995', + gtquest: '\u2A7C', + gtrapprox: '\u2A86', + gtrarr: '\u2978', + gtrdot: '\u22D7', + gtreqless: '\u22DB', + gtreqqless: '\u2A8C', + gtrless: '\u2277', + gtrsim: '\u2273', + gvertneqq: '\u2269\uFE00', + gvnE: '\u2269\uFE00', + hArr: '\u21D4', + hairsp: '\u200A', + half: '\u00BD', + hamilt: '\u210B', + hardcy: '\u044A', + harr: '\u2194', + harrcir: '\u2948', + harrw: '\u21AD', + hbar: '\u210F', + hcirc: '\u0125', + hearts: '\u2665', + heartsuit: '\u2665', + hellip: '\u2026', + hercon: '\u22B9', + hfr: '\uD835\uDD25', + hksearow: '\u2925', + hkswarow: '\u2926', + hoarr: '\u21FF', + homtht: '\u223B', + hookleftarrow: '\u21A9', + hookrightarrow: '\u21AA', + hopf: '\uD835\uDD59', + horbar: '\u2015', + hscr: '\uD835\uDCBD', + hslash: '\u210F', + hstrok: '\u0127', + hybull: '\u2043', + hyphen: '\u2010', + iacute: '\u00ED', + ic: '\u2063', + icirc: '\u00EE', + icy: '\u0438', + iecy: '\u0435', + iexcl: '\u00A1', + iff: '\u21D4', + ifr: '\uD835\uDD26', + igrave: '\u00EC', + ii: '\u2148', + iiiint: '\u2A0C', + iiint: '\u222D', + iinfin: '\u29DC', + iiota: '\u2129', + ijlig: '\u0133', + imacr: '\u012B', + image: '\u2111', + imagline: '\u2110', + imagpart: '\u2111', + imath: '\u0131', + imof: '\u22B7', + imped: '\u01B5', + in: '\u2208', + incare: '\u2105', + infin: '\u221E', + infintie: '\u29DD', + inodot: '\u0131', + int: '\u222B', + intcal: '\u22BA', + integers: '\u2124', + intercal: '\u22BA', + intlarhk: '\u2A17', + intprod: '\u2A3C', + iocy: '\u0451', + iogon: '\u012F', + iopf: '\uD835\uDD5A', + iota: '\u03B9', + iprod: '\u2A3C', + iquest: '\u00BF', + iscr: '\uD835\uDCBE', + isin: '\u2208', + isinE: '\u22F9', + isindot: '\u22F5', + isins: '\u22F4', + isinsv: '\u22F3', + isinv: '\u2208', + it: '\u2062', + itilde: '\u0129', + iukcy: '\u0456', + iuml: '\u00EF', + jcirc: '\u0135', + jcy: '\u0439', + jfr: '\uD835\uDD27', + jmath: '\u0237', + jopf: '\uD835\uDD5B', + jscr: '\uD835\uDCBF', + jsercy: '\u0458', + jukcy: '\u0454', + kappa: '\u03BA', + kappav: '\u03F0', + kcedil: '\u0137', + kcy: '\u043A', + kfr: '\uD835\uDD28', + kgreen: '\u0138', + khcy: '\u0445', + kjcy: '\u045C', + kopf: '\uD835\uDD5C', + kscr: '\uD835\uDCC0', + lAarr: '\u21DA', + lArr: '\u21D0', + lAtail: '\u291B', + lBarr: '\u290E', + lE: '\u2266', + lEg: '\u2A8B', + lHar: '\u2962', + lacute: '\u013A', + laemptyv: '\u29B4', + lagran: '\u2112', + lambda: '\u03BB', + lang: '\u27E8', + langd: '\u2991', + langle: '\u27E8', + lap: '\u2A85', + laquo: '\u00AB', + larr: '\u2190', + larrb: '\u21E4', + larrbfs: '\u291F', + larrfs: '\u291D', + larrhk: '\u21A9', + larrlp: '\u21AB', + larrpl: '\u2939', + larrsim: '\u2973', + larrtl: '\u21A2', + lat: '\u2AAB', + latail: '\u2919', + late: '\u2AAD', + lates: '\u2AAD\uFE00', + lbarr: '\u290C', + lbbrk: '\u2772', + lbrace: '\u007B', + lbrack: '\u005B', + lbrke: '\u298B', + lbrksld: '\u298F', + lbrkslu: '\u298D', + lcaron: '\u013E', + lcedil: '\u013C', + lceil: '\u2308', + lcub: '\u007B', + lcy: '\u043B', + ldca: '\u2936', + ldquo: '\u201C', + ldquor: '\u201E', + ldrdhar: '\u2967', + ldrushar: '\u294B', + ldsh: '\u21B2', + le: '\u2264', + leftarrow: '\u2190', + leftarrowtail: '\u21A2', + leftharpoondown: '\u21BD', + leftharpoonup: '\u21BC', + leftleftarrows: '\u21C7', + leftrightarrow: '\u2194', + leftrightarrows: '\u21C6', + leftrightharpoons: '\u21CB', + leftrightsquigarrow: '\u21AD', + leftthreetimes: '\u22CB', + leg: '\u22DA', + leq: '\u2264', + leqq: '\u2266', + leqslant: '\u2A7D', + les: '\u2A7D', + lescc: '\u2AA8', + lesdot: '\u2A7F', + lesdoto: '\u2A81', + lesdotor: '\u2A83', + lesg: '\u22DA\uFE00', + lesges: '\u2A93', + lessapprox: '\u2A85', + lessdot: '\u22D6', + lesseqgtr: '\u22DA', + lesseqqgtr: '\u2A8B', + lessgtr: '\u2276', + lesssim: '\u2272', + lfisht: '\u297C', + lfloor: '\u230A', + lfr: '\uD835\uDD29', + lg: '\u2276', + lgE: '\u2A91', + lhard: '\u21BD', + lharu: '\u21BC', + lharul: '\u296A', + lhblk: '\u2584', + ljcy: '\u0459', + ll: '\u226A', + llarr: '\u21C7', + llcorner: '\u231E', + llhard: '\u296B', + lltri: '\u25FA', + lmidot: '\u0140', + lmoust: '\u23B0', + lmoustache: '\u23B0', + lnE: '\u2268', + lnap: '\u2A89', + lnapprox: '\u2A89', + lne: '\u2A87', + lneq: '\u2A87', + lneqq: '\u2268', + lnsim: '\u22E6', + loang: '\u27EC', + loarr: '\u21FD', + lobrk: '\u27E6', + longleftarrow: '\u27F5', + longleftrightarrow: '\u27F7', + longmapsto: '\u27FC', + longrightarrow: '\u27F6', + looparrowleft: '\u21AB', + looparrowright: '\u21AC', + lopar: '\u2985', + lopf: '\uD835\uDD5D', + loplus: '\u2A2D', + lotimes: '\u2A34', + lowast: '\u2217', + lowbar: '\u005F', + loz: '\u25CA', + lozenge: '\u25CA', + lozf: '\u29EB', + lpar: '\u0028', + lparlt: '\u2993', + lrarr: '\u21C6', + lrcorner: '\u231F', + lrhar: '\u21CB', + lrhard: '\u296D', + lrm: '\u200E', + lrtri: '\u22BF', + lsaquo: '\u2039', + lscr: '\uD835\uDCC1', + lsh: '\u21B0', + lsim: '\u2272', + lsime: '\u2A8D', + lsimg: '\u2A8F', + lsqb: '\u005B', + lsquo: '\u2018', + lsquor: '\u201A', + lstrok: '\u0142', + lt: '\u003C', + ltcc: '\u2AA6', + ltcir: '\u2A79', + ltdot: '\u22D6', + lthree: '\u22CB', + ltimes: '\u22C9', + ltlarr: '\u2976', + ltquest: '\u2A7B', + ltrPar: '\u2996', + ltri: '\u25C3', + ltrie: '\u22B4', + ltrif: '\u25C2', + lurdshar: '\u294A', + luruhar: '\u2966', + lvertneqq: '\u2268\uFE00', + lvnE: '\u2268\uFE00', + mDDot: '\u223A', + macr: '\u00AF', + male: '\u2642', + malt: '\u2720', + maltese: '\u2720', + map: '\u21A6', + mapsto: '\u21A6', + mapstodown: '\u21A7', + mapstoleft: '\u21A4', + mapstoup: '\u21A5', + marker: '\u25AE', + mcomma: '\u2A29', + mcy: '\u043C', + mdash: '\u2014', + measuredangle: '\u2221', + mfr: '\uD835\uDD2A', + mho: '\u2127', + micro: '\u00B5', + mid: '\u2223', + midast: '\u002A', + midcir: '\u2AF0', + middot: '\u00B7', + minus: '\u2212', + minusb: '\u229F', + minusd: '\u2238', + minusdu: '\u2A2A', + mlcp: '\u2ADB', + mldr: '\u2026', + mnplus: '\u2213', + models: '\u22A7', + mopf: '\uD835\uDD5E', + mp: '\u2213', + mscr: '\uD835\uDCC2', + mstpos: '\u223E', + mu: '\u03BC', + multimap: '\u22B8', + mumap: '\u22B8', + nGg: '\u22D9\u0338', + nGt: '\u226B\u20D2', + nGtv: '\u226B\u0338', + nLeftarrow: '\u21CD', + nLeftrightarrow: '\u21CE', + nLl: '\u22D8\u0338', + nLt: '\u226A\u20D2', + nLtv: '\u226A\u0338', + nRightarrow: '\u21CF', + nVDash: '\u22AF', + nVdash: '\u22AE', + nabla: '\u2207', + nacute: '\u0144', + nang: '\u2220\u20D2', + nap: '\u2249', + napE: '\u2A70\u0338', + napid: '\u224B\u0338', + napos: '\u0149', + napprox: '\u2249', + natur: '\u266E', + natural: '\u266E', + naturals: '\u2115', + nbsp: '\u00A0', + nbump: '\u224E\u0338', + nbumpe: '\u224F\u0338', + ncap: '\u2A43', + ncaron: '\u0148', + ncedil: '\u0146', + ncong: '\u2247', + ncongdot: '\u2A6D\u0338', + ncup: '\u2A42', + ncy: '\u043D', + ndash: '\u2013', + ne: '\u2260', + neArr: '\u21D7', + nearhk: '\u2924', + nearr: '\u2197', + nearrow: '\u2197', + nedot: '\u2250\u0338', + nequiv: '\u2262', + nesear: '\u2928', + nesim: '\u2242\u0338', + nexist: '\u2204', + nexists: '\u2204', + nfr: '\uD835\uDD2B', + ngE: '\u2267\u0338', + nge: '\u2271', + ngeq: '\u2271', + ngeqq: '\u2267\u0338', + ngeqslant: '\u2A7E\u0338', + nges: '\u2A7E\u0338', + ngsim: '\u2275', + ngt: '\u226F', + ngtr: '\u226F', + nhArr: '\u21CE', + nharr: '\u21AE', + nhpar: '\u2AF2', + ni: '\u220B', + nis: '\u22FC', + nisd: '\u22FA', + niv: '\u220B', + njcy: '\u045A', + nlArr: '\u21CD', + nlE: '\u2266\u0338', + nlarr: '\u219A', + nldr: '\u2025', + nle: '\u2270', + nleftarrow: '\u219A', + nleftrightarrow: '\u21AE', + nleq: '\u2270', + nleqq: '\u2266\u0338', + nleqslant: '\u2A7D\u0338', + nles: '\u2A7D\u0338', + nless: '\u226E', + nlsim: '\u2274', + nlt: '\u226E', + nltri: '\u22EA', + nltrie: '\u22EC', + nmid: '\u2224', + nopf: '\uD835\uDD5F', + not: '\u00AC', + notin: '\u2209', + notinE: '\u22F9\u0338', + notindot: '\u22F5\u0338', + notinva: '\u2209', + notinvb: '\u22F7', + notinvc: '\u22F6', + notni: '\u220C', + notniva: '\u220C', + notnivb: '\u22FE', + notnivc: '\u22FD', + npar: '\u2226', + nparallel: '\u2226', + nparsl: '\u2AFD\u20E5', + npart: '\u2202\u0338', + npolint: '\u2A14', + npr: '\u2280', + nprcue: '\u22E0', + npre: '\u2AAF\u0338', + nprec: '\u2280', + npreceq: '\u2AAF\u0338', + nrArr: '\u21CF', + nrarr: '\u219B', + nrarrc: '\u2933\u0338', + nrarrw: '\u219D\u0338', + nrightarrow: '\u219B', + nrtri: '\u22EB', + nrtrie: '\u22ED', + nsc: '\u2281', + nsccue: '\u22E1', + nsce: '\u2AB0\u0338', + nscr: '\uD835\uDCC3', + nshortmid: '\u2224', + nshortparallel: '\u2226', + nsim: '\u2241', + nsime: '\u2244', + nsimeq: '\u2244', + nsmid: '\u2224', + nspar: '\u2226', + nsqsube: '\u22E2', + nsqsupe: '\u22E3', + nsub: '\u2284', + nsubE: '\u2AC5\u0338', + nsube: '\u2288', + nsubset: '\u2282\u20D2', + nsubseteq: '\u2288', + nsubseteqq: '\u2AC5\u0338', + nsucc: '\u2281', + nsucceq: '\u2AB0\u0338', + nsup: '\u2285', + nsupE: '\u2AC6\u0338', + nsupe: '\u2289', + nsupset: '\u2283\u20D2', + nsupseteq: '\u2289', + nsupseteqq: '\u2AC6\u0338', + ntgl: '\u2279', + ntilde: '\u00F1', + ntlg: '\u2278', + ntriangleleft: '\u22EA', + ntrianglelefteq: '\u22EC', + ntriangleright: '\u22EB', + ntrianglerighteq: '\u22ED', + nu: '\u03BD', + num: '\u0023', + numero: '\u2116', + numsp: '\u2007', + nvDash: '\u22AD', + nvHarr: '\u2904', + nvap: '\u224D\u20D2', + nvdash: '\u22AC', + nvge: '\u2265\u20D2', + nvgt: '\u003E\u20D2', + nvinfin: '\u29DE', + nvlArr: '\u2902', + nvle: '\u2264\u20D2', + nvlt: '\u003C\u20D2', + nvltrie: '\u22B4\u20D2', + nvrArr: '\u2903', + nvrtrie: '\u22B5\u20D2', + nvsim: '\u223C\u20D2', + nwArr: '\u21D6', + nwarhk: '\u2923', + nwarr: '\u2196', + nwarrow: '\u2196', + nwnear: '\u2927', + oS: '\u24C8', + oacute: '\u00F3', + oast: '\u229B', + ocir: '\u229A', + ocirc: '\u00F4', + ocy: '\u043E', + odash: '\u229D', + odblac: '\u0151', + odiv: '\u2A38', + odot: '\u2299', + odsold: '\u29BC', + oelig: '\u0153', + ofcir: '\u29BF', + ofr: '\uD835\uDD2C', + ogon: '\u02DB', + ograve: '\u00F2', + ogt: '\u29C1', + ohbar: '\u29B5', + ohm: '\u03A9', + oint: '\u222E', + olarr: '\u21BA', + olcir: '\u29BE', + olcross: '\u29BB', + oline: '\u203E', + olt: '\u29C0', + omacr: '\u014D', + omega: '\u03C9', + omicron: '\u03BF', + omid: '\u29B6', + ominus: '\u2296', + oopf: '\uD835\uDD60', + opar: '\u29B7', + operp: '\u29B9', + oplus: '\u2295', + or: '\u2228', + orarr: '\u21BB', + ord: '\u2A5D', + order: '\u2134', + orderof: '\u2134', + ordf: '\u00AA', + ordm: '\u00BA', + origof: '\u22B6', + oror: '\u2A56', + orslope: '\u2A57', + orv: '\u2A5B', + oscr: '\u2134', + oslash: '\u00F8', + osol: '\u2298', + otilde: '\u00F5', + otimes: '\u2297', + otimesas: '\u2A36', + ouml: '\u00F6', + ovbar: '\u233D', + par: '\u2225', + para: '\u00B6', + parallel: '\u2225', + parsim: '\u2AF3', + parsl: '\u2AFD', + part: '\u2202', + pcy: '\u043F', + percnt: '\u0025', + period: '\u002E', + permil: '\u2030', + perp: '\u22A5', + pertenk: '\u2031', + pfr: '\uD835\uDD2D', + phi: '\u03C6', + phiv: '\u03D5', + phmmat: '\u2133', + phone: '\u260E', + pi: '\u03C0', + pitchfork: '\u22D4', + piv: '\u03D6', + planck: '\u210F', + planckh: '\u210E', + plankv: '\u210F', + plus: '\u002B', + plusacir: '\u2A23', + plusb: '\u229E', + pluscir: '\u2A22', + plusdo: '\u2214', + plusdu: '\u2A25', + pluse: '\u2A72', + plusmn: '\u00B1', + plussim: '\u2A26', + plustwo: '\u2A27', + pm: '\u00B1', + pointint: '\u2A15', + popf: '\uD835\uDD61', + pound: '\u00A3', + pr: '\u227A', + prE: '\u2AB3', + prap: '\u2AB7', + prcue: '\u227C', + pre: '\u2AAF', + prec: '\u227A', + precapprox: '\u2AB7', + preccurlyeq: '\u227C', + preceq: '\u2AAF', + precnapprox: '\u2AB9', + precneqq: '\u2AB5', + precnsim: '\u22E8', + precsim: '\u227E', + prime: '\u2032', + primes: '\u2119', + prnE: '\u2AB5', + prnap: '\u2AB9', + prnsim: '\u22E8', + prod: '\u220F', + profalar: '\u232E', + profline: '\u2312', + profsurf: '\u2313', + prop: '\u221D', + propto: '\u221D', + prsim: '\u227E', + prurel: '\u22B0', + pscr: '\uD835\uDCC5', + psi: '\u03C8', + puncsp: '\u2008', + qfr: '\uD835\uDD2E', + qint: '\u2A0C', + qopf: '\uD835\uDD62', + qprime: '\u2057', + qscr: '\uD835\uDCC6', + quaternions: '\u210D', + quatint: '\u2A16', + quest: '\u003F', + questeq: '\u225F', + quot: '\u0022', + rAarr: '\u21DB', + rArr: '\u21D2', + rAtail: '\u291C', + rBarr: '\u290F', + rHar: '\u2964', + race: '\u223D\u0331', + racute: '\u0155', + radic: '\u221A', + raemptyv: '\u29B3', + rang: '\u27E9', + rangd: '\u2992', + range: '\u29A5', + rangle: '\u27E9', + raquo: '\u00BB', + rarr: '\u2192', + rarrap: '\u2975', + rarrb: '\u21E5', + rarrbfs: '\u2920', + rarrc: '\u2933', + rarrfs: '\u291E', + rarrhk: '\u21AA', + rarrlp: '\u21AC', + rarrpl: '\u2945', + rarrsim: '\u2974', + rarrtl: '\u21A3', + rarrw: '\u219D', + ratail: '\u291A', + ratio: '\u2236', + rationals: '\u211A', + rbarr: '\u290D', + rbbrk: '\u2773', + rbrace: '\u007D', + rbrack: '\u005D', + rbrke: '\u298C', + rbrksld: '\u298E', + rbrkslu: '\u2990', + rcaron: '\u0159', + rcedil: '\u0157', + rceil: '\u2309', + rcub: '\u007D', + rcy: '\u0440', + rdca: '\u2937', + rdldhar: '\u2969', + rdquo: '\u201D', + rdquor: '\u201D', + rdsh: '\u21B3', + real: '\u211C', + realine: '\u211B', + realpart: '\u211C', + reals: '\u211D', + rect: '\u25AD', + reg: '\u00AE', + rfisht: '\u297D', + rfloor: '\u230B', + rfr: '\uD835\uDD2F', + rhard: '\u21C1', + rharu: '\u21C0', + rharul: '\u296C', + rho: '\u03C1', + rhov: '\u03F1', + rightarrow: '\u2192', + rightarrowtail: '\u21A3', + rightharpoondown: '\u21C1', + rightharpoonup: '\u21C0', + rightleftarrows: '\u21C4', + rightleftharpoons: '\u21CC', + rightrightarrows: '\u21C9', + rightsquigarrow: '\u219D', + rightthreetimes: '\u22CC', + ring: '\u02DA', + risingdotseq: '\u2253', + rlarr: '\u21C4', + rlhar: '\u21CC', + rlm: '\u200F', + rmoust: '\u23B1', + rmoustache: '\u23B1', + rnmid: '\u2AEE', + roang: '\u27ED', + roarr: '\u21FE', + robrk: '\u27E7', + ropar: '\u2986', + ropf: '\uD835\uDD63', + roplus: '\u2A2E', + rotimes: '\u2A35', + rpar: '\u0029', + rpargt: '\u2994', + rppolint: '\u2A12', + rrarr: '\u21C9', + rsaquo: '\u203A', + rscr: '\uD835\uDCC7', + rsh: '\u21B1', + rsqb: '\u005D', + rsquo: '\u2019', + rsquor: '\u2019', + rthree: '\u22CC', + rtimes: '\u22CA', + rtri: '\u25B9', + rtrie: '\u22B5', + rtrif: '\u25B8', + rtriltri: '\u29CE', + ruluhar: '\u2968', + rx: '\u211E', + sacute: '\u015B', + sbquo: '\u201A', + sc: '\u227B', + scE: '\u2AB4', + scap: '\u2AB8', + scaron: '\u0161', + sccue: '\u227D', + sce: '\u2AB0', + scedil: '\u015F', + scirc: '\u015D', + scnE: '\u2AB6', + scnap: '\u2ABA', + scnsim: '\u22E9', + scpolint: '\u2A13', + scsim: '\u227F', + scy: '\u0441', + sdot: '\u22C5', + sdotb: '\u22A1', + sdote: '\u2A66', + seArr: '\u21D8', + searhk: '\u2925', + searr: '\u2198', + searrow: '\u2198', + sect: '\u00A7', + semi: '\u003B', + seswar: '\u2929', + setminus: '\u2216', + setmn: '\u2216', + sext: '\u2736', + sfr: '\uD835\uDD30', + sfrown: '\u2322', + sharp: '\u266F', + shchcy: '\u0449', + shcy: '\u0448', + shortmid: '\u2223', + shortparallel: '\u2225', + shy: '\u00AD', + sigma: '\u03C3', + sigmaf: '\u03C2', + sigmav: '\u03C2', + sim: '\u223C', + simdot: '\u2A6A', + sime: '\u2243', + simeq: '\u2243', + simg: '\u2A9E', + simgE: '\u2AA0', + siml: '\u2A9D', + simlE: '\u2A9F', + simne: '\u2246', + simplus: '\u2A24', + simrarr: '\u2972', + slarr: '\u2190', + smallsetminus: '\u2216', + smashp: '\u2A33', + smeparsl: '\u29E4', + smid: '\u2223', + smile: '\u2323', + smt: '\u2AAA', + smte: '\u2AAC', + smtes: '\u2AAC\uFE00', + softcy: '\u044C', + sol: '\u002F', + solb: '\u29C4', + solbar: '\u233F', + sopf: '\uD835\uDD64', + spades: '\u2660', + spadesuit: '\u2660', + spar: '\u2225', + sqcap: '\u2293', + sqcaps: '\u2293\uFE00', + sqcup: '\u2294', + sqcups: '\u2294\uFE00', + sqsub: '\u228F', + sqsube: '\u2291', + sqsubset: '\u228F', + sqsubseteq: '\u2291', + sqsup: '\u2290', + sqsupe: '\u2292', + sqsupset: '\u2290', + sqsupseteq: '\u2292', + squ: '\u25A1', + square: '\u25A1', + squarf: '\u25AA', + squf: '\u25AA', + srarr: '\u2192', + sscr: '\uD835\uDCC8', + ssetmn: '\u2216', + ssmile: '\u2323', + sstarf: '\u22C6', + star: '\u2606', + starf: '\u2605', + straightepsilon: '\u03F5', + straightphi: '\u03D5', + strns: '\u00AF', + sub: '\u2282', + subE: '\u2AC5', + subdot: '\u2ABD', + sube: '\u2286', + subedot: '\u2AC3', + submult: '\u2AC1', + subnE: '\u2ACB', + subne: '\u228A', + subplus: '\u2ABF', + subrarr: '\u2979', + subset: '\u2282', + subseteq: '\u2286', + subseteqq: '\u2AC5', + subsetneq: '\u228A', + subsetneqq: '\u2ACB', + subsim: '\u2AC7', + subsub: '\u2AD5', + subsup: '\u2AD3', + succ: '\u227B', + succapprox: '\u2AB8', + succcurlyeq: '\u227D', + succeq: '\u2AB0', + succnapprox: '\u2ABA', + succneqq: '\u2AB6', + succnsim: '\u22E9', + succsim: '\u227F', + sum: '\u2211', + sung: '\u266A', + sup1: '\u00B9', + sup2: '\u00B2', + sup3: '\u00B3', + sup: '\u2283', + supE: '\u2AC6', + supdot: '\u2ABE', + supdsub: '\u2AD8', + supe: '\u2287', + supedot: '\u2AC4', + suphsol: '\u27C9', + suphsub: '\u2AD7', + suplarr: '\u297B', + supmult: '\u2AC2', + supnE: '\u2ACC', + supne: '\u228B', + supplus: '\u2AC0', + supset: '\u2283', + supseteq: '\u2287', + supseteqq: '\u2AC6', + supsetneq: '\u228B', + supsetneqq: '\u2ACC', + supsim: '\u2AC8', + supsub: '\u2AD4', + supsup: '\u2AD6', + swArr: '\u21D9', + swarhk: '\u2926', + swarr: '\u2199', + swarrow: '\u2199', + swnwar: '\u292A', + szlig: '\u00DF', + target: '\u2316', + tau: '\u03C4', + tbrk: '\u23B4', + tcaron: '\u0165', + tcedil: '\u0163', + tcy: '\u0442', + tdot: '\u20DB', + telrec: '\u2315', + tfr: '\uD835\uDD31', + there4: '\u2234', + therefore: '\u2234', + theta: '\u03B8', + thetasym: '\u03D1', + thetav: '\u03D1', + thickapprox: '\u2248', + thicksim: '\u223C', + thinsp: '\u2009', + thkap: '\u2248', + thksim: '\u223C', + thorn: '\u00FE', + tilde: '\u02DC', + times: '\u00D7', + timesb: '\u22A0', + timesbar: '\u2A31', + timesd: '\u2A30', + tint: '\u222D', + toea: '\u2928', + top: '\u22A4', + topbot: '\u2336', + topcir: '\u2AF1', + topf: '\uD835\uDD65', + topfork: '\u2ADA', + tosa: '\u2929', + tprime: '\u2034', + trade: '\u2122', + triangle: '\u25B5', + triangledown: '\u25BF', + triangleleft: '\u25C3', + trianglelefteq: '\u22B4', + triangleq: '\u225C', + triangleright: '\u25B9', + trianglerighteq: '\u22B5', + tridot: '\u25EC', + trie: '\u225C', + triminus: '\u2A3A', + triplus: '\u2A39', + trisb: '\u29CD', + tritime: '\u2A3B', + trpezium: '\u23E2', + tscr: '\uD835\uDCC9', + tscy: '\u0446', + tshcy: '\u045B', + tstrok: '\u0167', + twixt: '\u226C', + twoheadleftarrow: '\u219E', + twoheadrightarrow: '\u21A0', + uArr: '\u21D1', + uHar: '\u2963', + uacute: '\u00FA', + uarr: '\u2191', + ubrcy: '\u045E', + ubreve: '\u016D', + ucirc: '\u00FB', + ucy: '\u0443', + udarr: '\u21C5', + udblac: '\u0171', + udhar: '\u296E', + ufisht: '\u297E', + ufr: '\uD835\uDD32', + ugrave: '\u00F9', + uharl: '\u21BF', + uharr: '\u21BE', + uhblk: '\u2580', + ulcorn: '\u231C', + ulcorner: '\u231C', + ulcrop: '\u230F', + ultri: '\u25F8', + umacr: '\u016B', + uml: '\u00A8', + uogon: '\u0173', + uopf: '\uD835\uDD66', + uparrow: '\u2191', + updownarrow: '\u2195', + upharpoonleft: '\u21BF', + upharpoonright: '\u21BE', + uplus: '\u228E', + upsi: '\u03C5', + upsih: '\u03D2', + upsilon: '\u03C5', + upuparrows: '\u21C8', + urcorn: '\u231D', + urcorner: '\u231D', + urcrop: '\u230E', + uring: '\u016F', + urtri: '\u25F9', + uscr: '\uD835\uDCCA', + utdot: '\u22F0', + utilde: '\u0169', + utri: '\u25B5', + utrif: '\u25B4', + uuarr: '\u21C8', + uuml: '\u00FC', + uwangle: '\u29A7', + vArr: '\u21D5', + vBar: '\u2AE8', + vBarv: '\u2AE9', + vDash: '\u22A8', + vangrt: '\u299C', + varepsilon: '\u03F5', + varkappa: '\u03F0', + varnothing: '\u2205', + varphi: '\u03D5', + varpi: '\u03D6', + varpropto: '\u221D', + varr: '\u2195', + varrho: '\u03F1', + varsigma: '\u03C2', + varsubsetneq: '\u228A\uFE00', + varsubsetneqq: '\u2ACB\uFE00', + varsupsetneq: '\u228B\uFE00', + varsupsetneqq: '\u2ACC\uFE00', + vartheta: '\u03D1', + vartriangleleft: '\u22B2', + vartriangleright: '\u22B3', + vcy: '\u0432', + vdash: '\u22A2', + vee: '\u2228', + veebar: '\u22BB', + veeeq: '\u225A', + vellip: '\u22EE', + verbar: '\u007C', + vert: '\u007C', + vfr: '\uD835\uDD33', + vltri: '\u22B2', + vnsub: '\u2282\u20D2', + vnsup: '\u2283\u20D2', + vopf: '\uD835\uDD67', + vprop: '\u221D', + vrtri: '\u22B3', + vscr: '\uD835\uDCCB', + vsubnE: '\u2ACB\uFE00', + vsubne: '\u228A\uFE00', + vsupnE: '\u2ACC\uFE00', + vsupne: '\u228B\uFE00', + vzigzag: '\u299A', + wcirc: '\u0175', + wedbar: '\u2A5F', + wedge: '\u2227', + wedgeq: '\u2259', + weierp: '\u2118', + wfr: '\uD835\uDD34', + wopf: '\uD835\uDD68', + wp: '\u2118', + wr: '\u2240', + wreath: '\u2240', + wscr: '\uD835\uDCCC', + xcap: '\u22C2', + xcirc: '\u25EF', + xcup: '\u22C3', + xdtri: '\u25BD', + xfr: '\uD835\uDD35', + xhArr: '\u27FA', + xharr: '\u27F7', + xi: '\u03BE', + xlArr: '\u27F8', + xlarr: '\u27F5', + xmap: '\u27FC', + xnis: '\u22FB', + xodot: '\u2A00', + xopf: '\uD835\uDD69', + xoplus: '\u2A01', + xotime: '\u2A02', + xrArr: '\u27F9', + xrarr: '\u27F6', + xscr: '\uD835\uDCCD', + xsqcup: '\u2A06', + xuplus: '\u2A04', + xutri: '\u25B3', + xvee: '\u22C1', + xwedge: '\u22C0', + yacute: '\u00FD', + yacy: '\u044F', + ycirc: '\u0177', + ycy: '\u044B', + yen: '\u00A5', + yfr: '\uD835\uDD36', + yicy: '\u0457', + yopf: '\uD835\uDD6A', + yscr: '\uD835\uDCCE', + yucy: '\u044E', + yuml: '\u00FF', + zacute: '\u017A', + zcaron: '\u017E', + zcy: '\u0437', + zdot: '\u017C', + zeetrf: '\u2128', + zeta: '\u03B6', + zfr: '\uD835\uDD37', + zhcy: '\u0436', + zigrarr: '\u21DD', + zopf: '\uD835\uDD6B', + zscr: '\uD835\uDCCF', + zwj: '\u200D', + zwnj: '\u200C', + }; + const decodeMap = { + '0': 65533, + '128': 8364, + '130': 8218, + '131': 402, + '132': 8222, + '133': 8230, + '134': 8224, + '135': 8225, + '136': 710, + '137': 8240, + '138': 352, + '139': 8249, + '140': 338, + '142': 381, + '145': 8216, + '146': 8217, + '147': 8220, + '148': 8221, + '149': 8226, + '150': 8211, + '151': 8212, + '152': 732, + '153': 8482, + '154': 353, + '155': 8250, + '156': 339, + '158': 382, + '159': 376, + }; + function decodeHTMLStrict(text) { + return text.replace(/&(?:[a-zA-Z]+|#[xX][\da-fA-F]+|#\d+);/g, (key) => { + if (key.charAt(1) === '#') { + const secondChar = key.charAt(2); + const codePoint = secondChar === 'X' || secondChar === 'x' ? parseInt(key.slice(3), 16) : parseInt(key.slice(2), 10); + return decodeCodePoint(codePoint); + } + return getOwnProperty(entities, key.slice(1, -1)) ?? key; + }); + } + function decodeCodePoint(codePoint) { + if ((codePoint >= 0xd800 && codePoint <= 0xdfff) || codePoint > 0x10ffff) { + return '\uFFFD'; + } + return String.fromCodePoint(getOwnProperty(decodeMap, codePoint) ?? codePoint); + } + + function scanJSXAttributeValue(parser, context) { + parser.startIndex = parser.tokenIndex = parser.index; + parser.startColumn = parser.tokenColumn = parser.column; + parser.startLine = parser.tokenLine = parser.line; + parser.setToken(CharTypes[parser.currentChar] & 8192 + ? scanJSXString(parser) + : scanSingleToken(parser, context, 0)); + return parser.getToken(); + } + function scanJSXString(parser) { + const quote = parser.currentChar; + let char = advanceChar(parser); + const start = parser.index; + while (char !== quote) { + if (parser.index >= parser.end) + parser.report(16); + char = advanceChar(parser); + } + if (char !== quote) + parser.report(16); + parser.tokenValue = parser.source.slice(start, parser.index); + advanceChar(parser); + if (parser.options.raw) + parser.tokenRaw = parser.source.slice(parser.tokenIndex, parser.index); + return 134283267; + } + function nextJSXToken(parser) { + parser.startIndex = parser.tokenIndex = parser.index; + parser.startColumn = parser.tokenColumn = parser.column; + parser.startLine = parser.tokenLine = parser.line; + if (parser.index >= parser.end) { + parser.setToken(1048576); + return; + } + if (parser.currentChar === 60) { + advanceChar(parser); + parser.setToken(8456256); + return; + } + if (parser.currentChar === 123) { + advanceChar(parser); + parser.setToken(2162700); + return; + } + let state = 0; + while (parser.index < parser.end) { + const type = CharTypes[parser.source.charCodeAt(parser.index)]; + if (type & 1024) { + state |= 1 | 4; + scanNewLine(parser); + } + else if (type & 2048) { + consumeLineFeed(parser, state); + state = (state & -5) | 1; + } + else { + advanceChar(parser); + } + if (CharTypes[parser.currentChar] & 16384) + break; + } + if (parser.tokenIndex === parser.index) + parser.report(0); + const raw = parser.source.slice(parser.tokenIndex, parser.index); + if (parser.options.raw) + parser.tokenRaw = raw; + parser.tokenValue = decodeHTMLStrict(raw); + parser.setToken(137); + } + function rescanJSXIdentifier(parser) { + if ((parser.getToken() & 143360) === 143360) { + const { index } = parser; + let char = parser.currentChar; + while (CharTypes[char] & (32768 | 2)) { + char = advanceChar(parser); + } + parser.tokenValue += parser.source.slice(index, parser.index); + parser.setToken(208897, true); + } + return parser.getToken(); + } + + class Scope { + parser; + type; + parent; + scopeError; + variableBindings = new Map(); + constructor(parser, type = 2, parent) { + this.parser = parser; + this.type = type; + this.parent = parent; + } + createChildScope(type) { + return new Scope(this.parser, type, this); + } + addVarOrBlock(context, name, kind, origin) { + if (kind & 4) { + this.addVarName(context, name, kind); + } + else { + this.addBlockName(context, name, kind, origin); + } + if (origin & 64) { + this.parser.declareUnboundVariable(name); + } + } + addVarName(context, name, kind) { + const { parser } = this; + let currentScope = this; + while (currentScope && (currentScope.type & 128) === 0) { + const { variableBindings } = currentScope; + const value = variableBindings.get(name); + if (value && value & 248) { + if (parser.options.webcompat && + (context & 1) === 0 && + ((kind & 128 && value & 68) || + (value & 128 && kind & 68))) ; + else { + parser.report(145, name); + } + } + if (currentScope === this) { + if (value && value & 1 && kind & 1) { + currentScope.recordScopeError(145, name); + } + } + if (value && + (value & 256 || (value & 512 && !parser.options.webcompat))) { + parser.report(145, name); + } + currentScope.variableBindings.set(name, kind); + currentScope = currentScope.parent; + } + } + hasVariable(name) { + return this.variableBindings.has(name); + } + addBlockName(context, name, kind, origin) { + const { parser } = this; + const value = this.variableBindings.get(name); + if (value && (value & 2) === 0) { + if (kind & 1) { + this.recordScopeError(145, name); + } + else if (parser.options.webcompat && + (context & 1) === 0 && + origin & 2 && + value === 64 && + kind === 64) ; + else { + parser.report(145, name); + } + } + if (this.type & 64 && + this.parent?.hasVariable(name) && + (this.parent.variableBindings.get(name) & 2) === 0) { + parser.report(145, name); + } + if (this.type & 512 && value && (value & 2) === 0) { + if (kind & 1) { + this.recordScopeError(145, name); + } + } + if (this.type & 32) { + if (this.parent.variableBindings.get(name) & 768) + parser.report(159, name); + } + this.variableBindings.set(name, kind); + } + recordScopeError(type, ...params) { + this.scopeError = { + type, + params, + start: this.parser.tokenStart, + end: this.parser.currentLocation, + }; + } + reportScopeError() { + const { scopeError } = this; + if (!scopeError) { + return; + } + throw new ParseError(scopeError.start, scopeError.end, scopeError.type, ...scopeError.params); + } + } + function createArrowHeadParsingScope(parser, context, value) { + const scope = parser.createScope().createChildScope(512); + scope.addBlockName(context, value, 1, 0); + return scope; + } + + class PrivateScope { + parser; + parent; + refs = Object.create(null); + privateIdentifiers = new Map(); + constructor(parser, parent) { + this.parser = parser; + this.parent = parent; + } + addPrivateIdentifier(name, kind) { + const { privateIdentifiers } = this; + let focusKind = kind & (32 | 768); + if (!(focusKind & 768)) + focusKind |= 768; + const value = privateIdentifiers.get(name); + if (this.hasPrivateIdentifier(name) && + ((value & 32) !== (focusKind & 32) || value & focusKind & 768)) { + this.parser.report(146, name); + } + privateIdentifiers.set(name, this.hasPrivateIdentifier(name) ? value | focusKind : focusKind); + } + addPrivateIdentifierRef(name) { + this.refs[name] ??= []; + this.refs[name].push(this.parser.tokenStart); + } + isPrivateIdentifierDefined(name) { + return this.hasPrivateIdentifier(name) || Boolean(this.parent?.isPrivateIdentifierDefined(name)); + } + validatePrivateIdentifierRefs() { + for (const name in this.refs) { + if (!this.isPrivateIdentifierDefined(name)) { + const { index, line, column } = this.refs[name][0]; + throw new ParseError({ index, line, column }, { index: index + name.length, line, column: column + name.length }, 4, name); + } + } + } + hasPrivateIdentifier(name) { + return this.privateIdentifiers.has(name); + } + } + + class Parser { + source; + options; + lastOnToken = null; + token = 1048576; + flags = 0; + index = 0; + line = 1; + column = 0; + startIndex = 0; + end = 0; + tokenIndex = 0; + startColumn = 0; + tokenColumn = 0; + tokenLine = 1; + startLine = 1; + tokenValue = ''; + tokenRaw = ''; + tokenRegExp = void 0; + currentChar = 0; + exportedNames = new Set(); + exportedBindings = new Set(); + assignable = 1; + destructible = 0; + leadingDecorators = { decorators: [] }; + constructor(source, options = {}) { + this.source = source; + this.options = options; + this.end = source.length; + this.currentChar = source.charCodeAt(0); + } + getToken() { + return this.token; + } + setToken(value, replaceLast = false) { + this.token = value; + const { onToken } = this.options; + if (onToken) { + if (value !== 1048576) { + const loc = { + start: { + line: this.tokenLine, + column: this.tokenColumn, + }, + end: { + line: this.line, + column: this.column, + }, + }; + if (!replaceLast && this.lastOnToken) { + onToken(...this.lastOnToken); + } + this.lastOnToken = [convertTokenType(value), this.tokenIndex, this.index, loc]; + } + else { + if (this.lastOnToken) { + onToken(...this.lastOnToken); + this.lastOnToken = null; + } + } + } + return value; + } + get tokenStart() { + return { + index: this.tokenIndex, + line: this.tokenLine, + column: this.tokenColumn, + }; + } + get currentLocation() { + return { index: this.index, line: this.line, column: this.column }; + } + finishNode(node, start, end) { + if (this.options.ranges) { + node.start = start.index; + const endIndex = end ? end.index : this.startIndex; + node.end = endIndex; + node.range = [start.index, endIndex]; + } + if (this.options.loc) { + node.loc = { + start: { + line: start.line, + column: start.column, + }, + end: end ? { line: end.line, column: end.column } : { line: this.startLine, column: this.startColumn }, + }; + if (this.options.source) { + node.loc.source = this.options.source; + } + } + return node; + } + addBindingToExports(name) { + this.exportedBindings.add(name); + } + declareUnboundVariable(name) { + const { exportedNames } = this; + if (exportedNames.has(name)) { + this.report(147, name); + } + exportedNames.add(name); + } + report(type, ...params) { + throw new ParseError(this.tokenStart, this.currentLocation, type, ...params); + } + createScopeIfLexical(type, parent) { + if (this.options.lexical) { + return this.createScope(type, parent); + } + return undefined; + } + createScope(type, parent) { + return new Scope(this, type, parent); + } + createPrivateScopeIfLexical(parent) { + if (this.options.lexical) { + return new PrivateScope(this, parent); + } + return undefined; + } + } + function pushComment(comments, options) { + return function (type, value, start, end, loc) { + const comment = { + type, + value, + }; + if (options.ranges) { + comment.start = start; + comment.end = end; + comment.range = [start, end]; + } + if (options.loc) { + comment.loc = loc; + } + comments.push(comment); + }; + } + function pushToken(tokens, options) { + return function (type, start, end, loc) { + const token = { + token: type, + }; + if (options.ranges) { + token.start = start; + token.end = end; + token.range = [start, end]; + } + if (options.loc) { + token.loc = loc; + } + tokens.push(token); + }; + } + + function normalizeOptions(rawOptions) { + const options = { ...rawOptions }; + if (options.onComment) { + options.onComment = Array.isArray(options.onComment) ? pushComment(options.onComment, options) : options.onComment; + } + if (options.onToken) { + options.onToken = Array.isArray(options.onToken) ? pushToken(options.onToken, options) : options.onToken; + } + return options; + } + + function parseSource(source, rawOptions = {}, context = 0) { + const options = normalizeOptions(rawOptions); + if (options.module) + context |= 2 | 1; + if (options.globalReturn) + context |= 4096; + if (options.impliedStrict) + context |= 1; + const parser = new Parser(source, options); + skipHashBang(parser); + const scope = parser.createScopeIfLexical(); + let body = []; + let sourceType = 'script'; + if (context & 2) { + sourceType = 'module'; + body = parseModuleItemList(parser, context | 8, scope); + if (scope) { + for (const name of parser.exportedBindings) { + if (!scope.hasVariable(name)) + parser.report(148, name); + } + } + } + else { + body = parseStatementList(parser, context | 8, scope); + } + return parser.finishNode({ + type: 'Program', + sourceType, + body, + }, { index: 0, line: 1, column: 0 }, parser.currentLocation); + } + function parseStatementList(parser, context, scope) { + nextToken(parser, context | 32 | 262144); + const statements = []; + while (parser.getToken() === 134283267) { + const { index, tokenValue, tokenStart, tokenIndex } = parser; + const token = parser.getToken(); + const expr = parseLiteral(parser, context); + if (isValidStrictMode(parser, index, tokenIndex, tokenValue)) { + context |= 1; + if (parser.flags & 64) { + throw new ParseError(parser.tokenStart, parser.currentLocation, 9); + } + if (parser.flags & 4096) { + throw new ParseError(parser.tokenStart, parser.currentLocation, 15); + } + } + statements.push(parseDirective(parser, context, expr, token, tokenStart)); + } + while (parser.getToken() !== 1048576) { + statements.push(parseStatementListItem(parser, context, scope, undefined, 4, {})); + } + return statements; + } + function parseModuleItemList(parser, context, scope) { + nextToken(parser, context | 32); + const statements = []; + while (parser.getToken() === 134283267) { + const { tokenStart } = parser; + const token = parser.getToken(); + statements.push(parseDirective(parser, context, parseLiteral(parser, context), token, tokenStart)); + } + while (parser.getToken() !== 1048576) { + statements.push(parseModuleItem(parser, context, scope)); + } + return statements; + } + function parseModuleItem(parser, context, scope) { + if (parser.getToken() === 132) { + Object.assign(parser.leadingDecorators, { + start: parser.tokenStart, + decorators: parseDecorators(parser, context, undefined), + }); + } + let moduleItem; + switch (parser.getToken()) { + case 20564: + moduleItem = parseExportDeclaration(parser, context, scope); + break; + case 86106: + moduleItem = parseImportDeclaration(parser, context, scope); + break; + default: + moduleItem = parseStatementListItem(parser, context, scope, undefined, 4, {}); + } + if (parser.leadingDecorators?.decorators.length) { + parser.report(170); + } + return moduleItem; + } + function parseStatementListItem(parser, context, scope, privateScope, origin, labels) { + const start = parser.tokenStart; + switch (parser.getToken()) { + case 86104: + return parseFunctionDeclaration(parser, context, scope, privateScope, origin, 1, 0, 0, start); + case 132: + case 86094: + return parseClassDeclaration(parser, context, scope, privateScope, 0); + case 86090: + return parseLexicalDeclaration(parser, context, scope, privateScope, 16, 0); + case 241737: + return parseLetIdentOrVarDeclarationStatement(parser, context, scope, privateScope, origin); + case 20564: + parser.report(103, 'export'); + case 86106: + nextToken(parser, context); + switch (parser.getToken()) { + case 67174411: + return parseImportCallDeclaration(parser, context, privateScope, start); + case 67108877: + return parseImportMetaDeclaration(parser, context, start); + default: + parser.report(103, 'import'); + } + case 209005: + return parseAsyncArrowOrAsyncFunctionDeclaration(parser, context, scope, privateScope, origin, labels, 1); + default: + return parseStatement(parser, context, scope, privateScope, origin, labels, 1); + } + } + function parseStatement(parser, context, scope, privateScope, origin, labels, allowFuncDecl) { + switch (parser.getToken()) { + case 86088: + return parseVariableStatement(parser, context, scope, privateScope, 0); + case 20572: + return parseReturnStatement(parser, context, privateScope); + case 20569: + return parseIfStatement(parser, context, scope, privateScope, labels); + case 20567: + return parseForStatement(parser, context, scope, privateScope, labels); + case 20562: + return parseDoWhileStatement(parser, context, scope, privateScope, labels); + case 20578: + return parseWhileStatement(parser, context, scope, privateScope, labels); + case 86110: + return parseSwitchStatement(parser, context, scope, privateScope, labels); + case 1074790417: + return parseEmptyStatement(parser, context); + case 2162700: + return parseBlock(parser, context, scope?.createChildScope(), privateScope, labels, parser.tokenStart); + case 86112: + return parseThrowStatement(parser, context, privateScope); + case 20555: + return parseBreakStatement(parser, context, labels); + case 20559: + return parseContinueStatement(parser, context, labels); + case 20577: + return parseTryStatement(parser, context, scope, privateScope, labels); + case 20579: + return parseWithStatement(parser, context, scope, privateScope, labels); + case 20560: + return parseDebuggerStatement(parser, context); + case 209005: + return parseAsyncArrowOrAsyncFunctionDeclaration(parser, context, scope, privateScope, origin, labels, 0); + case 20557: + parser.report(162); + case 20566: + parser.report(163); + case 86104: + parser.report(context & 1 + ? 76 + : !parser.options.webcompat + ? 78 + : 77); + case 86094: + parser.report(79); + default: + return parseExpressionOrLabelledStatement(parser, context, scope, privateScope, origin, labels, allowFuncDecl); + } + } + function parseExpressionOrLabelledStatement(parser, context, scope, privateScope, origin, labels, allowFuncDecl) { + const { tokenValue, tokenStart } = parser; + const token = parser.getToken(); + let expr; + switch (token) { + case 241737: + expr = parseIdentifier(parser, context); + if (context & 1) + parser.report(85); + if (parser.getToken() === 69271571) + parser.report(84); + break; + default: + expr = parsePrimaryExpression(parser, context, privateScope, 2, 0, 1, 0, 1, parser.tokenStart); + } + if (token & 143360 && parser.getToken() === 21) { + return parseLabelledStatement(parser, context, scope, privateScope, origin, labels, tokenValue, expr, token, allowFuncDecl, tokenStart); + } + expr = parseMemberOrUpdateExpression(parser, context, privateScope, expr, 0, 0, tokenStart); + expr = parseAssignmentExpression(parser, context, privateScope, 0, 0, tokenStart, expr); + if (parser.getToken() === 18) { + expr = parseSequenceExpression(parser, context, privateScope, 0, tokenStart, expr); + } + return parseExpressionStatement(parser, context, expr, tokenStart); + } + function parseBlock(parser, context, scope, privateScope, labels, start = parser.tokenStart, type = 'BlockStatement') { + const body = []; + consume(parser, context | 32, 2162700); + while (parser.getToken() !== 1074790415) { + body.push(parseStatementListItem(parser, context, scope, privateScope, 2, { $: labels })); + } + consume(parser, context | 32, 1074790415); + return parser.finishNode({ + type, + body, + }, start); + } + function parseReturnStatement(parser, context, privateScope) { + if ((context & 4096) === 0) + parser.report(92); + const start = parser.tokenStart; + nextToken(parser, context | 32); + const argument = parser.flags & 1 || parser.getToken() & 1048576 + ? null + : parseExpressions(parser, context, privateScope, 0, 1, parser.tokenStart); + matchOrInsertSemicolon(parser, context | 32); + return parser.finishNode({ + type: 'ReturnStatement', + argument, + }, start); + } + function parseExpressionStatement(parser, context, expression, start) { + matchOrInsertSemicolon(parser, context | 32); + return parser.finishNode({ + type: 'ExpressionStatement', + expression, + }, start); + } + function parseLabelledStatement(parser, context, scope, privateScope, origin, labels, value, expr, token, allowFuncDecl, start) { + validateBindingIdentifier(parser, context, 0, token, 1); + validateAndDeclareLabel(parser, labels, value); + nextToken(parser, context | 32); + const body = allowFuncDecl && + (context & 1) === 0 && + parser.options.webcompat && + parser.getToken() === 86104 + ? parseFunctionDeclaration(parser, context, scope?.createChildScope(), privateScope, origin, 0, 0, 0, parser.tokenStart) + : parseStatement(parser, context, scope, privateScope, origin, labels, allowFuncDecl); + return parser.finishNode({ + type: 'LabeledStatement', + label: expr, + body, + }, start); + } + function parseAsyncArrowOrAsyncFunctionDeclaration(parser, context, scope, privateScope, origin, labels, allowFuncDecl) { + const { tokenValue, tokenStart: start } = parser; + const token = parser.getToken(); + let expr = parseIdentifier(parser, context); + if (parser.getToken() === 21) { + return parseLabelledStatement(parser, context, scope, privateScope, origin, labels, tokenValue, expr, token, 1, start); + } + const asyncNewLine = parser.flags & 1; + if (!asyncNewLine) { + if (parser.getToken() === 86104) { + if (!allowFuncDecl) + parser.report(123); + return parseFunctionDeclaration(parser, context, scope, privateScope, origin, 1, 0, 1, start); + } + if (isValidIdentifier(context, parser.getToken())) { + expr = parseAsyncArrowAfterIdent(parser, context, privateScope, 1, start); + if (parser.getToken() === 18) + expr = parseSequenceExpression(parser, context, privateScope, 0, start, expr); + return parseExpressionStatement(parser, context, expr, start); + } + } + if (parser.getToken() === 67174411) { + expr = parseAsyncArrowOrCallExpression(parser, context, privateScope, expr, 1, 1, 0, asyncNewLine, start); + } + else { + if (parser.getToken() === 10) { + classifyIdentifier(parser, context, token); + if ((token & 36864) === 36864) { + parser.flags |= 256; + } + expr = parseArrowFromIdentifier(parser, context | 2048, privateScope, parser.tokenValue, expr, 0, 1, 0, start); + } + parser.assignable = 1; + } + expr = parseMemberOrUpdateExpression(parser, context, privateScope, expr, 0, 0, start); + expr = parseAssignmentExpression(parser, context, privateScope, 0, 0, start, expr); + parser.assignable = 1; + if (parser.getToken() === 18) { + expr = parseSequenceExpression(parser, context, privateScope, 0, start, expr); + } + return parseExpressionStatement(parser, context, expr, start); + } + function parseDirective(parser, context, expression, token, start) { + const endIndex = parser.startIndex; + if (token !== 1074790417) { + parser.assignable = 2; + expression = parseMemberOrUpdateExpression(parser, context, undefined, expression, 0, 0, start); + if (parser.getToken() !== 1074790417) { + expression = parseAssignmentExpression(parser, context, undefined, 0, 0, start, expression); + if (parser.getToken() === 18) { + expression = parseSequenceExpression(parser, context, undefined, 0, start, expression); + } + } + matchOrInsertSemicolon(parser, context | 32); + } + const node = { + type: 'ExpressionStatement', + expression, + }; + if (expression.type === 'Literal' && typeof expression.value === 'string') { + node.directive = parser.source.slice(start.index + 1, endIndex - 1); + } + return parser.finishNode(node, start); + } + function parseEmptyStatement(parser, context) { + const start = parser.tokenStart; + nextToken(parser, context | 32); + return parser.finishNode({ + type: 'EmptyStatement', + }, start); + } + function parseThrowStatement(parser, context, privateScope) { + const start = parser.tokenStart; + nextToken(parser, context | 32); + if (parser.flags & 1) + parser.report(90); + const argument = parseExpressions(parser, context, privateScope, 0, 1, parser.tokenStart); + matchOrInsertSemicolon(parser, context | 32); + return parser.finishNode({ + type: 'ThrowStatement', + argument, + }, start); + } + function parseIfStatement(parser, context, scope, privateScope, labels) { + const start = parser.tokenStart; + nextToken(parser, context); + consume(parser, context | 32, 67174411); + parser.assignable = 1; + const test = parseExpressions(parser, context, privateScope, 0, 1, parser.tokenStart); + consume(parser, context | 32, 16); + const consequent = parseConsequentOrAlternative(parser, context, scope, privateScope, labels); + let alternate = null; + if (parser.getToken() === 20563) { + nextToken(parser, context | 32); + alternate = parseConsequentOrAlternative(parser, context, scope, privateScope, labels); + } + return parser.finishNode({ + type: 'IfStatement', + test, + consequent, + alternate, + }, start); + } + function parseConsequentOrAlternative(parser, context, scope, privateScope, labels) { + const { tokenStart } = parser; + return context & 1 || + !parser.options.webcompat || + parser.getToken() !== 86104 + ? parseStatement(parser, context, scope, privateScope, 0, { $: labels }, 0) + : parseFunctionDeclaration(parser, context, scope?.createChildScope(), privateScope, 0, 0, 0, 0, tokenStart); + } + function parseSwitchStatement(parser, context, scope, privateScope, labels) { + const start = parser.tokenStart; + nextToken(parser, context); + consume(parser, context | 32, 67174411); + const discriminant = parseExpressions(parser, context, privateScope, 0, 1, parser.tokenStart); + consume(parser, context, 16); + consume(parser, context, 2162700); + const cases = []; + let seenDefault = 0; + scope = scope?.createChildScope(8); + while (parser.getToken() !== 1074790415) { + const { tokenStart } = parser; + let test = null; + const consequent = []; + if (consumeOpt(parser, context | 32, 20556)) { + test = parseExpressions(parser, context, privateScope, 0, 1, parser.tokenStart); + } + else { + consume(parser, context | 32, 20561); + if (seenDefault) + parser.report(89); + seenDefault = 1; + } + consume(parser, context | 32, 21); + while (parser.getToken() !== 20556 && + parser.getToken() !== 1074790415 && + parser.getToken() !== 20561) { + consequent.push(parseStatementListItem(parser, context | 4, scope, privateScope, 2, { + $: labels, + })); + } + cases.push(parser.finishNode({ + type: 'SwitchCase', + test, + consequent, + }, tokenStart)); + } + consume(parser, context | 32, 1074790415); + return parser.finishNode({ + type: 'SwitchStatement', + discriminant, + cases, + }, start); + } + function parseWhileStatement(parser, context, scope, privateScope, labels) { + const start = parser.tokenStart; + nextToken(parser, context); + consume(parser, context | 32, 67174411); + const test = parseExpressions(parser, context, privateScope, 0, 1, parser.tokenStart); + consume(parser, context | 32, 16); + const body = parseIterationStatementBody(parser, context, scope, privateScope, labels); + return parser.finishNode({ + type: 'WhileStatement', + test, + body, + }, start); + } + function parseIterationStatementBody(parser, context, scope, privateScope, labels) { + return parseStatement(parser, ((context | 131072) ^ 131072) | 128, scope, privateScope, 0, { loop: 1, $: labels }, 0); + } + function parseContinueStatement(parser, context, labels) { + if ((context & 128) === 0) + parser.report(68); + const start = parser.tokenStart; + nextToken(parser, context); + let label = null; + if ((parser.flags & 1) === 0 && parser.getToken() & 143360) { + const { tokenValue } = parser; + label = parseIdentifier(parser, context | 32); + if (!isValidLabel(parser, labels, tokenValue, 1)) + parser.report(138, tokenValue); + } + matchOrInsertSemicolon(parser, context | 32); + return parser.finishNode({ + type: 'ContinueStatement', + label, + }, start); + } + function parseBreakStatement(parser, context, labels) { + const start = parser.tokenStart; + nextToken(parser, context | 32); + let label = null; + if ((parser.flags & 1) === 0 && parser.getToken() & 143360) { + const { tokenValue } = parser; + label = parseIdentifier(parser, context | 32); + if (!isValidLabel(parser, labels, tokenValue, 0)) + parser.report(138, tokenValue); + } + else if ((context & (4 | 128)) === 0) { + parser.report(69); + } + matchOrInsertSemicolon(parser, context | 32); + return parser.finishNode({ + type: 'BreakStatement', + label, + }, start); + } + function parseWithStatement(parser, context, scope, privateScope, labels) { + const start = parser.tokenStart; + nextToken(parser, context); + if (context & 1) + parser.report(91); + consume(parser, context | 32, 67174411); + const object = parseExpressions(parser, context, privateScope, 0, 1, parser.tokenStart); + consume(parser, context | 32, 16); + const body = parseStatement(parser, context, scope, privateScope, 2, labels, 0); + return parser.finishNode({ + type: 'WithStatement', + object, + body, + }, start); + } + function parseDebuggerStatement(parser, context) { + const start = parser.tokenStart; + nextToken(parser, context | 32); + matchOrInsertSemicolon(parser, context | 32); + return parser.finishNode({ + type: 'DebuggerStatement', + }, start); + } + function parseTryStatement(parser, context, scope, privateScope, labels) { + const start = parser.tokenStart; + nextToken(parser, context | 32); + const firstScope = scope?.createChildScope(16); + const block = parseBlock(parser, context, firstScope, privateScope, { $: labels }); + const { tokenStart } = parser; + const handler = consumeOpt(parser, context | 32, 20557) + ? parseCatchBlock(parser, context, scope, privateScope, labels, tokenStart) + : null; + let finalizer = null; + if (parser.getToken() === 20566) { + nextToken(parser, context | 32); + const finalizerScope = scope?.createChildScope(4); + const block = parseBlock(parser, context, finalizerScope, privateScope, { $: labels }); + finalizer = block; + } + if (!handler && !finalizer) { + parser.report(88); + } + return parser.finishNode({ + type: 'TryStatement', + block, + handler, + finalizer, + }, start); + } + function parseCatchBlock(parser, context, scope, privateScope, labels, start) { + let param = null; + let additionalScope = scope; + if (consumeOpt(parser, context, 67174411)) { + scope = scope?.createChildScope(4); + param = parseBindingPattern(parser, context, scope, privateScope, (parser.getToken() & 2097152) === 2097152 + ? 256 + : 512, 0); + if (parser.getToken() === 18) { + parser.report(86); + } + else if (parser.getToken() === 1077936155) { + parser.report(87); + } + consume(parser, context | 32, 16); + } + additionalScope = scope?.createChildScope(32); + const body = parseBlock(parser, context, additionalScope, privateScope, { $: labels }); + return parser.finishNode({ + type: 'CatchClause', + param, + body, + }, start); + } + function parseStaticBlock(parser, context, scope, privateScope, start) { + scope = scope?.createChildScope(); + const ctorContext = 512 | 4096 | 1024 | 4 | 128; + context = + ((context | ctorContext) ^ ctorContext) | + 256 | + 2048 | + 524288 | + 65536; + return parseBlock(parser, context, scope, privateScope, {}, start, 'StaticBlock'); + } + function parseDoWhileStatement(parser, context, scope, privateScope, labels) { + const start = parser.tokenStart; + nextToken(parser, context | 32); + const body = parseIterationStatementBody(parser, context, scope, privateScope, labels); + consume(parser, context, 20578); + consume(parser, context | 32, 67174411); + const test = parseExpressions(parser, context, privateScope, 0, 1, parser.tokenStart); + consume(parser, context | 32, 16); + consumeOpt(parser, context | 32, 1074790417); + return parser.finishNode({ + type: 'DoWhileStatement', + body, + test, + }, start); + } + function parseLetIdentOrVarDeclarationStatement(parser, context, scope, privateScope, origin) { + const { tokenValue, tokenStart } = parser; + const token = parser.getToken(); + let expr = parseIdentifier(parser, context); + if (parser.getToken() & (143360 | 2097152)) { + const declarations = parseVariableDeclarationList(parser, context, scope, privateScope, 8, 0); + matchOrInsertSemicolon(parser, context | 32); + return parser.finishNode({ + type: 'VariableDeclaration', + kind: 'let', + declarations, + }, tokenStart); + } + parser.assignable = 1; + if (context & 1) + parser.report(85); + if (parser.getToken() === 21) { + return parseLabelledStatement(parser, context, scope, privateScope, origin, {}, tokenValue, expr, token, 0, tokenStart); + } + if (parser.getToken() === 10) { + let scope = void 0; + if (parser.options.lexical) + scope = createArrowHeadParsingScope(parser, context, tokenValue); + parser.flags = (parser.flags | 128) ^ 128; + expr = parseArrowFunctionExpression(parser, context, scope, privateScope, [expr], 0, tokenStart); + } + else { + expr = parseMemberOrUpdateExpression(parser, context, privateScope, expr, 0, 0, tokenStart); + expr = parseAssignmentExpression(parser, context, privateScope, 0, 0, tokenStart, expr); + } + if (parser.getToken() === 18) { + expr = parseSequenceExpression(parser, context, privateScope, 0, tokenStart, expr); + } + return parseExpressionStatement(parser, context, expr, tokenStart); + } + function parseLexicalDeclaration(parser, context, scope, privateScope, kind, origin) { + const start = parser.tokenStart; + nextToken(parser, context); + const declarations = parseVariableDeclarationList(parser, context, scope, privateScope, kind, origin); + matchOrInsertSemicolon(parser, context | 32); + return parser.finishNode({ + type: 'VariableDeclaration', + kind: kind & 8 ? 'let' : 'const', + declarations, + }, start); + } + function parseVariableStatement(parser, context, scope, privateScope, origin) { + const start = parser.tokenStart; + nextToken(parser, context); + const declarations = parseVariableDeclarationList(parser, context, scope, privateScope, 4, origin); + matchOrInsertSemicolon(parser, context | 32); + return parser.finishNode({ + type: 'VariableDeclaration', + kind: 'var', + declarations, + }, start); + } + function parseVariableDeclarationList(parser, context, scope, privateScope, kind, origin) { + let bindingCount = 1; + const list = [ + parseVariableDeclaration(parser, context, scope, privateScope, kind, origin), + ]; + while (consumeOpt(parser, context, 18)) { + bindingCount++; + list.push(parseVariableDeclaration(parser, context, scope, privateScope, kind, origin)); + } + if (bindingCount > 1 && origin & 32 && parser.getToken() & 262144) { + parser.report(61, KeywordDescTable[parser.getToken() & 255]); + } + return list; + } + function parseVariableDeclaration(parser, context, scope, privateScope, kind, origin) { + const { tokenStart } = parser; + const token = parser.getToken(); + let init = null; + const id = parseBindingPattern(parser, context, scope, privateScope, kind, origin); + if (parser.getToken() === 1077936155) { + nextToken(parser, context | 32); + init = parseExpression(parser, context, privateScope, 1, 0, parser.tokenStart); + if (origin & 32 || (token & 2097152) === 0) { + if (parser.getToken() === 471156 || + (parser.getToken() === 8673330 && + (token & 2097152 || (kind & 4) === 0 || context & 1))) { + throw new ParseError(tokenStart, parser.currentLocation, 60, parser.getToken() === 471156 ? 'of' : 'in'); + } + } + } + else if ((kind & 16 || (token & 2097152) > 0) && + (parser.getToken() & 262144) !== 262144) { + parser.report(59, kind & 16 ? 'const' : 'destructuring'); + } + return parser.finishNode({ + type: 'VariableDeclarator', + id, + init, + }, tokenStart); + } + function parseForStatement(parser, context, scope, privateScope, labels) { + const start = parser.tokenStart; + nextToken(parser, context); + const forAwait = ((context & 2048) > 0 || ((context & 2) > 0 && (context & 8) > 0)) && + consumeOpt(parser, context, 209006); + consume(parser, context | 32, 67174411); + scope = scope?.createChildScope(1); + let test = null; + let update = null; + let destructible = 0; + let init = null; + let isVarDecl = parser.getToken() === 86088 || + parser.getToken() === 241737 || + parser.getToken() === 86090; + let right; + const { tokenStart } = parser; + const token = parser.getToken(); + if (isVarDecl) { + if (token === 241737) { + init = parseIdentifier(parser, context); + if (parser.getToken() & (143360 | 2097152)) { + if (parser.getToken() === 8673330) { + if (context & 1) + parser.report(67); + } + else { + init = parser.finishNode({ + type: 'VariableDeclaration', + kind: 'let', + declarations: parseVariableDeclarationList(parser, context | 131072, scope, privateScope, 8, 32), + }, tokenStart); + } + parser.assignable = 1; + } + else if (context & 1) { + parser.report(67); + } + else { + isVarDecl = false; + parser.assignable = 1; + init = parseMemberOrUpdateExpression(parser, context, privateScope, init, 0, 0, tokenStart); + if (parser.getToken() === 471156) + parser.report(115); + } + } + else { + nextToken(parser, context); + init = parser.finishNode(token === 86088 + ? { + type: 'VariableDeclaration', + kind: 'var', + declarations: parseVariableDeclarationList(parser, context | 131072, scope, privateScope, 4, 32), + } + : { + type: 'VariableDeclaration', + kind: 'const', + declarations: parseVariableDeclarationList(parser, context | 131072, scope, privateScope, 16, 32), + }, tokenStart); + parser.assignable = 1; + } + } + else if (token === 1074790417) { + if (forAwait) + parser.report(82); + } + else if ((token & 2097152) === 2097152) { + const patternStart = parser.tokenStart; + init = + token === 2162700 + ? parseObjectLiteralOrPattern(parser, context, void 0, privateScope, 1, 0, 0, 2, 32) + : parseArrayExpressionOrPattern(parser, context, void 0, privateScope, 1, 0, 0, 2, 32); + destructible = parser.destructible; + if (destructible & 64) { + parser.report(63); + } + parser.assignable = + destructible & 16 ? 2 : 1; + init = parseMemberOrUpdateExpression(parser, context | 131072, privateScope, init, 0, 0, patternStart); + } + else { + init = parseLeftHandSideExpression(parser, context | 131072, privateScope, 1, 0, 1); + } + if ((parser.getToken() & 262144) === 262144) { + if (parser.getToken() === 471156) { + if (parser.assignable & 2) + parser.report(80, forAwait ? 'await' : 'of'); + reinterpretToPattern(parser, init); + nextToken(parser, context | 32); + right = parseExpression(parser, context, privateScope, 1, 0, parser.tokenStart); + consume(parser, context | 32, 16); + const body = parseIterationStatementBody(parser, context, scope, privateScope, labels); + return parser.finishNode({ + type: 'ForOfStatement', + left: init, + right, + body, + await: forAwait, + }, start); + } + if (parser.assignable & 2) + parser.report(80, 'in'); + reinterpretToPattern(parser, init); + nextToken(parser, context | 32); + if (forAwait) + parser.report(82); + right = parseExpressions(parser, context, privateScope, 0, 1, parser.tokenStart); + consume(parser, context | 32, 16); + const body = parseIterationStatementBody(parser, context, scope, privateScope, labels); + return parser.finishNode({ + type: 'ForInStatement', + body, + left: init, + right, + }, start); + } + if (forAwait) + parser.report(82); + if (!isVarDecl) { + if (destructible & 8 && parser.getToken() !== 1077936155) { + parser.report(80, 'loop'); + } + init = parseAssignmentExpression(parser, context | 131072, privateScope, 0, 0, tokenStart, init); + } + if (parser.getToken() === 18) + init = parseSequenceExpression(parser, context, privateScope, 0, tokenStart, init); + consume(parser, context | 32, 1074790417); + if (parser.getToken() !== 1074790417) + test = parseExpressions(parser, context, privateScope, 0, 1, parser.tokenStart); + consume(parser, context | 32, 1074790417); + if (parser.getToken() !== 16) + update = parseExpressions(parser, context, privateScope, 0, 1, parser.tokenStart); + consume(parser, context | 32, 16); + const body = parseIterationStatementBody(parser, context, scope, privateScope, labels); + return parser.finishNode({ + type: 'ForStatement', + init, + test, + update, + body, + }, start); + } + function parseRestrictedIdentifier(parser, context, scope) { + if (!isValidIdentifier(context, parser.getToken())) + parser.report(118); + if ((parser.getToken() & 537079808) === 537079808) + parser.report(119); + scope?.addBlockName(context, parser.tokenValue, 8, 0); + return parseIdentifier(parser, context); + } + function parseImportDeclaration(parser, context, scope) { + const start = parser.tokenStart; + nextToken(parser, context); + let source = null; + const { tokenStart } = parser; + let specifiers = []; + if (parser.getToken() === 134283267) { + source = parseLiteral(parser, context); + } + else { + if (parser.getToken() & 143360) { + const local = parseRestrictedIdentifier(parser, context, scope); + specifiers = [ + parser.finishNode({ + type: 'ImportDefaultSpecifier', + local, + }, tokenStart), + ]; + if (consumeOpt(parser, context, 18)) { + switch (parser.getToken()) { + case 8391476: + specifiers.push(parseImportNamespaceSpecifier(parser, context, scope)); + break; + case 2162700: + parseImportSpecifierOrNamedImports(parser, context, scope, specifiers); + break; + default: + parser.report(107); + } + } + } + else { + switch (parser.getToken()) { + case 8391476: + specifiers = [parseImportNamespaceSpecifier(parser, context, scope)]; + break; + case 2162700: + parseImportSpecifierOrNamedImports(parser, context, scope, specifiers); + break; + case 67174411: + return parseImportCallDeclaration(parser, context, undefined, start); + case 67108877: + return parseImportMetaDeclaration(parser, context, start); + default: + parser.report(30, KeywordDescTable[parser.getToken() & 255]); + } + } + source = parseModuleSpecifier(parser, context); + } + const attributes = parseImportAttributes(parser, context); + const node = { + type: 'ImportDeclaration', + specifiers, + source, + attributes, + }; + matchOrInsertSemicolon(parser, context | 32); + return parser.finishNode(node, start); + } + function parseImportNamespaceSpecifier(parser, context, scope) { + const { tokenStart } = parser; + nextToken(parser, context); + consume(parser, context, 77932); + if ((parser.getToken() & 134217728) === 134217728) { + throw new ParseError(tokenStart, parser.currentLocation, 30, KeywordDescTable[parser.getToken() & 255]); + } + return parser.finishNode({ + type: 'ImportNamespaceSpecifier', + local: parseRestrictedIdentifier(parser, context, scope), + }, tokenStart); + } + function parseModuleSpecifier(parser, context) { + consume(parser, context, 209011); + if (parser.getToken() !== 134283267) + parser.report(105, 'Import'); + return parseLiteral(parser, context); + } + function parseImportSpecifierOrNamedImports(parser, context, scope, specifiers) { + nextToken(parser, context); + while (parser.getToken() & 143360 || parser.getToken() === 134283267) { + let { tokenValue, tokenStart } = parser; + const token = parser.getToken(); + const imported = parseModuleExportName(parser, context); + let local; + if (consumeOpt(parser, context, 77932)) { + if ((parser.getToken() & 134217728) === 134217728 || + parser.getToken() === 18) { + parser.report(106); + } + else { + validateBindingIdentifier(parser, context, 16, parser.getToken(), 0); + } + tokenValue = parser.tokenValue; + local = parseIdentifier(parser, context); + } + else if (imported.type === 'Identifier') { + validateBindingIdentifier(parser, context, 16, token, 0); + local = imported; + } + else { + parser.report(25, KeywordDescTable[77932 & 255]); + } + scope?.addBlockName(context, tokenValue, 8, 0); + specifiers.push(parser.finishNode({ + type: 'ImportSpecifier', + local, + imported, + }, tokenStart)); + if (parser.getToken() !== 1074790415) + consume(parser, context, 18); + } + consume(parser, context, 1074790415); + return specifiers; + } + function parseImportMetaDeclaration(parser, context, start) { + let expr = parseImportMetaExpression(parser, context, parser.finishNode({ + type: 'Identifier', + name: 'import', + }, start), start); + expr = parseMemberOrUpdateExpression(parser, context, undefined, expr, 0, 0, start); + expr = parseAssignmentExpression(parser, context, undefined, 0, 0, start, expr); + if (parser.getToken() === 18) { + expr = parseSequenceExpression(parser, context, undefined, 0, start, expr); + } + return parseExpressionStatement(parser, context, expr, start); + } + function parseImportCallDeclaration(parser, context, privateScope, start) { + let expr = parseImportExpression(parser, context, privateScope, 0, start); + expr = parseMemberOrUpdateExpression(parser, context, privateScope, expr, 0, 0, start); + if (parser.getToken() === 18) { + expr = parseSequenceExpression(parser, context, privateScope, 0, start, expr); + } + return parseExpressionStatement(parser, context, expr, start); + } + function parseExportDeclaration(parser, context, scope) { + const start = parser.leadingDecorators.decorators.length ? parser.leadingDecorators.start : parser.tokenStart; + nextToken(parser, context | 32); + const specifiers = []; + let declaration = null; + let source = null; + let attributes = []; + if (consumeOpt(parser, context | 32, 20561)) { + switch (parser.getToken()) { + case 86104: { + declaration = parseFunctionDeclaration(parser, context, scope, undefined, 4, 1, 1, 0, parser.tokenStart); + break; + } + case 132: + case 86094: + declaration = parseClassDeclaration(parser, context, scope, undefined, 1); + break; + case 209005: { + const { tokenStart } = parser; + declaration = parseIdentifier(parser, context); + const { flags } = parser; + if ((flags & 1) === 0) { + if (parser.getToken() === 86104) { + declaration = parseFunctionDeclaration(parser, context, scope, undefined, 4, 1, 1, 1, tokenStart); + } + else { + if (parser.getToken() === 67174411) { + declaration = parseAsyncArrowOrCallExpression(parser, context, undefined, declaration, 1, 1, 0, flags, tokenStart); + declaration = parseMemberOrUpdateExpression(parser, context, undefined, declaration, 0, 0, tokenStart); + declaration = parseAssignmentExpression(parser, context, undefined, 0, 0, tokenStart, declaration); + } + else if (parser.getToken() & 143360) { + if (scope) + scope = createArrowHeadParsingScope(parser, context, parser.tokenValue); + declaration = parseIdentifier(parser, context); + declaration = parseArrowFunctionExpression(parser, context, scope, undefined, [declaration], 1, tokenStart); + } + } + } + break; + } + default: + declaration = parseExpression(parser, context, undefined, 1, 0, parser.tokenStart); + matchOrInsertSemicolon(parser, context | 32); + } + if (scope) + parser.declareUnboundVariable('default'); + return parser.finishNode({ + type: 'ExportDefaultDeclaration', + declaration, + }, start); + } + switch (parser.getToken()) { + case 8391476: { + nextToken(parser, context); + let exported = null; + const isNamedDeclaration = consumeOpt(parser, context, 77932); + if (isNamedDeclaration) { + if (scope) + parser.declareUnboundVariable(parser.tokenValue); + exported = parseModuleExportName(parser, context); + } + consume(parser, context, 209011); + if (parser.getToken() !== 134283267) + parser.report(105, 'Export'); + source = parseLiteral(parser, context); + const attributes = parseImportAttributes(parser, context); + const node = { + type: 'ExportAllDeclaration', + source, + exported, + attributes, + }; + matchOrInsertSemicolon(parser, context | 32); + return parser.finishNode(node, start); + } + case 2162700: { + nextToken(parser, context); + const tmpExportedNames = []; + const tmpExportedBindings = []; + let hasLiteralLocal = 0; + while (parser.getToken() & 143360 || parser.getToken() === 134283267) { + const { tokenStart, tokenValue } = parser; + const local = parseModuleExportName(parser, context); + if (local.type === 'Literal') { + hasLiteralLocal = 1; + } + let exported; + if (parser.getToken() === 77932) { + nextToken(parser, context); + if ((parser.getToken() & 143360) === 0 && parser.getToken() !== 134283267) { + parser.report(106); + } + if (scope) { + tmpExportedNames.push(parser.tokenValue); + tmpExportedBindings.push(tokenValue); + } + exported = parseModuleExportName(parser, context); + } + else { + if (scope) { + tmpExportedNames.push(parser.tokenValue); + tmpExportedBindings.push(parser.tokenValue); + } + exported = local; + } + specifiers.push(parser.finishNode({ + type: 'ExportSpecifier', + local, + exported, + }, tokenStart)); + if (parser.getToken() !== 1074790415) + consume(parser, context, 18); + } + consume(parser, context, 1074790415); + if (consumeOpt(parser, context, 209011)) { + if (parser.getToken() !== 134283267) + parser.report(105, 'Export'); + source = parseLiteral(parser, context); + attributes = parseImportAttributes(parser, context); + if (scope) { + tmpExportedNames.forEach((n) => parser.declareUnboundVariable(n)); + } + } + else { + if (hasLiteralLocal) { + parser.report(172); + } + if (scope) { + tmpExportedNames.forEach((n) => parser.declareUnboundVariable(n)); + tmpExportedBindings.forEach((b) => parser.addBindingToExports(b)); + } + } + matchOrInsertSemicolon(parser, context | 32); + break; + } + case 132: + case 86094: + declaration = parseClassDeclaration(parser, context, scope, undefined, 2); + break; + case 86104: + declaration = parseFunctionDeclaration(parser, context, scope, undefined, 4, 1, 2, 0, parser.tokenStart); + break; + case 241737: + declaration = parseLexicalDeclaration(parser, context, scope, undefined, 8, 64); + break; + case 86090: + declaration = parseLexicalDeclaration(parser, context, scope, undefined, 16, 64); + break; + case 86088: + declaration = parseVariableStatement(parser, context, scope, undefined, 64); + break; + case 209005: { + const { tokenStart } = parser; + nextToken(parser, context); + if ((parser.flags & 1) === 0 && parser.getToken() === 86104) { + declaration = parseFunctionDeclaration(parser, context, scope, undefined, 4, 1, 2, 1, tokenStart); + break; + } + } + default: + parser.report(30, KeywordDescTable[parser.getToken() & 255]); + } + const node = { + type: 'ExportNamedDeclaration', + declaration, + specifiers, + source, + attributes: attributes, + }; + return parser.finishNode(node, start); + } + function parseExpression(parser, context, privateScope, canAssign, inGroup, start) { + let expr = parsePrimaryExpression(parser, context, privateScope, 2, 0, canAssign, inGroup, 1, start); + expr = parseMemberOrUpdateExpression(parser, context, privateScope, expr, inGroup, 0, start); + return parseAssignmentExpression(parser, context, privateScope, inGroup, 0, start, expr); + } + function parseSequenceExpression(parser, context, privateScope, inGroup, start, expr) { + const expressions = [expr]; + while (consumeOpt(parser, context | 32, 18)) { + expressions.push(parseExpression(parser, context, privateScope, 1, inGroup, parser.tokenStart)); + } + return parser.finishNode({ + type: 'SequenceExpression', + expressions, + }, start); + } + function parseExpressions(parser, context, privateScope, inGroup, canAssign, start) { + const expr = parseExpression(parser, context, privateScope, canAssign, inGroup, start); + return parser.getToken() === 18 + ? parseSequenceExpression(parser, context, privateScope, inGroup, start, expr) + : expr; + } + function parseAssignmentExpression(parser, context, privateScope, inGroup, isPattern, start, left) { + const token = parser.getToken(); + if ((token & 4194304) === 4194304) { + if (parser.assignable & 2) + parser.report(26); + if ((!isPattern && token === 1077936155 && left.type === 'ArrayExpression') || + left.type === 'ObjectExpression') { + reinterpretToPattern(parser, left); + } + nextToken(parser, context | 32); + const right = parseExpression(parser, context, privateScope, 1, inGroup, parser.tokenStart); + parser.assignable = 2; + return parser.finishNode(isPattern + ? { + type: 'AssignmentPattern', + left, + right, + } + : { + type: 'AssignmentExpression', + left, + operator: KeywordDescTable[token & 255], + right, + }, start); + } + if ((token & 8388608) === 8388608) { + left = parseBinaryExpression(parser, context, privateScope, inGroup, start, 4, token, left); + } + if (consumeOpt(parser, context | 32, 22)) { + left = parseConditionalExpression(parser, context, privateScope, left, start); + } + return left; + } + function parseAssignmentExpressionOrPattern(parser, context, privateScope, inGroup, isPattern, start, left) { + const token = parser.getToken(); + nextToken(parser, context | 32); + const right = parseExpression(parser, context, privateScope, 1, inGroup, parser.tokenStart); + left = parser.finishNode(isPattern + ? { + type: 'AssignmentPattern', + left, + right, + } + : { + type: 'AssignmentExpression', + left, + operator: KeywordDescTable[token & 255], + right, + }, start); + parser.assignable = 2; + return left; + } + function parseConditionalExpression(parser, context, privateScope, test, start) { + const consequent = parseExpression(parser, (context | 131072) ^ 131072, privateScope, 1, 0, parser.tokenStart); + consume(parser, context | 32, 21); + parser.assignable = 1; + const alternate = parseExpression(parser, context, privateScope, 1, 0, parser.tokenStart); + parser.assignable = 2; + return parser.finishNode({ + type: 'ConditionalExpression', + test, + consequent, + alternate, + }, start); + } + function parseBinaryExpression(parser, context, privateScope, inGroup, start, minPrecedence, operator, left) { + const bit = -((context & 131072) > 0) & 8673330; + let t; + let precedence; + parser.assignable = 2; + while (parser.getToken() & 8388608) { + t = parser.getToken(); + precedence = t & 3840; + if ((t & 524288 && operator & 268435456) || (operator & 524288 && t & 268435456)) { + parser.report(165); + } + if (precedence + ((t === 8391735) << 8) - ((bit === t) << 12) <= minPrecedence) + break; + nextToken(parser, context | 32); + left = parser.finishNode({ + type: t & 524288 || t & 268435456 ? 'LogicalExpression' : 'BinaryExpression', + left, + right: parseBinaryExpression(parser, context, privateScope, inGroup, parser.tokenStart, precedence, t, parseLeftHandSideExpression(parser, context, privateScope, 0, inGroup, 1)), + operator: KeywordDescTable[t & 255], + }, start); + } + if (parser.getToken() === 1077936155) + parser.report(26); + return left; + } + function parseUnaryExpression(parser, context, privateScope, isLHS, inGroup) { + if (!isLHS) + parser.report(0); + const { tokenStart } = parser; + const unaryOperator = parser.getToken(); + nextToken(parser, context | 32); + const arg = parseLeftHandSideExpression(parser, context, privateScope, 0, inGroup, 1); + if (parser.getToken() === 8391735) + parser.report(33); + if (context & 1 && unaryOperator === 16863276) { + if (arg.type === 'Identifier') { + parser.report(121); + } + else if (isPropertyWithPrivateFieldKey(arg)) { + parser.report(127); + } + } + parser.assignable = 2; + return parser.finishNode({ + type: 'UnaryExpression', + operator: KeywordDescTable[unaryOperator & 255], + argument: arg, + prefix: true, + }, tokenStart); + } + function parseAsyncExpression(parser, context, privateScope, inGroup, isLHS, canAssign, inNew, start) { + const token = parser.getToken(); + const expr = parseIdentifier(parser, context); + const { flags } = parser; + if ((flags & 1) === 0) { + if (parser.getToken() === 86104) { + return parseFunctionExpression(parser, context, privateScope, 1, inGroup, start); + } + if (isValidIdentifier(context, parser.getToken())) { + if (!isLHS) + parser.report(0); + if ((parser.getToken() & 36864) === 36864) { + parser.flags |= 256; + } + return parseAsyncArrowAfterIdent(parser, context, privateScope, canAssign, start); + } + } + if (!inNew && parser.getToken() === 67174411) { + return parseAsyncArrowOrCallExpression(parser, context, privateScope, expr, canAssign, 1, 0, flags, start); + } + if (parser.getToken() === 10) { + classifyIdentifier(parser, context, token); + if (inNew) + parser.report(51); + if ((token & 36864) === 36864) { + parser.flags |= 256; + } + return parseArrowFromIdentifier(parser, context, privateScope, parser.tokenValue, expr, inNew, canAssign, 0, start); + } + parser.assignable = 1; + return expr; + } + function parseYieldExpressionOrIdentifier(parser, context, privateScope, inGroup, canAssign, start) { + if (inGroup) + parser.destructible |= 256; + if (context & 1024) { + nextToken(parser, context | 32); + if (context & 8192) + parser.report(32); + if (!canAssign) + parser.report(26); + if (parser.getToken() === 22) + parser.report(124); + let argument = null; + let delegate = false; + if ((parser.flags & 1) === 0) { + delegate = consumeOpt(parser, context | 32, 8391476); + if (parser.getToken() & (12288 | 65536) || delegate) { + argument = parseExpression(parser, context, privateScope, 1, 0, parser.tokenStart); + } + } + else if (parser.getToken() === 8391476) { + parser.report(30, KeywordDescTable[parser.getToken() & 255]); + } + parser.assignable = 2; + return parser.finishNode({ + type: 'YieldExpression', + argument, + delegate, + }, start); + } + if (context & 1) + parser.report(97, 'yield'); + return parseIdentifierOrArrow(parser, context, privateScope); + } + function parseAwaitExpressionOrIdentifier(parser, context, privateScope, inNew, inGroup, start) { + if (inGroup) + parser.destructible |= 128; + if (context & 524288) + parser.report(177); + const possibleIdentifierOrArrowFunc = parseIdentifierOrArrow(parser, context, privateScope); + const isIdentifier = possibleIdentifierOrArrowFunc.type === 'ArrowFunctionExpression' || + (parser.getToken() & 65536) === 0; + if (isIdentifier) { + if (context & 2048) + throw new ParseError(start, { index: parser.startIndex, line: parser.startLine, column: parser.startColumn }, 176); + if (context & 2) + throw new ParseError(start, { index: parser.startIndex, line: parser.startLine, column: parser.startColumn }, 110); + if (context & 8192 && context & 2048) + throw new ParseError(start, { index: parser.startIndex, line: parser.startLine, column: parser.startColumn }, 110); + return possibleIdentifierOrArrowFunc; + } + if (context & 8192) { + throw new ParseError(start, { index: parser.startIndex, line: parser.startLine, column: parser.startColumn }, 31); + } + if (context & 2048 || (context & 2 && context & 8)) { + if (inNew) + throw new ParseError(start, { index: parser.startIndex, line: parser.startLine, column: parser.startColumn }, 0); + const argument = parseLeftHandSideExpression(parser, context, privateScope, 0, 0, 1); + if (parser.getToken() === 8391735) + parser.report(33); + parser.assignable = 2; + return parser.finishNode({ + type: 'AwaitExpression', + argument, + }, start); + } + if (context & 2) + throw new ParseError(start, { index: parser.startIndex, line: parser.startLine, column: parser.startColumn }, 98); + return possibleIdentifierOrArrowFunc; + } + function parseFunctionBody(parser, context, scope, privateScope, origin, funcNameToken, functionScope) { + const { tokenStart } = parser; + consume(parser, context | 32, 2162700); + const body = []; + if (parser.getToken() !== 1074790415) { + while (parser.getToken() === 134283267) { + const { index, tokenStart, tokenIndex, tokenValue } = parser; + const token = parser.getToken(); + const expr = parseLiteral(parser, context); + if (isValidStrictMode(parser, index, tokenIndex, tokenValue)) { + context |= 1; + if (parser.flags & 128) { + throw new ParseError(tokenStart, parser.currentLocation, 66); + } + if (parser.flags & 64) { + throw new ParseError(tokenStart, parser.currentLocation, 9); + } + if (parser.flags & 4096) { + throw new ParseError(tokenStart, parser.currentLocation, 15); + } + functionScope?.reportScopeError(); + } + body.push(parseDirective(parser, context, expr, token, tokenStart)); + } + if (context & 1) { + if (funcNameToken) { + if ((funcNameToken & 537079808) === 537079808) { + parser.report(119); + } + if ((funcNameToken & 36864) === 36864) { + parser.report(40); + } + } + if (parser.flags & 512) + parser.report(119); + if (parser.flags & 256) + parser.report(118); + } + } + parser.flags = + (parser.flags | 512 | 256 | 64 | 4096) ^ + (512 | 256 | 64 | 4096); + parser.destructible = (parser.destructible | 256) ^ 256; + while (parser.getToken() !== 1074790415) { + body.push(parseStatementListItem(parser, context, scope, privateScope, 4, {})); + } + consume(parser, origin & (16 | 8) ? context | 32 : context, 1074790415); + parser.flags &= -4289; + if (parser.getToken() === 1077936155) + parser.report(26); + return parser.finishNode({ + type: 'BlockStatement', + body, + }, tokenStart); + } + function parseSuperExpression(parser, context) { + const { tokenStart } = parser; + nextToken(parser, context); + switch (parser.getToken()) { + case 67108990: + parser.report(167); + case 67174411: { + if ((context & 512) === 0) + parser.report(28); + parser.assignable = 2; + break; + } + case 69271571: + case 67108877: { + if ((context & 256) === 0) + parser.report(29); + parser.assignable = 1; + break; + } + default: + parser.report(30, 'super'); + } + return parser.finishNode({ type: 'Super' }, tokenStart); + } + function parseLeftHandSideExpression(parser, context, privateScope, canAssign, inGroup, isLHS) { + const start = parser.tokenStart; + const expression = parsePrimaryExpression(parser, context, privateScope, 2, 0, canAssign, inGroup, isLHS, start); + return parseMemberOrUpdateExpression(parser, context, privateScope, expression, inGroup, 0, start); + } + function parseUpdateExpression(parser, context, expr, start) { + if (parser.assignable & 2) + parser.report(55); + const token = parser.getToken(); + nextToken(parser, context); + parser.assignable = 2; + return parser.finishNode({ + type: 'UpdateExpression', + argument: expr, + operator: KeywordDescTable[token & 255], + prefix: false, + }, start); + } + function parseMemberOrUpdateExpression(parser, context, privateScope, expr, inGroup, inChain, start) { + if ((parser.getToken() & 33619968) === 33619968 && (parser.flags & 1) === 0) { + expr = parseUpdateExpression(parser, context, expr, start); + } + else if ((parser.getToken() & 67108864) === 67108864) { + context = (context | 131072) ^ 131072; + switch (parser.getToken()) { + case 67108877: { + nextToken(parser, (context | 262144 | 8) ^ 8); + if (context & 16 && parser.getToken() === 130 && parser.tokenValue === 'super') { + parser.report(173); + } + parser.assignable = 1; + const property = parsePropertyOrPrivatePropertyName(parser, context | 64, privateScope); + expr = parser.finishNode({ + type: 'MemberExpression', + object: expr, + computed: false, + property, + optional: false, + }, start); + break; + } + case 69271571: { + let restoreHasOptionalChaining = false; + if ((parser.flags & 2048) === 2048) { + restoreHasOptionalChaining = true; + parser.flags = (parser.flags | 2048) ^ 2048; + } + nextToken(parser, context | 32); + const { tokenStart } = parser; + const property = parseExpressions(parser, context, privateScope, inGroup, 1, tokenStart); + consume(parser, context, 20); + parser.assignable = 1; + expr = parser.finishNode({ + type: 'MemberExpression', + object: expr, + computed: true, + property, + optional: false, + }, start); + if (restoreHasOptionalChaining) { + parser.flags |= 2048; + } + break; + } + case 67174411: { + if ((parser.flags & 1024) === 1024) { + parser.flags = (parser.flags | 1024) ^ 1024; + return expr; + } + let restoreHasOptionalChaining = false; + if ((parser.flags & 2048) === 2048) { + restoreHasOptionalChaining = true; + parser.flags = (parser.flags | 2048) ^ 2048; + } + const args = parseArguments(parser, context, privateScope, inGroup); + parser.assignable = 2; + expr = parser.finishNode({ + type: 'CallExpression', + callee: expr, + arguments: args, + optional: false, + }, start); + if (restoreHasOptionalChaining) { + parser.flags |= 2048; + } + break; + } + case 67108990: { + nextToken(parser, (context | 262144 | 8) ^ 8); + parser.flags |= 2048; + parser.assignable = 2; + expr = parseOptionalChain(parser, context, privateScope, expr, start); + break; + } + default: + if ((parser.flags & 2048) === 2048) { + parser.report(166); + } + parser.assignable = 2; + expr = parser.finishNode({ + type: 'TaggedTemplateExpression', + tag: expr, + quasi: parser.getToken() === 67174408 + ? parseTemplate(parser, context | 64, privateScope) + : parseTemplateLiteral(parser, context), + }, start); + } + expr = parseMemberOrUpdateExpression(parser, context, privateScope, expr, 0, 1, start); + } + if (inChain === 0 && (parser.flags & 2048) === 2048) { + parser.flags = (parser.flags | 2048) ^ 2048; + expr = parser.finishNode({ + type: 'ChainExpression', + expression: expr, + }, start); + } + return expr; + } + function parseOptionalChain(parser, context, privateScope, expr, start) { + let restoreHasOptionalChaining = false; + let node; + if (parser.getToken() === 69271571 || parser.getToken() === 67174411) { + if ((parser.flags & 2048) === 2048) { + restoreHasOptionalChaining = true; + parser.flags = (parser.flags | 2048) ^ 2048; + } + } + if (parser.getToken() === 69271571) { + nextToken(parser, context | 32); + const { tokenStart } = parser; + const property = parseExpressions(parser, context, privateScope, 0, 1, tokenStart); + consume(parser, context, 20); + parser.assignable = 2; + node = parser.finishNode({ + type: 'MemberExpression', + object: expr, + computed: true, + optional: true, + property, + }, start); + } + else if (parser.getToken() === 67174411) { + const args = parseArguments(parser, context, privateScope, 0); + parser.assignable = 2; + node = parser.finishNode({ + type: 'CallExpression', + callee: expr, + arguments: args, + optional: true, + }, start); + } + else { + const property = parsePropertyOrPrivatePropertyName(parser, context, privateScope); + parser.assignable = 2; + node = parser.finishNode({ + type: 'MemberExpression', + object: expr, + computed: false, + optional: true, + property, + }, start); + } + if (restoreHasOptionalChaining) { + parser.flags |= 2048; + } + return node; + } + function parsePropertyOrPrivatePropertyName(parser, context, privateScope) { + if ((parser.getToken() & 143360) === 0 && + parser.getToken() !== -2147483528 && + parser.getToken() !== -2147483527 && + parser.getToken() !== 130) { + parser.report(160); + } + return parser.getToken() === 130 + ? parsePrivateIdentifier(parser, context, privateScope, 0) + : parseIdentifier(parser, context); + } + function parseUpdateExpressionPrefixed(parser, context, privateScope, inNew, isLHS, start) { + if (inNew) + parser.report(56); + if (!isLHS) + parser.report(0); + const token = parser.getToken(); + nextToken(parser, context | 32); + const arg = parseLeftHandSideExpression(parser, context, privateScope, 0, 0, 1); + if (parser.assignable & 2) { + parser.report(55); + } + parser.assignable = 2; + return parser.finishNode({ + type: 'UpdateExpression', + argument: arg, + operator: KeywordDescTable[token & 255], + prefix: true, + }, start); + } + function parsePrimaryExpression(parser, context, privateScope, kind, inNew, canAssign, inGroup, isLHS, start) { + if ((parser.getToken() & 143360) === 143360) { + switch (parser.getToken()) { + case 209006: + return parseAwaitExpressionOrIdentifier(parser, context, privateScope, inNew, inGroup, start); + case 241771: + return parseYieldExpressionOrIdentifier(parser, context, privateScope, inGroup, canAssign, start); + case 209005: + return parseAsyncExpression(parser, context, privateScope, inGroup, isLHS, canAssign, inNew, start); + } + const { tokenValue } = parser; + const token = parser.getToken(); + const expr = parseIdentifier(parser, context | 64); + if (parser.getToken() === 10) { + if (!isLHS) + parser.report(0); + classifyIdentifier(parser, context, token); + if ((token & 36864) === 36864) { + parser.flags |= 256; + } + return parseArrowFromIdentifier(parser, context, privateScope, tokenValue, expr, inNew, canAssign, 0, start); + } + if (context & 16 && + !(context & 32768) && + !(context & 8192) && + parser.tokenValue === 'arguments') + parser.report(130); + if ((token & 255) === (241737 & 255)) { + if (context & 1) + parser.report(113); + if (kind & (8 | 16)) + parser.report(100); + } + parser.assignable = + context & 1 && (token & 537079808) === 537079808 + ? 2 + : 1; + return expr; + } + if ((parser.getToken() & 134217728) === 134217728) { + return parseLiteral(parser, context); + } + switch (parser.getToken()) { + case 33619993: + case 33619994: + return parseUpdateExpressionPrefixed(parser, context, privateScope, inNew, isLHS, start); + case 16863276: + case 16842798: + case 16842799: + case 25233968: + case 25233969: + case 16863275: + case 16863277: + return parseUnaryExpression(parser, context, privateScope, isLHS, inGroup); + case 86104: + return parseFunctionExpression(parser, context, privateScope, 0, inGroup, start); + case 2162700: + return parseObjectLiteral(parser, context, privateScope, canAssign ? 0 : 1, inGroup); + case 69271571: + return parseArrayLiteral(parser, context, privateScope, canAssign ? 0 : 1, inGroup); + case 67174411: + return parseParenthesizedExpression(parser, context | 64, privateScope, canAssign, 1, 0, start); + case 86021: + case 86022: + case 86023: + return parseNullOrTrueOrFalseLiteral(parser, context); + case 86111: + return parseThisExpression(parser, context); + case 65540: + return parseRegExpLiteral(parser, context); + case 132: + case 86094: + return parseClassExpression(parser, context, privateScope, inGroup, start); + case 86109: + return parseSuperExpression(parser, context); + case 67174409: + return parseTemplateLiteral(parser, context); + case 67174408: + return parseTemplate(parser, context, privateScope); + case 86107: + return parseNewExpression(parser, context, privateScope, inGroup); + case 134283388: + return parseBigIntLiteral(parser, context); + case 130: + return parsePrivateIdentifier(parser, context, privateScope, 0); + case 86106: + return parseImportCallOrMetaExpression(parser, context, privateScope, inNew, inGroup, start); + case 8456256: + if (parser.options.jsx) + return parseJSXRootElementOrFragment(parser, context, privateScope, 0, parser.tokenStart); + default: + if (isValidIdentifier(context, parser.getToken())) + return parseIdentifierOrArrow(parser, context, privateScope); + parser.report(30, KeywordDescTable[parser.getToken() & 255]); + } + } + function parseImportCallOrMetaExpression(parser, context, privateScope, inNew, inGroup, start) { + let expr = parseIdentifier(parser, context); + if (parser.getToken() === 67108877) { + return parseImportMetaExpression(parser, context, expr, start); + } + if (inNew) + parser.report(142); + expr = parseImportExpression(parser, context, privateScope, inGroup, start); + parser.assignable = 2; + return parseMemberOrUpdateExpression(parser, context, privateScope, expr, inGroup, 0, start); + } + function parseImportMetaExpression(parser, context, meta, start) { + if ((context & 2) === 0) + parser.report(169); + nextToken(parser, context); + const token = parser.getToken(); + if (token !== 209030 && parser.tokenValue !== 'meta') { + parser.report(174); + } + else if (token & -2147483648) { + parser.report(175); + } + parser.assignable = 2; + return parser.finishNode({ + type: 'MetaProperty', + meta, + property: parseIdentifier(parser, context), + }, start); + } + function parseImportExpression(parser, context, privateScope, inGroup, start) { + consume(parser, context | 32, 67174411); + if (parser.getToken() === 14) + parser.report(143); + const source = parseExpression(parser, context, privateScope, 1, inGroup, parser.tokenStart); + let options = null; + if (parser.getToken() === 18) { + consume(parser, context, 18); + if (parser.getToken() !== 16) { + const expContext = (context | 131072) ^ 131072; + options = parseExpression(parser, expContext, privateScope, 1, inGroup, parser.tokenStart); + } + consumeOpt(parser, context, 18); + } + const node = { + type: 'ImportExpression', + source, + options, + }; + consume(parser, context, 16); + return parser.finishNode(node, start); + } + function parseImportAttributes(parser, context) { + if (!consumeOpt(parser, context, 20579)) + return []; + consume(parser, context, 2162700); + const attributes = []; + const keysContent = new Set(); + while (parser.getToken() !== 1074790415) { + const start = parser.tokenStart; + const key = parseIdentifierOrStringLiteral(parser, context); + consume(parser, context, 21); + const value = parseStringLiteral(parser, context); + const keyContent = key.type === 'Literal' ? key.value : key.name; + if (keysContent.has(keyContent)) { + parser.report(145, `${keyContent}`); + } + keysContent.add(keyContent); + attributes.push(parser.finishNode({ + type: 'ImportAttribute', + key, + value, + }, start)); + if (parser.getToken() !== 1074790415) { + consume(parser, context, 18); + } + } + consume(parser, context, 1074790415); + return attributes; + } + function parseStringLiteral(parser, context) { + if (parser.getToken() === 134283267) { + return parseLiteral(parser, context); + } + else { + parser.report(30, KeywordDescTable[parser.getToken() & 255]); + } + } + function parseIdentifierOrStringLiteral(parser, context) { + if (parser.getToken() === 134283267) { + return parseLiteral(parser, context); + } + else if (parser.getToken() & 143360) { + return parseIdentifier(parser, context); + } + else { + parser.report(30, KeywordDescTable[parser.getToken() & 255]); + } + } + function validateStringWellFormed(parser, str) { + const len = str.length; + for (let i = 0; i < len; i++) { + const code = str.charCodeAt(i); + if ((code & 0xfc00) !== 55296) + continue; + if (code > 56319 || ++i >= len || (str.charCodeAt(i) & 0xfc00) !== 56320) { + parser.report(171, JSON.stringify(str.charAt(i--))); + } + } + } + function parseModuleExportName(parser, context) { + if (parser.getToken() === 134283267) { + validateStringWellFormed(parser, parser.tokenValue); + return parseLiteral(parser, context); + } + else if (parser.getToken() & 143360) { + return parseIdentifier(parser, context); + } + else { + parser.report(30, KeywordDescTable[parser.getToken() & 255]); + } + } + function parseBigIntLiteral(parser, context) { + const { tokenRaw, tokenValue, tokenStart } = parser; + nextToken(parser, context); + parser.assignable = 2; + const node = { + type: 'Literal', + value: tokenValue, + bigint: String(tokenValue), + }; + if (parser.options.raw) { + node.raw = tokenRaw; + } + return parser.finishNode(node, tokenStart); + } + function parseTemplateLiteral(parser, context) { + parser.assignable = 2; + const { tokenValue, tokenRaw, tokenStart } = parser; + consume(parser, context, 67174409); + const quasis = [parseTemplateElement(parser, tokenValue, tokenRaw, tokenStart, true)]; + return parser.finishNode({ + type: 'TemplateLiteral', + expressions: [], + quasis, + }, tokenStart); + } + function parseTemplate(parser, context, privateScope) { + context = (context | 131072) ^ 131072; + const { tokenValue, tokenRaw, tokenStart } = parser; + consume(parser, (context & -65) | 32, 67174408); + const quasis = [parseTemplateElement(parser, tokenValue, tokenRaw, tokenStart, false)]; + const expressions = [ + parseExpressions(parser, context & -65, privateScope, 0, 1, parser.tokenStart), + ]; + if (parser.getToken() !== 1074790415) + parser.report(83); + while (parser.setToken(scanTemplateTail(parser, context), true) !== 67174409) { + const { tokenValue, tokenRaw, tokenStart } = parser; + consume(parser, (context & -65) | 32, 67174408); + quasis.push(parseTemplateElement(parser, tokenValue, tokenRaw, tokenStart, false)); + expressions.push(parseExpressions(parser, context, privateScope, 0, 1, parser.tokenStart)); + if (parser.getToken() !== 1074790415) + parser.report(83); + } + { + const { tokenValue, tokenRaw, tokenStart } = parser; + consume(parser, context, 67174409); + quasis.push(parseTemplateElement(parser, tokenValue, tokenRaw, tokenStart, true)); + } + return parser.finishNode({ + type: 'TemplateLiteral', + expressions, + quasis, + }, tokenStart); + } + function parseTemplateElement(parser, cooked, raw, start, tail) { + const node = parser.finishNode({ + type: 'TemplateElement', + value: { + cooked, + raw, + }, + tail, + }, start); + const tailSize = tail ? 1 : 2; + if (parser.options.ranges) { + node.start += 1; + node.range[0] += 1; + node.end -= tailSize; + node.range[1] -= tailSize; + } + if (parser.options.loc) { + node.loc.start.column += 1; + node.loc.end.column -= tailSize; + } + return node; + } + function parseSpreadElement(parser, context, privateScope) { + const start = parser.tokenStart; + context = (context | 131072) ^ 131072; + consume(parser, context | 32, 14); + const argument = parseExpression(parser, context, privateScope, 1, 0, parser.tokenStart); + parser.assignable = 1; + return parser.finishNode({ + type: 'SpreadElement', + argument, + }, start); + } + function parseArguments(parser, context, privateScope, inGroup) { + nextToken(parser, context | 32); + const args = []; + if (parser.getToken() === 16) { + nextToken(parser, context | 64); + return args; + } + while (parser.getToken() !== 16) { + if (parser.getToken() === 14) { + args.push(parseSpreadElement(parser, context, privateScope)); + } + else { + args.push(parseExpression(parser, context, privateScope, 1, inGroup, parser.tokenStart)); + } + if (parser.getToken() !== 18) + break; + nextToken(parser, context | 32); + if (parser.getToken() === 16) + break; + } + consume(parser, context | 64, 16); + return args; + } + function parseIdentifier(parser, context) { + const { tokenValue, tokenStart } = parser; + const allowRegex = tokenValue === 'await' && (parser.getToken() & -2147483648) === 0; + nextToken(parser, context | (allowRegex ? 32 : 0)); + return parser.finishNode({ + type: 'Identifier', + name: tokenValue, + }, tokenStart); + } + function parseLiteral(parser, context) { + const { tokenValue, tokenRaw, tokenStart } = parser; + if (parser.getToken() === 134283388) { + return parseBigIntLiteral(parser, context); + } + nextToken(parser, context); + parser.assignable = 2; + return parser.finishNode(parser.options.raw + ? { + type: 'Literal', + value: tokenValue, + raw: tokenRaw, + } + : { + type: 'Literal', + value: tokenValue, + }, tokenStart); + } + function parseNullOrTrueOrFalseLiteral(parser, context) { + const start = parser.tokenStart; + const raw = KeywordDescTable[parser.getToken() & 255]; + const value = parser.getToken() === 86023 ? null : raw === 'true'; + nextToken(parser, context); + parser.assignable = 2; + return parser.finishNode(parser.options.raw + ? { + type: 'Literal', + value, + raw, + } + : { + type: 'Literal', + value, + }, start); + } + function parseThisExpression(parser, context) { + const { tokenStart } = parser; + nextToken(parser, context); + parser.assignable = 2; + return parser.finishNode({ + type: 'ThisExpression', + }, tokenStart); + } + function parseFunctionDeclaration(parser, context, scope, privateScope, origin, allowGen, flags, isAsync, start) { + nextToken(parser, context | 32); + const isGenerator = allowGen ? optionalBit(parser, context, 8391476) : 0; + let id = null; + let funcNameToken; + let functionScope = scope ? parser.createScope() : void 0; + if (parser.getToken() === 67174411) { + if ((flags & 1) === 0) + parser.report(39, 'Function'); + } + else { + const kind = origin & 4 && ((context & 8) === 0 || (context & 2) === 0) + ? 4 + : 64 | (isAsync ? 1024 : 0) | (isGenerator ? 1024 : 0); + validateFunctionName(parser, context, parser.getToken()); + if (scope) { + if (kind & 4) { + scope.addVarName(context, parser.tokenValue, kind); + } + else { + scope.addBlockName(context, parser.tokenValue, kind, origin); + } + functionScope = functionScope?.createChildScope(128); + if (flags) { + if (flags & 2) { + parser.declareUnboundVariable(parser.tokenValue); + } + } + } + funcNameToken = parser.getToken(); + if (parser.getToken() & 143360) { + id = parseIdentifier(parser, context); + } + else { + parser.report(30, KeywordDescTable[parser.getToken() & 255]); + } + } + { + const modifierFlags = 256 | + 512 | + 1024 | + 2048 | + 8192 | + 16384; + context = + ((context | modifierFlags) ^ modifierFlags) | + 65536 | + (isAsync ? 2048 : 0) | + (isGenerator ? 1024 : 0) | + (isGenerator ? 0 : 262144); + } + functionScope = functionScope?.createChildScope(256); + const params = parseFormalParametersOrFormalList(parser, (context | 8192) & -524289, functionScope, privateScope, 0, 1); + const modifierFlags = 8 | 4 | 128 | 524288; + const body = parseFunctionBody(parser, ((context | modifierFlags) ^ modifierFlags) | 32768 | 4096, functionScope?.createChildScope(64), privateScope, 8, funcNameToken, functionScope); + return parser.finishNode({ + type: 'FunctionDeclaration', + id, + params, + body, + async: isAsync === 1, + generator: isGenerator === 1, + }, start); + } + function parseFunctionExpression(parser, context, privateScope, isAsync, inGroup, start) { + nextToken(parser, context | 32); + const isGenerator = optionalBit(parser, context, 8391476); + const generatorAndAsyncFlags = (isAsync ? 2048 : 0) | (isGenerator ? 1024 : 0); + let id = null; + let funcNameToken; + let scope = parser.createScopeIfLexical(); + const modifierFlags = 256 | + 512 | + 1024 | + 2048 | + 8192 | + 16384 | + 524288; + if (parser.getToken() & 143360) { + validateFunctionName(parser, ((context | modifierFlags) ^ modifierFlags) | generatorAndAsyncFlags, parser.getToken()); + scope = scope?.createChildScope(128); + funcNameToken = parser.getToken(); + id = parseIdentifier(parser, context); + } + context = + ((context | modifierFlags) ^ modifierFlags) | + 65536 | + generatorAndAsyncFlags | + (isGenerator ? 0 : 262144); + scope = scope?.createChildScope(256); + const params = parseFormalParametersOrFormalList(parser, (context | 8192) & -524289, scope, privateScope, inGroup, 1); + const body = parseFunctionBody(parser, (context & -131229) | + 32768 | + 4096, scope?.createChildScope(64), privateScope, 0, funcNameToken, scope); + parser.assignable = 2; + return parser.finishNode({ + type: 'FunctionExpression', + id, + params, + body, + async: isAsync === 1, + generator: isGenerator === 1, + }, start); + } + function parseArrayLiteral(parser, context, privateScope, skipInitializer, inGroup) { + const expr = parseArrayExpressionOrPattern(parser, context, void 0, privateScope, skipInitializer, inGroup, 0, 2, 0); + if (parser.destructible & 64) { + parser.report(63); + } + if (parser.destructible & 8) { + parser.report(62); + } + return expr; + } + function parseArrayExpressionOrPattern(parser, context, scope, privateScope, skipInitializer, inGroup, isPattern, kind, origin) { + const { tokenStart: start } = parser; + nextToken(parser, context | 32); + const elements = []; + let destructible = 0; + context = (context | 131072) ^ 131072; + while (parser.getToken() !== 20) { + if (consumeOpt(parser, context | 32, 18)) { + elements.push(null); + } + else { + let left; + const { tokenStart, tokenValue } = parser; + const token = parser.getToken(); + if (token & 143360) { + left = parsePrimaryExpression(parser, context, privateScope, kind, 0, 1, inGroup, 1, tokenStart); + if (parser.getToken() === 1077936155) { + if (parser.assignable & 2) + parser.report(26); + nextToken(parser, context | 32); + scope?.addVarOrBlock(context, tokenValue, kind, origin); + const right = parseExpression(parser, context, privateScope, 1, inGroup, parser.tokenStart); + left = parser.finishNode(isPattern + ? { + type: 'AssignmentPattern', + left, + right, + } + : { + type: 'AssignmentExpression', + operator: '=', + left, + right, + }, tokenStart); + destructible |= + parser.destructible & 256 + ? 256 + : 0 | (parser.destructible & 128) + ? 128 + : 0; + } + else if (parser.getToken() === 18 || parser.getToken() === 20) { + if (parser.assignable & 2) { + destructible |= 16; + } + else { + scope?.addVarOrBlock(context, tokenValue, kind, origin); + } + destructible |= + parser.destructible & 256 + ? 256 + : 0 | (parser.destructible & 128) + ? 128 + : 0; + } + else { + destructible |= + kind & 1 + ? 32 + : (kind & 2) === 0 + ? 16 + : 0; + left = parseMemberOrUpdateExpression(parser, context, privateScope, left, inGroup, 0, tokenStart); + if (parser.getToken() !== 18 && parser.getToken() !== 20) { + if (parser.getToken() !== 1077936155) + destructible |= 16; + left = parseAssignmentExpression(parser, context, privateScope, inGroup, isPattern, tokenStart, left); + } + else if (parser.getToken() !== 1077936155) { + destructible |= + parser.assignable & 2 + ? 16 + : 32; + } + } + } + else if (token & 2097152) { + left = + parser.getToken() === 2162700 + ? parseObjectLiteralOrPattern(parser, context, scope, privateScope, 0, inGroup, isPattern, kind, origin) + : parseArrayExpressionOrPattern(parser, context, scope, privateScope, 0, inGroup, isPattern, kind, origin); + destructible |= parser.destructible; + parser.assignable = + parser.destructible & 16 + ? 2 + : 1; + if (parser.getToken() === 18 || parser.getToken() === 20) { + if (parser.assignable & 2) { + destructible |= 16; + } + } + else if (parser.destructible & 8) { + parser.report(71); + } + else { + left = parseMemberOrUpdateExpression(parser, context, privateScope, left, inGroup, 0, tokenStart); + destructible = parser.assignable & 2 ? 16 : 0; + if (parser.getToken() !== 18 && parser.getToken() !== 20) { + left = parseAssignmentExpression(parser, context, privateScope, inGroup, isPattern, tokenStart, left); + } + else if (parser.getToken() !== 1077936155) { + destructible |= + parser.assignable & 2 + ? 16 + : 32; + } + } + } + else if (token === 14) { + left = parseSpreadOrRestElement(parser, context, scope, privateScope, 20, kind, origin, 0, inGroup, isPattern); + destructible |= parser.destructible; + if (parser.getToken() !== 18 && parser.getToken() !== 20) + parser.report(30, KeywordDescTable[parser.getToken() & 255]); + } + else { + left = parseLeftHandSideExpression(parser, context, privateScope, 1, 0, 1); + if (parser.getToken() !== 18 && parser.getToken() !== 20) { + left = parseAssignmentExpression(parser, context, privateScope, inGroup, isPattern, tokenStart, left); + if ((kind & (2 | 1)) === 0 && token === 67174411) + destructible |= 16; + } + else if (parser.assignable & 2) { + destructible |= 16; + } + else if (token === 67174411) { + destructible |= + parser.assignable & 1 && kind & (2 | 1) + ? 32 + : 16; + } + } + elements.push(left); + if (consumeOpt(parser, context | 32, 18)) { + if (parser.getToken() === 20) + break; + } + else + break; + } + } + consume(parser, context, 20); + const node = parser.finishNode({ + type: isPattern ? 'ArrayPattern' : 'ArrayExpression', + elements, + }, start); + if (!skipInitializer && parser.getToken() & 4194304) { + return parseArrayOrObjectAssignmentPattern(parser, context, privateScope, destructible, inGroup, isPattern, start, node); + } + parser.destructible = destructible; + return node; + } + function parseArrayOrObjectAssignmentPattern(parser, context, privateScope, destructible, inGroup, isPattern, start, node) { + if (parser.getToken() !== 1077936155) + parser.report(26); + nextToken(parser, context | 32); + if (destructible & 16) + parser.report(26); + if (!isPattern) + reinterpretToPattern(parser, node); + const { tokenStart } = parser; + const right = parseExpression(parser, context, privateScope, 1, inGroup, tokenStart); + parser.destructible = + ((destructible | 64 | 8) ^ + (8 | 64)) | + (parser.destructible & 128 ? 128 : 0) | + (parser.destructible & 256 ? 256 : 0); + return parser.finishNode(isPattern + ? { + type: 'AssignmentPattern', + left: node, + right, + } + : { + type: 'AssignmentExpression', + left: node, + operator: '=', + right, + }, start); + } + function parseSpreadOrRestElement(parser, context, scope, privateScope, closingToken, kind, origin, isAsync, inGroup, isPattern) { + const { tokenStart: start } = parser; + nextToken(parser, context | 32); + let argument = null; + let destructible = 0; + const { tokenValue, tokenStart } = parser; + let token = parser.getToken(); + if (token & 143360) { + parser.assignable = 1; + argument = parsePrimaryExpression(parser, context, privateScope, kind, 0, 1, inGroup, 1, tokenStart); + token = parser.getToken(); + argument = parseMemberOrUpdateExpression(parser, context, privateScope, argument, inGroup, 0, tokenStart); + if (parser.getToken() !== 18 && parser.getToken() !== closingToken) { + if (parser.assignable & 2 && parser.getToken() === 1077936155) + parser.report(71); + destructible |= 16; + argument = parseAssignmentExpression(parser, context, privateScope, inGroup, isPattern, tokenStart, argument); + } + if (parser.assignable & 2) { + destructible |= 16; + } + else if (token === closingToken || token === 18) { + scope?.addVarOrBlock(context, tokenValue, kind, origin); + } + else { + destructible |= 32; + } + destructible |= parser.destructible & 128 ? 128 : 0; + } + else if (token === closingToken) { + parser.report(41); + } + else if (token & 2097152) { + argument = + parser.getToken() === 2162700 + ? parseObjectLiteralOrPattern(parser, context, scope, privateScope, 1, inGroup, isPattern, kind, origin) + : parseArrayExpressionOrPattern(parser, context, scope, privateScope, 1, inGroup, isPattern, kind, origin); + token = parser.getToken(); + if (token !== 1077936155 && token !== closingToken && token !== 18) { + if (parser.destructible & 8) + parser.report(71); + argument = parseMemberOrUpdateExpression(parser, context, privateScope, argument, inGroup, 0, tokenStart); + destructible |= parser.assignable & 2 ? 16 : 0; + if ((parser.getToken() & 4194304) === 4194304) { + if (parser.getToken() !== 1077936155) + destructible |= 16; + argument = parseAssignmentExpression(parser, context, privateScope, inGroup, isPattern, tokenStart, argument); + } + else { + if ((parser.getToken() & 8388608) === 8388608) { + argument = parseBinaryExpression(parser, context, privateScope, 1, tokenStart, 4, token, argument); + } + if (consumeOpt(parser, context | 32, 22)) { + argument = parseConditionalExpression(parser, context, privateScope, argument, tokenStart); + } + destructible |= + parser.assignable & 2 + ? 16 + : 32; + } + } + else { + destructible |= + closingToken === 1074790415 && token !== 1077936155 + ? 16 + : parser.destructible; + } + } + else { + destructible |= 32; + argument = parseLeftHandSideExpression(parser, context, privateScope, 1, inGroup, 1); + const { tokenStart } = parser; + const token = parser.getToken(); + if (token === 1077936155) { + if (parser.assignable & 2) + parser.report(26); + argument = parseAssignmentExpression(parser, context, privateScope, inGroup, isPattern, tokenStart, argument); + destructible |= 16; + } + else { + if (token === 18) { + destructible |= 16; + } + else if (token !== closingToken) { + argument = parseAssignmentExpression(parser, context, privateScope, inGroup, isPattern, tokenStart, argument); + } + destructible |= + parser.assignable & 1 ? 32 : 16; + } + parser.destructible = destructible; + if (parser.getToken() !== closingToken && parser.getToken() !== 18) + parser.report(161); + return parser.finishNode({ + type: isPattern ? 'RestElement' : 'SpreadElement', + argument: argument, + }, start); + } + if (parser.getToken() !== closingToken) { + if (kind & 1) + destructible |= isAsync ? 16 : 32; + if (consumeOpt(parser, context | 32, 1077936155)) { + if (destructible & 16) + parser.report(26); + reinterpretToPattern(parser, argument); + const right = parseExpression(parser, context, privateScope, 1, inGroup, parser.tokenStart); + argument = parser.finishNode(isPattern + ? { + type: 'AssignmentPattern', + left: argument, + right, + } + : { + type: 'AssignmentExpression', + left: argument, + operator: '=', + right, + }, tokenStart); + destructible = 16; + } + else { + destructible |= 16; + } + } + parser.destructible = destructible; + return parser.finishNode({ + type: isPattern ? 'RestElement' : 'SpreadElement', + argument: argument, + }, start); + } + function parseMethodDefinition(parser, context, privateScope, kind, inGroup, start) { + const modifierFlags = 1024 | + 2048 | + 8192 | + ((kind & 64) === 0 ? 512 | 16384 : 0); + context = + ((context | modifierFlags) ^ modifierFlags) | + (kind & 8 ? 1024 : 0) | + (kind & 16 ? 2048 : 0) | + (kind & 64 ? 16384 : 0) | + 256 | + 32768 | + 65536; + let scope = parser.createScopeIfLexical(256); + const params = parseMethodFormals(parser, (context | 8192) & -524289, scope, privateScope, kind, 1, inGroup); + scope = scope?.createChildScope(64); + const body = parseFunctionBody(parser, (context & -655373) | + 32768 | + 4096, scope, privateScope, 0, void 0, scope?.parent); + return parser.finishNode({ + type: 'FunctionExpression', + params, + body, + async: (kind & 16) > 0, + generator: (kind & 8) > 0, + id: null, + }, start); + } + function parseObjectLiteral(parser, context, privateScope, skipInitializer, inGroup) { + const expr = parseObjectLiteralOrPattern(parser, context, void 0, privateScope, skipInitializer, inGroup, 0, 2, 0); + if (parser.destructible & 64) { + parser.report(63); + } + if (parser.destructible & 8) { + parser.report(62); + } + return expr; + } + function parseObjectLiteralOrPattern(parser, context, scope, privateScope, skipInitializer, inGroup, isPattern, kind, origin) { + const { tokenStart: start } = parser; + nextToken(parser, context); + const properties = []; + let destructible = 0; + let prototypeCount = 0; + context = (context | 131072) ^ 131072; + while (parser.getToken() !== 1074790415) { + const { tokenValue, tokenStart } = parser; + const token = parser.getToken(); + if (token === 14) { + properties.push(parseSpreadOrRestElement(parser, context, scope, privateScope, 1074790415, kind, origin, 0, inGroup, isPattern)); + } + else { + let state = 0; + let key = null; + let value; + if (parser.getToken() & 143360 || + parser.getToken() === -2147483528 || + parser.getToken() === -2147483527) { + if (parser.getToken() === -2147483527) + destructible |= 16; + key = parseIdentifier(parser, context); + if (parser.getToken() === 18 || + parser.getToken() === 1074790415 || + parser.getToken() === 1077936155) { + state |= 4; + if (context & 1 && (token & 537079808) === 537079808) { + destructible |= 16; + } + else { + validateBindingIdentifier(parser, context, kind, token, 0); + } + scope?.addVarOrBlock(context, tokenValue, kind, origin); + if (consumeOpt(parser, context | 32, 1077936155)) { + destructible |= 8; + const right = parseExpression(parser, context, privateScope, 1, inGroup, parser.tokenStart); + destructible |= + parser.destructible & 256 + ? 256 + : 0 | (parser.destructible & 128) + ? 128 + : 0; + value = parser.finishNode({ + type: 'AssignmentPattern', + left: parser.options.uniqueKeyInPattern ? Object.assign({}, key) : key, + right, + }, tokenStart); + } + else { + destructible |= + (token === 209006 ? 128 : 0) | + (token === -2147483528 ? 16 : 0); + value = parser.options.uniqueKeyInPattern ? Object.assign({}, key) : key; + } + } + else if (consumeOpt(parser, context | 32, 21)) { + const { tokenStart } = parser; + if (tokenValue === '__proto__') + prototypeCount++; + if (parser.getToken() & 143360) { + const tokenAfterColon = parser.getToken(); + const valueAfterColon = parser.tokenValue; + value = parsePrimaryExpression(parser, context, privateScope, kind, 0, 1, inGroup, 1, tokenStart); + const token = parser.getToken(); + value = parseMemberOrUpdateExpression(parser, context, privateScope, value, inGroup, 0, tokenStart); + if (parser.getToken() === 18 || parser.getToken() === 1074790415) { + if (token === 1077936155 || token === 1074790415 || token === 18) { + destructible |= parser.destructible & 128 ? 128 : 0; + if (parser.assignable & 2) { + destructible |= 16; + } + else if ((tokenAfterColon & 143360) === 143360) { + scope?.addVarOrBlock(context, valueAfterColon, kind, origin); + } + } + else { + destructible |= + parser.assignable & 1 + ? 32 + : 16; + } + } + else if ((parser.getToken() & 4194304) === 4194304) { + if (parser.assignable & 2) { + destructible |= 16; + } + else if (token !== 1077936155) { + destructible |= 32; + } + else { + scope?.addVarOrBlock(context, valueAfterColon, kind, origin); + } + value = parseAssignmentExpression(parser, context, privateScope, inGroup, isPattern, tokenStart, value); + } + else { + destructible |= 16; + if ((parser.getToken() & 8388608) === 8388608) { + value = parseBinaryExpression(parser, context, privateScope, 1, tokenStart, 4, token, value); + } + if (consumeOpt(parser, context | 32, 22)) { + value = parseConditionalExpression(parser, context, privateScope, value, tokenStart); + } + } + } + else if ((parser.getToken() & 2097152) === 2097152) { + value = + parser.getToken() === 69271571 + ? parseArrayExpressionOrPattern(parser, context, scope, privateScope, 0, inGroup, isPattern, kind, origin) + : parseObjectLiteralOrPattern(parser, context, scope, privateScope, 0, inGroup, isPattern, kind, origin); + destructible = parser.destructible; + parser.assignable = + destructible & 16 ? 2 : 1; + if (parser.getToken() === 18 || parser.getToken() === 1074790415) { + if (parser.assignable & 2) + destructible |= 16; + } + else if (parser.destructible & 8) { + parser.report(71); + } + else { + value = parseMemberOrUpdateExpression(parser, context, privateScope, value, inGroup, 0, tokenStart); + destructible = parser.assignable & 2 ? 16 : 0; + if ((parser.getToken() & 4194304) === 4194304) { + value = parseAssignmentExpressionOrPattern(parser, context, privateScope, inGroup, isPattern, tokenStart, value); + } + else { + if ((parser.getToken() & 8388608) === 8388608) { + value = parseBinaryExpression(parser, context, privateScope, 1, tokenStart, 4, token, value); + } + if (consumeOpt(parser, context | 32, 22)) { + value = parseConditionalExpression(parser, context, privateScope, value, tokenStart); + } + destructible |= + parser.assignable & 2 + ? 16 + : 32; + } + } + } + else { + value = parseLeftHandSideExpression(parser, context, privateScope, 1, inGroup, 1); + destructible |= + parser.assignable & 1 + ? 32 + : 16; + if (parser.getToken() === 18 || parser.getToken() === 1074790415) { + if (parser.assignable & 2) + destructible |= 16; + } + else { + value = parseMemberOrUpdateExpression(parser, context, privateScope, value, inGroup, 0, tokenStart); + destructible = parser.assignable & 2 ? 16 : 0; + if (parser.getToken() !== 18 && token !== 1074790415) { + if (parser.getToken() !== 1077936155) + destructible |= 16; + value = parseAssignmentExpression(parser, context, privateScope, inGroup, isPattern, tokenStart, value); + } + } + } + } + else if (parser.getToken() === 69271571) { + destructible |= 16; + if (token === 209005) + state |= 16; + state |= + (token === 209008 + ? 256 + : token === 209009 + ? 512 + : 1) | 2; + key = parseComputedPropertyName(parser, context, privateScope, inGroup); + destructible |= parser.assignable; + value = parseMethodDefinition(parser, context, privateScope, state, inGroup, parser.tokenStart); + } + else if (parser.getToken() & 143360) { + destructible |= 16; + if (token === -2147483528) + parser.report(95); + if (token === 209005) { + if (parser.flags & 1) + parser.report(132); + state |= 16 | 1; + } + else if (token === 209008) { + state |= 256; + } + else if (token === 209009) { + state |= 512; + } + else { + parser.report(0); + } + key = parseIdentifier(parser, context); + value = parseMethodDefinition(parser, context, privateScope, state, inGroup, parser.tokenStart); + } + else if (parser.getToken() === 67174411) { + destructible |= 16; + state |= 1; + value = parseMethodDefinition(parser, context, privateScope, state, inGroup, parser.tokenStart); + } + else if (parser.getToken() === 8391476) { + destructible |= 16; + if (token === 209008) { + parser.report(42); + } + else if (token === 209009) { + parser.report(43); + } + else if (token !== 209005) { + parser.report(30, KeywordDescTable[8391476 & 255]); + } + nextToken(parser, context); + state |= + 8 | 1 | (token === 209005 ? 16 : 0); + if (parser.getToken() & 143360) { + key = parseIdentifier(parser, context); + } + else if ((parser.getToken() & 134217728) === 134217728) { + key = parseLiteral(parser, context); + } + else if (parser.getToken() === 69271571) { + state |= 2; + key = parseComputedPropertyName(parser, context, privateScope, inGroup); + destructible |= parser.assignable; + } + else { + parser.report(30, KeywordDescTable[parser.getToken() & 255]); + } + value = parseMethodDefinition(parser, context, privateScope, state, inGroup, parser.tokenStart); + } + else if ((parser.getToken() & 134217728) === 134217728) { + if (token === 209005) + state |= 16; + state |= + token === 209008 + ? 256 + : token === 209009 + ? 512 + : 1; + destructible |= 16; + key = parseLiteral(parser, context); + value = parseMethodDefinition(parser, context, privateScope, state, inGroup, parser.tokenStart); + } + else { + parser.report(133); + } + } + else if ((parser.getToken() & 134217728) === 134217728) { + key = parseLiteral(parser, context); + if (parser.getToken() === 21) { + consume(parser, context | 32, 21); + const { tokenStart } = parser; + if (tokenValue === '__proto__') + prototypeCount++; + if (parser.getToken() & 143360) { + value = parsePrimaryExpression(parser, context, privateScope, kind, 0, 1, inGroup, 1, tokenStart); + const { tokenValue: valueAfterColon } = parser; + const token = parser.getToken(); + value = parseMemberOrUpdateExpression(parser, context, privateScope, value, inGroup, 0, tokenStart); + if (parser.getToken() === 18 || parser.getToken() === 1074790415) { + if (token === 1077936155 || token === 1074790415 || token === 18) { + if (parser.assignable & 2) { + destructible |= 16; + } + else { + scope?.addVarOrBlock(context, valueAfterColon, kind, origin); + } + } + else { + destructible |= + parser.assignable & 1 + ? 32 + : 16; + } + } + else if (parser.getToken() === 1077936155) { + if (parser.assignable & 2) + destructible |= 16; + value = parseAssignmentExpression(parser, context, privateScope, inGroup, isPattern, tokenStart, value); + } + else { + destructible |= 16; + value = parseAssignmentExpression(parser, context, privateScope, inGroup, isPattern, tokenStart, value); + } + } + else if ((parser.getToken() & 2097152) === 2097152) { + value = + parser.getToken() === 69271571 + ? parseArrayExpressionOrPattern(parser, context, scope, privateScope, 0, inGroup, isPattern, kind, origin) + : parseObjectLiteralOrPattern(parser, context, scope, privateScope, 0, inGroup, isPattern, kind, origin); + destructible = parser.destructible; + parser.assignable = + destructible & 16 ? 2 : 1; + if (parser.getToken() === 18 || parser.getToken() === 1074790415) { + if (parser.assignable & 2) { + destructible |= 16; + } + } + else if ((parser.destructible & 8) !== 8) { + value = parseMemberOrUpdateExpression(parser, context, privateScope, value, inGroup, 0, tokenStart); + destructible = parser.assignable & 2 ? 16 : 0; + if ((parser.getToken() & 4194304) === 4194304) { + value = parseAssignmentExpressionOrPattern(parser, context, privateScope, inGroup, isPattern, tokenStart, value); + } + else { + if ((parser.getToken() & 8388608) === 8388608) { + value = parseBinaryExpression(parser, context, privateScope, 1, tokenStart, 4, token, value); + } + if (consumeOpt(parser, context | 32, 22)) { + value = parseConditionalExpression(parser, context, privateScope, value, tokenStart); + } + destructible |= + parser.assignable & 2 + ? 16 + : 32; + } + } + } + else { + value = parseLeftHandSideExpression(parser, context, privateScope, 1, 0, 1); + destructible |= + parser.assignable & 1 + ? 32 + : 16; + if (parser.getToken() === 18 || parser.getToken() === 1074790415) { + if (parser.assignable & 2) { + destructible |= 16; + } + } + else { + value = parseMemberOrUpdateExpression(parser, context, privateScope, value, inGroup, 0, tokenStart); + destructible = parser.assignable & 1 ? 0 : 16; + if (parser.getToken() !== 18 && parser.getToken() !== 1074790415) { + if (parser.getToken() !== 1077936155) + destructible |= 16; + value = parseAssignmentExpression(parser, context, privateScope, inGroup, isPattern, tokenStart, value); + } + } + } + } + else if (parser.getToken() === 67174411) { + state |= 1; + value = parseMethodDefinition(parser, context, privateScope, state, inGroup, parser.tokenStart); + destructible = parser.assignable | 16; + } + else { + parser.report(134); + } + } + else if (parser.getToken() === 69271571) { + key = parseComputedPropertyName(parser, context, privateScope, inGroup); + destructible |= parser.destructible & 256 ? 256 : 0; + state |= 2; + if (parser.getToken() === 21) { + nextToken(parser, context | 32); + const { tokenStart, tokenValue } = parser; + const tokenAfterColon = parser.getToken(); + if (parser.getToken() & 143360) { + value = parsePrimaryExpression(parser, context, privateScope, kind, 0, 1, inGroup, 1, tokenStart); + const token = parser.getToken(); + value = parseMemberOrUpdateExpression(parser, context, privateScope, value, inGroup, 0, tokenStart); + if ((parser.getToken() & 4194304) === 4194304) { + destructible |= + parser.assignable & 2 + ? 16 + : token === 1077936155 + ? 0 + : 32; + value = parseAssignmentExpressionOrPattern(parser, context, privateScope, inGroup, isPattern, tokenStart, value); + } + else if (parser.getToken() === 18 || parser.getToken() === 1074790415) { + if (token === 1077936155 || token === 1074790415 || token === 18) { + if (parser.assignable & 2) { + destructible |= 16; + } + else if ((tokenAfterColon & 143360) === 143360) { + scope?.addVarOrBlock(context, tokenValue, kind, origin); + } + } + else { + destructible |= + parser.assignable & 1 + ? 32 + : 16; + } + } + else { + destructible |= 16; + value = parseAssignmentExpression(parser, context, privateScope, inGroup, isPattern, tokenStart, value); + } + } + else if ((parser.getToken() & 2097152) === 2097152) { + value = + parser.getToken() === 69271571 + ? parseArrayExpressionOrPattern(parser, context, scope, privateScope, 0, inGroup, isPattern, kind, origin) + : parseObjectLiteralOrPattern(parser, context, scope, privateScope, 0, inGroup, isPattern, kind, origin); + destructible = parser.destructible; + parser.assignable = + destructible & 16 ? 2 : 1; + if (parser.getToken() === 18 || parser.getToken() === 1074790415) { + if (parser.assignable & 2) + destructible |= 16; + } + else if (destructible & 8) { + parser.report(62); + } + else { + value = parseMemberOrUpdateExpression(parser, context, privateScope, value, inGroup, 0, tokenStart); + destructible = + parser.assignable & 2 ? destructible | 16 : 0; + if ((parser.getToken() & 4194304) === 4194304) { + if (parser.getToken() !== 1077936155) + destructible |= 16; + value = parseAssignmentExpressionOrPattern(parser, context, privateScope, inGroup, isPattern, tokenStart, value); + } + else { + if ((parser.getToken() & 8388608) === 8388608) { + value = parseBinaryExpression(parser, context, privateScope, 1, tokenStart, 4, token, value); + } + if (consumeOpt(parser, context | 32, 22)) { + value = parseConditionalExpression(parser, context, privateScope, value, tokenStart); + } + destructible |= + parser.assignable & 2 + ? 16 + : 32; + } + } + } + else { + value = parseLeftHandSideExpression(parser, context, privateScope, 1, 0, 1); + destructible |= + parser.assignable & 1 + ? 32 + : 16; + if (parser.getToken() === 18 || parser.getToken() === 1074790415) { + if (parser.assignable & 2) + destructible |= 16; + } + else { + value = parseMemberOrUpdateExpression(parser, context, privateScope, value, inGroup, 0, tokenStart); + destructible = parser.assignable & 1 ? 0 : 16; + if (parser.getToken() !== 18 && parser.getToken() !== 1074790415) { + if (parser.getToken() !== 1077936155) + destructible |= 16; + value = parseAssignmentExpression(parser, context, privateScope, inGroup, isPattern, tokenStart, value); + } + } + } + } + else if (parser.getToken() === 67174411) { + state |= 1; + value = parseMethodDefinition(parser, context, privateScope, state, inGroup, parser.tokenStart); + destructible = 16; + } + else { + parser.report(44); + } + } + else if (token === 8391476) { + consume(parser, context | 32, 8391476); + state |= 8; + if (parser.getToken() & 143360) { + const token = parser.getToken(); + key = parseIdentifier(parser, context); + state |= 1; + if (parser.getToken() === 67174411) { + destructible |= 16; + value = parseMethodDefinition(parser, context, privateScope, state, inGroup, parser.tokenStart); + } + else { + throw new ParseError(parser.tokenStart, parser.currentLocation, token === 209005 + ? 46 + : token === 209008 || parser.getToken() === 209009 + ? 45 + : 47, KeywordDescTable[token & 255]); + } + } + else if ((parser.getToken() & 134217728) === 134217728) { + destructible |= 16; + key = parseLiteral(parser, context); + state |= 1; + value = parseMethodDefinition(parser, context, privateScope, state, inGroup, parser.tokenStart); + } + else if (parser.getToken() === 69271571) { + destructible |= 16; + state |= 2 | 1; + key = parseComputedPropertyName(parser, context, privateScope, inGroup); + value = parseMethodDefinition(parser, context, privateScope, state, inGroup, parser.tokenStart); + } + else { + parser.report(126); + } + } + else { + parser.report(30, KeywordDescTable[token & 255]); + } + destructible |= parser.destructible & 128 ? 128 : 0; + parser.destructible = destructible; + properties.push(parser.finishNode({ + type: 'Property', + key: key, + value, + kind: !(state & 768) ? 'init' : state & 512 ? 'set' : 'get', + computed: (state & 2) > 0, + method: (state & 1) > 0, + shorthand: (state & 4) > 0, + }, tokenStart)); + } + destructible |= parser.destructible; + if (parser.getToken() !== 18) + break; + nextToken(parser, context); + } + consume(parser, context, 1074790415); + if (prototypeCount > 1) + destructible |= 64; + const node = parser.finishNode({ + type: isPattern ? 'ObjectPattern' : 'ObjectExpression', + properties, + }, start); + if (!skipInitializer && parser.getToken() & 4194304) { + return parseArrayOrObjectAssignmentPattern(parser, context, privateScope, destructible, inGroup, isPattern, start, node); + } + parser.destructible = destructible; + return node; + } + function parseMethodFormals(parser, context, scope, privateScope, kind, type, inGroup) { + consume(parser, context, 67174411); + const params = []; + parser.flags = (parser.flags | 128) ^ 128; + if (parser.getToken() === 16) { + if (kind & 512) { + parser.report(37, 'Setter', 'one', ''); + } + nextToken(parser, context); + return params; + } + if (kind & 256) { + parser.report(37, 'Getter', 'no', 's'); + } + if (kind & 512 && parser.getToken() === 14) { + parser.report(38); + } + context = (context | 131072) ^ 131072; + let setterArgs = 0; + let isNonSimpleParameterList = 0; + while (parser.getToken() !== 18) { + let left = null; + const { tokenStart } = parser; + if (parser.getToken() & 143360) { + if ((context & 1) === 0) { + if ((parser.getToken() & 36864) === 36864) { + parser.flags |= 256; + } + if ((parser.getToken() & 537079808) === 537079808) { + parser.flags |= 512; + } + } + left = parseAndClassifyIdentifier(parser, context, scope, kind | 1, 0); + } + else { + if (parser.getToken() === 2162700) { + left = parseObjectLiteralOrPattern(parser, context, scope, privateScope, 1, inGroup, 1, type, 0); + } + else if (parser.getToken() === 69271571) { + left = parseArrayExpressionOrPattern(parser, context, scope, privateScope, 1, inGroup, 1, type, 0); + } + else if (parser.getToken() === 14) { + left = parseSpreadOrRestElement(parser, context, scope, privateScope, 16, type, 0, 0, inGroup, 1); + } + isNonSimpleParameterList = 1; + if (parser.destructible & (32 | 16)) + parser.report(50); + } + if (parser.getToken() === 1077936155) { + nextToken(parser, context | 32); + isNonSimpleParameterList = 1; + const right = parseExpression(parser, context, privateScope, 1, 0, parser.tokenStart); + left = parser.finishNode({ + type: 'AssignmentPattern', + left: left, + right, + }, tokenStart); + } + setterArgs++; + params.push(left); + if (!consumeOpt(parser, context, 18)) + break; + if (parser.getToken() === 16) { + break; + } + } + if (kind & 512 && setterArgs !== 1) { + parser.report(37, 'Setter', 'one', ''); + } + scope?.reportScopeError(); + if (isNonSimpleParameterList) + parser.flags |= 128; + consume(parser, context, 16); + return params; + } + function parseComputedPropertyName(parser, context, privateScope, inGroup) { + nextToken(parser, context | 32); + const key = parseExpression(parser, (context | 131072) ^ 131072, privateScope, 1, inGroup, parser.tokenStart); + consume(parser, context, 20); + return key; + } + function parseParenthesizedExpression(parser, context, privateScope, canAssign, kind, origin, start) { + parser.flags = (parser.flags | 128) ^ 128; + const parenthesesStart = parser.tokenStart; + nextToken(parser, context | 32 | 262144); + const scope = parser.createScopeIfLexical()?.createChildScope(512); + context = (context | 131072) ^ 131072; + if (consumeOpt(parser, context, 16)) { + return parseParenthesizedArrow(parser, context, scope, privateScope, [], canAssign, 0, start); + } + let destructible = 0; + parser.destructible &= -385; + let expr; + let expressions = []; + let isSequence = 0; + let isNonSimpleParameterList = 0; + let hasStrictReserved = 0; + const tokenAfterParenthesesStart = parser.tokenStart; + parser.assignable = 1; + while (parser.getToken() !== 16) { + const { tokenStart } = parser; + const token = parser.getToken(); + if (token & 143360) { + scope?.addBlockName(context, parser.tokenValue, 1, 0); + if ((token & 537079808) === 537079808) { + isNonSimpleParameterList = 1; + } + else if ((token & 36864) === 36864) { + hasStrictReserved = 1; + } + expr = parsePrimaryExpression(parser, context, privateScope, kind, 0, 1, 1, 1, tokenStart); + if (parser.getToken() === 16 || parser.getToken() === 18) { + if (parser.assignable & 2) { + destructible |= 16; + isNonSimpleParameterList = 1; + } + } + else { + if (parser.getToken() === 1077936155) { + isNonSimpleParameterList = 1; + } + else { + destructible |= 16; + } + expr = parseMemberOrUpdateExpression(parser, context, privateScope, expr, 1, 0, tokenStart); + if (parser.getToken() !== 16 && parser.getToken() !== 18) { + expr = parseAssignmentExpression(parser, context, privateScope, 1, 0, tokenStart, expr); + } + } + } + else if ((token & 2097152) === 2097152) { + expr = + token === 2162700 + ? parseObjectLiteralOrPattern(parser, context | 262144, scope, privateScope, 0, 1, 0, kind, origin) + : parseArrayExpressionOrPattern(parser, context | 262144, scope, privateScope, 0, 1, 0, kind, origin); + destructible |= parser.destructible; + isNonSimpleParameterList = 1; + parser.assignable = 2; + if (parser.getToken() !== 16 && parser.getToken() !== 18) { + if (destructible & 8) + parser.report(122); + expr = parseMemberOrUpdateExpression(parser, context, privateScope, expr, 0, 0, tokenStart); + destructible |= 16; + if (parser.getToken() !== 16 && parser.getToken() !== 18) { + expr = parseAssignmentExpression(parser, context, privateScope, 0, 0, tokenStart, expr); + } + } + } + else if (token === 14) { + expr = parseSpreadOrRestElement(parser, context, scope, privateScope, 16, kind, origin, 0, 1, 0); + if (parser.destructible & 16) + parser.report(74); + isNonSimpleParameterList = 1; + if (isSequence && (parser.getToken() === 16 || parser.getToken() === 18)) { + expressions.push(expr); + } + destructible |= 8; + break; + } + else { + destructible |= 16; + expr = parseExpression(parser, context, privateScope, 1, 1, tokenStart); + if (isSequence && (parser.getToken() === 16 || parser.getToken() === 18)) { + expressions.push(expr); + } + if (parser.getToken() === 18) { + if (!isSequence) { + isSequence = 1; + expressions = [expr]; + } + } + if (isSequence) { + while (consumeOpt(parser, context | 32, 18)) { + expressions.push(parseExpression(parser, context, privateScope, 1, 1, parser.tokenStart)); + } + parser.assignable = 2; + expr = parser.finishNode({ + type: 'SequenceExpression', + expressions, + }, tokenAfterParenthesesStart); + } + consume(parser, context, 16); + parser.destructible = destructible; + return parser.options.preserveParens + ? parser.finishNode({ + type: 'ParenthesizedExpression', + expression: expr, + }, parenthesesStart) + : expr; + } + if (isSequence && (parser.getToken() === 16 || parser.getToken() === 18)) { + expressions.push(expr); + } + if (!consumeOpt(parser, context | 32, 18)) + break; + if (!isSequence) { + isSequence = 1; + expressions = [expr]; + } + if (parser.getToken() === 16) { + destructible |= 8; + break; + } + } + if (isSequence) { + parser.assignable = 2; + expr = parser.finishNode({ + type: 'SequenceExpression', + expressions, + }, tokenAfterParenthesesStart); + } + consume(parser, context, 16); + if (destructible & 16 && destructible & 8) + parser.report(151); + destructible |= + parser.destructible & 256 + ? 256 + : 0 | (parser.destructible & 128) + ? 128 + : 0; + if (parser.getToken() === 10) { + if (destructible & (32 | 16)) + parser.report(49); + if (context & (2048 | 2) && destructible & 128) + parser.report(31); + if (context & (1 | 1024) && destructible & 256) { + parser.report(32); + } + if (isNonSimpleParameterList) + parser.flags |= 128; + if (hasStrictReserved) + parser.flags |= 256; + return parseParenthesizedArrow(parser, context, scope, privateScope, isSequence ? expressions : [expr], canAssign, 0, start); + } + if (destructible & 64) { + parser.report(63); + } + if (destructible & 8) { + parser.report(144); + } + parser.destructible = ((parser.destructible | 256) ^ 256) | destructible; + return parser.options.preserveParens + ? parser.finishNode({ + type: 'ParenthesizedExpression', + expression: expr, + }, parenthesesStart) + : expr; + } + function parseIdentifierOrArrow(parser, context, privateScope) { + const { tokenStart: start } = parser; + const { tokenValue } = parser; + let isNonSimpleParameterList = 0; + let hasStrictReserved = 0; + if ((parser.getToken() & 537079808) === 537079808) { + isNonSimpleParameterList = 1; + } + else if ((parser.getToken() & 36864) === 36864) { + hasStrictReserved = 1; + } + const expr = parseIdentifier(parser, context); + parser.assignable = 1; + if (parser.getToken() === 10) { + const scope = parser.options.lexical ? createArrowHeadParsingScope(parser, context, tokenValue) : undefined; + if (isNonSimpleParameterList) + parser.flags |= 128; + if (hasStrictReserved) + parser.flags |= 256; + return parseArrowFunctionExpression(parser, context, scope, privateScope, [expr], 0, start); + } + return expr; + } + function parseArrowFromIdentifier(parser, context, privateScope, value, expr, inNew, canAssign, isAsync, start) { + if (!canAssign) + parser.report(57); + if (inNew) + parser.report(51); + parser.flags &= -129; + const scope = parser.options.lexical ? createArrowHeadParsingScope(parser, context, value) : void 0; + return parseArrowFunctionExpression(parser, context, scope, privateScope, [expr], isAsync, start); + } + function parseParenthesizedArrow(parser, context, scope, privateScope, params, canAssign, isAsync, start) { + if (!canAssign) + parser.report(57); + for (let i = 0; i < params.length; ++i) + reinterpretToPattern(parser, params[i]); + return parseArrowFunctionExpression(parser, context, scope, privateScope, params, isAsync, start); + } + function parseArrowFunctionExpression(parser, context, scope, privateScope, params, isAsync, start) { + if (parser.flags & 1) + parser.report(48); + consume(parser, context | 32, 10); + const modifierFlags = 1024 | 2048 | 8192 | 524288; + context = ((context | modifierFlags) ^ modifierFlags) | (isAsync ? 2048 : 0); + const expression = parser.getToken() !== 2162700; + let body; + scope?.reportScopeError(); + if (expression) { + parser.flags = + (parser.flags | 512 | 256 | 64 | 4096) ^ + (512 | 256 | 64 | 4096); + body = parseExpression(parser, context, privateScope, 1, 0, parser.tokenStart); + } + else { + scope = scope?.createChildScope(64); + const modifierFlags = 4 | 131072 | 8; + body = parseFunctionBody(parser, ((context | modifierFlags) ^ modifierFlags) | 4096, scope, privateScope, 16, void 0, void 0); + switch (parser.getToken()) { + case 69271571: + if ((parser.flags & 1) === 0) { + parser.report(116); + } + break; + case 67108877: + case 67174409: + case 22: + parser.report(117); + case 67174411: + if ((parser.flags & 1) === 0) { + parser.report(116); + } + parser.flags |= 1024; + break; + } + if ((parser.getToken() & 8388608) === 8388608 && (parser.flags & 1) === 0) + parser.report(30, KeywordDescTable[parser.getToken() & 255]); + if ((parser.getToken() & 33619968) === 33619968) + parser.report(125); + } + parser.assignable = 2; + return parser.finishNode({ + type: 'ArrowFunctionExpression', + params, + body, + async: isAsync === 1, + expression, + generator: false, + }, start); + } + function parseFormalParametersOrFormalList(parser, context, scope, privateScope, inGroup, kind) { + consume(parser, context, 67174411); + parser.flags = (parser.flags | 128) ^ 128; + const params = []; + if (consumeOpt(parser, context, 16)) + return params; + context = (context | 131072) ^ 131072; + let isNonSimpleParameterList = 0; + while (parser.getToken() !== 18) { + let left; + const { tokenStart } = parser; + const token = parser.getToken(); + if (token & 143360) { + if ((context & 1) === 0) { + if ((token & 36864) === 36864) { + parser.flags |= 256; + } + if ((token & 537079808) === 537079808) { + parser.flags |= 512; + } + } + left = parseAndClassifyIdentifier(parser, context, scope, kind | 1, 0); + } + else { + if (token === 2162700) { + left = parseObjectLiteralOrPattern(parser, context, scope, privateScope, 1, inGroup, 1, kind, 0); + } + else if (token === 69271571) { + left = parseArrayExpressionOrPattern(parser, context, scope, privateScope, 1, inGroup, 1, kind, 0); + } + else if (token === 14) { + left = parseSpreadOrRestElement(parser, context, scope, privateScope, 16, kind, 0, 0, inGroup, 1); + } + else { + parser.report(30, KeywordDescTable[token & 255]); + } + isNonSimpleParameterList = 1; + if (parser.destructible & (32 | 16)) { + parser.report(50); + } + } + if (parser.getToken() === 1077936155) { + nextToken(parser, context | 32); + isNonSimpleParameterList = 1; + const right = parseExpression(parser, context, privateScope, 1, inGroup, parser.tokenStart); + left = parser.finishNode({ + type: 'AssignmentPattern', + left, + right, + }, tokenStart); + } + params.push(left); + if (!consumeOpt(parser, context, 18)) + break; + if (parser.getToken() === 16) { + break; + } + } + if (isNonSimpleParameterList) + parser.flags |= 128; + if (isNonSimpleParameterList || context & 1) { + scope?.reportScopeError(); + } + consume(parser, context, 16); + return params; + } + function parseMemberExpressionNoCall(parser, context, privateScope, expr, inGroup, start) { + const token = parser.getToken(); + if (token & 67108864) { + if (token === 67108877) { + nextToken(parser, context | 262144); + parser.assignable = 1; + const property = parsePropertyOrPrivatePropertyName(parser, context, privateScope); + return parseMemberExpressionNoCall(parser, context, privateScope, parser.finishNode({ + type: 'MemberExpression', + object: expr, + computed: false, + property, + optional: false, + }, start), 0, start); + } + else if (token === 69271571) { + nextToken(parser, context | 32); + const { tokenStart } = parser; + const property = parseExpressions(parser, context, privateScope, inGroup, 1, tokenStart); + consume(parser, context, 20); + parser.assignable = 1; + return parseMemberExpressionNoCall(parser, context, privateScope, parser.finishNode({ + type: 'MemberExpression', + object: expr, + computed: true, + property, + optional: false, + }, start), 0, start); + } + else if (token === 67174408 || token === 67174409) { + parser.assignable = 2; + return parseMemberExpressionNoCall(parser, context, privateScope, parser.finishNode({ + type: 'TaggedTemplateExpression', + tag: expr, + quasi: parser.getToken() === 67174408 + ? parseTemplate(parser, context | 64, privateScope) + : parseTemplateLiteral(parser, context | 64), + }, start), 0, start); + } + } + return expr; + } + function parseNewExpression(parser, context, privateScope, inGroup) { + const { tokenStart: start } = parser; + const id = parseIdentifier(parser, context | 32); + const { tokenStart } = parser; + if (consumeOpt(parser, context, 67108877)) { + if (context & 65536 && parser.getToken() === 209029) { + parser.assignable = 2; + return parseMetaProperty(parser, context, id, start); + } + parser.report(94); + } + parser.assignable = 2; + if ((parser.getToken() & 16842752) === 16842752) { + parser.report(65, KeywordDescTable[parser.getToken() & 255]); + } + const expr = parsePrimaryExpression(parser, context, privateScope, 2, 1, 0, inGroup, 1, tokenStart); + context = (context | 131072) ^ 131072; + if (parser.getToken() === 67108990) + parser.report(168); + const callee = parseMemberExpressionNoCall(parser, context, privateScope, expr, inGroup, tokenStart); + parser.assignable = 2; + return parser.finishNode({ + type: 'NewExpression', + callee, + arguments: parser.getToken() === 67174411 ? parseArguments(parser, context, privateScope, inGroup) : [], + }, start); + } + function parseMetaProperty(parser, context, meta, start) { + const property = parseIdentifier(parser, context); + return parser.finishNode({ + type: 'MetaProperty', + meta, + property, + }, start); + } + function parseAsyncArrowAfterIdent(parser, context, privateScope, canAssign, start) { + if (parser.getToken() === 209006) + parser.report(31); + if (context & (1 | 1024) && parser.getToken() === 241771) { + parser.report(32); + } + classifyIdentifier(parser, context, parser.getToken()); + if ((parser.getToken() & 36864) === 36864) { + parser.flags |= 256; + } + return parseArrowFromIdentifier(parser, (context & -524289) | 2048, privateScope, parser.tokenValue, parseIdentifier(parser, context), 0, canAssign, 1, start); + } + function parseAsyncArrowOrCallExpression(parser, context, privateScope, callee, canAssign, kind, origin, flags, start) { + nextToken(parser, context | 32); + const scope = parser.createScopeIfLexical()?.createChildScope(512); + context = (context | 131072) ^ 131072; + if (consumeOpt(parser, context, 16)) { + if (parser.getToken() === 10) { + if (flags & 1) + parser.report(48); + return parseParenthesizedArrow(parser, context, scope, privateScope, [], canAssign, 1, start); + } + return parser.finishNode({ + type: 'CallExpression', + callee, + arguments: [], + optional: false, + }, start); + } + let destructible = 0; + let expr = null; + let isNonSimpleParameterList = 0; + parser.destructible = + (parser.destructible | 256 | 128) ^ + (256 | 128); + const params = []; + while (parser.getToken() !== 16) { + const { tokenStart } = parser; + const token = parser.getToken(); + if (token & 143360) { + scope?.addBlockName(context, parser.tokenValue, kind, 0); + if ((token & 537079808) === 537079808) { + parser.flags |= 512; + } + else if ((token & 36864) === 36864) { + parser.flags |= 256; + } + expr = parsePrimaryExpression(parser, context, privateScope, kind, 0, 1, 1, 1, tokenStart); + if (parser.getToken() === 16 || parser.getToken() === 18) { + if (parser.assignable & 2) { + destructible |= 16; + isNonSimpleParameterList = 1; + } + } + else { + if (parser.getToken() === 1077936155) { + isNonSimpleParameterList = 1; + } + else { + destructible |= 16; + } + expr = parseMemberOrUpdateExpression(parser, context, privateScope, expr, 1, 0, tokenStart); + if (parser.getToken() !== 16 && parser.getToken() !== 18) { + expr = parseAssignmentExpression(parser, context, privateScope, 1, 0, tokenStart, expr); + } + } + } + else if (token & 2097152) { + expr = + token === 2162700 + ? parseObjectLiteralOrPattern(parser, context, scope, privateScope, 0, 1, 0, kind, origin) + : parseArrayExpressionOrPattern(parser, context, scope, privateScope, 0, 1, 0, kind, origin); + destructible |= parser.destructible; + isNonSimpleParameterList = 1; + if (parser.getToken() !== 16 && parser.getToken() !== 18) { + if (destructible & 8) + parser.report(122); + expr = parseMemberOrUpdateExpression(parser, context, privateScope, expr, 0, 0, tokenStart); + destructible |= 16; + if ((parser.getToken() & 8388608) === 8388608) { + expr = parseBinaryExpression(parser, context, privateScope, 1, start, 4, token, expr); + } + if (consumeOpt(parser, context | 32, 22)) { + expr = parseConditionalExpression(parser, context, privateScope, expr, start); + } + } + } + else if (token === 14) { + expr = parseSpreadOrRestElement(parser, context, scope, privateScope, 16, kind, origin, 1, 1, 0); + destructible |= + (parser.getToken() === 16 ? 0 : 16) | parser.destructible; + isNonSimpleParameterList = 1; + } + else { + expr = parseExpression(parser, context, privateScope, 1, 0, tokenStart); + destructible = parser.assignable; + params.push(expr); + while (consumeOpt(parser, context | 32, 18)) { + params.push(parseExpression(parser, context, privateScope, 1, 0, tokenStart)); + } + destructible |= parser.assignable; + consume(parser, context, 16); + parser.destructible = destructible | 16; + parser.assignable = 2; + return parser.finishNode({ + type: 'CallExpression', + callee, + arguments: params, + optional: false, + }, start); + } + params.push(expr); + if (!consumeOpt(parser, context | 32, 18)) + break; + } + consume(parser, context, 16); + destructible |= + parser.destructible & 256 + ? 256 + : 0 | (parser.destructible & 128) + ? 128 + : 0; + if (parser.getToken() === 10) { + if (destructible & (32 | 16)) + parser.report(27); + if (parser.flags & 1 || flags & 1) + parser.report(48); + if (destructible & 128) + parser.report(31); + if (context & (1 | 1024) && destructible & 256) + parser.report(32); + if (isNonSimpleParameterList) + parser.flags |= 128; + return parseParenthesizedArrow(parser, context | 2048, scope, privateScope, params, canAssign, 1, start); + } + if (destructible & 64) { + parser.report(63); + } + if (destructible & 8) { + parser.report(62); + } + parser.assignable = 2; + return parser.finishNode({ + type: 'CallExpression', + callee, + arguments: params, + optional: false, + }, start); + } + function parseRegExpLiteral(parser, context) { + const { tokenRaw, tokenRegExp, tokenValue, tokenStart } = parser; + nextToken(parser, context); + parser.assignable = 2; + const node = { + type: 'Literal', + value: tokenValue, + regex: tokenRegExp, + }; + if (parser.options.raw) { + node.raw = tokenRaw; + } + return parser.finishNode(node, tokenStart); + } + function parseClassDeclaration(parser, context, scope, privateScope, flags) { + let start; + let decorators; + if (parser.leadingDecorators.decorators.length) { + if (parser.getToken() === 132) { + parser.report(30, '@'); + } + start = parser.leadingDecorators.start; + decorators = [...parser.leadingDecorators.decorators]; + parser.leadingDecorators.decorators.length = 0; + } + else { + start = parser.tokenStart; + decorators = parseDecorators(parser, context, privateScope); + } + context = (context | 16384 | 1) ^ 16384; + nextToken(parser, context); + let id = null; + let superClass = null; + const { tokenValue } = parser; + if (parser.getToken() & 4096 && parser.getToken() !== 20565) { + if (isStrictReservedWord(parser, context, parser.getToken())) { + parser.report(118); + } + if ((parser.getToken() & 537079808) === 537079808) { + parser.report(119); + } + if (scope) { + scope.addBlockName(context, tokenValue, 32, 0); + if (flags) { + if (flags & 2) { + parser.declareUnboundVariable(tokenValue); + } + } + } + id = parseIdentifier(parser, context); + } + else { + if ((flags & 1) === 0) + parser.report(39, 'Class'); + } + let inheritedContext = context; + if (consumeOpt(parser, context | 32, 20565)) { + superClass = parseLeftHandSideExpression(parser, context, privateScope, 0, 0, 0); + inheritedContext |= 512; + } + else { + inheritedContext = (inheritedContext | 512) ^ 512; + } + const body = parseClassBody(parser, inheritedContext, context, scope, privateScope, 2, 8, 0); + return parser.finishNode({ + type: 'ClassDeclaration', + id, + superClass, + body, + ...(parser.options.next ? { decorators } : null), + }, start); + } + function parseClassExpression(parser, context, privateScope, inGroup, start) { + let id = null; + let superClass = null; + const decorators = parseDecorators(parser, context, privateScope); + context = (context | 1 | 16384) ^ 16384; + nextToken(parser, context); + if (parser.getToken() & 4096 && parser.getToken() !== 20565) { + if (isStrictReservedWord(parser, context, parser.getToken())) + parser.report(118); + if ((parser.getToken() & 537079808) === 537079808) { + parser.report(119); + } + id = parseIdentifier(parser, context); + } + let inheritedContext = context; + if (consumeOpt(parser, context | 32, 20565)) { + superClass = parseLeftHandSideExpression(parser, context, privateScope, 0, inGroup, 0); + inheritedContext |= 512; + } + else { + inheritedContext = (inheritedContext | 512) ^ 512; + } + const body = parseClassBody(parser, inheritedContext, context, void 0, privateScope, 2, 0, inGroup); + parser.assignable = 2; + return parser.finishNode({ + type: 'ClassExpression', + id, + superClass, + body, + ...(parser.options.next ? { decorators } : null), + }, start); + } + function parseDecorators(parser, context, privateScope) { + const list = []; + if (parser.options.next) { + while (parser.getToken() === 132) { + list.push(parseDecoratorList(parser, context, privateScope)); + } + } + return list; + } + function parseDecoratorList(parser, context, privateScope) { + const start = parser.tokenStart; + nextToken(parser, context | 32); + let expression = parsePrimaryExpression(parser, context, privateScope, 2, 0, 1, 0, 1, start); + expression = parseMemberOrUpdateExpression(parser, context, privateScope, expression, 0, 0, parser.tokenStart); + return parser.finishNode({ + type: 'Decorator', + expression, + }, start); + } + function parseClassBody(parser, context, inheritedContext, scope, parentScope, kind, origin, inGroup) { + const { tokenStart } = parser; + const privateScope = parser.createPrivateScopeIfLexical(parentScope); + consume(parser, context | 32, 2162700); + const modifierFlags = 131072 | 524288; + context = (context | modifierFlags) ^ modifierFlags; + const hasConstr = parser.flags & 32; + parser.flags = (parser.flags | 32) ^ 32; + const body = []; + while (parser.getToken() !== 1074790415) { + const decoratorStart = parser.tokenStart; + const decorators = parseDecorators(parser, context, privateScope); + if (decorators.length > 0 && parser.tokenValue === 'constructor') { + parser.report(109); + } + if (parser.getToken() === 1074790415) + parser.report(108); + if (consumeOpt(parser, context, 1074790417)) { + if (decorators.length > 0) + parser.report(120); + continue; + } + body.push(parseClassElementList(parser, context, scope, privateScope, inheritedContext, kind, decorators, 0, inGroup, decorators.length > 0 ? decoratorStart : parser.tokenStart)); + } + consume(parser, origin & 8 ? context | 32 : context, 1074790415); + privateScope?.validatePrivateIdentifierRefs(); + parser.flags = (parser.flags & -33) | hasConstr; + return parser.finishNode({ + type: 'ClassBody', + body, + }, tokenStart); + } + function parseClassElementList(parser, context, scope, privateScope, inheritedContext, type, decorators, isStatic, inGroup, start) { + let kind = isStatic ? 32 : 0; + let key = null; + const token = parser.getToken(); + if (token & (143360 | 36864) || token === -2147483528) { + key = parseIdentifier(parser, context); + switch (token) { + case 36970: + if (!isStatic && + parser.getToken() !== 67174411 && + (parser.getToken() & 1048576) !== 1048576 && + parser.getToken() !== 1077936155) { + return parseClassElementList(parser, context, scope, privateScope, inheritedContext, type, decorators, 1, inGroup, start); + } + break; + case 209005: + if (parser.getToken() !== 67174411 && (parser.flags & 1) === 0) { + if ((parser.getToken() & 1073741824) === 1073741824) { + return parsePropertyDefinition(parser, context, privateScope, key, kind, decorators, start); + } + kind |= 16 | (optionalBit(parser, context, 8391476) ? 8 : 0); + } + break; + case 209008: + if (parser.getToken() !== 67174411) { + if ((parser.getToken() & 1073741824) === 1073741824) { + return parsePropertyDefinition(parser, context, privateScope, key, kind, decorators, start); + } + kind |= 256; + } + break; + case 209009: + if (parser.getToken() !== 67174411) { + if ((parser.getToken() & 1073741824) === 1073741824) { + return parsePropertyDefinition(parser, context, privateScope, key, kind, decorators, start); + } + kind |= 512; + } + break; + case 12402: + if (parser.getToken() !== 67174411 && (parser.flags & 1) === 0) { + if ((parser.getToken() & 1073741824) === 1073741824) { + return parsePropertyDefinition(parser, context, privateScope, key, kind, decorators, start); + } + if (parser.options.next) + kind |= 1024; + } + break; + } + } + else if (token === 69271571) { + kind |= 2; + key = parseComputedPropertyName(parser, inheritedContext, privateScope, inGroup); + } + else if ((token & 134217728) === 134217728) { + key = parseLiteral(parser, context); + } + else if (token === 8391476) { + kind |= 8; + nextToken(parser, context); + } + else if (parser.getToken() === 130) { + kind |= 8192; + key = parsePrivateIdentifier(parser, context | 16, privateScope, 768); + } + else if ((parser.getToken() & 1073741824) === 1073741824) { + kind |= 128; + } + else if (isStatic && token === 2162700) { + return parseStaticBlock(parser, context | 16, scope, privateScope, start); + } + else if (token === -2147483527) { + key = parseIdentifier(parser, context); + if (parser.getToken() !== 67174411) + parser.report(30, KeywordDescTable[parser.getToken() & 255]); + } + else { + parser.report(30, KeywordDescTable[parser.getToken() & 255]); + } + if (kind & (8 | 16 | 768 | 1024)) { + if (parser.getToken() & 143360 || + parser.getToken() === -2147483528 || + parser.getToken() === -2147483527) { + key = parseIdentifier(parser, context); + } + else if ((parser.getToken() & 134217728) === 134217728) { + key = parseLiteral(parser, context); + } + else if (parser.getToken() === 69271571) { + kind |= 2; + key = parseComputedPropertyName(parser, context, privateScope, 0); + } + else if (parser.getToken() === 130) { + kind |= 8192; + key = parsePrivateIdentifier(parser, context, privateScope, kind); + } + else + parser.report(135); + } + if ((kind & 2) === 0) { + if (parser.tokenValue === 'constructor') { + if ((parser.getToken() & 1073741824) === 1073741824) { + parser.report(129); + } + else if ((kind & 32) === 0 && parser.getToken() === 67174411) { + if (kind & (768 | 16 | 128 | 8)) { + parser.report(53, 'accessor'); + } + else if ((context & 512) === 0) { + if (parser.flags & 32) + parser.report(54); + else + parser.flags |= 32; + } + } + kind |= 64; + } + else if ((kind & 8192) === 0 && + kind & 32 && + parser.tokenValue === 'prototype') { + parser.report(52); + } + } + if (kind & 1024 || (parser.getToken() !== 67174411 && (kind & 768) === 0)) { + return parsePropertyDefinition(parser, context, privateScope, key, kind, decorators, start); + } + const value = parseMethodDefinition(parser, context | 16, privateScope, kind, inGroup, parser.tokenStart); + return parser.finishNode({ + type: 'MethodDefinition', + kind: (kind & 32) === 0 && kind & 64 + ? 'constructor' + : kind & 256 + ? 'get' + : kind & 512 + ? 'set' + : 'method', + static: (kind & 32) > 0, + computed: (kind & 2) > 0, + key, + value, + ...(parser.options.next ? { decorators } : null), + }, start); + } + function parsePrivateIdentifier(parser, context, privateScope, kind) { + const { tokenStart } = parser; + nextToken(parser, context); + const { tokenValue } = parser; + if (tokenValue === 'constructor') + parser.report(128); + if (parser.options.lexical) { + if (!privateScope) + parser.report(4, tokenValue); + if (kind) { + privateScope.addPrivateIdentifier(tokenValue, kind); + } + else { + privateScope.addPrivateIdentifierRef(tokenValue); + } + } + nextToken(parser, context); + return parser.finishNode({ + type: 'PrivateIdentifier', + name: tokenValue, + }, tokenStart); + } + function parsePropertyDefinition(parser, context, privateScope, key, state, decorators, start) { + let value = null; + if (state & 8) + parser.report(0); + if (parser.getToken() === 1077936155) { + nextToken(parser, context | 32); + const { tokenStart } = parser; + if (parser.getToken() === 537079927) + parser.report(119); + const modifierFlags = 1024 | + 2048 | + 8192 | + ((state & 64) === 0 ? 512 | 16384 : 0); + context = + ((context | modifierFlags) ^ modifierFlags) | + (state & 8 ? 1024 : 0) | + (state & 16 ? 2048 : 0) | + (state & 64 ? 16384 : 0) | + 256 | + 65536; + value = parsePrimaryExpression(parser, context | 16, privateScope, 2, 0, 1, 0, 1, tokenStart); + if ((parser.getToken() & 1073741824) !== 1073741824 || + (parser.getToken() & 4194304) === 4194304) { + value = parseMemberOrUpdateExpression(parser, context | 16, privateScope, value, 0, 0, tokenStart); + value = parseAssignmentExpression(parser, context | 16, privateScope, 0, 0, tokenStart, value); + } + } + matchOrInsertSemicolon(parser, context); + return parser.finishNode({ + type: state & 1024 ? 'AccessorProperty' : 'PropertyDefinition', + key, + value, + static: (state & 32) > 0, + computed: (state & 2) > 0, + ...(parser.options.next ? { decorators } : null), + }, start); + } + function parseBindingPattern(parser, context, scope, privateScope, type, origin) { + if (parser.getToken() & 143360 || + ((context & 1) === 0 && parser.getToken() === -2147483527)) + return parseAndClassifyIdentifier(parser, context, scope, type, origin); + if ((parser.getToken() & 2097152) !== 2097152) + parser.report(30, KeywordDescTable[parser.getToken() & 255]); + const left = parser.getToken() === 69271571 + ? parseArrayExpressionOrPattern(parser, context, scope, privateScope, 1, 0, 1, type, origin) + : parseObjectLiteralOrPattern(parser, context, scope, privateScope, 1, 0, 1, type, origin); + if (parser.destructible & 16) + parser.report(50); + if (parser.destructible & 32) + parser.report(50); + return left; + } + function parseAndClassifyIdentifier(parser, context, scope, kind, origin) { + const token = parser.getToken(); + if (context & 1) { + if ((token & 537079808) === 537079808) { + parser.report(119); + } + else if ((token & 36864) === 36864 || token === -2147483527) { + parser.report(118); + } + } + if ((token & 20480) === 20480) { + parser.report(102); + } + if (token === 241771) { + if (context & 1024) + parser.report(32); + if (context & 2) + parser.report(111); + } + if ((token & 255) === (241737 & 255)) { + if (kind & (8 | 16)) + parser.report(100); + } + if (token === 209006) { + if (context & 2048) + parser.report(176); + if (context & 2) + parser.report(110); + } + const { tokenValue, tokenStart: start } = parser; + nextToken(parser, context); + scope?.addVarOrBlock(context, tokenValue, kind, origin); + return parser.finishNode({ + type: 'Identifier', + name: tokenValue, + }, start); + } + function parseJSXRootElementOrFragment(parser, context, privateScope, inJSXChild, start) { + if (!inJSXChild) + consume(parser, context, 8456256); + if (parser.getToken() === 8390721) { + const openingFragment = parseJSXOpeningFragment(parser, start); + const [children, closingFragment] = parseJSXChildrenAndClosingFragment(parser, context, privateScope, inJSXChild); + return parser.finishNode({ + type: 'JSXFragment', + openingFragment, + children, + closingFragment, + }, start); + } + if (parser.getToken() === 8457014) + parser.report(30, KeywordDescTable[parser.getToken() & 255]); + let closingElement = null; + let children = []; + const openingElement = parseJSXOpeningElementOrSelfCloseElement(parser, context, privateScope, inJSXChild, start); + if (!openingElement.selfClosing) { + [children, closingElement] = parseJSXChildrenAndClosingElement(parser, context, privateScope, inJSXChild); + const close = isEqualTagName(closingElement.name); + if (isEqualTagName(openingElement.name) !== close) + parser.report(155, close); + } + return parser.finishNode({ + type: 'JSXElement', + children, + openingElement, + closingElement, + }, start); + } + function parseJSXOpeningFragment(parser, start) { + nextJSXToken(parser); + return parser.finishNode({ + type: 'JSXOpeningFragment', + }, start); + } + function parseJSXClosingElement(parser, context, inJSXChild, start) { + consume(parser, context, 8457014); + const name = parseJSXElementName(parser, context); + if (parser.getToken() !== 8390721) { + parser.report(25, KeywordDescTable[8390721 & 255]); + } + if (inJSXChild) { + nextJSXToken(parser); + } + else { + nextToken(parser, context); + } + return parser.finishNode({ + type: 'JSXClosingElement', + name, + }, start); + } + function parseJSXClosingFragment(parser, context, inJSXChild, start) { + consume(parser, context, 8457014); + if (parser.getToken() !== 8390721) { + parser.report(25, KeywordDescTable[8390721 & 255]); + } + if (inJSXChild) { + nextJSXToken(parser); + } + else { + nextToken(parser, context); + } + return parser.finishNode({ + type: 'JSXClosingFragment', + }, start); + } + function parseJSXChildrenAndClosingElement(parser, context, privateScope, inJSXChild) { + const children = []; + while (true) { + const child = parseJSXChildOrClosingElement(parser, context, privateScope, inJSXChild); + if (child.type === 'JSXClosingElement') { + return [children, child]; + } + children.push(child); + } + } + function parseJSXChildrenAndClosingFragment(parser, context, privateScope, inJSXChild) { + const children = []; + while (true) { + const child = parseJSXChildOrClosingFragment(parser, context, privateScope, inJSXChild); + if (child.type === 'JSXClosingFragment') { + return [children, child]; + } + children.push(child); + } + } + function parseJSXChildOrClosingElement(parser, context, privateScope, inJSXChild) { + if (parser.getToken() === 137) + return parseJSXText(parser, context); + if (parser.getToken() === 2162700) + return parseJSXExpressionContainer(parser, context, privateScope, 1, 0); + if (parser.getToken() === 8456256) { + const { tokenStart } = parser; + nextToken(parser, context); + if (parser.getToken() === 8457014) + return parseJSXClosingElement(parser, context, inJSXChild, tokenStart); + return parseJSXRootElementOrFragment(parser, context, privateScope, 1, tokenStart); + } + parser.report(0); + } + function parseJSXChildOrClosingFragment(parser, context, privateScope, inJSXChild) { + if (parser.getToken() === 137) + return parseJSXText(parser, context); + if (parser.getToken() === 2162700) + return parseJSXExpressionContainer(parser, context, privateScope, 1, 0); + if (parser.getToken() === 8456256) { + const { tokenStart } = parser; + nextToken(parser, context); + if (parser.getToken() === 8457014) + return parseJSXClosingFragment(parser, context, inJSXChild, tokenStart); + return parseJSXRootElementOrFragment(parser, context, privateScope, 1, tokenStart); + } + parser.report(0); + } + function parseJSXText(parser, context) { + const start = parser.tokenStart; + nextToken(parser, context); + const node = { + type: 'JSXText', + value: parser.tokenValue, + }; + if (parser.options.raw) { + node.raw = parser.tokenRaw; + } + return parser.finishNode(node, start); + } + function parseJSXOpeningElementOrSelfCloseElement(parser, context, privateScope, inJSXChild, start) { + if ((parser.getToken() & 143360) !== 143360 && + (parser.getToken() & 4096) !== 4096) + parser.report(0); + const tagName = parseJSXElementName(parser, context); + const attributes = parseJSXAttributes(parser, context, privateScope); + const selfClosing = parser.getToken() === 8457014; + if (selfClosing) + consume(parser, context, 8457014); + if (parser.getToken() !== 8390721) { + parser.report(25, KeywordDescTable[8390721 & 255]); + } + if (inJSXChild || !selfClosing) { + nextJSXToken(parser); + } + else { + nextToken(parser, context); + } + return parser.finishNode({ + type: 'JSXOpeningElement', + name: tagName, + attributes, + selfClosing, + }, start); + } + function parseJSXElementName(parser, context) { + const { tokenStart } = parser; + rescanJSXIdentifier(parser); + let key = parseJSXIdentifier(parser, context); + if (parser.getToken() === 21) + return parseJSXNamespacedName(parser, context, key, tokenStart); + while (consumeOpt(parser, context, 67108877)) { + rescanJSXIdentifier(parser); + key = parseJSXMemberExpression(parser, context, key, tokenStart); + } + return key; + } + function parseJSXMemberExpression(parser, context, object, start) { + const property = parseJSXIdentifier(parser, context); + return parser.finishNode({ + type: 'JSXMemberExpression', + object, + property, + }, start); + } + function parseJSXAttributes(parser, context, privateScope) { + const attributes = []; + while (parser.getToken() !== 8457014 && + parser.getToken() !== 8390721 && + parser.getToken() !== 1048576) { + attributes.push(parseJsxAttribute(parser, context, privateScope)); + } + return attributes; + } + function parseJSXSpreadAttribute(parser, context, privateScope) { + const start = parser.tokenStart; + nextToken(parser, context); + consume(parser, context, 14); + const expression = parseExpression(parser, context, privateScope, 1, 0, parser.tokenStart); + consume(parser, context, 1074790415); + return parser.finishNode({ + type: 'JSXSpreadAttribute', + argument: expression, + }, start); + } + function parseJsxAttribute(parser, context, privateScope) { + const { tokenStart } = parser; + if (parser.getToken() === 2162700) + return parseJSXSpreadAttribute(parser, context, privateScope); + rescanJSXIdentifier(parser); + let value = null; + let name = parseJSXIdentifier(parser, context); + if (parser.getToken() === 21) { + name = parseJSXNamespacedName(parser, context, name, tokenStart); + } + if (parser.getToken() === 1077936155) { + const token = scanJSXAttributeValue(parser, context); + switch (token) { + case 134283267: + value = parseLiteral(parser, context); + break; + case 8456256: + value = parseJSXRootElementOrFragment(parser, context, privateScope, 0, parser.tokenStart); + break; + case 2162700: + value = parseJSXExpressionContainer(parser, context, privateScope, 0, 1); + break; + default: + parser.report(154); + } + } + return parser.finishNode({ + type: 'JSXAttribute', + value, + name, + }, tokenStart); + } + function parseJSXNamespacedName(parser, context, namespace, start) { + consume(parser, context, 21); + const name = parseJSXIdentifier(parser, context); + return parser.finishNode({ + type: 'JSXNamespacedName', + namespace, + name, + }, start); + } + function parseJSXExpressionContainer(parser, context, privateScope, inJSXChild, isAttr) { + const { tokenStart: start } = parser; + nextToken(parser, context | 32); + const { tokenStart } = parser; + if (parser.getToken() === 14) + return parseJSXSpreadChild(parser, context, privateScope, start); + let expression = null; + if (parser.getToken() === 1074790415) { + if (isAttr) + parser.report(157); + expression = parseJSXEmptyExpression(parser, { + index: parser.startIndex, + line: parser.startLine, + column: parser.startColumn, + }); + } + else { + expression = parseExpression(parser, context, privateScope, 1, 0, tokenStart); + } + if (parser.getToken() !== 1074790415) { + parser.report(25, KeywordDescTable[1074790415 & 255]); + } + if (inJSXChild) { + nextJSXToken(parser); + } + else { + nextToken(parser, context); + } + return parser.finishNode({ + type: 'JSXExpressionContainer', + expression, + }, start); + } + function parseJSXSpreadChild(parser, context, privateScope, start) { + consume(parser, context, 14); + const expression = parseExpression(parser, context, privateScope, 1, 0, parser.tokenStart); + consume(parser, context, 1074790415); + return parser.finishNode({ + type: 'JSXSpreadChild', + expression, + }, start); + } + function parseJSXEmptyExpression(parser, start) { + return parser.finishNode({ + type: 'JSXEmptyExpression', + }, start, parser.tokenStart); + } + function parseJSXIdentifier(parser, context) { + const start = parser.tokenStart; + if (!(parser.getToken() & 143360)) { + parser.report(30, KeywordDescTable[parser.getToken() & 255]); + } + const { tokenValue } = parser; + nextToken(parser, context); + return parser.finishNode({ + type: 'JSXIdentifier', + name: tokenValue, + }, start); + } + + var version$1 = "6.1.4"; + + const version = version$1; + function parseScript(source, options) { + return parseSource(source, options); + } + function parseModule(source, options) { + return parseSource(source, options, 1 | 2); + } + function parse(source, options) { + return parseSource(source, options); + } + + exports.parse = parse; + exports.parseModule = parseModule; + exports.parseScript = parseScript; + exports.version = version; + +})); diff --git a/node_modules/meriyah/dist/meriyah.umd.min.js b/node_modules/meriyah/dist/meriyah.umd.min.js new file mode 100644 index 0000000..8498c5b --- /dev/null +++ b/node_modules/meriyah/dist/meriyah.umd.min.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).meriyah={})}(this,(function(e){"use strict";const t=((e,t)=>{const r=new Uint32Array(69632);let n=0,o=0;for(;n<2571;){const a=e[n++];if(a<0)o-=a;else{let i=e[n++];2&a&&(i=t[i]),1&a?r.fill(i,o,o+=e[n++]):r[o++]=i}}return r})([-1,2,26,2,27,2,5,-1,0,77595648,3,44,2,3,0,14,2,63,2,64,3,0,3,0,3168796671,0,4294956992,2,1,2,0,2,41,3,0,4,0,4294966523,3,0,4,2,16,2,65,2,0,0,4294836735,0,3221225471,0,4294901942,2,66,0,134152192,3,0,2,0,4294951935,3,0,2,0,2683305983,0,2684354047,2,18,2,0,0,4294961151,3,0,2,2,19,2,0,0,608174079,2,0,2,60,2,7,2,6,0,4286611199,3,0,2,2,1,3,0,3,0,4294901711,2,40,0,4089839103,0,2961209759,0,1342439375,0,4294543342,0,3547201023,0,1577204103,0,4194240,0,4294688750,2,2,0,80831,0,4261478351,0,4294549486,2,2,0,2967484831,0,196559,0,3594373100,0,3288319768,0,8469959,0,65472,2,3,0,4093640191,0,660618719,0,65487,0,4294828015,0,4092591615,0,1616920031,0,982991,2,3,2,0,0,2163244511,0,4227923919,0,4236247022,2,71,0,4284449919,0,851904,2,4,2,12,0,67076095,-1,2,72,0,1073741743,0,4093607775,-1,0,50331649,0,3265266687,2,33,0,4294844415,0,4278190047,2,20,2,137,-1,3,0,2,2,23,2,0,2,10,2,0,2,15,2,22,3,0,10,2,74,2,0,2,75,2,76,2,77,2,0,2,78,2,0,2,11,0,261632,2,25,3,0,2,2,13,2,4,3,0,18,2,79,2,5,3,0,2,2,80,0,2151677951,2,29,2,9,0,909311,3,0,2,0,814743551,2,49,0,67090432,3,0,2,2,42,2,0,2,6,2,0,2,30,2,8,0,268374015,2,110,2,51,2,0,2,81,0,134153215,-1,2,7,2,0,2,8,0,2684354559,0,67044351,0,3221160064,2,17,-1,3,0,2,2,53,0,1046528,3,0,3,2,9,2,0,2,54,0,4294960127,2,10,2,6,2,11,0,4294377472,2,12,3,0,16,2,13,2,0,2,82,2,10,2,0,2,83,2,84,2,85,0,12288,2,55,0,1048577,2,86,2,14,-1,2,14,0,131042,2,87,2,88,2,89,2,0,2,34,-83,3,0,7,0,1046559,2,0,2,15,2,0,0,2147516671,2,21,3,90,2,2,0,-16,2,91,0,524222462,2,4,2,0,0,4269801471,2,4,3,0,2,2,28,2,16,3,0,2,2,17,2,0,-1,2,18,-16,3,0,206,-2,3,0,692,2,73,-1,2,18,2,10,3,0,8,2,93,2,133,2,0,0,3220242431,3,0,3,2,19,2,94,2,95,3,0,2,2,96,2,0,2,97,2,46,2,0,0,4351,2,0,2,9,3,0,2,0,67043391,0,3909091327,2,0,2,24,2,9,2,20,3,0,2,0,67076097,2,8,2,0,2,21,0,67059711,0,4236247039,3,0,2,0,939524103,0,8191999,2,101,2,102,2,22,2,23,3,0,3,0,67057663,3,0,349,2,103,2,104,2,7,-264,3,0,11,2,24,3,0,2,2,32,-1,0,3774349439,2,105,2,106,3,0,2,2,19,2,107,3,0,10,2,10,2,18,2,0,2,47,2,0,2,31,2,108,2,25,0,1638399,0,57344,2,109,3,0,3,2,20,2,26,2,27,2,5,2,28,2,0,2,8,2,111,-1,2,112,2,113,2,114,-1,3,0,3,2,12,-2,2,0,2,29,-3,0,536870912,-4,2,20,2,0,2,36,0,1,2,0,2,67,2,6,2,12,2,10,2,0,2,115,-1,3,0,4,2,10,2,23,2,116,2,7,2,0,2,117,2,0,2,118,2,119,2,120,2,0,2,9,3,0,9,2,21,2,30,2,31,2,121,2,122,-2,2,123,2,124,2,30,2,21,2,8,-2,2,125,2,30,2,32,-2,2,0,2,39,-2,0,4277137519,0,2269118463,-1,3,20,2,-1,2,33,2,38,2,0,3,30,2,2,35,2,19,-3,3,0,2,2,34,-1,2,0,2,35,2,0,2,35,2,0,2,48,2,0,0,4294950463,2,37,-7,2,0,0,203775,2,57,0,4026531840,2,20,2,43,2,36,2,18,2,37,2,18,2,126,2,21,3,0,2,2,38,0,2151677888,2,0,2,12,0,4294901764,2,144,2,0,2,58,2,56,0,5242879,3,0,2,0,402644511,-1,2,128,2,39,0,3,-1,2,129,2,130,2,0,0,67045375,2,40,0,4226678271,0,3766565279,0,2039759,2,132,2,41,0,1046437,0,6,3,0,2,0,3288270847,0,3,3,0,2,0,67043519,-5,2,0,0,4282384383,0,1056964609,-1,3,0,2,0,67043345,-1,2,0,2,42,2,23,2,50,2,11,2,61,2,38,-5,2,0,2,12,-3,3,0,2,0,2147484671,2,134,0,4190109695,2,52,-2,2,135,0,4244635647,0,27,2,0,2,8,2,43,2,0,2,68,2,18,2,0,2,42,-6,2,0,2,45,2,59,2,44,2,45,2,46,2,47,0,8388351,-2,2,136,0,3028287487,2,48,2,138,0,33259519,2,49,-9,2,21,0,4294836223,0,3355443199,0,134152199,-2,2,69,-2,3,0,28,2,32,-3,3,0,3,2,17,3,0,6,2,50,-81,2,18,3,0,2,2,36,3,0,33,2,25,2,30,3,0,124,2,12,3,0,18,2,38,-213,2,0,2,32,-54,3,0,17,2,42,2,8,2,23,2,0,2,8,2,23,2,51,2,0,2,21,2,52,2,139,2,25,-13,2,0,2,53,-6,3,0,2,-4,3,0,2,0,4294936575,2,0,0,4294934783,-2,0,196635,3,0,191,2,54,3,0,38,2,30,2,55,2,34,-278,2,140,3,0,9,2,141,2,142,2,56,3,0,11,2,7,-72,3,0,3,2,143,0,1677656575,-130,2,26,-16,2,0,2,24,2,38,-16,0,4161266656,0,4071,0,15360,-4,2,57,-13,3,0,2,2,58,2,0,2,145,2,146,2,62,2,0,2,147,2,148,2,149,3,0,10,2,150,2,151,2,22,3,58,2,3,152,2,3,59,2,0,4294954999,2,0,-16,2,0,2,92,2,0,0,2105343,0,4160749584,0,65534,-34,2,8,2,154,-6,0,4194303871,0,4294903771,2,0,2,60,2,100,-3,2,0,0,1073684479,0,17407,-9,2,18,2,17,2,0,2,32,-14,2,18,2,32,-6,2,18,2,12,-15,2,155,3,0,6,0,8323103,-1,3,0,2,2,61,-37,2,62,2,156,2,157,2,158,2,159,2,160,-105,2,26,-32,3,0,1335,-1,3,0,129,2,32,3,0,6,2,10,3,0,180,2,161,3,0,233,2,162,3,0,18,2,10,-77,3,0,16,2,10,-47,3,0,154,2,6,3,0,130,2,25,-22250,3,0,7,2,25,-6130,3,5,2,-1,0,69207040,3,44,2,3,0,14,2,63,2,64,-3,0,3168731136,0,4294956864,2,1,2,0,2,41,3,0,4,0,4294966275,3,0,4,2,16,2,65,2,0,2,34,-1,2,18,2,66,-1,2,0,0,2047,0,4294885376,3,0,2,0,3145727,0,2617294944,0,4294770688,2,25,2,67,3,0,2,0,131135,2,98,0,70256639,0,71303167,0,272,2,42,2,6,0,32511,2,0,2,49,-1,2,99,2,68,0,4278255616,0,4294836227,0,4294549473,0,600178175,0,2952806400,0,268632067,0,4294543328,0,57540095,0,1577058304,0,1835008,0,4294688736,2,70,2,69,0,33554435,2,131,2,70,0,2952790016,0,131075,0,3594373096,0,67094296,2,69,-1,0,4294828e3,0,603979263,0,654311424,0,3,0,4294828001,0,602930687,0,1610612736,0,393219,0,4294828016,0,671088639,0,2154840064,0,4227858435,0,4236247008,2,71,2,38,-1,2,4,0,917503,2,38,-1,2,72,0,537788335,0,4026531935,-1,0,1,-1,2,33,2,73,0,7936,-3,2,0,0,2147485695,0,1010761728,0,4292984930,0,16387,2,0,2,15,2,22,3,0,10,2,74,2,0,2,75,2,76,2,77,2,0,2,78,2,0,2,12,-1,2,25,3,0,2,2,13,2,4,3,0,18,2,79,2,5,3,0,2,2,80,0,2147745791,3,19,2,0,122879,2,0,2,9,0,276824064,-2,3,0,2,2,42,2,0,0,4294903295,2,0,2,30,2,8,-1,2,18,2,51,2,0,2,81,2,49,-1,2,21,2,0,2,29,-2,0,128,-2,2,28,2,9,0,8160,-1,2,127,0,4227907585,2,0,2,37,2,0,2,50,0,4227915776,2,10,2,6,2,11,-1,0,74440192,3,0,6,-2,3,0,8,2,13,2,0,2,82,2,10,2,0,2,83,2,84,2,85,-3,2,86,2,14,-3,2,87,2,88,2,89,2,0,2,34,-83,3,0,7,0,817183,2,0,2,15,2,0,0,33023,2,21,3,90,2,-17,2,91,0,524157950,2,4,2,0,2,92,2,4,2,0,2,22,2,28,2,16,3,0,2,2,17,2,0,-1,2,18,-16,3,0,206,-2,3,0,692,2,73,-1,2,18,2,10,3,0,8,2,93,0,3072,2,0,0,2147516415,2,10,3,0,2,2,25,2,94,2,95,3,0,2,2,96,2,0,2,97,2,46,0,4294965179,0,7,2,0,2,9,2,95,2,9,-1,0,1761345536,2,98,0,4294901823,2,38,2,20,2,99,2,35,2,100,0,2080440287,2,0,2,34,2,153,0,3296722943,2,0,0,1046675455,0,939524101,0,1837055,2,101,2,102,2,22,2,23,3,0,3,0,7,3,0,349,2,103,2,104,2,7,-264,3,0,11,2,24,3,0,2,2,32,-1,0,2700607615,2,105,2,106,3,0,2,2,19,2,107,3,0,10,2,10,2,18,2,0,2,47,2,0,2,31,2,108,-3,2,109,3,0,3,2,20,-1,3,5,2,2,110,2,0,2,8,2,111,-1,2,112,2,113,2,114,-1,3,0,3,2,12,-2,2,0,2,29,-8,2,20,2,0,2,36,-1,2,0,2,67,2,6,2,30,2,10,2,0,2,115,-1,3,0,4,2,10,2,18,2,116,2,7,2,0,2,117,2,0,2,118,2,119,2,120,2,0,2,9,3,0,9,2,21,2,30,2,31,2,121,2,122,-2,2,123,2,124,2,30,2,21,2,8,-2,2,125,2,30,2,32,-2,2,0,2,39,-2,0,4277075969,2,30,-1,3,20,2,-1,2,33,2,126,2,0,3,30,2,2,35,2,19,-3,3,0,2,2,34,-1,2,0,2,35,2,0,2,35,2,0,2,50,2,98,0,4294934591,2,37,-7,2,0,0,197631,2,57,-1,2,20,2,43,2,37,2,18,0,3,2,18,2,126,2,21,2,127,2,54,-1,0,2490368,2,127,2,25,2,18,2,34,2,127,2,38,0,4294901904,0,4718591,2,127,2,35,0,335544350,-1,2,128,0,2147487743,0,1,-1,2,129,2,130,2,8,-1,2,131,2,70,0,3758161920,0,3,2,132,0,12582911,0,655360,-1,2,0,2,29,0,2147485568,0,3,2,0,2,25,0,176,-5,2,0,2,17,0,251658240,-1,2,0,2,25,0,16,-1,2,0,0,16779263,-2,2,12,-1,2,38,-5,2,0,2,133,-3,3,0,2,2,55,2,134,0,2147549183,0,2,-2,2,135,2,36,0,10,0,4294965249,0,67633151,0,4026597376,2,0,0,536871935,2,18,2,0,2,42,-6,2,0,0,1,2,59,2,17,0,1,2,46,2,25,-3,2,136,2,36,2,137,2,138,0,16778239,-10,2,35,0,4294836212,2,9,-3,2,69,-2,3,0,28,2,32,-3,3,0,3,2,17,3,0,6,2,50,-81,2,18,3,0,2,2,36,3,0,33,2,25,0,126,3,0,124,2,12,3,0,18,2,38,-213,2,10,-55,3,0,17,2,42,2,8,2,18,2,0,2,8,2,18,2,60,2,0,2,25,2,50,2,139,2,25,-13,2,0,2,73,-6,3,0,2,-4,3,0,2,0,67583,-1,2,107,-2,0,11,3,0,191,2,54,3,0,38,2,30,2,55,2,34,-278,2,140,3,0,9,2,141,2,142,2,56,3,0,11,2,7,-72,3,0,3,2,143,2,144,-187,3,0,2,2,58,2,0,2,145,2,146,2,62,2,0,2,147,2,148,2,149,3,0,10,2,150,2,151,2,22,3,58,2,3,152,2,3,59,2,2,153,-57,2,8,2,154,-7,2,18,2,0,2,60,-4,2,0,0,1065361407,0,16384,-9,2,18,2,60,2,0,2,133,-14,2,18,2,133,-6,2,18,0,81919,-15,2,155,3,0,6,2,126,-1,3,0,2,0,2063,-37,2,62,2,156,2,157,2,158,2,159,2,160,-138,3,0,1335,-1,3,0,129,2,32,3,0,6,2,10,3,0,180,2,161,3,0,233,2,162,3,0,18,2,10,-77,3,0,16,2,10,-47,3,0,154,2,6,3,0,130,2,25,-28386],[4294967295,4294967291,4092460543,4294828031,4294967294,134217726,4294903807,268435455,2147483647,1048575,1073741823,3892314111,134217727,1061158911,536805376,4294910143,4294901759,32767,4294901760,262143,536870911,8388607,4160749567,4294902783,4294918143,65535,67043328,2281701374,4294967264,2097151,4194303,255,67108863,4294967039,511,524287,131071,63,127,3238002687,4294549487,4290772991,33554431,4294901888,4286578687,67043329,4294705152,4294770687,67043583,1023,15,2047999,67043343,67051519,16777215,2147483648,4294902e3,28,4292870143,4294966783,16383,67047423,4294967279,262083,20511,41943039,493567,4294959104,603979775,65536,602799615,805044223,4294965206,8191,1031749119,4294917631,2134769663,4286578493,4282253311,4294942719,33540095,4294905855,2868854591,1608515583,265232348,534519807,2147614720,1060109444,4093640016,17376,2139062143,224,4169138175,4294909951,4286578688,4294967292,4294965759,535511039,4294966272,4294967280,32768,8289918,4294934399,4294901775,4294965375,1602223615,4294967259,4294443008,268369920,4292804608,4294967232,486341884,4294963199,3087007615,1073692671,4128527,4279238655,4294902015,4160684047,4290246655,469499899,4294967231,134086655,4294966591,2445279231,3670015,31,4294967288,4294705151,3221208447,4294902271,4294549472,4294921215,4095,4285526655,4294966527,4294966143,64,4294966719,3774873592,1877934080,262151,2555904,536807423,67043839,3758096383,3959414372,3755993023,2080374783,4294835295,4294967103,4160749565,4294934527,4087,2016,2147446655,184024726,2862017156,1593309078,268434431,268434414,4294901763,4294901761]),r=e=>!!(1&t[34816+(e>>>5)]>>>e);function n(e){return e.column++,e.currentChar=e.source.charCodeAt(++e.index)}function o(e){const t=e.currentChar;if(55296!=(64512&t))return 0;const r=e.source.charCodeAt(e.index+1);return 56320!=(64512&r)?0:65536+((1023&t)<<10)+(1023&r)}function a(e,t){e.currentChar=e.source.charCodeAt(++e.index),e.flags|=1,4&t||(e.column=0,e.line++)}function i(e){e.flags|=1,e.currentChar=e.source.charCodeAt(++e.index),e.column=0,e.line++}function s(e){return e<65?e-48:e-65+10&15}function c(e){switch(e){case 134283266:return"NumericLiteral";case 134283267:return"StringLiteral";case 86021:case 86022:return"BooleanLiteral";case 86023:return"NullLiteral";case 65540:return"RegularExpression";case 67174408:case 67174409:case 131:return"TemplateLiteral";default:return 143360&~e?4096&~e?"Punctuator":"Keyword":"Identifier"}}const l=[0,0,0,0,0,0,0,0,0,0,1032,0,0,2056,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8192,0,3,0,0,8192,0,0,0,256,0,33024,0,0,242,242,114,114,114,114,114,114,594,594,0,0,16384,0,0,0,0,67,67,67,67,67,67,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,0,1,0,0,4099,0,71,71,71,71,71,71,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,16384,0,0,0,0],u=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0],p=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0];function d(e){return e<=127?u[e]>0:r(e)}function g(e){return e<=127?p[e]>0:(e=>!!(1&t[0+(e>>>5)]>>>e))(e)||8204===e||8205===e}const f=["SingleLine","MultiLine","HTMLOpen","HTMLClose","HashbangComment"];function k(e,t,r,n,o,a){return 2&n&&e.report(0),h(e,t,r,o,a)}function h(e,t,r,o,a){const{index:s}=e;for(e.tokenIndex=e.index,e.tokenLine=e.line,e.tokenColumn=e.column;e.index=e.source.length)return e.report(34)}const o=e.index-1;let a=T.Empty,i=e.currentChar;const{index:s}=e;for(;g(i);){switch(i){case 103:a&T.Global&&e.report(36,"g"),a|=T.Global;break;case 105:a&T.IgnoreCase&&e.report(36,"i"),a|=T.IgnoreCase;break;case 109:a&T.Multiline&&e.report(36,"m"),a|=T.Multiline;break;case 117:a&T.Unicode&&e.report(36,"u"),a&T.UnicodeSets&&e.report(36,"vu"),a|=T.Unicode;break;case 118:a&T.Unicode&&e.report(36,"uv"),a&T.UnicodeSets&&e.report(36,"v"),a|=T.UnicodeSets;break;case 121:a&T.Sticky&&e.report(36,"y"),a|=T.Sticky;break;case 115:a&T.DotAll&&e.report(36,"s"),a|=T.DotAll;break;case 100:a&T.Indices&&e.report(36,"d"),a|=T.Indices;break;default:e.report(35)}i=n(e)}const c=e.source.slice(s,e.index),l=e.source.slice(t,o);return e.tokenRegExp={pattern:l,flags:c},e.options.raw&&(e.tokenRaw=e.source.slice(e.tokenIndex,e.index)),e.tokenValue=function(e,t,r){try{return new RegExp(t,r)}catch{try{return new RegExp(t,r),null}catch{e.report(34)}}}(e,l,c),65540}function x(e,t,r){const{index:o}=e;let a="",i=n(e),s=e.index;for(;!(8&l[i]);){if(i===r)return a+=e.source.slice(s,e.index),n(e),e.options.raw&&(e.tokenRaw=e.source.slice(o,e.index)),e.tokenValue=a,134283267;if(8&~i||92!==i)8232!==i&&8233!==i||(e.column=-1,e.line++);else{if(a+=e.source.slice(s,e.index),i=n(e),i<127||8232===i||8233===i){const r=w(e,t,i);r>=0?a+=String.fromCodePoint(r):S(e,r,0)}else a+=String.fromCodePoint(i);s=e.index+1}e.index>=e.end&&e.report(16),i=n(e)}e.report(16)}function w(e,t,r,o=0){switch(r){case 98:return 8;case 102:return 12;case 114:return 13;case 110:return 10;case 116:return 9;case 118:return 11;case 13:if(e.index1114111)return-5;return e.currentChar<1||125!==e.currentChar?-4:t}{if(!(64&l[t]))return-4;const r=e.source.charCodeAt(e.index+1);if(!(64&l[r]))return-4;const n=e.source.charCodeAt(e.index+2);if(!(64&l[n]))return-4;const o=e.source.charCodeAt(e.index+3);return 64&l[o]?(e.index+=3,e.column+=3,e.currentChar=e.source.charCodeAt(e.index),s(t)<<12|s(r)<<8|s(n)<<4|s(o)):-4}}case 56:case 57:if(o||!e.options.webcompat||1&t)return-3;e.flags|=4096;default:return r}}function S(e,t,r){switch(t){case-1:return;case-2:e.report(r?2:1);case-3:e.report(r?3:14);case-4:e.report(7);case-5:e.report(104)}}function v(e,t){const{index:r}=e;let o=67174409,a="",i=n(e);for(;96!==i;){if(36===i&&123===e.source.charCodeAt(e.index+1)){n(e),o=67174408;break}if(92===i)if(i=n(e),i>126)a+=String.fromCodePoint(i);else{const{index:r,line:n,column:s}=e,c=w(e,1|t,i,1);if(c>=0)a+=String.fromCodePoint(c);else{if(-1!==c&&64&t){e.index=r,e.line=n,e.column=s,a=null,i=C(e,i),i<0&&(o=67174408);break}S(e,c,1)}}else e.index=e.end&&e.report(17),i=n(e)}return n(e),e.tokenValue=a,e.tokenRaw=e.source.slice(r+1,e.index-(67174409===o?1:2)),o}function C(e,t){for(;96!==t;){switch(t){case 36:{const r=e.index+1;if(r=e.end&&e.report(17),t=n(e)}return t}function q(e,t){return e.index>=e.end&&e.report(0),e.index--,e.column--,v(e,t)}!function(e){e[e.Empty=0]="Empty",e[e.Escape=1]="Escape",e[e.Class=2]="Class"}(b||(b={})),function(e){e[e.Empty=0]="Empty",e[e.IgnoreCase=1]="IgnoreCase",e[e.Global=2]="Global",e[e.Multiline=4]="Multiline",e[e.Unicode=16]="Unicode",e[e.Sticky=8]="Sticky",e[e.DotAll=32]="DotAll",e[e.Indices=64]="Indices",e[e.UnicodeSets=128]="UnicodeSets"}(T||(T={}));const E={0:"Unexpected token",30:"Unexpected token: '%0'",1:"Octal escape sequences are not allowed in strict mode",2:"Octal escape sequences are not allowed in template strings",3:"\\8 and \\9 are not allowed in template strings",4:"Private identifier #%0 is not defined",5:"Illegal Unicode escape sequence",6:"Invalid code point %0",7:"Invalid hexadecimal escape sequence",9:"Octal literals are not allowed in strict mode",8:"Decimal integer literals with a leading zero are forbidden in strict mode",10:"Expected number in radix %0",151:"Invalid left-hand side assignment to a destructible right-hand side",11:"Non-number found after exponent indicator",12:"Invalid BigIntLiteral",13:"No identifiers allowed directly after numeric literal",14:"Escapes \\8 or \\9 are not syntactically valid escapes",15:"Escapes \\8 or \\9 are not allowed in strict mode",16:"Unterminated string literal",17:"Unterminated template literal",18:"Multiline comment was not closed properly",19:"The identifier contained dynamic unicode escape that was not closed",20:"Illegal character '%0'",21:"Missing hexadecimal digits",22:"Invalid implicit octal",23:"Invalid line break in string literal",24:"Only unicode escapes are legal in identifier names",25:"Expected '%0'",26:"Invalid left-hand side in assignment",27:"Invalid left-hand side in async arrow",28:'Calls to super must be in the "constructor" method of a class expression or class declaration that has a superclass',29:"Member access on super must be in a method",31:"Await expression not allowed in formal parameter",32:"Yield expression not allowed in formal parameter",95:"Unexpected token: 'escaped keyword'",33:"Unary expressions as the left operand of an exponentiation expression must be disambiguated with parentheses",123:"Async functions can only be declared at the top level or inside a block",34:"Unterminated regular expression",35:"Unexpected regular expression flag",36:"Duplicate regular expression flag '%0'",37:"%0 functions must have exactly %1 argument%2",38:"Setter function argument must not be a rest parameter",39:"%0 declaration must have a name in this context",40:"Function name may not contain any reserved words or be eval or arguments in strict mode",41:"The rest operator is missing an argument",42:"A getter cannot be a generator",43:"A setter cannot be a generator",44:"A computed property name must be followed by a colon or paren",134:"Object literal keys that are strings or numbers must be a method or have a colon",46:"Found `* async x(){}` but this should be `async * x(){}`",45:"Getters and setters can not be generators",47:"'%0' can not be generator method",48:"No line break is allowed after '=>'",49:"The left-hand side of the arrow can only be destructed through assignment",50:"The binding declaration is not destructible",51:"Async arrow can not be followed by new expression",52:"Classes may not have a static property named 'prototype'",53:"Class constructor may not be a %0",54:"Duplicate constructor method in class",55:"Invalid increment/decrement operand",56:"Invalid use of `new` keyword on an increment/decrement expression",57:"`=>` is an invalid assignment target",58:"Rest element may not have a trailing comma",59:"Missing initializer in %0 declaration",60:"'for-%0' loop head declarations can not have an initializer",61:"Invalid left-hand side in for-%0 loop: Must have a single binding",62:"Invalid shorthand property initializer",63:"Property name __proto__ appears more than once in object literal",64:"Let is disallowed as a lexically bound name",65:"Invalid use of '%0' inside new expression",66:"Illegal 'use strict' directive in function with non-simple parameter list",67:'Identifier "let" disallowed as left-hand side expression in strict mode',68:"Illegal continue statement",69:"Illegal break statement",70:"Cannot have `let[...]` as a var name in strict mode",71:"Invalid destructuring assignment target",72:"Rest parameter may not have a default initializer",73:"The rest argument must the be last parameter",74:"Invalid rest argument",76:"In strict mode code, functions can only be declared at top level or inside a block",77:"In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement",78:"Without web compatibility enabled functions can not be declared at top level, inside a block, or as the body of an if statement",79:"Class declaration can't appear in single-statement context",80:"Invalid left-hand side in for-%0",81:"Invalid assignment in for-%0",82:"for await (... of ...) is only valid in async functions and async generators",83:"The first token after the template expression should be a continuation of the template",85:"`let` declaration not allowed here and `let` cannot be a regular var name in strict mode",84:"`let \n [` is a restricted production at the start of a statement",86:"Catch clause requires exactly one parameter, not more (and no trailing comma)",87:"Catch clause parameter does not support default values",88:"Missing catch or finally after try",89:"More than one default clause in switch statement",90:"Illegal newline after throw",91:"Strict mode code may not include a with statement",92:"Illegal return statement",93:"The left hand side of the for-header binding declaration is not destructible",94:"new.target only allowed within functions or static blocks",96:"'#' not followed by identifier",102:"Invalid keyword",101:"Can not use 'let' as a class name",100:"'A lexical declaration can't define a 'let' binding",99:"Can not use `let` as variable name in strict mode",97:"'%0' may not be used as an identifier in this context",98:"Await is only valid in async functions",103:"The %0 keyword can only be used with the module goal",104:"Unicode codepoint must not be greater than 0x10FFFF",105:"%0 source must be string",106:"Only a identifier or string can be used to indicate alias",107:"Only '*' or '{...}' can be imported after default",108:"Trailing decorator may be followed by method",109:"Decorators can't be used with a constructor",110:"Can not use `await` as identifier in module or async func",111:"Can not use `await` as identifier in module",112:"HTML comments are only allowed with web compatibility (Annex B)",113:"The identifier 'let' must not be in expression position in strict mode",114:"Cannot assign to `eval` and `arguments` in strict mode",115:"The left-hand side of a for-of loop may not start with 'let'",116:"Block body arrows can not be immediately invoked without a group",117:"Block body arrows can not be immediately accessed without a group",118:"Unexpected strict mode reserved word",119:"Unexpected eval or arguments in strict mode",120:"Decorators must not be followed by a semicolon",121:"Calling delete on expression not allowed in strict mode",122:"Pattern can not have a tail",124:"Can not have a `yield` expression on the left side of a ternary",125:"An arrow function can not have a postfix update operator",126:"Invalid object literal key character after generator star",127:"Private fields can not be deleted",129:"Classes may not have a field called constructor",128:"Classes may not have a private element named constructor",130:"A class field initializer or static block may not contain arguments",131:"Generators can only be declared at the top level or inside a block",132:"Async methods are a restricted production and cannot have a newline following it",133:"Unexpected character after object literal property name",135:"Invalid key token",136:"Label '%0' has already been declared",137:"continue statement must be nested within an iteration statement",138:"Undefined label '%0'",139:"Trailing comma is disallowed inside import(...) arguments",140:"Invalid binding in JSON import",141:"import() requires exactly one argument",142:"Cannot use new with import(...)",143:"... is not allowed in import()",144:"Expected '=>'",145:"Duplicate binding '%0'",146:"Duplicate private identifier #%0",147:"Cannot export a duplicate name '%0'",150:"Duplicate %0 for-binding",148:"Exported binding '%0' needs to refer to a top-level declared variable",149:"Unexpected private field",153:"Numeric separators are not allowed at the end of numeric literals",152:"Only one underscore is allowed as numeric separator",154:"JSX value should be either an expression or a quoted JSX text",155:"Expected corresponding JSX closing tag for %0",156:"Adjacent JSX elements must be wrapped in an enclosing tag",157:"JSX attributes must only be assigned a non-empty 'expression'",158:"'%0' has already been declared",159:"'%0' shadowed a catch clause binding",160:"Dot property must be an identifier",161:"Encountered invalid input after spread/rest argument",162:"Catch without try",163:"Finally without try",164:"Expected corresponding closing tag for JSX fragment",165:"Coalescing and logical operators used together in the same expression must be disambiguated with parentheses",166:"Invalid tagged template on optional chain",167:"Invalid optional chain from super property",168:"Invalid optional chain from new expression",169:'Cannot use "import.meta" outside a module',170:"Leading decorators must be attached to a class declaration",171:"An export name cannot include a lone surrogate, found %0",172:"A string literal cannot be used as an exported binding without `from`",173:"Private fields can't be accessed on super",174:"The only valid meta property for import is 'import.meta'",175:"'import.meta' must not contain escaped characters",176:'cannot use "await" as identifier inside an async function',177:'cannot use "await" in static blocks'};class N extends SyntaxError{start;end;range;loc;description;constructor(e,t,r,...n){const o=E[r].replace(/%(\d+)/g,((e,t)=>n[t]));super("["+e.line+":"+e.column+"-"+t.line+":"+t.column+"]: "+o),this.start=e.index,this.end=t.index,this.range=[e.index,t.index],this.loc={start:{line:e.line,column:e.column},end:{line:t.line,column:t.column}},this.description=o}}function L(e,t,r){let o=e.currentChar,a=0,i=9,c=64&r?0:1,u=0,p=0;if(64&r)a="."+A(e,o),o=e.currentChar,110===o&&e.report(12);else{if(48===o)if(o=n(e),120==(32|o)){for(r=136,o=n(e);4160&l[o];)95!==o?(p=1,a=16*a+s(o),u++,o=n(e)):(p||e.report(152),p=0,o=n(e));0!==u&&p||e.report(0===u?21:153)}else if(111==(32|o)){for(r=132,o=n(e);4128&l[o];)95!==o?(p=1,a=8*a+(o-48),u++,o=n(e)):(p||e.report(152),p=0,o=n(e));0!==u&&p||e.report(0===u?0:153)}else if(98==(32|o)){for(r=130,o=n(e);4224&l[o];)95!==o?(p=1,a=2*a+(o-48),u++,o=n(e)):(p||e.report(152),p=0,o=n(e));0!==u&&p||e.report(0===u?0:153)}else if(32&l[o])for(1&t&&e.report(1),r=1;16&l[o];){if(512&l[o]){r=32,c=0;break}a=8*a+(o-48),o=n(e)}else 512&l[o]?(1&t&&e.report(1),e.flags|=64,r=32):95===o&&e.report(0);if(48&r){if(c){for(;i>=0&&4112&l[o];)if(95!==o)p=0,a=10*a+(o-48),o=n(e),--i;else{if(o=n(e),95===o||32&r)throw new N(e.currentLocation,{index:e.index+1,line:e.line,column:e.column},152);p=1}if(p)throw new N(e.currentLocation,{index:e.index+1,line:e.line,column:e.column},153);if(i>=0&&!d(o)&&46!==o)return e.tokenValue=a,e.options.raw&&(e.tokenRaw=e.source.slice(e.tokenIndex,e.index)),134283266}a+=A(e,o),o=e.currentChar,46===o&&(95===n(e)&&e.report(0),r=64,a+="."+A(e,e.currentChar),o=e.currentChar)}}const g=e.index;let f=0;if(110===o&&128&r)f=1,o=n(e);else if(101==(32|o)){o=n(e),256&l[o]&&(o=n(e));const{index:t}=e;16&l[o]||e.report(11),a+=e.source.substring(g,t)+A(e,o),o=e.currentChar}return(e.index","(","{",".","...","}",")",";",",","[","]",":","?","'",'"',"++","--","=","<<=",">>=",">>>=","**=","+=","-=","*=","/=","%=","^=","|=","&=","||=","&&=","??=","typeof","delete","void","!","~","+","-","in","instanceof","*","%","/","**","&&","||","===","!==","==","!=","<=",">=","<",">","<<",">>",">>>","&","|","^","var","let","const","break","case","catch","class","continue","debugger","default","do","else","export","extends","finally","for","function","if","import","new","return","super","switch","this","throw","try","while","with","implements","interface","package","private","protected","public","static","yield","as","async","await","constructor","get","set","accessor","from","of","enum","eval","arguments","escaped keyword","escaped future reserved keyword","reserved if strict","#","BigIntLiteral","??","?.","WhiteSpace","Illegal","LineTerminator","PrivateField","Template","@","target","meta","LineFeed","Escaped","JSXText"],V={this:86111,function:86104,if:20569,return:20572,var:86088,else:20563,for:20567,new:86107,in:8673330,typeof:16863275,while:20578,case:20556,break:20555,try:20577,catch:20557,delete:16863276,throw:86112,switch:86110,continue:20559,default:20561,instanceof:8411187,do:20562,void:16863277,finally:20566,async:209005,await:209006,class:86094,const:86090,constructor:12399,debugger:20560,export:20564,extends:20565,false:86021,from:209011,get:209008,implements:36964,import:86106,interface:36965,let:241737,null:86023,of:471156,package:36966,private:36967,protected:36968,public:36969,set:209009,static:36970,super:86109,true:86022,with:20579,yield:241771,enum:86133,eval:537079926,as:77932,arguments:537079927,target:209029,meta:209030,accessor:12402};function D(e,t){!(1&e.flags)&&1048576&~e.getToken()&&e.report(30,I[255&e.getToken()]),U(e,t,1074790417)||e.options.onInsertedSemicolon?.(e.startIndex)}function R(e,t,r,n){return t-r<13&&"use strict"===n&&(!(1048576&~e.getToken())||1&e.flags)?1:0}function B(e,t,r){return e.getToken()!==r?0:(Q(e,t),1)}function U(e,t,r){return e.getToken()===r&&(Q(e,t),!0)}function P(e,t,r){e.getToken()!==r&&e.report(25,I[255&r]),Q(e,t)}function O(e,t){switch(t.type){case"ArrayExpression":{t.type="ArrayPattern";const{elements:r}=t;for(let t=0,n=r.length;t0)g(t)||e.report(20,String.fromCodePoint(t)),e.currentChar=t,e.index++,e.column++;else if(!g(e.currentChar))break;n(e)}e.index<=e.end&&(e.tokenValue+=e.source.slice(i,e.index));const{length:s}=e.tokenValue;if(a&&s>=2&&s<=11){const n=X(V,e.tokenValue);return void 0===n?208897|(r?-2147483648:0):r?209006===n?2050&t?-2147483528:-2147483648|n:1&t?36970===n?-2147483527:36864&~n?20480&~n?-2147274630:262144&t&&!(8&t)?-2147483648|n:-2147483528:-2147483527:!(262144&t)||8&t||20480&~n?241771===n?262144&t?-2147274630:1024&t?-2147483528:-2147483648|n:209005===n?-2147274630:36864&~n?-2147483528:12288|n|-2147483648:-2147483648|n:n}return 208897|(r?-2147483648:0)}function Z(e){let t=n(e);if(92===t)return 130;const r=o(e);return r&&(t=r),d(t)||e.report(96),130}function K(e){return 117!==e.source.charCodeAt(e.index+1)&&e.report(5),e.currentChar=e.source.charCodeAt(e.index+=2),e.column+=2,function(e){let t=0;const r=e.currentChar;if(123===r){const r=e.index-2;for(;64&l[n(e)];)if(t=t<<4|s(e.currentChar),t>1114111)throw new N({index:r,line:e.line,column:e.column},e.currentLocation,104);if(125!==e.currentChar)throw new N({index:r,line:e.line,column:e.column},e.currentLocation,7);return n(e),t}64&l[r]||e.report(7);const o=e.source.charCodeAt(e.index+1);64&l[o]||e.report(7);const a=e.source.charCodeAt(e.index+2);64&l[a]||e.report(7);const i=e.source.charCodeAt(e.index+3);64&l[i]||e.report(7);return t=s(r)<<12|s(o)<<8|s(a)<<4|s(i),e.currentChar=e.source.charCodeAt(e.index+=4),e.column+=4,t}(e)}const W=[128,128,128,128,128,128,128,128,128,127,135,127,127,129,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,127,16842798,134283267,130,208897,8391477,8390213,134283267,67174411,16,8391476,25233968,18,25233969,67108877,8457014,134283266,134283266,134283266,134283266,134283266,134283266,134283266,134283266,134283266,134283266,21,1074790417,8456256,1077936155,8390721,22,132,208897,208897,208897,208897,208897,208897,208897,208897,208897,208897,208897,208897,208897,208897,208897,208897,208897,208897,208897,208897,208897,208897,208897,208897,208897,208897,69271571,136,20,8389959,208897,131,4096,4096,4096,4096,4096,4096,4096,208897,4096,208897,208897,4096,208897,4096,208897,4096,208897,4096,4096,4096,208897,4096,4096,208897,4096,4096,2162700,8389702,1074790415,16842799,128];function Q(e,t){e.flags=1^(1|e.flags),e.startIndex=e.index,e.startColumn=e.column,e.startLine=e.line,e.setToken(ee(e,t,0))}function ee(e,t,s){const c=0===e.index,{source:l}=e;let u=e.currentLocation;for(;e.index=e.end)return 8391476;const t=e.currentChar;return 61===t?(n(e),4194338):42!==t?8391476:61!==n(e)?8391735:(n(e),4194335)}case 8389959:return 61!==n(e)?8389959:(n(e),4194341);case 25233968:{n(e);const t=e.currentChar;return 43===t?(n(e),33619993):61===t?(n(e),4194336):25233968}case 25233969:{n(e);const r=e.currentChar;if(45===r){if(n(e),(1&s||c)&&62===e.currentChar){e.options.webcompat||e.report(112),n(e),s=k(e,l,s,t,3,u),u=e.tokenStart;continue}return 33619994}return 61===r?(n(e),4194337):25233969}case 8457014:if(n(e),e.index=48&&r<=57)return L(e,t,80);if(46===r){const t=e.index+1;if(t=48&&t<=57)))return n(e),67108990}return 22}}}else{if((8232^d)<=1){s=-5&s|1,i(e);continue}const a=o(e);if(a>0&&(d=a),r(d))return e.tokenValue="",Y(e,t,0,0);if(160===(p=d)||65279===p||133===p||5760===p||p>=8192&&p<=8203||8239===p||8287===p||12288===p||8201===p||65519===p){n(e);continue}e.report(20,String.fromCodePoint(d))}}var p;return 1048576}const te={AElig:"Æ",AMP:"&",Aacute:"Á",Abreve:"Ă",Acirc:"Â",Acy:"А",Afr:"𝔄",Agrave:"À",Alpha:"Α",Amacr:"Ā",And:"⩓",Aogon:"Ą",Aopf:"𝔸",ApplyFunction:"⁡",Aring:"Å",Ascr:"𝒜",Assign:"≔",Atilde:"Ã",Auml:"Ä",Backslash:"∖",Barv:"⫧",Barwed:"⌆",Bcy:"Б",Because:"∵",Bernoullis:"ℬ",Beta:"Β",Bfr:"𝔅",Bopf:"𝔹",Breve:"˘",Bscr:"ℬ",Bumpeq:"≎",CHcy:"Ч",COPY:"©",Cacute:"Ć",Cap:"⋒",CapitalDifferentialD:"ⅅ",Cayleys:"ℭ",Ccaron:"Č",Ccedil:"Ç",Ccirc:"Ĉ",Cconint:"∰",Cdot:"Ċ",Cedilla:"¸",CenterDot:"·",Cfr:"ℭ",Chi:"Χ",CircleDot:"⊙",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",Colon:"∷",Colone:"⩴",Congruent:"≡",Conint:"∯",ContourIntegral:"∮",Copf:"ℂ",Coproduct:"∐",CounterClockwiseContourIntegral:"∳",Cross:"⨯",Cscr:"𝒞",Cup:"⋓",CupCap:"≍",DD:"ⅅ",DDotrahd:"⤑",DJcy:"Ђ",DScy:"Ѕ",DZcy:"Џ",Dagger:"‡",Darr:"↡",Dashv:"⫤",Dcaron:"Ď",Dcy:"Д",Del:"∇",Delta:"Δ",Dfr:"𝔇",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",Diamond:"⋄",DifferentialD:"ⅆ",Dopf:"𝔻",Dot:"¨",DotDot:"⃜",DotEqual:"≐",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",DownBreve:"̑",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",DownTeeArrow:"↧",Downarrow:"⇓",Dscr:"𝒟",Dstrok:"Đ",ENG:"Ŋ",ETH:"Ð",Eacute:"É",Ecaron:"Ě",Ecirc:"Ê",Ecy:"Э",Edot:"Ė",Efr:"𝔈",Egrave:"È",Element:"∈",Emacr:"Ē",EmptySmallSquare:"◻",EmptyVerySmallSquare:"▫",Eogon:"Ę",Eopf:"𝔼",Epsilon:"Ε",Equal:"⩵",EqualTilde:"≂",Equilibrium:"⇌",Escr:"ℰ",Esim:"⩳",Eta:"Η",Euml:"Ë",Exists:"∃",ExponentialE:"ⅇ",Fcy:"Ф",Ffr:"𝔉",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",Fopf:"𝔽",ForAll:"∀",Fouriertrf:"ℱ",Fscr:"ℱ",GJcy:"Ѓ",GT:">",Gamma:"Γ",Gammad:"Ϝ",Gbreve:"Ğ",Gcedil:"Ģ",Gcirc:"Ĝ",Gcy:"Г",Gdot:"Ġ",Gfr:"𝔊",Gg:"⋙",Gopf:"𝔾",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",Gt:"≫",HARDcy:"Ъ",Hacek:"ˇ",Hat:"^",Hcirc:"Ĥ",Hfr:"ℌ",HilbertSpace:"ℋ",Hopf:"ℍ",HorizontalLine:"─",Hscr:"ℋ",Hstrok:"Ħ",HumpDownHump:"≎",HumpEqual:"≏",IEcy:"Е",IJlig:"IJ",IOcy:"Ё",Iacute:"Í",Icirc:"Î",Icy:"И",Idot:"İ",Ifr:"ℑ",Igrave:"Ì",Im:"ℑ",Imacr:"Ī",ImaginaryI:"ⅈ",Implies:"⇒",Int:"∬",Integral:"∫",Intersection:"⋂",InvisibleComma:"⁣",InvisibleTimes:"⁢",Iogon:"Į",Iopf:"𝕀",Iota:"Ι",Iscr:"ℐ",Itilde:"Ĩ",Iukcy:"І",Iuml:"Ï",Jcirc:"Ĵ",Jcy:"Й",Jfr:"𝔍",Jopf:"𝕁",Jscr:"𝒥",Jsercy:"Ј",Jukcy:"Є",KHcy:"Х",KJcy:"Ќ",Kappa:"Κ",Kcedil:"Ķ",Kcy:"К",Kfr:"𝔎",Kopf:"𝕂",Kscr:"𝒦",LJcy:"Љ",LT:"<",Lacute:"Ĺ",Lambda:"Λ",Lang:"⟪",Laplacetrf:"ℒ",Larr:"↞",Lcaron:"Ľ",Lcedil:"Ļ",Lcy:"Л",LeftAngleBracket:"⟨",LeftArrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",LeftRightArrow:"↔",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",Leftarrow:"⇐",Leftrightarrow:"⇔",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",LessLess:"⪡",LessSlantEqual:"⩽",LessTilde:"≲",Lfr:"𝔏",Ll:"⋘",Lleftarrow:"⇚",Lmidot:"Ŀ",LongLeftArrow:"⟵",LongLeftRightArrow:"⟷",LongRightArrow:"⟶",Longleftarrow:"⟸",Longleftrightarrow:"⟺",Longrightarrow:"⟹",Lopf:"𝕃",LowerLeftArrow:"↙",LowerRightArrow:"↘",Lscr:"ℒ",Lsh:"↰",Lstrok:"Ł",Lt:"≪",Map:"⤅",Mcy:"М",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",MinusPlus:"∓",Mopf:"𝕄",Mscr:"ℳ",Mu:"Μ",NJcy:"Њ",Nacute:"Ń",Ncaron:"Ň",Ncedil:"Ņ",Ncy:"Н",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:"\n",Nfr:"𝔑",NoBreak:"⁠",NonBreakingSpace:" ",Nopf:"ℕ",Not:"⫬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",Nscr:"𝒩",Ntilde:"Ñ",Nu:"Ν",OElig:"Œ",Oacute:"Ó",Ocirc:"Ô",Ocy:"О",Odblac:"Ő",Ofr:"𝔒",Ograve:"Ò",Omacr:"Ō",Omega:"Ω",Omicron:"Ο",Oopf:"𝕆",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",Or:"⩔",Oscr:"𝒪",Oslash:"Ø",Otilde:"Õ",Otimes:"⨷",Ouml:"Ö",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",PartialD:"∂",Pcy:"П",Pfr:"𝔓",Phi:"Φ",Pi:"Π",PlusMinus:"±",Poincareplane:"ℌ",Popf:"ℙ",Pr:"⪻",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",Prime:"″",Product:"∏",Proportion:"∷",Proportional:"∝",Pscr:"𝒫",Psi:"Ψ",QUOT:'"',Qfr:"𝔔",Qopf:"ℚ",Qscr:"𝒬",RBarr:"⤐",REG:"®",Racute:"Ŕ",Rang:"⟫",Rarr:"↠",Rarrtl:"⤖",Rcaron:"Ř",Rcedil:"Ŗ",Rcy:"Р",Re:"ℜ",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",Rfr:"ℜ",Rho:"Ρ",RightAngleBracket:"⟩",RightArrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",Rightarrow:"⇒",Ropf:"ℝ",RoundImplies:"⥰",Rrightarrow:"⇛",Rscr:"ℛ",Rsh:"↱",RuleDelayed:"⧴",SHCHcy:"Щ",SHcy:"Ш",SOFTcy:"Ь",Sacute:"Ś",Sc:"⪼",Scaron:"Š",Scedil:"Ş",Scirc:"Ŝ",Scy:"С",Sfr:"𝔖",ShortDownArrow:"↓",ShortLeftArrow:"←",ShortRightArrow:"→",ShortUpArrow:"↑",Sigma:"Σ",SmallCircle:"∘",Sopf:"𝕊",Sqrt:"√",Square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",Sscr:"𝒮",Star:"⋆",Sub:"⋐",Subset:"⋐",SubsetEqual:"⊆",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",SuchThat:"∋",Sum:"∑",Sup:"⋑",Superset:"⊃",SupersetEqual:"⊇",Supset:"⋑",THORN:"Þ",TRADE:"™",TSHcy:"Ћ",TScy:"Ц",Tab:"\t",Tau:"Τ",Tcaron:"Ť",Tcedil:"Ţ",Tcy:"Т",Tfr:"𝔗",Therefore:"∴",Theta:"Θ",ThickSpace:"  ",ThinSpace:" ",Tilde:"∼",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",Topf:"𝕋",TripleDot:"⃛",Tscr:"𝒯",Tstrok:"Ŧ",Uacute:"Ú",Uarr:"↟",Uarrocir:"⥉",Ubrcy:"Ў",Ubreve:"Ŭ",Ucirc:"Û",Ucy:"У",Udblac:"Ű",Ufr:"𝔘",Ugrave:"Ù",Umacr:"Ū",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",Uopf:"𝕌",UpArrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",UpDownArrow:"↕",UpEquilibrium:"⥮",UpTee:"⊥",UpTeeArrow:"↥",Uparrow:"⇑",Updownarrow:"⇕",UpperLeftArrow:"↖",UpperRightArrow:"↗",Upsi:"ϒ",Upsilon:"Υ",Uring:"Ů",Uscr:"𝒰",Utilde:"Ũ",Uuml:"Ü",VDash:"⊫",Vbar:"⫫",Vcy:"В",Vdash:"⊩",Vdashl:"⫦",Vee:"⋁",Verbar:"‖",Vert:"‖",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",Vopf:"𝕍",Vscr:"𝒱",Vvdash:"⊪",Wcirc:"Ŵ",Wedge:"⋀",Wfr:"𝔚",Wopf:"𝕎",Wscr:"𝒲",Xfr:"𝔛",Xi:"Ξ",Xopf:"𝕏",Xscr:"𝒳",YAcy:"Я",YIcy:"Ї",YUcy:"Ю",Yacute:"Ý",Ycirc:"Ŷ",Ycy:"Ы",Yfr:"𝔜",Yopf:"𝕐",Yscr:"𝒴",Yuml:"Ÿ",ZHcy:"Ж",Zacute:"Ź",Zcaron:"Ž",Zcy:"З",Zdot:"Ż",ZeroWidthSpace:"​",Zeta:"Ζ",Zfr:"ℨ",Zopf:"ℤ",Zscr:"𝒵",aacute:"á",abreve:"ă",ac:"∾",acE:"∾̳",acd:"∿",acirc:"â",acute:"´",acy:"а",aelig:"æ",af:"⁡",afr:"𝔞",agrave:"à",alefsym:"ℵ",aleph:"ℵ",alpha:"α",amacr:"ā",amalg:"⨿",amp:"&",and:"∧",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsd:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",aogon:"ą",aopf:"𝕒",ap:"≈",apE:"⩰",apacir:"⩯",ape:"≊",apid:"≋",apos:"'",approx:"≈",approxeq:"≊",aring:"å",ascr:"𝒶",ast:"*",asymp:"≈",asympeq:"≍",atilde:"ã",auml:"ä",awconint:"∳",awint:"⨑",bNot:"⫭",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",barvee:"⊽",barwed:"⌅",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",bcy:"б",bdquo:"„",becaus:"∵",because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",beta:"β",beth:"ℶ",between:"≬",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bnot:"⌐",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxDL:"╗",boxDR:"╔",boxDl:"╖",boxDr:"╓",boxH:"═",boxHD:"╦",boxHU:"╩",boxHd:"╤",boxHu:"╧",boxUL:"╝",boxUR:"╚",boxUl:"╜",boxUr:"╙",boxV:"║",boxVH:"╬",boxVL:"╣",boxVR:"╠",boxVh:"╫",boxVl:"╢",boxVr:"╟",boxbox:"⧉",boxdL:"╕",boxdR:"╒",boxdl:"┐",boxdr:"┌",boxh:"─",boxhD:"╥",boxhU:"╨",boxhd:"┬",boxhu:"┴",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxuL:"╛",boxuR:"╘",boxul:"┘",boxur:"└",boxv:"│",boxvH:"╪",boxvL:"╡",boxvR:"╞",boxvh:"┼",boxvl:"┤",boxvr:"├",bprime:"‵",breve:"˘",brvbar:"¦",bscr:"𝒷",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",bumpeq:"≏",cacute:"ć",cap:"∩",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",caps:"∩︀",caret:"⁁",caron:"ˇ",ccaps:"⩍",ccaron:"č",ccedil:"ç",ccirc:"ĉ",ccups:"⩌",ccupssm:"⩐",cdot:"ċ",cedil:"¸",cemptyv:"⦲",cent:"¢",centerdot:"·",cfr:"𝔠",chcy:"ч",check:"✓",checkmark:"✓",chi:"χ",cir:"○",cirE:"⧃",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledR:"®",circledS:"Ⓢ",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",clubs:"♣",clubsuit:"♣",colon:":",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",conint:"∮",copf:"𝕔",coprod:"∐",copy:"©",copysr:"℗",crarr:"↵",cross:"✗",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",cup:"∪",cupbrcap:"⩈",cupcap:"⩆",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",dArr:"⇓",dHar:"⥥",dagger:"†",daleth:"ℸ",darr:"↓",dash:"‐",dashv:"⊣",dbkarow:"⤏",dblac:"˝",dcaron:"ď",dcy:"д",dd:"ⅆ",ddagger:"‡",ddarr:"⇊",ddotseq:"⩷",deg:"°",delta:"δ",demptyv:"⦱",dfisht:"⥿",dfr:"𝔡",dharl:"⇃",dharr:"⇂",diam:"⋄",diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",dopf:"𝕕",dot:"˙",doteq:"≐",doteqdot:"≑",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",downarrow:"↓",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",dscr:"𝒹",dscy:"ѕ",dsol:"⧶",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",dzcy:"џ",dzigrarr:"⟿",eDDot:"⩷",eDot:"≑",eacute:"é",easter:"⩮",ecaron:"ě",ecir:"≖",ecirc:"ê",ecolon:"≕",ecy:"э",edot:"ė",ee:"ⅇ",efDot:"≒",efr:"𝔢",eg:"⪚",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",emacr:"ē",empty:"∅",emptyset:"∅",emptyv:"∅",emsp13:" ",emsp14:" ",emsp:" ",eng:"ŋ",ensp:" ",eogon:"ę",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",equals:"=",equest:"≟",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erDot:"≓",erarr:"⥱",escr:"ℯ",esdot:"≐",esim:"≂",eta:"η",eth:"ð",euml:"ë",euro:"€",excl:"!",exist:"∃",expectation:"ℰ",exponentiale:"ⅇ",fallingdotseq:"≒",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",ffr:"𝔣",filig:"fi",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",fopf:"𝕗",forall:"∀",fork:"⋔",forkv:"⫙",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",fscr:"𝒻",gE:"≧",gEl:"⪌",gacute:"ǵ",gamma:"γ",gammad:"ϝ",gap:"⪆",gbreve:"ğ",gcirc:"ĝ",gcy:"г",gdot:"ġ",ge:"≥",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",gfr:"𝔤",gg:"≫",ggg:"⋙",gimel:"ℷ",gjcy:"ѓ",gl:"≷",glE:"⪒",gla:"⪥",glj:"⪤",gnE:"≩",gnap:"⪊",gnapprox:"⪊",gne:"⪈",gneq:"⪈",gneqq:"≩",gnsim:"⋧",gopf:"𝕘",grave:"`",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",gt:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",hArr:"⇔",hairsp:" ",half:"½",hamilt:"ℋ",hardcy:"ъ",harr:"↔",harrcir:"⥈",harrw:"↭",hbar:"ℏ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",hfr:"𝔥",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",hopf:"𝕙",horbar:"―",hscr:"𝒽",hslash:"ℏ",hstrok:"ħ",hybull:"⁃",hyphen:"‐",iacute:"í",ic:"⁣",icirc:"î",icy:"и",iecy:"е",iexcl:"¡",iff:"⇔",ifr:"𝔦",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",ijlig:"ij",imacr:"ī",image:"ℑ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",in:"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",int:"∫",intcal:"⊺",integers:"ℤ",intercal:"⊺",intlarhk:"⨗",intprod:"⨼",iocy:"ё",iogon:"į",iopf:"𝕚",iota:"ι",iprod:"⨼",iquest:"¿",iscr:"𝒾",isin:"∈",isinE:"⋹",isindot:"⋵",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",itilde:"ĩ",iukcy:"і",iuml:"ï",jcirc:"ĵ",jcy:"й",jfr:"𝔧",jmath:"ȷ",jopf:"𝕛",jscr:"𝒿",jsercy:"ј",jukcy:"є",kappa:"κ",kappav:"ϰ",kcedil:"ķ",kcy:"к",kfr:"𝔨",kgreen:"ĸ",khcy:"х",kjcy:"ќ",kopf:"𝕜",kscr:"𝓀",lAarr:"⇚",lArr:"⇐",lAtail:"⤛",lBarr:"⤎",lE:"≦",lEg:"⪋",lHar:"⥢",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",lambda:"λ",lang:"⟨",langd:"⦑",langle:"⟨",lap:"⪅",laquo:"«",larr:"←",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",latail:"⤙",late:"⪭",lates:"⪭︀",lbarr:"⤌",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",lcaron:"ľ",lcedil:"ļ",lceil:"⌈",lcub:"{",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",le:"≤",leftarrow:"←",leftarrowtail:"↢",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",leftrightarrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",leftthreetimes:"⋋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",lessgtr:"≶",lesssim:"≲",lfisht:"⥼",lfloor:"⌊",lfr:"𝔩",lg:"≶",lgE:"⪑",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",ljcy:"љ",ll:"≪",llarr:"⇇",llcorner:"⌞",llhard:"⥫",lltri:"◺",lmidot:"ŀ",lmoust:"⎰",lmoustache:"⎰",lnE:"≨",lnap:"⪉",lnapprox:"⪉",lne:"⪇",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",longleftarrow:"⟵",longleftrightarrow:"⟷",longmapsto:"⟼",longrightarrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",lscr:"𝓁",lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",lstrok:"ł",lt:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltrPar:"⦖",ltri:"◃",ltrie:"⊴",ltrif:"◂",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",mDDot:"∺",macr:"¯",male:"♂",malt:"✠",maltese:"✠",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",mcy:"м",mdash:"—",measuredangle:"∡",mfr:"𝔪",mho:"℧",micro:"µ",mid:"∣",midast:"*",midcir:"⫰",middot:"·",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",mopf:"𝕞",mp:"∓",mscr:"𝓂",mstpos:"∾",mu:"μ",multimap:"⊸",mumap:"⊸",nGg:"⋙̸",nGt:"≫⃒",nGtv:"≫̸",nLeftarrow:"⇍",nLeftrightarrow:"⇎",nLl:"⋘̸",nLt:"≪⃒",nLtv:"≪̸",nRightarrow:"⇏",nVDash:"⊯",nVdash:"⊮",nabla:"∇",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",ncaron:"ň",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",ncy:"н",ndash:"–",ne:"≠",neArr:"⇗",nearhk:"⤤",nearr:"↗",nearrow:"↗",nedot:"≐̸",nequiv:"≢",nesear:"⤨",nesim:"≂̸",nexist:"∄",nexists:"∄",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",ngsim:"≵",ngt:"≯",ngtr:"≯",nhArr:"⇎",nharr:"↮",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",njcy:"њ",nlArr:"⇍",nlE:"≦̸",nlarr:"↚",nldr:"‥",nle:"≰",nleftarrow:"↚",nleftrightarrow:"↮",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nlsim:"≴",nlt:"≮",nltri:"⋪",nltrie:"⋬",nmid:"∤",nopf:"𝕟",not:"¬",notin:"∉",notinE:"⋹̸",notindot:"⋵̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrArr:"⇏",nrarr:"↛",nrarrc:"⤳̸",nrarrw:"↝̸",nrightarrow:"↛",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",nu:"ν",num:"#",numero:"№",numsp:" ",nvDash:"⊭",nvHarr:"⤄",nvap:"≍⃒",nvdash:"⊬",nvge:"≥⃒",nvgt:">⃒",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwArr:"⇖",nwarhk:"⤣",nwarr:"↖",nwarrow:"↖",nwnear:"⤧",oS:"Ⓢ",oacute:"ó",oast:"⊛",ocir:"⊚",ocirc:"ô",ocy:"о",odash:"⊝",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",oelig:"œ",ofcir:"⦿",ofr:"𝔬",ogon:"˛",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",omacr:"ō",omega:"ω",omicron:"ο",omid:"⦶",ominus:"⊖",oopf:"𝕠",opar:"⦷",operp:"⦹",oplus:"⊕",or:"∨",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oscr:"ℴ",oslash:"ø",osol:"⊘",otilde:"õ",otimes:"⊗",otimesas:"⨶",ouml:"ö",ovbar:"⌽",par:"∥",para:"¶",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",pfr:"𝔭",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",pointint:"⨕",popf:"𝕡",pound:"£",pr:"≺",prE:"⪳",prap:"⪷",prcue:"≼",pre:"⪯",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",prime:"′",primes:"ℙ",prnE:"⪵",prnap:"⪹",prnsim:"⋨",prod:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",propto:"∝",prsim:"≾",prurel:"⊰",pscr:"𝓅",psi:"ψ",puncsp:" ",qfr:"𝔮",qint:"⨌",qopf:"𝕢",qprime:"⁗",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",quot:'"',rAarr:"⇛",rArr:"⇒",rAtail:"⤜",rBarr:"⤏",rHar:"⥤",race:"∽̱",racute:"ŕ",radic:"√",raemptyv:"⦳",rang:"⟩",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",rarr:"→",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",rarrtl:"↣",rarrw:"↝",ratail:"⤚",ratio:"∶",rationals:"ℚ",rbarr:"⤍",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",rcaron:"ř",rcedil:"ŗ",rceil:"⌉",rcub:"}",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",reg:"®",rfisht:"⥽",rfloor:"⌋",rfr:"𝔯",rhard:"⇁",rharu:"⇀",rharul:"⥬",rho:"ρ",rhov:"ϱ",rightarrow:"→",rightarrowtail:"↣",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",rightthreetimes:"⋌",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",ropf:"𝕣",roplus:"⨮",rotimes:"⨵",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",rsaquo:"›",rscr:"𝓇",rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",ruluhar:"⥨",rx:"℞",sacute:"ś",sbquo:"‚",sc:"≻",scE:"⪴",scap:"⪸",scaron:"š",sccue:"≽",sce:"⪰",scedil:"ş",scirc:"ŝ",scnE:"⪶",scnap:"⪺",scnsim:"⋩",scpolint:"⨓",scsim:"≿",scy:"с",sdot:"⋅",sdotb:"⊡",sdote:"⩦",seArr:"⇘",searhk:"⤥",searr:"↘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",sfr:"𝔰",sfrown:"⌢",sharp:"♯",shchcy:"щ",shcy:"ш",shortmid:"∣",shortparallel:"∥",shy:"­",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",softcy:"ь",sol:"/",solb:"⧄",solbar:"⌿",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",square:"□",squarf:"▪",squf:"▪",srarr:"→",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",sub:"⊂",subE:"⫅",subdot:"⪽",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",subset:"⊂",subseteq:"⊆",subseteqq:"⫅",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",sum:"∑",sung:"♪",sup1:"¹",sup2:"²",sup3:"³",sup:"⊃",supE:"⫆",supdot:"⪾",supdsub:"⫘",supe:"⊇",supedot:"⫄",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",supset:"⊃",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swArr:"⇙",swarhk:"⤦",swarr:"↙",swarrow:"↙",swnwar:"⤪",szlig:"ß",target:"⌖",tau:"τ",tbrk:"⎴",tcaron:"ť",tcedil:"ţ",tcy:"т",tdot:"⃛",telrec:"⌕",tfr:"𝔱",there4:"∴",therefore:"∴",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",thinsp:" ",thkap:"≈",thksim:"∼",thorn:"þ",tilde:"˜",times:"×",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",trade:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",tscr:"𝓉",tscy:"ц",tshcy:"ћ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",uArr:"⇑",uHar:"⥣",uacute:"ú",uarr:"↑",ubrcy:"ў",ubreve:"ŭ",ucirc:"û",ucy:"у",udarr:"⇅",udblac:"ű",udhar:"⥮",ufisht:"⥾",ufr:"𝔲",ugrave:"ù",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",umacr:"ū",uml:"¨",uogon:"ų",uopf:"𝕦",uparrow:"↑",updownarrow:"↕",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",upsi:"υ",upsih:"ϒ",upsilon:"υ",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",uring:"ů",urtri:"◹",uscr:"𝓊",utdot:"⋰",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",uuml:"ü",uwangle:"⦧",vArr:"⇕",vBar:"⫨",vBarv:"⫩",vDash:"⊨",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",varr:"↕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",vcy:"в",vdash:"⊢",vee:"∨",veebar:"⊻",veeeq:"≚",vellip:"⋮",verbar:"|",vert:"|",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",vopf:"𝕧",vprop:"∝",vrtri:"⊳",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",vzigzag:"⦚",wcirc:"ŵ",wedbar:"⩟",wedge:"∧",wedgeq:"≙",weierp:"℘",wfr:"𝔴",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",xfr:"𝔵",xhArr:"⟺",xharr:"⟷",xi:"ξ",xlArr:"⟸",xlarr:"⟵",xmap:"⟼",xnis:"⋻",xodot:"⨀",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrArr:"⟹",xrarr:"⟶",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",yacute:"ý",yacy:"я",ycirc:"ŷ",ycy:"ы",yen:"¥",yfr:"𝔶",yicy:"ї",yopf:"𝕪",yscr:"𝓎",yucy:"ю",yuml:"ÿ",zacute:"ź",zcaron:"ž",zcy:"з",zdot:"ż",zeetrf:"ℨ",zeta:"ζ",zfr:"𝔷",zhcy:"ж",zigrarr:"⇝",zopf:"𝕫",zscr:"𝓏",zwj:"‍",zwnj:"‌"},re={0:65533,128:8364,130:8218,131:402,132:8222,133:8230,134:8224,135:8225,136:710,137:8240,138:352,139:8249,140:338,142:381,145:8216,146:8217,147:8220,148:8221,149:8226,150:8211,151:8212,152:732,153:8482,154:353,155:8250,156:339,158:382,159:376};function ne(e){return e.replace(/&(?:[a-zA-Z]+|#[xX][\da-fA-F]+|#\d+);/g,(e=>{if("#"===e.charAt(1)){const t=e.charAt(2);return function(e){if(e>=55296&&e<=57343||e>1114111)return"�";return String.fromCodePoint(X(re,e)??e)}("X"===t||"x"===t?parseInt(e.slice(3),16):parseInt(e.slice(2),10))}return X(te,e.slice(1,-1))??e}))}function oe(e,t){return e.startIndex=e.tokenIndex=e.index,e.startColumn=e.tokenColumn=e.column,e.startLine=e.tokenLine=e.line,e.setToken(8192&l[e.currentChar]?function(e){const t=e.currentChar;let r=n(e);const o=e.index;for(;r!==t;)e.index>=e.end&&e.report(16),r=n(e);r!==t&&e.report(16);e.tokenValue=e.source.slice(o,e.index),n(e),e.options.raw&&(e.tokenRaw=e.source.slice(e.tokenIndex,e.index));return 134283267}(e):ee(e,t,0)),e.getToken()}function ae(e){if(e.startIndex=e.tokenIndex=e.index,e.startColumn=e.tokenColumn=e.column,e.startLine=e.tokenLine=e.line,e.index>=e.end)return void e.setToken(1048576);if(60===e.currentChar)return n(e),void e.setToken(8456256);if(123===e.currentChar)return n(e),void e.setToken(2162700);let t=0;for(;e.indexe.declareUnboundVariable(t)))):(c&&e.report(172),r&&(n.forEach((t=>e.declareUnboundVariable(t))),a.forEach((t=>e.addBindingToExports(t))))),D(e,32|t);break}case 132:case 86094:a=Tt(e,t,r,void 0,2);break;case 86104:a=nt(e,t,r,void 0,4,1,2,0,e.tokenStart);break;case 241737:a=we(e,t,r,void 0,8,64);break;case 86090:a=we(e,t,r,void 0,16,64);break;case 86088:a=Se(e,t,r,void 0,64);break;case 209005:{const{tokenStart:n}=e;if(Q(e,t),!(1&e.flags)&&86104===e.getToken()){a=nt(e,t,r,void 0,4,1,2,1,n);break}}default:e.report(30,I[255&e.getToken()])}const c={type:"ExportNamedDeclaration",declaration:a,specifiers:o,source:i,attributes:s};return e.finishNode(c,n)}(e,t,r);break;case 86106:n=function(e,t,r){const n=e.tokenStart;Q(e,t);let o=null;const{tokenStart:a}=e;let i=[];if(134283267===e.getToken())o=rt(e,t);else{if(143360&e.getToken()){const n=qe(e,t,r);if(i=[e.finishNode({type:"ImportDefaultSpecifier",local:n},a)],U(e,t,18))switch(e.getToken()){case 8391476:i.push(Ee(e,t,r));break;case 2162700:Ne(e,t,r,i);break;default:e.report(107)}}else switch(e.getToken()){case 8391476:i=[Ee(e,t,r)];break;case 2162700:Ne(e,t,r,i);break;case 67174411:return Ae(e,t,void 0,n);case 67108877:return Le(e,t,n);default:e.report(30,I[255&e.getToken()])}o=function(e,t){P(e,t,209011),134283267!==e.getToken()&&e.report(105,"Import");return rt(e,t)}(e,t)}const s=ze(e,t),c={type:"ImportDeclaration",specifiers:i,source:o,attributes:s};return D(e,32|t),e.finishNode(c,n)}(e,t,r);break;default:n=ge(e,t,r,void 0,4,{})}return e.leadingDecorators?.decorators.length&&e.report(170),n}function ge(e,t,r,n,o,a){const i=e.tokenStart;switch(e.getToken()){case 86104:return nt(e,t,r,n,o,1,0,0,i);case 132:case 86094:return Tt(e,t,r,n,0);case 86090:return we(e,t,r,n,16,0);case 241737:return function(e,t,r,n,o){const{tokenValue:a,tokenStart:i}=e,s=e.getToken();let c=tt(e,t);if(2240512&e.getToken()){const o=ve(e,t,r,n,8,0);return D(e,32|t),e.finishNode({type:"VariableDeclaration",kind:"let",declarations:o},i)}e.assignable=1,1&t&&e.report(85);if(21===e.getToken())return me(e,t,r,n,o,{},a,c,s,0,i);if(10===e.getToken()){let r;e.options.lexical&&(r=ce(e,t,a)),e.flags=128^(128|e.flags),c=ft(e,t,r,n,[c],0,i)}else c=je(e,t,n,c,0,0,i),c=Re(e,t,n,0,0,i,c);18===e.getToken()&&(c=Ve(e,t,n,0,i,c));return he(e,t,c,i)}(e,t,r,n,o);case 20564:e.report(103,"export");case 86106:switch(Q(e,t),e.getToken()){case 67174411:return Ae(e,t,n,i);case 67108877:return Le(e,t,i);default:e.report(103,"import")}case 209005:return be(e,t,r,n,o,a,1);default:return fe(e,t,r,n,o,a,1)}}function fe(e,t,r,n,o,a,i){switch(e.getToken()){case 86088:return Se(e,t,r,n,0);case 20572:return function(e,t,r){4096&t||e.report(92);const n=e.tokenStart;Q(e,32|t);const o=1&e.flags||1048576&e.getToken()?null:De(e,t,r,0,1,e.tokenStart);return D(e,32|t),e.finishNode({type:"ReturnStatement",argument:o},n)}(e,t,n);case 20569:return function(e,t,r,n,o){const a=e.tokenStart;Q(e,t),P(e,32|t,67174411),e.assignable=1;const i=De(e,t,n,0,1,e.tokenStart);P(e,32|t,16);const s=ye(e,t,r,n,o);let c=null;20563===e.getToken()&&(Q(e,32|t),c=ye(e,t,r,n,o));return e.finishNode({type:"IfStatement",test:i,consequent:s,alternate:c},a)}(e,t,r,n,a);case 20567:return function(e,t,r,n,o){const a=e.tokenStart;Q(e,t);const i=((2048&t)>0||(2&t)>0&&(8&t)>0)&&U(e,t,209006);P(e,32|t,67174411),r=r?.createChildScope(1);let s,c=null,l=null,u=0,p=null,d=86088===e.getToken()||241737===e.getToken()||86090===e.getToken();const{tokenStart:g}=e,f=e.getToken();if(d)241737===f?(p=tt(e,t),2240512&e.getToken()?(8673330===e.getToken()?1&t&&e.report(67):p=e.finishNode({type:"VariableDeclaration",kind:"let",declarations:ve(e,131072|t,r,n,8,32)},g),e.assignable=1):1&t?e.report(67):(d=!1,e.assignable=1,p=je(e,t,n,p,0,0,g),471156===e.getToken()&&e.report(115))):(Q(e,t),p=e.finishNode(86088===f?{type:"VariableDeclaration",kind:"var",declarations:ve(e,131072|t,r,n,4,32)}:{type:"VariableDeclaration",kind:"const",declarations:ve(e,131072|t,r,n,16,32)},g),e.assignable=1);else if(1074790417===f)i&&e.report(82);else if(2097152&~f)p=Ge(e,131072|t,n,1,0,1);else{const r=e.tokenStart;p=2162700===f?lt(e,t,void 0,n,1,0,0,2,32):at(e,t,void 0,n,1,0,0,2,32),u=e.destructible,64&u&&e.report(63),e.assignable=16&u?2:1,p=je(e,131072|t,n,p,0,0,r)}if(!(262144&~e.getToken())){if(471156===e.getToken()){2&e.assignable&&e.report(80,i?"await":"of"),O(e,p),Q(e,32|t),s=Ie(e,t,n,1,0,e.tokenStart),P(e,32|t,16);const c=xe(e,t,r,n,o);return e.finishNode({type:"ForOfStatement",left:p,right:s,body:c,await:i},a)}2&e.assignable&&e.report(80,"in"),O(e,p),Q(e,32|t),i&&e.report(82),s=De(e,t,n,0,1,e.tokenStart),P(e,32|t,16);const c=xe(e,t,r,n,o);return e.finishNode({type:"ForInStatement",body:c,left:p,right:s},a)}i&&e.report(82);d||(8&u&&1077936155!==e.getToken()&&e.report(80,"loop"),p=Re(e,131072|t,n,0,0,g,p));18===e.getToken()&&(p=Ve(e,t,n,0,g,p));P(e,32|t,1074790417),1074790417!==e.getToken()&&(c=De(e,t,n,0,1,e.tokenStart));P(e,32|t,1074790417),16!==e.getToken()&&(l=De(e,t,n,0,1,e.tokenStart));P(e,32|t,16);const k=xe(e,t,r,n,o);return e.finishNode({type:"ForStatement",init:p,test:c,update:l,body:k},a)}(e,t,r,n,a);case 20562:return function(e,t,r,n,o){const a=e.tokenStart;Q(e,32|t);const i=xe(e,t,r,n,o);P(e,t,20578),P(e,32|t,67174411);const s=De(e,t,n,0,1,e.tokenStart);return P(e,32|t,16),U(e,32|t,1074790417),e.finishNode({type:"DoWhileStatement",body:i,test:s},a)}(e,t,r,n,a);case 20578:return function(e,t,r,n,o){const a=e.tokenStart;Q(e,t),P(e,32|t,67174411);const i=De(e,t,n,0,1,e.tokenStart);P(e,32|t,16);const s=xe(e,t,r,n,o);return e.finishNode({type:"WhileStatement",test:i,body:s},a)}(e,t,r,n,a);case 86110:return function(e,t,r,n,o){const a=e.tokenStart;Q(e,t),P(e,32|t,67174411);const i=De(e,t,n,0,1,e.tokenStart);P(e,t,16),P(e,t,2162700);const s=[];let c=0;r=r?.createChildScope(8);for(;1074790415!==e.getToken();){const{tokenStart:a}=e;let i=null;const l=[];for(U(e,32|t,20556)?i=De(e,t,n,0,1,e.tokenStart):(P(e,32|t,20561),c&&e.report(89),c=1),P(e,32|t,21);20556!==e.getToken()&&1074790415!==e.getToken()&&20561!==e.getToken();)l.push(ge(e,4|t,r,n,2,{$:o}));s.push(e.finishNode({type:"SwitchCase",test:i,consequent:l},a))}return P(e,32|t,1074790415),e.finishNode({type:"SwitchStatement",discriminant:i,cases:s},a)}(e,t,r,n,a);case 1074790417:return function(e,t){const r=e.tokenStart;return Q(e,32|t),e.finishNode({type:"EmptyStatement"},r)}(e,t);case 2162700:return ke(e,t,r?.createChildScope(),n,a,e.tokenStart);case 86112:return function(e,t,r){const n=e.tokenStart;Q(e,32|t),1&e.flags&&e.report(90);const o=De(e,t,r,0,1,e.tokenStart);return D(e,32|t),e.finishNode({type:"ThrowStatement",argument:o},n)}(e,t,n);case 20555:return function(e,t,r){const n=e.tokenStart;Q(e,32|t);let o=null;if(!(1&e.flags)&&143360&e.getToken()){const{tokenValue:n}=e;o=tt(e,32|t),J(e,r,n,0)||e.report(138,n)}else 132&t||e.report(69);return D(e,32|t),e.finishNode({type:"BreakStatement",label:o},n)}(e,t,a);case 20559:return function(e,t,r){128&t||e.report(68);const n=e.tokenStart;Q(e,t);let o=null;if(!(1&e.flags)&&143360&e.getToken()){const{tokenValue:n}=e;o=tt(e,32|t),J(e,r,n,1)||e.report(138,n)}return D(e,32|t),e.finishNode({type:"ContinueStatement",label:o},n)}(e,t,a);case 20577:return function(e,t,r,n,o){const a=e.tokenStart;Q(e,32|t);const i=r?.createChildScope(16),s=ke(e,t,i,n,{$:o}),{tokenStart:c}=e,l=U(e,32|t,20557)?function(e,t,r,n,o,a){let i=null,s=r;U(e,t,67174411)&&(r=r?.createChildScope(4),i=qt(e,t,r,n,2097152&~e.getToken()?512:256,0),18===e.getToken()?e.report(86):1077936155===e.getToken()&&e.report(87),P(e,32|t,16));s=r?.createChildScope(32);const c=ke(e,t,s,n,{$:o});return e.finishNode({type:"CatchClause",param:i,body:c},a)}(e,t,r,n,o,c):null;let u=null;if(20566===e.getToken()){Q(e,32|t);const a=r?.createChildScope(4);u=ke(e,t,a,n,{$:o})}l||u||e.report(88);return e.finishNode({type:"TryStatement",block:s,handler:l,finalizer:u},a)}(e,t,r,n,a);case 20579:return function(e,t,r,n,o){const a=e.tokenStart;Q(e,t),1&t&&e.report(91);P(e,32|t,67174411);const i=De(e,t,n,0,1,e.tokenStart);P(e,32|t,16);const s=fe(e,t,r,n,2,o,0);return e.finishNode({type:"WithStatement",object:i,body:s},a)}(e,t,r,n,a);case 20560:return function(e,t){const r=e.tokenStart;return Q(e,32|t),D(e,32|t),e.finishNode({type:"DebuggerStatement"},r)}(e,t);case 209005:return be(e,t,r,n,o,a,0);case 20557:e.report(162);case 20566:e.report(163);case 86104:e.report(1&t?76:e.options.webcompat?77:78);case 86094:e.report(79);default:return function(e,t,r,n,o,a,i){const{tokenValue:s,tokenStart:c}=e,l=e.getToken();let u;if(241737===l)u=tt(e,t),1&t&&e.report(85),69271571===e.getToken()&&e.report(84);else u=Je(e,t,n,2,0,1,0,1,e.tokenStart);if(143360&l&&21===e.getToken())return me(e,t,r,n,o,a,s,u,l,i,c);u=je(e,t,n,u,0,0,c),u=Re(e,t,n,0,0,c,u),18===e.getToken()&&(u=Ve(e,t,n,0,c,u));return he(e,t,u,c)}(e,t,r,n,o,a,i)}}function ke(e,t,r,n,o,a=e.tokenStart,i="BlockStatement"){const s=[];for(P(e,32|t,2162700);1074790415!==e.getToken();)s.push(ge(e,t,r,n,2,{$:o}));return P(e,32|t,1074790415),e.finishNode({type:i,body:s},a)}function he(e,t,r,n){return D(e,32|t),e.finishNode({type:"ExpressionStatement",expression:r},n)}function me(e,t,r,n,o,a,i,s,c,l,u){G(e,t,0,c,1),function(e,t,r){let n=t;for(;n;)n["$"+r]&&e.report(136,r),n=n.$;t["$"+r]=1}(e,a,i),Q(e,32|t);const p=!l||1&t||!e.options.webcompat||86104!==e.getToken()?fe(e,t,r,n,o,a,l):nt(e,t,r?.createChildScope(),n,o,0,0,0,e.tokenStart);return e.finishNode({type:"LabeledStatement",label:s,body:p},u)}function be(e,t,r,n,o,a,i){const{tokenValue:s,tokenStart:c}=e,l=e.getToken();let u=tt(e,t);if(21===e.getToken())return me(e,t,r,n,o,a,s,u,l,1,c);const p=1&e.flags;if(!p){if(86104===e.getToken())return i||e.report(123),nt(e,t,r,n,o,1,0,1,c);if(H(t,e.getToken()))return u=mt(e,t,n,1,c),18===e.getToken()&&(u=Ve(e,t,n,0,c,u)),he(e,t,u,c)}return 67174411===e.getToken()?u=bt(e,t,n,u,1,1,0,p,c):(10===e.getToken()&&(z(e,t,l),36864&~l||(e.flags|=256),u=dt(e,2048|t,n,e.tokenValue,u,0,1,0,c)),e.assignable=1),u=je(e,t,n,u,0,0,c),u=Re(e,t,n,0,0,c,u),e.assignable=1,18===e.getToken()&&(u=Ve(e,t,n,0,c,u)),he(e,t,u,c)}function Te(e,t,r,n,o){const a=e.startIndex;1074790417!==n&&(e.assignable=2,r=je(e,t,void 0,r,0,0,o),1074790417!==e.getToken()&&(r=Re(e,t,void 0,0,0,o,r),18===e.getToken()&&(r=Ve(e,t,void 0,0,o,r))),D(e,32|t));const i={type:"ExpressionStatement",expression:r};return"Literal"===r.type&&"string"==typeof r.value&&(i.directive=e.source.slice(o.index+1,a-1)),e.finishNode(i,o)}function ye(e,t,r,n,o){const{tokenStart:a}=e;return 1&t||!e.options.webcompat||86104!==e.getToken()?fe(e,t,r,n,0,{$:o},0):nt(e,t,r?.createChildScope(),n,0,0,0,0,a)}function xe(e,t,r,n,o){return fe(e,131072^(131072|t)|128,r,n,0,{loop:1,$:o},0)}function we(e,t,r,n,o,a){const i=e.tokenStart;Q(e,t);const s=ve(e,t,r,n,o,a);return D(e,32|t),e.finishNode({type:"VariableDeclaration",kind:8&o?"let":"const",declarations:s},i)}function Se(e,t,r,n,o){const a=e.tokenStart;Q(e,t);const i=ve(e,t,r,n,4,o);return D(e,32|t),e.finishNode({type:"VariableDeclaration",kind:"var",declarations:i},a)}function ve(e,t,r,n,o,a){let i=1;const s=[Ce(e,t,r,n,o,a)];for(;U(e,t,18);)i++,s.push(Ce(e,t,r,n,o,a));return i>1&&32&a&&262144&e.getToken()&&e.report(61,I[255&e.getToken()]),s}function Ce(e,t,r,n,o,a){const{tokenStart:i}=e,s=e.getToken();let c=null;const l=qt(e,t,r,n,o,a);if(1077936155===e.getToken()){if(Q(e,32|t),c=Ie(e,t,n,1,0,e.tokenStart),(32&a||!(2097152&s))&&(471156===e.getToken()||8673330===e.getToken()&&(2097152&s||!(4&o)||1&t)))throw new N(i,e.currentLocation,60,471156===e.getToken()?"of":"in")}else(16&o||(2097152&s)>0)&&262144&~e.getToken()&&e.report(59,16&o?"const":"destructuring");return e.finishNode({type:"VariableDeclarator",id:l,init:c},i)}function qe(e,t,r){return H(t,e.getToken())||e.report(118),537079808&~e.getToken()||e.report(119),r?.addBlockName(t,e.tokenValue,8,0),tt(e,t)}function Ee(e,t,r){const{tokenStart:n}=e;if(Q(e,t),P(e,t,77932),!(134217728&~e.getToken()))throw new N(n,e.currentLocation,30,I[255&e.getToken()]);return e.finishNode({type:"ImportNamespaceSpecifier",local:qe(e,t,r)},n)}function Ne(e,t,r,n){for(Q(e,t);143360&e.getToken()||134283267===e.getToken();){let{tokenValue:o,tokenStart:a}=e;const i=e.getToken(),s=$e(e,t);let c;U(e,t,77932)?(134217728&~e.getToken()&&18!==e.getToken()?G(e,t,16,e.getToken(),0):e.report(106),o=e.tokenValue,c=tt(e,t)):"Identifier"===s.type?(G(e,t,16,i,0),c=s):e.report(25,I[108]),r?.addBlockName(t,o,8,0),n.push(e.finishNode({type:"ImportSpecifier",local:c,imported:s},a)),1074790415!==e.getToken()&&P(e,t,18)}return P(e,t,1074790415),n}function Le(e,t,r){let n=Me(e,t,e.finishNode({type:"Identifier",name:"import"},r),r);return n=je(e,t,void 0,n,0,0,r),n=Re(e,t,void 0,0,0,r,n),18===e.getToken()&&(n=Ve(e,t,void 0,0,r,n)),he(e,t,n,r)}function Ae(e,t,r,n){let o=He(e,t,r,0,n);return o=je(e,t,r,o,0,0,n),18===e.getToken()&&(o=Ve(e,t,r,0,n,o)),he(e,t,o,n)}function Ie(e,t,r,n,o,a){let i=Je(e,t,r,2,0,n,o,1,a);return i=je(e,t,r,i,o,0,a),Re(e,t,r,o,0,a,i)}function Ve(e,t,r,n,o,a){const i=[a];for(;U(e,32|t,18);)i.push(Ie(e,t,r,1,n,e.tokenStart));return e.finishNode({type:"SequenceExpression",expressions:i},o)}function De(e,t,r,n,o,a){const i=Ie(e,t,r,o,n,a);return 18===e.getToken()?Ve(e,t,r,n,a,i):i}function Re(e,t,r,n,o,a,i){const s=e.getToken();if(!(4194304&~s)){2&e.assignable&&e.report(26),(!o&&1077936155===s&&"ArrayExpression"===i.type||"ObjectExpression"===i.type)&&O(e,i),Q(e,32|t);const c=Ie(e,t,r,1,n,e.tokenStart);return e.assignable=2,e.finishNode(o?{type:"AssignmentPattern",left:i,right:c}:{type:"AssignmentExpression",left:i,operator:I[255&s],right:c},a)}return 8388608&~s||(i=Pe(e,t,r,n,a,4,s,i)),U(e,32|t,22)&&(i=Ue(e,t,r,i,a)),i}function Be(e,t,r,n,o,a,i){const s=e.getToken();Q(e,32|t);const c=Ie(e,t,r,1,n,e.tokenStart);return i=e.finishNode(o?{type:"AssignmentPattern",left:i,right:c}:{type:"AssignmentExpression",left:i,operator:I[255&s],right:c},a),e.assignable=2,i}function Ue(e,t,r,n,o){const a=Ie(e,131072^(131072|t),r,1,0,e.tokenStart);P(e,32|t,21),e.assignable=1;const i=Ie(e,t,r,1,0,e.tokenStart);return e.assignable=2,e.finishNode({type:"ConditionalExpression",test:n,consequent:a,alternate:i},o)}function Pe(e,t,r,n,o,a,i,s){const c=8673330&-((131072&t)>0);let l,u;for(e.assignable=2;8388608&e.getToken()&&(l=e.getToken(),u=3840&l,(524288&l&&268435456&i||524288&i&&268435456&l)&&e.report(165),!(u+((8391735===l)<<8)-((c===l)<<12)<=a));)Q(e,32|t),s=e.finishNode({type:524288&l||268435456&l?"LogicalExpression":"BinaryExpression",left:s,right:Pe(e,t,r,n,e.tokenStart,u,l,Ge(e,t,r,0,n,1)),operator:I[255&l]},o);return 1077936155===e.getToken()&&e.report(26),s}function Oe(e,t,r,n,o,a,i){const{tokenStart:s}=e;P(e,32|t,2162700);const c=[];if(1074790415!==e.getToken()){for(;134283267===e.getToken();){const{index:r,tokenStart:n,tokenIndex:o,tokenValue:a}=e,s=e.getToken(),l=rt(e,t);if(R(e,r,o,a)){if(t|=1,128&e.flags)throw new N(n,e.currentLocation,66);if(64&e.flags)throw new N(n,e.currentLocation,9);if(4096&e.flags)throw new N(n,e.currentLocation,15);i?.reportScopeError()}c.push(Te(e,t,l,s,n))}1&t&&(a&&(537079808&~a||e.report(119),36864&~a||e.report(40)),512&e.flags&&e.report(119),256&e.flags&&e.report(118))}for(e.flags=4928^(4928|e.flags),e.destructible=256^(256|e.destructible);1074790415!==e.getToken();)c.push(ge(e,t,r,n,4,{}));return P(e,24&o?32|t:t,1074790415),e.flags&=-4289,1077936155===e.getToken()&&e.report(26),e.finishNode({type:"BlockStatement",body:c},s)}function Ge(e,t,r,n,o,a){const i=e.tokenStart;return je(e,t,r,Je(e,t,r,2,0,n,o,a,i),o,0,i)}function je(e,t,r,n,o,a,i){if(33619968&~e.getToken()||1&e.flags){if(!(67108864&~e.getToken())){switch(t=131072^(131072|t),e.getToken()){case 67108877:{Q(e,8^(262152|t)),16&t&&130===e.getToken()&&"super"===e.tokenValue&&e.report(173),e.assignable=1;const o=Fe(e,64|t,r);n=e.finishNode({type:"MemberExpression",object:n,computed:!1,property:o,optional:!1},i);break}case 69271571:{let a=!1;2048&~e.flags||(a=!0,e.flags=2048^(2048|e.flags)),Q(e,32|t);const{tokenStart:s}=e,c=De(e,t,r,o,1,s);P(e,t,20),e.assignable=1,n=e.finishNode({type:"MemberExpression",object:n,computed:!0,property:c,optional:!1},i),a&&(e.flags|=2048);break}case 67174411:{if(!(1024&~e.flags))return e.flags=1024^(1024|e.flags),n;let a=!1;2048&~e.flags||(a=!0,e.flags=2048^(2048|e.flags));const s=et(e,t,r,o);e.assignable=2,n=e.finishNode({type:"CallExpression",callee:n,arguments:s,optional:!1},i),a&&(e.flags|=2048);break}case 67108990:Q(e,8^(262152|t)),e.flags|=2048,e.assignable=2,n=function(e,t,r,n,o){let a,i=!1;69271571!==e.getToken()&&67174411!==e.getToken()||2048&~e.flags||(i=!0,e.flags=2048^(2048|e.flags));if(69271571===e.getToken()){Q(e,32|t);const{tokenStart:i}=e,s=De(e,t,r,0,1,i);P(e,t,20),e.assignable=2,a=e.finishNode({type:"MemberExpression",object:n,computed:!0,optional:!0,property:s},o)}else if(67174411===e.getToken()){const i=et(e,t,r,0);e.assignable=2,a=e.finishNode({type:"CallExpression",callee:n,arguments:i,optional:!0},o)}else{const i=Fe(e,t,r);e.assignable=2,a=e.finishNode({type:"MemberExpression",object:n,computed:!1,optional:!0,property:i},o)}i&&(e.flags|=2048);return a}(e,t,r,n,i);break;default:2048&~e.flags||e.report(166),e.assignable=2,n=e.finishNode({type:"TaggedTemplateExpression",tag:n,quasi:67174408===e.getToken()?Ke(e,64|t,r):Ze(e,t)},i)}n=je(e,t,r,n,0,1,i)}}else n=function(e,t,r,n){2&e.assignable&&e.report(55);const o=e.getToken();return Q(e,t),e.assignable=2,e.finishNode({type:"UpdateExpression",argument:r,operator:I[255&o],prefix:!1},n)}(e,t,n,i);return 0!==a||2048&~e.flags||(e.flags=2048^(2048|e.flags),n=e.finishNode({type:"ChainExpression",expression:n},i)),n}function Fe(e,t,r){return 143360&e.getToken()||-2147483528===e.getToken()||-2147483527===e.getToken()||130===e.getToken()||e.report(160),130===e.getToken()?vt(e,t,r,0):tt(e,t)}function Je(e,t,r,n,o,a,i,s,c){if(!(143360&~e.getToken())){switch(e.getToken()){case 209006:return function(e,t,r,n,o,a){o&&(e.destructible|=128),524288&t&&e.report(177);const i=pt(e,t,r);if("ArrowFunctionExpression"===i.type||!(65536&e.getToken())){if(2048&t)throw new N(a,{index:e.startIndex,line:e.startLine,column:e.startColumn},176);if(2&t)throw new N(a,{index:e.startIndex,line:e.startLine,column:e.startColumn},110);if(8192&t&&2048&t)throw new N(a,{index:e.startIndex,line:e.startLine,column:e.startColumn},110);return i}if(8192&t)throw new N(a,{index:e.startIndex,line:e.startLine,column:e.startColumn},31);if(2048&t||2&t&&8&t){if(n)throw new N(a,{index:e.startIndex,line:e.startLine,column:e.startColumn},0);const o=Ge(e,t,r,0,0,1);return 8391735===e.getToken()&&e.report(33),e.assignable=2,e.finishNode({type:"AwaitExpression",argument:o},a)}if(2&t)throw new N(a,{index:e.startIndex,line:e.startLine,column:e.startColumn},98);return i}(e,t,r,o,i,c);case 241771:return function(e,t,r,n,o,a){if(n&&(e.destructible|=256),1024&t){Q(e,32|t),8192&t&&e.report(32),o||e.report(26),22===e.getToken()&&e.report(124);let n=null,i=!1;return 1&e.flags?8391476===e.getToken()&&e.report(30,I[255&e.getToken()]):(i=U(e,32|t,8391476),(77824&e.getToken()||i)&&(n=Ie(e,t,r,1,0,e.tokenStart))),e.assignable=2,e.finishNode({type:"YieldExpression",argument:n,delegate:i},a)}return 1&t&&e.report(97,"yield"),pt(e,t,r)}(e,t,r,i,a,c);case 209005:return function(e,t,r,n,o,a,i,s){const c=e.getToken(),l=tt(e,t),{flags:u}=e;if(!(1&u)){if(86104===e.getToken())return ot(e,t,r,1,n,s);if(H(t,e.getToken()))return o||e.report(0),36864&~e.getToken()||(e.flags|=256),mt(e,t,r,a,s)}return i||67174411!==e.getToken()?10===e.getToken()?(z(e,t,c),i&&e.report(51),36864&~c||(e.flags|=256),dt(e,t,r,e.tokenValue,l,i,a,0,s)):(e.assignable=1,l):bt(e,t,r,l,a,1,0,u,s)}(e,t,r,i,s,a,o,c)}const{tokenValue:l}=e,u=e.getToken(),p=tt(e,64|t);return 10===e.getToken()?(s||e.report(0),z(e,t,u),36864&~u||(e.flags|=256),dt(e,t,r,l,p,o,a,0,c)):(!(16&t)||32768&t||8192&t||"arguments"!==e.tokenValue||e.report(130),73==(255&u)&&(1&t&&e.report(113),24&n&&e.report(100)),e.assignable=1&t&&!(537079808&~u)?2:1,p)}if(!(134217728&~e.getToken()))return rt(e,t);switch(e.getToken()){case 33619993:case 33619994:return function(e,t,r,n,o,a){n&&e.report(56),o||e.report(0);const i=e.getToken();Q(e,32|t);const s=Ge(e,t,r,0,0,1);return 2&e.assignable&&e.report(55),e.assignable=2,e.finishNode({type:"UpdateExpression",argument:s,operator:I[255&i],prefix:!0},a)}(e,t,r,o,s,c);case 16863276:case 16842798:case 16842799:case 25233968:case 25233969:case 16863275:case 16863277:return function(e,t,r,n,o){n||e.report(0);const{tokenStart:a}=e,i=e.getToken();Q(e,32|t);const s=Ge(e,t,r,0,o,1);var c;return 8391735===e.getToken()&&e.report(33),1&t&&16863276===i&&("Identifier"===s.type?e.report(121):(c=s).property&&"PrivateIdentifier"===c.property.type&&e.report(127)),e.assignable=2,e.finishNode({type:"UnaryExpression",operator:I[255&i],argument:s,prefix:!0},a)}(e,t,r,s,i);case 86104:return ot(e,t,r,0,i,c);case 2162700:return function(e,t,r,n,o){const a=lt(e,t,void 0,r,n,o,0,2,0);64&e.destructible&&e.report(63);8&e.destructible&&e.report(62);return a}(e,t,r,a?0:1,i);case 69271571:return function(e,t,r,n,o){const a=at(e,t,void 0,r,n,o,0,2,0);64&e.destructible&&e.report(63);8&e.destructible&&e.report(62);return a}(e,t,r,a?0:1,i);case 67174411:return function(e,t,r,n,o,a,i){e.flags=128^(128|e.flags);const s=e.tokenStart;Q(e,262176|t);const c=e.createScopeIfLexical()?.createChildScope(512);if(t=131072^(131072|t),U(e,t,16))return gt(e,t,c,r,[],n,0,i);let l,u=0;e.destructible&=-385;let p=[],d=0,g=0,f=0;const k=e.tokenStart;e.assignable=1;for(;16!==e.getToken();){const{tokenStart:n}=e,i=e.getToken();if(143360&i)c?.addBlockName(t,e.tokenValue,1,0),537079808&~i?36864&~i||(f=1):g=1,l=Je(e,t,r,o,0,1,1,1,n),16===e.getToken()||18===e.getToken()?2&e.assignable&&(u|=16,g=1):(1077936155===e.getToken()?g=1:u|=16,l=je(e,t,r,l,1,0,n),16!==e.getToken()&&18!==e.getToken()&&(l=Re(e,t,r,1,0,n,l)));else{if(2097152&~i){if(14===i){l=st(e,t,c,r,16,o,a,0,1,0),16&e.destructible&&e.report(74),g=1,!d||16!==e.getToken()&&18!==e.getToken()||p.push(l),u|=8;break}if(u|=16,l=Ie(e,t,r,1,1,n),!d||16!==e.getToken()&&18!==e.getToken()||p.push(l),18===e.getToken()&&(d||(d=1,p=[l])),d){for(;U(e,32|t,18);)p.push(Ie(e,t,r,1,1,e.tokenStart));e.assignable=2,l=e.finishNode({type:"SequenceExpression",expressions:p},k)}return P(e,t,16),e.destructible=u,e.options.preserveParens?e.finishNode({type:"ParenthesizedExpression",expression:l},s):l}l=2162700===i?lt(e,262144|t,c,r,0,1,0,o,a):at(e,262144|t,c,r,0,1,0,o,a),u|=e.destructible,g=1,e.assignable=2,16!==e.getToken()&&18!==e.getToken()&&(8&u&&e.report(122),l=je(e,t,r,l,0,0,n),u|=16,16!==e.getToken()&&18!==e.getToken()&&(l=Re(e,t,r,0,0,n,l)))}if(!d||16!==e.getToken()&&18!==e.getToken()||p.push(l),!U(e,32|t,18))break;if(d||(d=1,p=[l]),16===e.getToken()){u|=8;break}}d&&(e.assignable=2,l=e.finishNode({type:"SequenceExpression",expressions:p},k));P(e,t,16),16&u&&8&u&&e.report(151);if(u|=256&e.destructible?256:128&e.destructible?128:0,10===e.getToken())return 48&u&&e.report(49),2050&t&&128&u&&e.report(31),1025&t&&256&u&&e.report(32),g&&(e.flags|=128),f&&(e.flags|=256),gt(e,t,c,r,d?p:[l],n,0,i);64&u&&e.report(63);8&u&&e.report(144);return e.destructible=256^(256|e.destructible)|u,e.options.preserveParens?e.finishNode({type:"ParenthesizedExpression",expression:l},s):l}(e,64|t,r,a,1,0,c);case 86021:case 86022:case 86023:return function(e,t){const r=e.tokenStart,n=I[255&e.getToken()],o=86023===e.getToken()?null:"true"===n;return Q(e,t),e.assignable=2,e.finishNode(e.options.raw?{type:"Literal",value:o,raw:n}:{type:"Literal",value:o},r)}(e,t);case 86111:return function(e,t){const{tokenStart:r}=e;return Q(e,t),e.assignable=2,e.finishNode({type:"ThisExpression"},r)}(e,t);case 65540:return function(e,t){const{tokenRaw:r,tokenRegExp:n,tokenValue:o,tokenStart:a}=e;Q(e,t),e.assignable=2;const i={type:"Literal",value:o,regex:n};e.options.raw&&(i.raw=r);return e.finishNode(i,a)}(e,t);case 132:case 86094:return function(e,t,r,n,o){let a=null,i=null;const s=yt(e,t,r);t=16384^(16385|t),Q(e,t),4096&e.getToken()&&20565!==e.getToken()&&(F(e,t,e.getToken())&&e.report(118),537079808&~e.getToken()||e.report(119),a=tt(e,t));let c=t;U(e,32|t,20565)?(i=Ge(e,t,r,0,n,0),c|=512):c=512^(512|c);const l=wt(e,c,t,void 0,r,2,0,n);return e.assignable=2,e.finishNode({type:"ClassExpression",id:a,superClass:i,body:l,...e.options.next?{decorators:s}:null},o)}(e,t,r,i,c);case 86109:return function(e,t){const{tokenStart:r}=e;switch(Q(e,t),e.getToken()){case 67108990:e.report(167);case 67174411:512&t||e.report(28),e.assignable=2;break;case 69271571:case 67108877:256&t||e.report(29),e.assignable=1;break;default:e.report(30,"super")}return e.finishNode({type:"Super"},r)}(e,t);case 67174409:return Ze(e,t);case 67174408:return Ke(e,t,r);case 86107:return function(e,t,r,n){const{tokenStart:o}=e,a=tt(e,32|t),{tokenStart:i}=e;if(U(e,t,67108877)){if(65536&t&&209029===e.getToken())return e.assignable=2,function(e,t,r,n){const o=tt(e,t);return e.finishNode({type:"MetaProperty",meta:r,property:o},n)}(e,t,a,o);e.report(94)}e.assignable=2,16842752&~e.getToken()||e.report(65,I[255&e.getToken()]);const s=Je(e,t,r,2,1,0,n,1,i);t=131072^(131072|t),67108990===e.getToken()&&e.report(168);const c=ht(e,t,r,s,n,i);return e.assignable=2,e.finishNode({type:"NewExpression",callee:c,arguments:67174411===e.getToken()?et(e,t,r,n):[]},o)}(e,t,r,i);case 134283388:return Ye(e,t);case 130:return vt(e,t,r,0);case 86106:return function(e,t,r,n,o,a){let i=tt(e,t);if(67108877===e.getToken())return Me(e,t,i,a);n&&e.report(142);return i=He(e,t,r,o,a),e.assignable=2,je(e,t,r,i,o,0,a)}(e,t,r,o,i,c);case 8456256:if(e.options.jsx)return Nt(e,t,r,0,e.tokenStart);default:if(H(t,e.getToken()))return pt(e,t,r);e.report(30,I[255&e.getToken()])}}function Me(e,t,r,n){2&t||e.report(169),Q(e,t);const o=e.getToken();return 209030!==o&&"meta"!==e.tokenValue?e.report(174):-2147483648&o&&e.report(175),e.assignable=2,e.finishNode({type:"MetaProperty",meta:r,property:tt(e,t)},n)}function He(e,t,r,n,o){P(e,32|t,67174411),14===e.getToken()&&e.report(143);const a=Ie(e,t,r,1,n,e.tokenStart);let i=null;if(18===e.getToken()){if(P(e,t,18),16!==e.getToken()){i=Ie(e,131072^(131072|t),r,1,n,e.tokenStart)}U(e,t,18)}const s={type:"ImportExpression",source:a,options:i};return P(e,t,16),e.finishNode(s,o)}function ze(e,t){if(!U(e,t,20579))return[];P(e,t,2162700);const r=[],n=new Set;for(;1074790415!==e.getToken();){const o=e.tokenStart,a=_e(e,t);P(e,t,21);const i=Xe(e,t),s="Literal"===a.type?a.value:a.name;n.has(s)&&e.report(145,`${s}`),n.add(s),r.push(e.finishNode({type:"ImportAttribute",key:a,value:i},o)),1074790415!==e.getToken()&&P(e,t,18)}return P(e,t,1074790415),r}function Xe(e,t){if(134283267===e.getToken())return rt(e,t);e.report(30,I[255&e.getToken()])}function _e(e,t){return 134283267===e.getToken()?rt(e,t):143360&e.getToken()?tt(e,t):void e.report(30,I[255&e.getToken()])}function $e(e,t){return 134283267===e.getToken()?(function(e,t){const r=t.length;for(let n=0;n56319||++n>=r||56320!=(64512&t.charCodeAt(n)))&&e.report(171,JSON.stringify(t.charAt(n--)))}}(e,e.tokenValue),rt(e,t)):143360&e.getToken()?tt(e,t):void e.report(30,I[255&e.getToken()])}function Ye(e,t){const{tokenRaw:r,tokenValue:n,tokenStart:o}=e;Q(e,t),e.assignable=2;const a={type:"Literal",value:n,bigint:String(n)};return e.options.raw&&(a.raw=r),e.finishNode(a,o)}function Ze(e,t){e.assignable=2;const{tokenValue:r,tokenRaw:n,tokenStart:o}=e;P(e,t,67174409);const a=[We(e,r,n,o,!0)];return e.finishNode({type:"TemplateLiteral",expressions:[],quasis:a},o)}function Ke(e,t,r){t=131072^(131072|t);const{tokenValue:n,tokenRaw:o,tokenStart:a}=e;P(e,-65&t|32,67174408);const i=[We(e,n,o,a,!1)],s=[De(e,-65&t,r,0,1,e.tokenStart)];for(1074790415!==e.getToken()&&e.report(83);67174409!==e.setToken(q(e,t),!0);){const{tokenValue:n,tokenRaw:o,tokenStart:a}=e;P(e,-65&t|32,67174408),i.push(We(e,n,o,a,!1)),s.push(De(e,t,r,0,1,e.tokenStart)),1074790415!==e.getToken()&&e.report(83)}{const{tokenValue:r,tokenRaw:n,tokenStart:o}=e;P(e,t,67174409),i.push(We(e,r,n,o,!0))}return e.finishNode({type:"TemplateLiteral",expressions:s,quasis:i},a)}function We(e,t,r,n,o){const a=e.finishNode({type:"TemplateElement",value:{cooked:t,raw:r},tail:o},n),i=o?1:2;return e.options.ranges&&(a.start+=1,a.range[0]+=1,a.end-=i,a.range[1]-=i),e.options.loc&&(a.loc.start.column+=1,a.loc.end.column-=i),a}function Qe(e,t,r){const n=e.tokenStart;P(e,32|(t=131072^(131072|t)),14);const o=Ie(e,t,r,1,0,e.tokenStart);return e.assignable=1,e.finishNode({type:"SpreadElement",argument:o},n)}function et(e,t,r,n){Q(e,32|t);const o=[];if(16===e.getToken())return Q(e,64|t),o;for(;16!==e.getToken()&&(14===e.getToken()?o.push(Qe(e,t,r)):o.push(Ie(e,t,r,1,n,e.tokenStart)),18===e.getToken())&&(Q(e,32|t),16!==e.getToken()););return P(e,64|t,16),o}function tt(e,t){const{tokenValue:r,tokenStart:n}=e,o="await"===r&&!(-2147483648&e.getToken());return Q(e,t|(o?32:0)),e.finishNode({type:"Identifier",name:r},n)}function rt(e,t){const{tokenValue:r,tokenRaw:n,tokenStart:o}=e;return 134283388===e.getToken()?Ye(e,t):(Q(e,t),e.assignable=2,e.finishNode(e.options.raw?{type:"Literal",value:r,raw:n}:{type:"Literal",value:r},o))}function nt(e,t,r,n,o,a,i,s,c){Q(e,32|t);const l=a?B(e,t,8391476):0;let u,p=null,d=r?e.createScope():void 0;if(67174411===e.getToken())1&i||e.report(39,"Function");else{const n=!(4&o)||8&t&&2&t?64|(s?1024:0)|(l?1024:0):4;j(e,t,e.getToken()),r&&(4&n?r.addVarName(t,e.tokenValue,n):r.addBlockName(t,e.tokenValue,n,o),d=d?.createChildScope(128),i&&2&i&&e.declareUnboundVariable(e.tokenValue)),u=e.getToken(),143360&e.getToken()?p=tt(e,t):e.report(30,I[255&e.getToken()])}{const e=28416;t=(t|e)^e|65536|(s?2048:0)|(l?1024:0)|(l?0:262144)}d=d?.createChildScope(256);const g=kt(e,-524289&t|8192,d,n,0,1),f=524428,k=Oe(e,36864|(t|f)^f,d?.createChildScope(64),n,8,u,d);return e.finishNode({type:"FunctionDeclaration",id:p,params:g,body:k,async:1===s,generator:1===l},c)}function ot(e,t,r,n,o,a){Q(e,32|t);const i=B(e,t,8391476),s=(n?2048:0)|(i?1024:0);let c,l=null,u=e.createScopeIfLexical();const p=552704;143360&e.getToken()&&(j(e,(t|p)^p|s,e.getToken()),u=u?.createChildScope(128),c=e.getToken(),l=tt(e,t)),t=(t|p)^p|65536|s|(i?0:262144),u=u?.createChildScope(256);const d=kt(e,-524289&t|8192,u,r,o,1),g=Oe(e,36864|-131229&t,u?.createChildScope(64),r,0,c,u);return e.assignable=2,e.finishNode({type:"FunctionExpression",id:l,params:d,body:g,async:1===n,generator:1===i},a)}function at(e,t,r,n,o,a,i,s,c){const{tokenStart:l}=e;Q(e,32|t);const u=[];let p=0;for(t=131072^(131072|t);20!==e.getToken();)if(U(e,32|t,18))u.push(null);else{let o;const{tokenStart:l,tokenValue:d}=e,g=e.getToken();if(143360&g)if(o=Je(e,t,n,s,0,1,a,1,l),1077936155===e.getToken()){2&e.assignable&&e.report(26),Q(e,32|t),r?.addVarOrBlock(t,d,s,c);const u=Ie(e,t,n,1,a,e.tokenStart);o=e.finishNode(i?{type:"AssignmentPattern",left:o,right:u}:{type:"AssignmentExpression",operator:"=",left:o,right:u},l),p|=256&e.destructible?256:128&e.destructible?128:0}else 18===e.getToken()||20===e.getToken()?(2&e.assignable?p|=16:r?.addVarOrBlock(t,d,s,c),p|=256&e.destructible?256:128&e.destructible?128:0):(p|=1&s?32:2&s?0:16,o=je(e,t,n,o,a,0,l),18!==e.getToken()&&20!==e.getToken()?(1077936155!==e.getToken()&&(p|=16),o=Re(e,t,n,a,i,l,o)):1077936155!==e.getToken()&&(p|=2&e.assignable?16:32));else 2097152&g?(o=2162700===e.getToken()?lt(e,t,r,n,0,a,i,s,c):at(e,t,r,n,0,a,i,s,c),p|=e.destructible,e.assignable=16&e.destructible?2:1,18===e.getToken()||20===e.getToken()?2&e.assignable&&(p|=16):8&e.destructible?e.report(71):(o=je(e,t,n,o,a,0,l),p=2&e.assignable?16:0,18!==e.getToken()&&20!==e.getToken()?o=Re(e,t,n,a,i,l,o):1077936155!==e.getToken()&&(p|=2&e.assignable?16:32))):14===g?(o=st(e,t,r,n,20,s,c,0,a,i),p|=e.destructible,18!==e.getToken()&&20!==e.getToken()&&e.report(30,I[255&e.getToken()])):(o=Ge(e,t,n,1,0,1),18!==e.getToken()&&20!==e.getToken()?(o=Re(e,t,n,a,i,l,o),3&s||67174411!==g||(p|=16)):2&e.assignable?p|=16:67174411===g&&(p|=1&e.assignable&&3&s?32:16));if(u.push(o),!U(e,32|t,18))break;if(20===e.getToken())break}P(e,t,20);const d=e.finishNode({type:i?"ArrayPattern":"ArrayExpression",elements:u},l);return!o&&4194304&e.getToken()?it(e,t,n,p,a,i,l,d):(e.destructible=p,d)}function it(e,t,r,n,o,a,i,s){1077936155!==e.getToken()&&e.report(26),Q(e,32|t),16&n&&e.report(26),a||O(e,s);const{tokenStart:c}=e,l=Ie(e,t,r,1,o,c);return e.destructible=72^(72|n)|(128&e.destructible?128:0)|(256&e.destructible?256:0),e.finishNode(a?{type:"AssignmentPattern",left:s,right:l}:{type:"AssignmentExpression",left:s,operator:"=",right:l},i)}function st(e,t,r,n,o,a,i,s,c,l){const{tokenStart:u}=e;Q(e,32|t);let p=null,d=0;const{tokenValue:g,tokenStart:f}=e;let k=e.getToken();if(143360&k)e.assignable=1,p=Je(e,t,n,a,0,1,c,1,f),k=e.getToken(),p=je(e,t,n,p,c,0,f),18!==e.getToken()&&e.getToken()!==o&&(2&e.assignable&&1077936155===e.getToken()&&e.report(71),d|=16,p=Re(e,t,n,c,l,f,p)),2&e.assignable?d|=16:k===o||18===k?r?.addVarOrBlock(t,g,a,i):d|=32,d|=128&e.destructible?128:0;else if(k===o)e.report(41);else{if(!(2097152&k)){d|=32,p=Ge(e,t,n,1,c,1);const{tokenStart:r}=e,a=e.getToken();return 1077936155===a?(2&e.assignable&&e.report(26),p=Re(e,t,n,c,l,r,p),d|=16):(18===a?d|=16:a!==o&&(p=Re(e,t,n,c,l,r,p)),d|=1&e.assignable?32:16),e.destructible=d,e.getToken()!==o&&18!==e.getToken()&&e.report(161),e.finishNode({type:l?"RestElement":"SpreadElement",argument:p},u)}p=2162700===e.getToken()?lt(e,t,r,n,1,c,l,a,i):at(e,t,r,n,1,c,l,a,i),k=e.getToken(),1077936155!==k&&k!==o&&18!==k?(8&e.destructible&&e.report(71),p=je(e,t,n,p,c,0,f),d|=2&e.assignable?16:0,4194304&~e.getToken()?(8388608&~e.getToken()||(p=Pe(e,t,n,1,f,4,k,p)),U(e,32|t,22)&&(p=Ue(e,t,n,p,f)),d|=2&e.assignable?16:32):(1077936155!==e.getToken()&&(d|=16),p=Re(e,t,n,c,l,f,p))):d|=1074790415===o&&1077936155!==k?16:e.destructible}if(e.getToken()!==o)if(1&a&&(d|=s?16:32),U(e,32|t,1077936155)){16&d&&e.report(26),O(e,p);const r=Ie(e,t,n,1,c,e.tokenStart);p=e.finishNode(l?{type:"AssignmentPattern",left:p,right:r}:{type:"AssignmentExpression",left:p,operator:"=",right:r},f),d=16}else d|=16;return e.destructible=d,e.finishNode({type:l?"RestElement":"SpreadElement",argument:p},u)}function ct(e,t,r,n,o,a){const i=11264|(64&n?0:16896);t=98560|((t|i)^i|(8&n?1024:0)|(16&n?2048:0)|(64&n?16384:0));let s=e.createScopeIfLexical(256);const c=function(e,t,r,n,o,a,i){P(e,t,67174411);const s=[];if(e.flags=128^(128|e.flags),16===e.getToken())return 512&o&&e.report(37,"Setter","one",""),Q(e,t),s;256&o&&e.report(37,"Getter","no","s");512&o&&14===e.getToken()&&e.report(38);t=131072^(131072|t);let c=0,l=0;for(;18!==e.getToken();){let u=null;const{tokenStart:p}=e;if(143360&e.getToken()?(1&t||(36864&~e.getToken()||(e.flags|=256),537079808&~e.getToken()||(e.flags|=512)),u=Et(e,t,r,1|o,0)):(2162700===e.getToken()?u=lt(e,t,r,n,1,i,1,a,0):69271571===e.getToken()?u=at(e,t,r,n,1,i,1,a,0):14===e.getToken()&&(u=st(e,t,r,n,16,a,0,0,i,1)),l=1,48&e.destructible&&e.report(50)),1077936155===e.getToken()){Q(e,32|t),l=1;const r=Ie(e,t,n,1,0,e.tokenStart);u=e.finishNode({type:"AssignmentPattern",left:u,right:r},p)}if(c++,s.push(u),!U(e,t,18))break;if(16===e.getToken())break}512&o&&1!==c&&e.report(37,"Setter","one","");r?.reportScopeError(),l&&(e.flags|=128);return P(e,t,16),s}(e,-524289&t|8192,s,r,n,1,o);s=s?.createChildScope(64);const l=Oe(e,36864|-655373&t,s,r,0,void 0,s?.parent);return e.finishNode({type:"FunctionExpression",params:c,body:l,async:(16&n)>0,generator:(8&n)>0,id:null},a)}function lt(e,t,r,n,o,a,i,s,c){const{tokenStart:l}=e;Q(e,t);const u=[];let p=0,d=0;for(t=131072^(131072|t);1074790415!==e.getToken();){const{tokenValue:o,tokenStart:l}=e,g=e.getToken();if(14===g)u.push(st(e,t,r,n,1074790415,s,c,0,a,i));else{let f,k=0,h=null;if(143360&e.getToken()||-2147483528===e.getToken()||-2147483527===e.getToken())if(-2147483527===e.getToken()&&(p|=16),h=tt(e,t),18===e.getToken()||1074790415===e.getToken()||1077936155===e.getToken())if(k|=4,1&t&&!(537079808&~g)?p|=16:G(e,t,s,g,0),r?.addVarOrBlock(t,o,s,c),U(e,32|t,1077936155)){p|=8;const r=Ie(e,t,n,1,a,e.tokenStart);p|=256&e.destructible?256:128&e.destructible?128:0,f=e.finishNode({type:"AssignmentPattern",left:e.options.uniqueKeyInPattern?Object.assign({},h):h,right:r},l)}else p|=(209006===g?128:0)|(-2147483528===g?16:0),f=e.options.uniqueKeyInPattern?Object.assign({},h):h;else if(U(e,32|t,21)){const{tokenStart:l}=e;if("__proto__"===o&&d++,143360&e.getToken()){const o=e.getToken(),u=e.tokenValue;f=Je(e,t,n,s,0,1,a,1,l);const d=e.getToken();f=je(e,t,n,f,a,0,l),18===e.getToken()||1074790415===e.getToken()?1077936155===d||1074790415===d||18===d?(p|=128&e.destructible?128:0,2&e.assignable?p|=16:143360&~o||r?.addVarOrBlock(t,u,s,c)):p|=1&e.assignable?32:16:4194304&~e.getToken()?(p|=16,8388608&~e.getToken()||(f=Pe(e,t,n,1,l,4,d,f)),U(e,32|t,22)&&(f=Ue(e,t,n,f,l))):(2&e.assignable?p|=16:1077936155!==d?p|=32:r?.addVarOrBlock(t,u,s,c),f=Re(e,t,n,a,i,l,f))}else 2097152&~e.getToken()?(f=Ge(e,t,n,1,a,1),p|=1&e.assignable?32:16,18===e.getToken()||1074790415===e.getToken()?2&e.assignable&&(p|=16):(f=je(e,t,n,f,a,0,l),p=2&e.assignable?16:0,18!==e.getToken()&&1074790415!==g&&(1077936155!==e.getToken()&&(p|=16),f=Re(e,t,n,a,i,l,f)))):(f=69271571===e.getToken()?at(e,t,r,n,0,a,i,s,c):lt(e,t,r,n,0,a,i,s,c),p=e.destructible,e.assignable=16&p?2:1,18===e.getToken()||1074790415===e.getToken()?2&e.assignable&&(p|=16):8&e.destructible?e.report(71):(f=je(e,t,n,f,a,0,l),p=2&e.assignable?16:0,4194304&~e.getToken()?(8388608&~e.getToken()||(f=Pe(e,t,n,1,l,4,g,f)),U(e,32|t,22)&&(f=Ue(e,t,n,f,l)),p|=2&e.assignable?16:32):f=Be(e,t,n,a,i,l,f)))}else 69271571===e.getToken()?(p|=16,209005===g&&(k|=16),k|=2|(209008===g?256:209009===g?512:1),h=ut(e,t,n,a),p|=e.assignable,f=ct(e,t,n,k,a,e.tokenStart)):143360&e.getToken()?(p|=16,-2147483528===g&&e.report(95),209005===g?(1&e.flags&&e.report(132),k|=17):209008===g?k|=256:209009===g?k|=512:e.report(0),h=tt(e,t),f=ct(e,t,n,k,a,e.tokenStart)):67174411===e.getToken()?(p|=16,k|=1,f=ct(e,t,n,k,a,e.tokenStart)):8391476===e.getToken()?(p|=16,209008===g?e.report(42):209009===g?e.report(43):209005!==g&&e.report(30,I[52]),Q(e,t),k|=9|(209005===g?16:0),143360&e.getToken()?h=tt(e,t):134217728&~e.getToken()?69271571===e.getToken()?(k|=2,h=ut(e,t,n,a),p|=e.assignable):e.report(30,I[255&e.getToken()]):h=rt(e,t),f=ct(e,t,n,k,a,e.tokenStart)):134217728&~e.getToken()?e.report(133):(209005===g&&(k|=16),k|=209008===g?256:209009===g?512:1,p|=16,h=rt(e,t),f=ct(e,t,n,k,a,e.tokenStart));else if(134217728&~e.getToken())if(69271571===e.getToken())if(h=ut(e,t,n,a),p|=256&e.destructible?256:0,k|=2,21===e.getToken()){Q(e,32|t);const{tokenStart:o,tokenValue:l}=e,u=e.getToken();if(143360&e.getToken()){f=Je(e,t,n,s,0,1,a,1,o);const d=e.getToken();f=je(e,t,n,f,a,0,o),4194304&~e.getToken()?18===e.getToken()||1074790415===e.getToken()?1077936155===d||1074790415===d||18===d?2&e.assignable?p|=16:143360&~u||r?.addVarOrBlock(t,l,s,c):p|=1&e.assignable?32:16:(p|=16,f=Re(e,t,n,a,i,o,f)):(p|=2&e.assignable?16:1077936155===d?0:32,f=Be(e,t,n,a,i,o,f))}else 2097152&~e.getToken()?(f=Ge(e,t,n,1,0,1),p|=1&e.assignable?32:16,18===e.getToken()||1074790415===e.getToken()?2&e.assignable&&(p|=16):(f=je(e,t,n,f,a,0,o),p=1&e.assignable?0:16,18!==e.getToken()&&1074790415!==e.getToken()&&(1077936155!==e.getToken()&&(p|=16),f=Re(e,t,n,a,i,o,f)))):(f=69271571===e.getToken()?at(e,t,r,n,0,a,i,s,c):lt(e,t,r,n,0,a,i,s,c),p=e.destructible,e.assignable=16&p?2:1,18===e.getToken()||1074790415===e.getToken()?2&e.assignable&&(p|=16):8&p?e.report(62):(f=je(e,t,n,f,a,0,o),p=2&e.assignable?16|p:0,4194304&~e.getToken()?(8388608&~e.getToken()||(f=Pe(e,t,n,1,o,4,g,f)),U(e,32|t,22)&&(f=Ue(e,t,n,f,o)),p|=2&e.assignable?16:32):(1077936155!==e.getToken()&&(p|=16),f=Be(e,t,n,a,i,o,f))))}else 67174411===e.getToken()?(k|=1,f=ct(e,t,n,k,a,e.tokenStart),p=16):e.report(44);else if(8391476===g)if(P(e,32|t,8391476),k|=8,143360&e.getToken()){const r=e.getToken();if(h=tt(e,t),k|=1,67174411!==e.getToken())throw new N(e.tokenStart,e.currentLocation,209005===r?46:209008===r||209009===e.getToken()?45:47,I[255&r]);p|=16,f=ct(e,t,n,k,a,e.tokenStart)}else 134217728&~e.getToken()?69271571===e.getToken()?(p|=16,k|=3,h=ut(e,t,n,a),f=ct(e,t,n,k,a,e.tokenStart)):e.report(126):(p|=16,h=rt(e,t),k|=1,f=ct(e,t,n,k,a,e.tokenStart));else e.report(30,I[255&g]);else if(h=rt(e,t),21===e.getToken()){P(e,32|t,21);const{tokenStart:l}=e;if("__proto__"===o&&d++,143360&e.getToken()){f=Je(e,t,n,s,0,1,a,1,l);const{tokenValue:o}=e,u=e.getToken();f=je(e,t,n,f,a,0,l),18===e.getToken()||1074790415===e.getToken()?1077936155===u||1074790415===u||18===u?2&e.assignable?p|=16:r?.addVarOrBlock(t,o,s,c):p|=1&e.assignable?32:16:1077936155===e.getToken()?(2&e.assignable&&(p|=16),f=Re(e,t,n,a,i,l,f)):(p|=16,f=Re(e,t,n,a,i,l,f))}else 2097152&~e.getToken()?(f=Ge(e,t,n,1,0,1),p|=1&e.assignable?32:16,18===e.getToken()||1074790415===e.getToken()?2&e.assignable&&(p|=16):(f=je(e,t,n,f,a,0,l),p=1&e.assignable?0:16,18!==e.getToken()&&1074790415!==e.getToken()&&(1077936155!==e.getToken()&&(p|=16),f=Re(e,t,n,a,i,l,f)))):(f=69271571===e.getToken()?at(e,t,r,n,0,a,i,s,c):lt(e,t,r,n,0,a,i,s,c),p=e.destructible,e.assignable=16&p?2:1,18===e.getToken()||1074790415===e.getToken()?2&e.assignable&&(p|=16):8&~e.destructible&&(f=je(e,t,n,f,a,0,l),p=2&e.assignable?16:0,4194304&~e.getToken()?(8388608&~e.getToken()||(f=Pe(e,t,n,1,l,4,g,f)),U(e,32|t,22)&&(f=Ue(e,t,n,f,l)),p|=2&e.assignable?16:32):f=Be(e,t,n,a,i,l,f)))}else 67174411===e.getToken()?(k|=1,f=ct(e,t,n,k,a,e.tokenStart),p=16|e.assignable):e.report(134);p|=128&e.destructible?128:0,e.destructible=p,u.push(e.finishNode({type:"Property",key:h,value:f,kind:768&k?512&k?"set":"get":"init",computed:(2&k)>0,method:(1&k)>0,shorthand:(4&k)>0},l))}if(p|=e.destructible,18!==e.getToken())break;Q(e,t)}P(e,t,1074790415),d>1&&(p|=64);const g=e.finishNode({type:i?"ObjectPattern":"ObjectExpression",properties:u},l);return!o&&4194304&e.getToken()?it(e,t,n,p,a,i,l,g):(e.destructible=p,g)}function ut(e,t,r,n){Q(e,32|t);const o=Ie(e,131072^(131072|t),r,1,n,e.tokenStart);return P(e,t,20),o}function pt(e,t,r){const{tokenStart:n}=e,{tokenValue:o}=e;let a=0,i=0;537079808&~e.getToken()?36864&~e.getToken()||(i=1):a=1;const s=tt(e,t);if(e.assignable=1,10===e.getToken()){const c=e.options.lexical?ce(e,t,o):void 0;return a&&(e.flags|=128),i&&(e.flags|=256),ft(e,t,c,r,[s],0,n)}return s}function dt(e,t,r,n,o,a,i,s,c){i||e.report(57),a&&e.report(51),e.flags&=-129;return ft(e,t,e.options.lexical?ce(e,t,n):void 0,r,[o],s,c)}function gt(e,t,r,n,o,a,i,s){a||e.report(57);for(let t=0;t0&&"constructor"===e.tokenValue&&e.report(109),1074790415===e.getToken()&&e.report(108),U(e,t,1074790417)?i.length>0&&e.report(120):d.push(St(e,t,n,l,r,a,i,0,s,i.length>0?o:e.tokenStart))}return P(e,8&i?32|t:t,1074790415),l?.validatePrivateIdentifierRefs(),e.flags=-33&e.flags|p,e.finishNode({type:"ClassBody",body:d},c)}function St(e,t,r,n,o,a,i,s,c,l){let u=s?32:0,p=null;const d=e.getToken();if(176128&d||-2147483528===d)switch(p=tt(e,t),d){case 36970:if(!s&&67174411!==e.getToken()&&1048576&~e.getToken()&&1077936155!==e.getToken())return St(e,t,r,n,o,a,i,1,c,l);break;case 209005:if(67174411!==e.getToken()&&!(1&e.flags)){if(!(1073741824&~e.getToken()))return Ct(e,t,n,p,u,i,l);u|=16|(B(e,t,8391476)?8:0)}break;case 209008:if(67174411!==e.getToken()){if(!(1073741824&~e.getToken()))return Ct(e,t,n,p,u,i,l);u|=256}break;case 209009:if(67174411!==e.getToken()){if(!(1073741824&~e.getToken()))return Ct(e,t,n,p,u,i,l);u|=512}break;case 12402:if(67174411!==e.getToken()&&!(1&e.flags)){if(!(1073741824&~e.getToken()))return Ct(e,t,n,p,u,i,l);e.options.next&&(u|=1024)}}else if(69271571===d)u|=2,p=ut(e,o,n,c);else if(134217728&~d)if(8391476===d)u|=8,Q(e,t);else if(130===e.getToken())u|=8192,p=vt(e,16|t,n,768);else if(1073741824&~e.getToken()){if(s&&2162700===d)return function(e,t,r,n,o){return r=r?.createChildScope(),ke(e,t=592128|5764^(5764|t),r,n,{},o,"StaticBlock")}(e,16|t,r,n,l);-2147483527===d?(p=tt(e,t),67174411!==e.getToken()&&e.report(30,I[255&e.getToken()])):e.report(30,I[255&e.getToken()])}else u|=128;else p=rt(e,t);if(1816&u&&(143360&e.getToken()||-2147483528===e.getToken()||-2147483527===e.getToken()?p=tt(e,t):134217728&~e.getToken()?69271571===e.getToken()?(u|=2,p=ut(e,t,n,0)):130===e.getToken()?(u|=8192,p=vt(e,t,n,u)):e.report(135):p=rt(e,t)),2&u||("constructor"===e.tokenValue?(1073741824&~e.getToken()?32&u||67174411!==e.getToken()||(920&u?e.report(53,"accessor"):512&t||(32&e.flags?e.report(54):e.flags|=32)):e.report(129),u|=64):!(8192&u)&&32&u&&"prototype"===e.tokenValue&&e.report(52)),1024&u||67174411!==e.getToken()&&!(768&u))return Ct(e,t,n,p,u,i,l);const g=ct(e,16|t,n,u,c,e.tokenStart);return e.finishNode({type:"MethodDefinition",kind:!(32&u)&&64&u?"constructor":256&u?"get":512&u?"set":"method",static:(32&u)>0,computed:(2&u)>0,key:p,value:g,...e.options.next?{decorators:i}:null},l)}function vt(e,t,r,n){const{tokenStart:o}=e;Q(e,t);const{tokenValue:a}=e;return"constructor"===a&&e.report(128),e.options.lexical&&(r||e.report(4,a),n?r.addPrivateIdentifier(a,n):r.addPrivateIdentifierRef(a)),Q(e,t),e.finishNode({type:"PrivateIdentifier",name:a},o)}function Ct(e,t,r,n,o,a,i){let s=null;if(8&o&&e.report(0),1077936155===e.getToken()){Q(e,32|t);const{tokenStart:n}=e;537079927===e.getToken()&&e.report(119);const a=11264|(64&o?0:16896);s=Je(e,16|(t=65792|((t|a)^a|(8&o?1024:0)|(16&o?2048:0)|(64&o?16384:0))),r,2,0,1,0,1,n),!(1073741824&~e.getToken())&&4194304&~e.getToken()||(s=je(e,16|t,r,s,0,0,n),s=Re(e,16|t,r,0,0,n,s))}return D(e,t),e.finishNode({type:1024&o?"AccessorProperty":"PropertyDefinition",key:n,value:s,static:(32&o)>0,computed:(2&o)>0,...e.options.next?{decorators:a}:null},i)}function qt(e,t,r,n,o,a){if(143360&e.getToken()||!(1&t)&&-2147483527===e.getToken())return Et(e,t,r,o,a);2097152&~e.getToken()&&e.report(30,I[255&e.getToken()]);const i=69271571===e.getToken()?at(e,t,r,n,1,0,1,o,a):lt(e,t,r,n,1,0,1,o,a);return 16&e.destructible&&e.report(50),32&e.destructible&&e.report(50),i}function Et(e,t,r,n,o){const a=e.getToken();1&t&&(537079808&~a?36864&~a&&-2147483527!==a||e.report(118):e.report(119)),20480&~a||e.report(102),241771===a&&(1024&t&&e.report(32),2&t&&e.report(111)),73==(255&a)&&24&n&&e.report(100),209006===a&&(2048&t&&e.report(176),2&t&&e.report(110));const{tokenValue:i,tokenStart:s}=e;return Q(e,t),r?.addVarOrBlock(t,i,n,o),e.finishNode({type:"Identifier",name:i},s)}function Nt(e,t,r,n,o){if(n||P(e,t,8456256),8390721===e.getToken()){const a=function(e,t){return ae(e),e.finishNode({type:"JSXOpeningFragment"},t)}(e,o),[i,s]=function(e,t,r,n){const o=[];for(;;){const a=At(e,t,r,n);if("JSXClosingFragment"===a.type)return[o,a];o.push(a)}}(e,t,r,n);return e.finishNode({type:"JSXFragment",openingFragment:a,children:i,closingFragment:s},o)}8457014===e.getToken()&&e.report(30,I[255&e.getToken()]);let a=null,i=[];const s=function(e,t,r,n,o){143360&~e.getToken()&&4096&~e.getToken()&&e.report(0);const a=Vt(e,t),i=function(e,t,r){const n=[];for(;8457014!==e.getToken()&&8390721!==e.getToken()&&1048576!==e.getToken();)n.push(Rt(e,t,r));return n}(e,t,r),s=8457014===e.getToken();s&&P(e,t,8457014);8390721!==e.getToken()&&e.report(25,I[65]);n||!s?ae(e):Q(e,t);return e.finishNode({type:"JSXOpeningElement",name:a,attributes:i,selfClosing:s},o)}(e,t,r,n,o);if(!s.selfClosing){[i,a]=function(e,t,r,n){const o=[];for(;;){const a=Lt(e,t,r,n);if("JSXClosingElement"===a.type)return[o,a];o.push(a)}}(e,t,r,n);const o=M(a.name);M(s.name)!==o&&e.report(155,o)}return e.finishNode({type:"JSXElement",children:i,openingElement:s,closingElement:a},o)}function Lt(e,t,r,n){if(137===e.getToken())return It(e,t);if(2162700===e.getToken())return Ut(e,t,r,1,0);if(8456256===e.getToken()){const{tokenStart:o}=e;return Q(e,t),8457014===e.getToken()?function(e,t,r,n){P(e,t,8457014);const o=Vt(e,t);return 8390721!==e.getToken()&&e.report(25,I[65]),r?ae(e):Q(e,t),e.finishNode({type:"JSXClosingElement",name:o},n)}(e,t,n,o):Nt(e,t,r,1,o)}e.report(0)}function At(e,t,r,n){if(137===e.getToken())return It(e,t);if(2162700===e.getToken())return Ut(e,t,r,1,0);if(8456256===e.getToken()){const{tokenStart:o}=e;return Q(e,t),8457014===e.getToken()?function(e,t,r,n){return P(e,t,8457014),8390721!==e.getToken()&&e.report(25,I[65]),r?ae(e):Q(e,t),e.finishNode({type:"JSXClosingFragment"},n)}(e,t,n,o):Nt(e,t,r,1,o)}e.report(0)}function It(e,t){const r=e.tokenStart;Q(e,t);const n={type:"JSXText",value:e.tokenValue};return e.options.raw&&(n.raw=e.tokenRaw),e.finishNode(n,r)}function Vt(e,t){const{tokenStart:r}=e;ie(e);let n=Pt(e,t);if(21===e.getToken())return Bt(e,t,n,r);for(;U(e,t,67108877);)ie(e),n=Dt(e,t,n,r);return n}function Dt(e,t,r,n){const o=Pt(e,t);return e.finishNode({type:"JSXMemberExpression",object:r,property:o},n)}function Rt(e,t,r){const{tokenStart:n}=e;if(2162700===e.getToken())return function(e,t,r){const n=e.tokenStart;Q(e,t),P(e,t,14);const o=Ie(e,t,r,1,0,e.tokenStart);return P(e,t,1074790415),e.finishNode({type:"JSXSpreadAttribute",argument:o},n)}(e,t,r);ie(e);let o=null,a=Pt(e,t);if(21===e.getToken()&&(a=Bt(e,t,a,n)),1077936155===e.getToken()){switch(oe(e,t)){case 134283267:o=rt(e,t);break;case 8456256:o=Nt(e,t,r,0,e.tokenStart);break;case 2162700:o=Ut(e,t,r,0,1);break;default:e.report(154)}}return e.finishNode({type:"JSXAttribute",value:o,name:a},n)}function Bt(e,t,r,n){P(e,t,21);const o=Pt(e,t);return e.finishNode({type:"JSXNamespacedName",namespace:r,name:o},n)}function Ut(e,t,r,n,o){const{tokenStart:a}=e;Q(e,32|t);const{tokenStart:i}=e;if(14===e.getToken())return function(e,t,r,n){P(e,t,14);const o=Ie(e,t,r,1,0,e.tokenStart);return P(e,t,1074790415),e.finishNode({type:"JSXSpreadChild",expression:o},n)}(e,t,r,a);let s=null;return 1074790415===e.getToken()?(o&&e.report(157),s=function(e,t){return e.finishNode({type:"JSXEmptyExpression"},t,e.tokenStart)}(e,{index:e.startIndex,line:e.startLine,column:e.startColumn})):s=Ie(e,t,r,1,0,i),1074790415!==e.getToken()&&e.report(25,I[15]),n?ae(e):Q(e,t),e.finishNode({type:"JSXExpressionContainer",expression:s},a)}function Pt(e,t){const r=e.tokenStart;143360&e.getToken()||e.report(30,I[255&e.getToken()]);const{tokenValue:n}=e;return Q(e,t),e.finishNode({type:"JSXIdentifier",name:n},r)}e.parse=function(e,t){return pe(e,t)},e.parseModule=function(e,t){return pe(e,t,3)},e.parseScript=function(e,t){return pe(e,t)},e.version="6.1.4"})); diff --git a/node_modules/meriyah/dist/types/chars.d.ts b/node_modules/meriyah/dist/types/chars.d.ts new file mode 100644 index 0000000..f39672a --- /dev/null +++ b/node_modules/meriyah/dist/types/chars.d.ts @@ -0,0 +1,135 @@ +export declare const enum Chars { + Null = 0, + Backspace = 8, + Tab = 9, + LineFeed = 10, + VerticalTab = 11, + FormFeed = 12, + CarriageReturn = 13, + Space = 32, + Exclamation = 33, + DoubleQuote = 34, + Hash = 35, + Dollar = 36, + Percent = 37, + Ampersand = 38, + SingleQuote = 39, + LeftParen = 40, + RightParen = 41, + Asterisk = 42, + Plus = 43, + Comma = 44, + Hyphen = 45, + Period = 46, + Slash = 47, + Zero = 48, + One = 49, + Two = 50, + Three = 51, + Four = 52, + Five = 53, + Six = 54, + Seven = 55, + Eight = 56, + Nine = 57, + Colon = 58, + Semicolon = 59, + LessThan = 60, + EqualSign = 61, + GreaterThan = 62, + QuestionMark = 63, + UpperA = 65, + UpperB = 66, + UpperC = 67, + UpperD = 68, + UpperE = 69, + UpperF = 70, + UpperG = 71, + UpperH = 72, + UpperI = 73, + UpperJ = 74, + UpperK = 75, + UpperL = 76, + UpperM = 77, + UpperN = 78, + UpperO = 79, + UpperP = 80, + UpperQ = 81, + UpperR = 82, + UpperS = 83, + UpperT = 84, + UpperU = 85, + UpperV = 86, + UpperW = 87, + UpperX = 88, + UpperY = 89, + UpperZ = 90, + LeftBracket = 91, + Backslash = 92, + RightBracket = 93, + Caret = 94, + Underscore = 95, + Backtick = 96, + LowerA = 97, + LowerB = 98, + LowerC = 99, + LowerD = 100, + LowerE = 101, + LowerF = 102, + LowerG = 103, + LowerH = 104, + LowerI = 105, + LowerJ = 106, + LowerK = 107, + LowerL = 108, + LowerM = 109, + LowerN = 110, + LowerO = 111, + LowerP = 112, + LowerQ = 113, + LowerR = 114, + LowerS = 115, + LowerT = 116, + LowerU = 117, + LowerV = 118, + LowerW = 119, + LowerX = 120, + LowerY = 121, + LowerZ = 122, + LeftBrace = 123, + VerticalBar = 124, + RightBrace = 125, + Tilde = 126, + Delete = 127, + NextLine = 133, + NonBreakingSpace = 160, + Ogham = 5760, + EnQuad = 8192, + EmQuad = 8193, + EnSpace = 8194, + EmSpace = 8195, + ThreePerEmSpace = 8196, + FourPerEmSpace = 8197, + SixPerEmSpace = 8198, + FigureSpace = 8199, + PunctuationSpace = 8200, + ThinSpace = 8201, + HairSpace = 8202, + ZeroWidthSpace = 8203, + ZeroWidthJoiner = 8204, + ZeroWidthNonJoiner = 8205, + LineSeparator = 8232, + ParagraphSeparator = 8233, + NarrowNoBreakSpace = 8239, + MathematicalSpace = 8287, + IdeographicSpace = 12288, + ZeroWidthNoBreakSpace = 65279, + ByteOrderMark = 65519, + NonBMPMax = 1114111, + LeadSurrogateMin = 55296, + LeadSurrogateMax = 56319, + TrailSurrogateMin = 56320, + TrailSurrogateMax = 57343, + UTF16Max = 65535, + NonBMPMin = 65536 +} diff --git a/node_modules/meriyah/dist/types/common.d.ts b/node_modules/meriyah/dist/types/common.d.ts new file mode 100644 index 0000000..4ac5790 --- /dev/null +++ b/node_modules/meriyah/dist/types/common.d.ts @@ -0,0 +1,130 @@ +import { Token } from './token'; +import { type Parser } from './parser/parser'; +export declare const enum Context { + None = 0, + Strict = 1, + Module = 2, + InSwitch = 4, + InGlobal = 8, + InClass = 16, + AllowRegExp = 32, + TaggedTemplate = 64, + InIteration = 128, + SuperProperty = 256, + SuperCall = 512, + InYieldContext = 1024, + InAwaitContext = 2048, + InReturnContext = 4096, + InArgumentList = 8192, + InConstructor = 16384, + InMethodOrFunction = 32768, + AllowNewTarget = 65536, + DisallowIn = 131072, + AllowEscapedKeyword = 262144, + InStaticBlock = 524288 +} +export declare const enum PropertyKind { + None = 0, + Method = 1, + Computed = 2, + Shorthand = 4, + Generator = 8, + Async = 16, + Static = 32, + Constructor = 64, + ClassField = 128, + Getter = 256, + Setter = 512, + Accessor = 1024, + Extends = 2048, + Literal = 4096, + PrivateField = 8192, + GetSet = 768 +} +export declare const enum BindingKind { + None = 0, + ArgumentList = 1, + Empty = 2, + Variable = 4, + Let = 8, + Const = 16, + Class = 32, + FunctionLexical = 64, + FunctionStatement = 128, + CatchPattern = 256, + CatchIdentifier = 512, + Async = 1024, + Generator = 1024, + AsyncFunctionLexical = 1088, + GeneratorFunctionLexical = 1088, + AsyncGeneratorFunctionLexical = 1088, + CatchIdentifierOrPattern = 768, + LexicalOrFunction = 68, + LexicalBinding = 248 +} +export declare const enum Origin { + None = 0, + Statement = 1, + BlockStatement = 2, + TopLevel = 4, + Declaration = 8, + Arrow = 16, + ForStatement = 32, + Export = 64 +} +export declare const enum AssignmentKind { + None = 0, + Assignable = 1, + CannotAssign = 2 +} +export declare const enum DestructuringKind { + None = 0, + HasToDestruct = 8, + CannotDestruct = 16, + Assignable = 32, + SeenProto = 64, + Await = 128, + Yield = 256 +} +export declare const enum Flags { + None = 0, + NewLine = 1, + HasConstructor = 32, + Octal = 64, + NonSimpleParameterList = 128, + HasStrictReserved = 256, + StrictEvalArguments = 512, + DisallowCall = 1024, + HasOptionalChaining = 2048, + EightAndNine = 4096 +} +export declare const enum HoistedClassFlags { + None = 0, + Hoisted = 1, + Export = 2 +} +export declare const enum HoistedFunctionFlags { + None = 0, + Hoisted = 1, + Export = 2 +} +export declare function matchOrInsertSemicolon(parser: Parser, context: Context): void; +export declare function isValidStrictMode(parser: Parser, index: number, tokenIndex: number, tokenValue: string): 0 | 1; +export declare function optionalBit(parser: Parser, context: Context, t: Token): 0 | 1; +export declare function consumeOpt(parser: Parser, context: Context, t: Token): boolean; +export declare function consume(parser: Parser, context: Context, t: Token): void; +export declare function reinterpretToPattern(parser: Parser, node: any): void; +export declare function validateBindingIdentifier(parser: Parser, context: Context, kind: BindingKind, t: Token, skipEvalArgCheck: 0 | 1): void; +export declare function validateFunctionName(parser: Parser, context: Context, t: Token): void; +export declare function isStrictReservedWord(parser: Parser, context: Context, t: Token): boolean; +export declare function isPropertyWithPrivateFieldKey(expr: any): boolean; +export declare function isValidLabel(parser: Parser, labels: any, name: string, isIterationStatement: 0 | 1): 0 | 1; +export declare function validateAndDeclareLabel(parser: Parser, labels: any, name: string): void; +export declare function isValidIdentifier(context: Context, t: Token): boolean; +export declare function classifyIdentifier(parser: Parser, context: Context, t: Token): any; +export type Location = { + readonly index: number; + readonly line: number; + readonly column: number; +}; +export declare function getOwnProperty(object: Record, key: string | number): T | undefined; diff --git a/node_modules/meriyah/dist/types/errors.d.ts b/node_modules/meriyah/dist/types/errors.d.ts new file mode 100644 index 0000000..dcf04c6 --- /dev/null +++ b/node_modules/meriyah/dist/types/errors.d.ts @@ -0,0 +1,190 @@ +import { type _Node, type SourceLocation } from './estree'; +import { type Location } from './common'; +export declare const enum Errors { + Unexpected = 0, + StrictOctalEscape = 1, + TemplateOctalLiteral = 2, + TemplateEightAndNine = 3, + InvalidPrivateIdentifier = 4, + InvalidUnicodeEscapeSequence = 5, + InvalidCodePoint = 6, + InvalidHexEscapeSequence = 7, + StrictDecimalWithLeadingZero = 8, + StrictOctalLiteral = 9, + ExpectedNumberInRadix = 10, + MissingExponent = 11, + InvalidBigInt = 12, + IDStartAfterNumber = 13, + InvalidEightAndNine = 14, + StrictEightAndNine = 15, + UnterminatedString = 16, + UnterminatedTemplate = 17, + UnterminatedComment = 18, + InvalidDynamicUnicode = 19, + IllegalCharacter = 20, + MissingHexDigits = 21, + InvalidImplicitOctal = 22, + InvalidStringLT = 23, + InvalidEscapeIdentifier = 24, + ExpectedToken = 25, + CantAssignTo = 26, + InvalidLHSAsyncArrow = 27, + SuperNoConstructor = 28, + InvalidSuperProperty = 29, + UnexpectedToken = 30, + AwaitInParameter = 31, + YieldInParameter = 32, + InvalidExponentiationLHS = 33, + UnterminatedRegExp = 34, + UnexpectedTokenRegExpFlag = 35, + DuplicateRegExpFlag = 36, + AccessorWrongArgs = 37, + BadSetterRestParameter = 38, + DeclNoName = 39, + StrictFunctionName = 40, + RestMissingArg = 41, + InvalidGeneratorGetter = 42, + InvalidGeneratorSetter = 43, + InvalidComputedPropName = 44, + InvalidGetSetGenerator = 45, + InvalidAsyncGetter = 46, + InvalidGenMethodShorthand = 47, + InvalidLineBreak = 48, + InvalidArrowDestructLHS = 49, + InvalidBindingDestruct = 50, + InvalidAsyncArrow = 51, + StaticPrototype = 52, + InvalidConstructor = 53, + DuplicateConstructor = 54, + InvalidIncDecTarget = 55, + InvalidIncDecNew = 56, + InvalidAssignmentTarget = 57, + InvalidRestTrailing = 58, + DeclarationMissingInitializer = 59, + ForInOfLoopInitializer = 60, + ForInOfLoopMultiBindings = 61, + InvalidShorthandPropInit = 62, + DuplicateProto = 63, + InvalidLetBoundName = 64, + InvalidNewUnary = 65, + IllegalUseStrict = 66, + DisallowedLetInStrict = 67, + IllegalContinue = 68, + IllegalBreak = 69, + InvalidLetBracket = 70, + InvalidDestructuringTarget = 71, + RestDefaultInitializer = 72, + InvalidRestNotLast = 73, + InvalidRestArg = 74, + InvalidRestDefault = 75, + StrictFunction = 76, + SloppyFunction = 77, + WebCompatFunction = 78, + ClassForbiddenAsStatement = 79, + CantAssignToInOfForLoop = 80, + InvalidAssignmentInOfForLoop = 81, + InvalidForAwait = 82, + InvalidTemplateContinuation = 83, + RestrictedLetProduction = 84, + UnexpectedLetStrictReserved = 85, + InvalidCatchParams = 86, + InvalidCatchParamDefault = 87, + NoCatchOrFinally = 88, + MultipleDefaultsInSwitch = 89, + NewlineAfterThrow = 90, + StrictWith = 91, + IllegalReturn = 92, + InvalidForLHSBinding = 93, + InvalidNewTarget = 94, + InvalidEscapedKeyword = 95, + MissingPrivateIdentifier = 96, + DisallowedInContext = 97, + AwaitOutsideAsync = 98, + InvalidStrictLet = 99, + InvalidLetConstBinding = 100, + InvalidLetClassName = 101, + KeywordNotId = 102, + InvalidImportExportSloppy = 103, + UnicodeOverflow = 104, + InvalidExportImportSource = 105, + InvalidKeywordAsAlias = 106, + InvalidDefaultImport = 107, + TrailingDecorators = 108, + GeneratorConstructor = 109, + AwaitIdentInModuleOrAsyncFunc = 110, + YieldIdentInModule = 111, + HtmlCommentInWebCompat = 112, + StrictInvalidLetInExprPos = 113, + NotAssignableLetArgs = 114, + ForOfLet = 115, + InvalidInvokedBlockBodyArrow = 116, + InvalidAccessedBlockBodyArrow = 117, + UnexpectedStrictReserved = 118, + StrictEvalArguments = 119, + InvalidDecoratorSemicolon = 120, + StrictDelete = 121, + InvalidPatternTail = 122, + AsyncFunctionInSingleStatementContext = 123, + InvalidTernaryYield = 124, + InvalidArrowPostfix = 125, + InvalidObjLitKeyStar = 126, + DeletePrivateField = 127, + InvalidStaticClassFieldConstructor = 128, + InvalidClassFieldConstructor = 129, + InvalidClassFieldArgEval = 130, + InvalidGeneratorFunction = 131, + AsyncRestrictedProd = 132, + UnexpectedCharAfterObjLit = 133, + InvalidObjLitKey = 134, + InvalidKeyToken = 135, + LabelRedeclaration = 136, + InvalidNestedStatement = 137, + UnknownLabel = 138, + InvalidImportTail = 139, + InvalidJSONImportBinding = 140, + ImportNotOneArg = 141, + InvalidImportNew = 142, + InvalidSpreadInImport = 143, + IncompleteArrow = 144, + DuplicateBinding = 145, + DuplicatePrivateIdentifier = 146, + DuplicateExportBinding = 147, + UndeclaredExportedBinding = 148, + UnexpectedPrivateField = 149, + DuplicateLetConstBinding = 150, + CantAssignToValidRHS = 151, + ContinuousNumericSeparator = 152, + TrailingNumericSeparator = 153, + InvalidJSXAttributeValue = 154, + ExpectedJSXClosingTag = 155, + AdjacentJSXElements = 156, + InvalidNonEmptyJSXExpr = 157, + DuplicateIdentifier = 158, + ShadowedCatchClause = 159, + InvalidDotProperty = 160, + UnclosedSpreadElement = 161, + CatchWithoutTry = 162, + FinallyWithoutTry = 163, + UnCorrespondingFragmentTag = 164, + InvalidCoalescing = 165, + OptionalChainingNoTemplate = 166, + OptionalChainingNoSuper = 167, + OptionalChainingNoNew = 168, + ImportMetaOutsideModule = 169, + InvalidLeadingDecorator = 170, + InvalidExportName = 171, + InvalidExportReference = 172, + InvalidSuperPrivate = 173, + InvalidImportMeta = 174, + InvalidEscapedImportMeta = 175, + InvalidAwaitAsIdentifier = 176, + InvalidAwaitInStaticBlock = 177 +} +export declare class ParseError extends SyntaxError implements _Node { + start: number; + end: number; + range: [number, number]; + loc: SourceLocation; + description: string; + constructor(start: Location, end: Location, type: Errors, ...params: string[]); +} diff --git a/node_modules/meriyah/dist/types/estree.d.ts b/node_modules/meriyah/dist/types/estree.d.ts new file mode 100644 index 0000000..104be27 --- /dev/null +++ b/node_modules/meriyah/dist/types/estree.d.ts @@ -0,0 +1,518 @@ +export interface _Node { + start?: number; + end?: number; + range?: [number, number]; + loc?: SourceLocation | null; +} +export interface SourceLocation { + source?: string | null; + start: Position; + end: Position; +} +export interface Position { + line: number; + column: number; +} +export type Labels = any; +export type IdentifierOrExpression = Identifier | Expression | ArrowFunctionExpression; +export type ArgumentExpression = ArrayExpression | AssignmentExpression | ConditionalExpression | Literal | SpreadElement | BinaryExpression | LogicalExpression | SequenceExpression; +export type CommentType = 'SingleLine' | 'MultiLine' | 'HTMLOpen' | 'HTMLClose' | 'HashbangComment'; +export interface Comment extends _Node { + type: CommentType; + value: string; +} +export type Node = AccessorProperty | ArrayExpression | ArrayPattern | ArrowFunctionExpression | AssignmentExpression | AssignmentPattern | AwaitExpression | BigIntLiteral | BinaryExpression | BlockStatement | BreakStatement | CallExpression | ChainExpression | ImportExpression | CatchClause | ClassBody | ClassDeclaration | ClassExpression | ConditionalExpression | ContinueStatement | DebuggerStatement | Decorator | DoWhileStatement | EmptyStatement | ExportAllDeclaration | ExportDefaultDeclaration | ExportNamedDeclaration | ExportSpecifier | ExpressionStatement | PropertyDefinition | ForInStatement | ForOfStatement | ForStatement | FunctionDeclaration | FunctionExpression | Identifier | IfStatement | ImportDeclaration | ImportDefaultSpecifier | ImportAttribute | ImportNamespaceSpecifier | ImportSpecifier | JSXNamespacedName | JSXAttribute | JSXClosingElement | JSXClosingFragment | JSXElement | JSXEmptyExpression | JSXExpressionContainer | JSXFragment | JSXIdentifier | JSXOpeningElement | JSXOpeningFragment | JSXSpreadAttribute | JSXSpreadChild | JSXMemberExpression | JSXText | LabeledStatement | Literal | LogicalExpression | MemberExpression | MetaProperty | MethodDefinition | NewExpression | ObjectExpression | ObjectPattern | ParenthesizedExpression | PrivateIdentifier | Program | Property | RegExpLiteral | RestElement | ReturnStatement | SequenceExpression | SpreadElement | StaticBlock | Super | SwitchCase | SwitchStatement | TaggedTemplateExpression | TemplateElement | TemplateLiteral | ThisExpression | ThrowStatement | TryStatement | UpdateExpression | UnaryExpression | VariableDeclaration | VariableDeclarator | WhileStatement | WithStatement | YieldExpression; +export type BindingPattern = ArrayPattern | ObjectPattern | Identifier; +export type ClassElement = FunctionExpression | MethodDefinition; +export type DeclarationStatement = ClassDeclaration | ClassExpression | ExportDefaultDeclaration | ExportAllDeclaration | ExportNamedDeclaration | FunctionDeclaration; +export type EntityName = Identifier; +export type ExportDeclaration = ClassDeclaration | ClassExpression | FunctionDeclaration | VariableDeclaration; +export type Expression = ArrowFunctionExpression | AssignmentExpression | BinaryExpression | ConditionalExpression | MetaProperty | ChainExpression | JSXClosingElement | JSXClosingFragment | JSXExpressionContainer | JSXOpeningElement | JSXOpeningFragment | JSXSpreadChild | LogicalExpression | NewExpression | RestElement | SequenceExpression | SpreadElement | AwaitExpression | LeftHandSideExpression | UnaryExpression | UpdateExpression | YieldExpression; +export type ForInitializer = Expression | VariableDeclaration; +export { ForInitializer as ForInitialiser }; +export type ImportClause = ImportDefaultSpecifier | ImportNamespaceSpecifier | ImportSpecifier; +export type IterationStatement = DoWhileStatement | ForInStatement | ForOfStatement | ForStatement | WhileStatement; +export type JSXChild = JSXElement | JSXExpression | JSXFragment | JSXText; +export type JSXExpression = JSXEmptyExpression | JSXSpreadChild | JSXExpressionContainer; +export type JSXTagNameExpression = JSXIdentifier | JSXMemberExpression | JSXNamespacedName; +export type LeftHandSideExpression = CallExpression | ChainExpression | ImportExpression | ClassExpression | ClassDeclaration | FunctionExpression | LiteralExpression | MemberExpression | PrimaryExpression | TaggedTemplateExpression; +export type LiteralExpression = Literal | TemplateLiteral; +export type ObjectLiteralElementLike = MethodDefinition | Property | RestElement | SpreadElement; +export type Parameter = AssignmentPattern | RestElement | ArrayPattern | ObjectPattern | Identifier; +export type PrimaryExpression = ArrayExpression | ArrayPattern | ClassExpression | FunctionExpression | Identifier | JSXElement | JSXFragment | JSXOpeningElement | Literal | LiteralExpression | MetaProperty | ObjectExpression | ObjectPattern | Super | TemplateLiteral | ThisExpression; +export type PrimaryExpressionExtended = ArrayExpression | ArrowFunctionExpression | ArrayPattern | AwaitExpression | Expression | ClassExpression | FunctionExpression | Identifier | JSXElement | JSXFragment | JSXOpeningElement | Literal | LiteralExpression | MetaProperty | ObjectExpression | ObjectPattern | PrivateIdentifier | NewExpression | Super | TemplateLiteral | ThisExpression | UnaryExpression | UpdateExpression; +export type PropertyName = Identifier | Literal; +export type Statement = BlockStatement | BreakStatement | ContinueStatement | DebuggerStatement | DeclarationStatement | EmptyStatement | ExpressionStatement | IfStatement | IterationStatement | ImportDeclaration | LabeledStatement | ReturnStatement | SwitchStatement | ThrowStatement | TryStatement | VariableDeclaration | WithStatement; +interface ClassDeclarationBase extends _Node { + id: Identifier | null; + body: ClassBody; + superClass: Expression | null; + decorators?: Decorator[]; +} +interface FunctionDeclarationBase extends _Node { + id: Identifier | null; + generator: boolean; + async: boolean; + params: Parameter[]; + body?: BlockStatement | null; +} +export interface BlockStatementBase extends _Node { + body: Statement[]; +} +export interface ArrayExpression extends _Node { + type: 'ArrayExpression'; + elements: (Expression | SpreadElement | null)[]; +} +export interface ArrayPattern extends _Node { + type: 'ArrayPattern'; + elements: Expression[]; +} +export interface ArrowFunctionExpression extends _Node { + type: 'ArrowFunctionExpression'; + params: Parameter[]; + body: Expression | BlockStatement; + async: boolean; + expression: boolean; + generator: false; +} +export interface AssignmentExpression extends _Node { + type: 'AssignmentExpression'; + operator: string; + left: Expression; + right: Expression; +} +export interface AssignmentPattern extends _Node { + type: 'AssignmentPattern'; + left: BindingPattern | Identifier; + right?: Expression; +} +export interface AwaitExpression extends _Node { + type: 'AwaitExpression'; + argument: Expression; +} +export interface BigIntLiteral extends Literal { + bigint: string; +} +export interface BinaryExpression extends _Node { + type: 'BinaryExpression'; + operator: string; + left: Expression | PrivateIdentifier; + right: Expression; +} +export interface BlockStatement extends BlockStatementBase { + type: 'BlockStatement'; +} +export interface BreakStatement extends _Node { + type: 'BreakStatement'; + label: Identifier | null; +} +export interface ImportExpression extends _Node { + type: 'ImportExpression'; + source: Expression; + options?: Expression | null; +} +export interface ChainExpression extends _Node { + type: 'ChainExpression'; + expression: CallExpression | MemberExpression; +} +export interface CallExpression extends _Node { + type: 'CallExpression'; + callee: any; + arguments: (Expression | SpreadElement)[]; + optional: boolean; +} +export interface CatchClause extends _Node { + type: 'CatchClause'; + param: BindingPattern | Identifier | null; + body: BlockStatement; +} +export interface StaticBlock extends BlockStatementBase { + type: 'StaticBlock'; +} +export interface ClassBody extends _Node { + type: 'ClassBody'; + body: (ClassElement | PropertyDefinition | AccessorProperty | StaticBlock)[]; +} +export interface AccessorProperty extends _Node { + type: 'AccessorProperty'; + key: PrivateIdentifier | Expression; + value: any; + decorators?: Decorator[]; + computed: boolean; + static: boolean; +} +export interface PropertyDefinition extends _Node { + type: 'PropertyDefinition'; + key: PrivateIdentifier | Expression; + value: any; + decorators?: Decorator[]; + computed: boolean; + static: boolean; +} +export interface PrivateIdentifier extends _Node { + type: 'PrivateIdentifier'; + name: string; +} +export interface ClassDeclaration extends ClassDeclarationBase { + type: 'ClassDeclaration'; +} +export interface ClassExpression extends ClassDeclarationBase { + type: 'ClassExpression'; +} +export interface ConditionalExpression extends _Node { + type: 'ConditionalExpression'; + test: Expression; + consequent: Expression; + alternate: Expression; +} +export interface ContinueStatement extends _Node { + type: 'ContinueStatement'; + label: Identifier | null; +} +export interface DebuggerStatement extends _Node { + type: 'DebuggerStatement'; +} +export interface Decorator extends _Node { + type: 'Decorator'; + expression: LeftHandSideExpression; +} +export interface DoWhileStatement extends _Node { + type: 'DoWhileStatement'; + test: Expression; + body: Statement; +} +export interface EmptyStatement extends _Node { + type: 'EmptyStatement'; +} +export interface ExportAllDeclaration extends _Node { + type: 'ExportAllDeclaration'; + source: Literal; + exported: Identifier | Literal | null; + attributes: ImportAttribute[]; +} +export interface ExportDefaultDeclaration extends _Node { + type: 'ExportDefaultDeclaration'; + declaration: ExportDeclaration | Expression; +} +export interface ExportNamedDeclaration extends _Node { + type: 'ExportNamedDeclaration'; + declaration: ExportDeclaration | null; + specifiers: ExportSpecifier[]; + source: Literal | null; + attributes: ImportAttribute[]; +} +export interface ExportSpecifier extends _Node { + type: 'ExportSpecifier'; + local: Identifier | Literal; + exported: Identifier | Literal; +} +export interface ExpressionStatement extends _Node { + type: 'ExpressionStatement'; + expression: Expression; + directive?: string; +} +export interface ForInStatement extends _Node { + type: 'ForInStatement'; + left: ForInitializer; + right: Expression; + body: Statement; +} +export interface ForOfStatement extends _Node { + type: 'ForOfStatement'; + left: ForInitializer; + right: Expression; + body: Statement; + await: boolean; +} +export interface ForStatement extends _Node { + type: 'ForStatement'; + init: Expression | ForInitializer | null; + test: Expression | null; + update: Expression | null; + body: Statement; +} +export interface FunctionDeclaration extends FunctionDeclarationBase { + type: 'FunctionDeclaration'; +} +export interface FunctionExpression extends FunctionDeclarationBase { + type: 'FunctionExpression'; +} +export interface Identifier extends _Node { + type: 'Identifier'; + name: string; +} +export interface IfStatement extends _Node { + type: 'IfStatement'; + test: Expression; + consequent: Statement; + alternate: Statement | null; +} +export interface ImportDeclaration extends _Node { + type: 'ImportDeclaration'; + source: Literal; + specifiers: ImportClause[]; + attributes: ImportAttribute[]; +} +export interface ImportAttribute extends _Node { + type: 'ImportAttribute'; + key: Identifier | Literal; + value: Literal; +} +export interface ImportDefaultSpecifier extends _Node { + type: 'ImportDefaultSpecifier'; + local: Identifier; +} +export interface ImportNamespaceSpecifier extends _Node { + type: 'ImportNamespaceSpecifier'; + local: Identifier; +} +export interface ImportSpecifier extends _Node { + type: 'ImportSpecifier'; + local: Identifier; + imported: Identifier | Literal; +} +export interface JSXNamespacedName extends _Node { + type: 'JSXNamespacedName'; + namespace: JSXIdentifier | JSXMemberExpression; + name: JSXIdentifier; +} +export type JSXAttributeValue = JSXIdentifier | Literal | JSXElement | JSXFragment | JSXExpressionContainer | JSXSpreadChild | null; +export interface JSXAttribute extends _Node { + type: 'JSXAttribute'; + name: JSXNamespacedName | JSXIdentifier; + value: JSXAttributeValue; +} +export interface JSXClosingElement extends _Node { + type: 'JSXClosingElement'; + name: JSXTagNameExpression; +} +export interface JSXClosingFragment extends _Node { + type: 'JSXClosingFragment'; +} +export interface JSXElement extends _Node { + type: 'JSXElement'; + openingElement: JSXOpeningElement; + closingElement: JSXClosingElement | null; + children: JSXChild[]; +} +export interface JSXEmptyExpression extends _Node { + type: 'JSXEmptyExpression'; +} +export interface JSXExpressionContainer extends _Node { + type: 'JSXExpressionContainer'; + expression: Expression | JSXEmptyExpression; +} +export interface JSXFragment extends _Node { + type: 'JSXFragment'; + openingFragment: JSXOpeningFragment; + closingFragment: JSXClosingFragment; + children: JSXChild[]; +} +export interface JSXIdentifier extends _Node { + type: 'JSXIdentifier'; + name: string; +} +export interface JSXMemberExpression extends _Node { + type: 'JSXMemberExpression'; + object: JSXTagNameExpression; + property: JSXIdentifier; +} +export interface JSXOpeningElement extends _Node { + type: 'JSXOpeningElement'; + selfClosing: boolean; + name: JSXTagNameExpression; + attributes: (JSXAttribute | JSXSpreadAttribute)[]; +} +export interface JSXOpeningFragment extends _Node { + type: 'JSXOpeningFragment'; +} +export interface JSXSpreadAttribute extends _Node { + type: 'JSXSpreadAttribute'; + argument: Expression; +} +export interface JSXSpreadChild extends _Node { + type: 'JSXSpreadChild'; + expression: Expression | JSXEmptyExpression; +} +export interface JSXText extends _Node { + type: 'JSXText'; + value: string; + raw?: string; +} +export interface LabeledStatement extends _Node { + type: 'LabeledStatement'; + label: Identifier; + body: Statement; +} +export interface Literal extends _Node { + type: 'Literal'; + value: boolean | number | string | null | RegExp | bigint; + raw?: string; +} +export interface LogicalExpression extends _Node { + type: 'LogicalExpression'; + operator: string; + left: Expression; + right: Expression; +} +export interface MemberExpression extends _Node { + type: 'MemberExpression'; + object: Expression | Super; + property: Expression | PrivateIdentifier; + computed: boolean; + optional: boolean; +} +export type Pattern = Identifier | ObjectPattern | ArrayPattern | RestElement | AssignmentPattern | MemberExpression; +export interface MetaProperty extends _Node { + type: 'MetaProperty'; + meta: Identifier; + property: Identifier; +} +export interface MethodDefinition extends _Node { + type: 'MethodDefinition'; + key: Expression | PrivateIdentifier | null; + value: FunctionExpression; + computed: boolean; + static: boolean; + kind: 'method' | 'get' | 'set' | 'constructor'; + decorators?: Decorator[]; +} +export interface NewExpression extends _Node { + type: 'NewExpression'; + callee: LeftHandSideExpression; + arguments: Expression[]; +} +export interface ObjectExpression extends _Node { + type: 'ObjectExpression'; + properties: ObjectLiteralElementLike[]; +} +export interface ObjectPattern extends _Node { + type: 'ObjectPattern'; + properties: ObjectLiteralElementLike[]; +} +export interface Program extends _Node { + type: 'Program'; + body: Statement[]; + sourceType: 'module' | 'script'; +} +export interface ParenthesizedExpression extends _Node { + type: 'ParenthesizedExpression'; + expression: Expression; +} +export interface Property extends _Node { + type: 'Property'; + key: Expression; + value: Expression | AssignmentPattern | BindingPattern | Identifier; + computed: boolean; + method: boolean; + shorthand: boolean; + kind: 'init' | 'get' | 'set'; +} +export interface RegExpLiteral extends Literal { + regex: { + pattern: string; + flags: string; + }; +} +export interface RestElement extends _Node { + type: 'RestElement'; + argument: BindingPattern | Identifier | Expression | PropertyName; + value?: AssignmentPattern; +} +export interface ReturnStatement extends _Node { + type: 'ReturnStatement'; + argument: Expression | null; +} +export interface SequenceExpression extends _Node { + type: 'SequenceExpression'; + expressions: Expression[]; +} +export type SpreadArgument = BindingPattern | Identifier | Expression | PropertyName | SpreadElement; +export interface SpreadElement extends _Node { + type: 'SpreadElement'; + argument: SpreadArgument; +} +export interface Super extends _Node { + type: 'Super'; +} +export interface SwitchCase extends _Node { + type: 'SwitchCase'; + test: Expression | null; + consequent: Statement[]; +} +export interface SwitchStatement extends _Node { + type: 'SwitchStatement'; + discriminant: Expression; + cases: SwitchCase[]; +} +export interface TaggedTemplateExpression extends _Node { + type: 'TaggedTemplateExpression'; + tag: Expression; + quasi: TemplateLiteral; +} +export interface TemplateElement extends _Node { + type: 'TemplateElement'; + value: { + raw: string; + cooked: string | null; + }; + tail: boolean; +} +export interface TemplateLiteral extends _Node { + type: 'TemplateLiteral'; + quasis: TemplateElement[]; + expressions: Expression[]; +} +export interface ThisExpression extends _Node { + type: 'ThisExpression'; +} +export interface ThrowStatement extends _Node { + type: 'ThrowStatement'; + argument: Expression; +} +export interface TryStatement extends _Node { + type: 'TryStatement'; + block: BlockStatement; + handler: CatchClause | null; + finalizer: BlockStatement | null; +} +export type UnaryOperator = '-' | '+' | '!' | '~' | 'typeof' | 'void' | 'delete'; +export type UpdateOperator = '++' | '--'; +export interface UpdateExpression extends _Node { + type: 'UpdateExpression'; + operator: UpdateOperator; + argument: Expression; + prefix: boolean; +} +export interface UnaryExpression extends _Node { + type: 'UnaryExpression'; + operator: UnaryOperator; + prefix: true; + argument: Expression; +} +export interface VariableDeclaration extends _Node { + type: 'VariableDeclaration'; + declarations: VariableDeclarator[]; + kind: 'let' | 'const' | 'var'; +} +export interface VariableDeclarator extends _Node { + type: 'VariableDeclarator'; + id: Expression | BindingPattern | Identifier; + init: Expression | null; + definite?: boolean; +} +export interface WhileStatement extends _Node { + type: 'WhileStatement'; + test: Expression; + body: Statement; +} +export interface WithStatement extends _Node { + type: 'WithStatement'; + object: Expression; + body: Statement; +} +export interface YieldExpression extends _Node { + type: 'YieldExpression'; + delegate: boolean; + argument?: Expression | null; +} diff --git a/node_modules/meriyah/dist/types/lexer/charClassifier.d.ts b/node_modules/meriyah/dist/types/lexer/charClassifier.d.ts new file mode 100644 index 0000000..a188150 --- /dev/null +++ b/node_modules/meriyah/dist/types/lexer/charClassifier.d.ts @@ -0,0 +1,23 @@ +export declare const enum CharFlags { + None = 0, + IdentifierStart = 1, + IdentifierPart = 2, + KeywordCandidate = 4, + LineTerminator = 8, + Decimal = 16, + Octal = 32, + Hex = 64, + Binary = 128, + Exponent = 256, + ImplicitOctalDigits = 512, + CarriageReturn = 1024, + LineFeed = 2048, + Underscore = 4096, + StringLiteral = 8192, + JSXToken = 16384, + Hyphen = 32768 +} +export declare const CharTypes: number[]; +export declare const isIdPart: number[]; +export declare function isIdentifierStart(code: number): boolean; +export declare function isIdentifierPart(code: number): boolean; diff --git a/node_modules/meriyah/dist/types/lexer/comments.d.ts b/node_modules/meriyah/dist/types/lexer/comments.d.ts new file mode 100644 index 0000000..b76db7e --- /dev/null +++ b/node_modules/meriyah/dist/types/lexer/comments.d.ts @@ -0,0 +1,14 @@ +import { LexerState } from './common'; +import { Context, type Location } from '../common'; +import { type Parser } from '../parser/parser'; +export declare const enum CommentType { + Single = 0, + Multi = 1, + HTMLOpen = 2, + HTMLClose = 3, + HashBang = 4 +} +export declare function skipHashBang(parser: Parser): void; +export declare function skipSingleHTMLComment(parser: Parser, source: string, state: LexerState, context: Context, type: CommentType, start: Location): LexerState; +export declare function skipSingleLineComment(parser: Parser, source: string, state: LexerState, type: CommentType, start: Location): LexerState; +export declare function skipMultiLineComment(parser: Parser, source: string, state: LexerState): LexerState | void; diff --git a/node_modules/meriyah/dist/types/lexer/common.d.ts b/node_modules/meriyah/dist/types/lexer/common.d.ts new file mode 100644 index 0000000..590d6f8 --- /dev/null +++ b/node_modules/meriyah/dist/types/lexer/common.d.ts @@ -0,0 +1,25 @@ +import { Token } from '../token'; +import { type Parser } from '../parser/parser'; +export declare const enum LexerState { + None = 0, + NewLine = 1, + LastIsCR = 4 +} +export declare const enum NumberKind { + ImplicitOctal = 1, + Binary = 2, + Octal = 4, + Hex = 8, + Decimal = 16, + NonOctalDecimal = 32, + Float = 64, + ValidBigIntKind = 128, + DecimalNumberKind = 48 +} +export declare function advanceChar(parser: Parser): number; +export declare function consumePossibleSurrogatePair(parser: Parser): number; +export declare function consumeLineFeed(parser: Parser, state: LexerState): void; +export declare function scanNewLine(parser: Parser): void; +export declare function isExoticECMAScriptWhitespace(ch: number): boolean; +export declare function toHex(code: number): number; +export declare function convertTokenType(t: Token): string; diff --git a/node_modules/meriyah/dist/types/lexer/decodeHTML.d.ts b/node_modules/meriyah/dist/types/lexer/decodeHTML.d.ts new file mode 100644 index 0000000..c171e6a --- /dev/null +++ b/node_modules/meriyah/dist/types/lexer/decodeHTML.d.ts @@ -0,0 +1 @@ +export declare function decodeHTMLStrict(text: string): string; diff --git a/node_modules/meriyah/dist/types/lexer/identifier.d.ts b/node_modules/meriyah/dist/types/lexer/identifier.d.ts new file mode 100644 index 0000000..4924e03 --- /dev/null +++ b/node_modules/meriyah/dist/types/lexer/identifier.d.ts @@ -0,0 +1,7 @@ +import { Token } from './../token'; +import { Context } from '../common'; +import { type Parser } from '../parser/parser'; +export declare function scanIdentifier(parser: Parser, context: Context, isValidAsKeyword: 0 | 1): Token; +export declare function scanUnicodeIdentifier(parser: Parser, context: Context): Token; +export declare function scanIdentifierSlowCase(parser: Parser, context: Context, hasEscape: 0 | 1, isValidAsKeyword: number): Token; +export declare function scanPrivateIdentifier(parser: Parser): Token; diff --git a/node_modules/meriyah/dist/types/lexer/index.d.ts b/node_modules/meriyah/dist/types/lexer/index.d.ts new file mode 100644 index 0000000..b1f44ba --- /dev/null +++ b/node_modules/meriyah/dist/types/lexer/index.d.ts @@ -0,0 +1,3 @@ +export { scanSingleToken, nextToken } from './scan'; +export { skipHashBang } from './comments'; +export { advanceChar, consumeLineFeed, scanNewLine, LexerState, convertTokenType } from './common'; diff --git a/node_modules/meriyah/dist/types/lexer/jsx.d.ts b/node_modules/meriyah/dist/types/lexer/jsx.d.ts new file mode 100644 index 0000000..7492098 --- /dev/null +++ b/node_modules/meriyah/dist/types/lexer/jsx.d.ts @@ -0,0 +1,6 @@ +import { Token } from '../token'; +import { type Context } from '../common'; +import { type Parser } from '../parser/parser'; +export declare function scanJSXAttributeValue(parser: Parser, context: Context): Token; +export declare function nextJSXToken(parser: Parser): void; +export declare function rescanJSXIdentifier(parser: Parser): Token; diff --git a/node_modules/meriyah/dist/types/lexer/numeric.d.ts b/node_modules/meriyah/dist/types/lexer/numeric.d.ts new file mode 100644 index 0000000..9fbd714 --- /dev/null +++ b/node_modules/meriyah/dist/types/lexer/numeric.d.ts @@ -0,0 +1,5 @@ +import { Context } from '../common'; +import { type Parser } from '../parser/parser'; +import { Token } from '../token'; +import { NumberKind } from './common'; +export declare function scanNumber(parser: Parser, context: Context, kind: NumberKind): Token; diff --git a/node_modules/meriyah/dist/types/lexer/regexp.d.ts b/node_modules/meriyah/dist/types/lexer/regexp.d.ts new file mode 100644 index 0000000..540e58e --- /dev/null +++ b/node_modules/meriyah/dist/types/lexer/regexp.d.ts @@ -0,0 +1,3 @@ +import { type Parser } from '../parser/parser'; +import { Token } from '../token'; +export declare function scanRegularExpression(parser: Parser): Token; diff --git a/node_modules/meriyah/dist/types/lexer/scan.d.ts b/node_modules/meriyah/dist/types/lexer/scan.d.ts new file mode 100644 index 0000000..2a47a58 --- /dev/null +++ b/node_modules/meriyah/dist/types/lexer/scan.d.ts @@ -0,0 +1,6 @@ +import { Token } from '../token'; +import { Context } from '../common'; +import { type Parser } from '../parser/parser'; +import { LexerState } from './common'; +export declare function nextToken(parser: Parser, context: Context): void; +export declare function scanSingleToken(parser: Parser, context: Context, state: LexerState): Token; diff --git a/node_modules/meriyah/dist/types/lexer/string.d.ts b/node_modules/meriyah/dist/types/lexer/string.d.ts new file mode 100644 index 0000000..919bc9b --- /dev/null +++ b/node_modules/meriyah/dist/types/lexer/string.d.ts @@ -0,0 +1,13 @@ +import { Context } from '../common'; +import { type Parser } from '../parser/parser'; +import { Token } from '../token'; +export declare const enum Escape { + Empty = -1, + StrictOctal = -2, + EightOrNine = -3, + InvalidHex = -4, + OutOfRange = -5 +} +export declare function scanString(parser: Parser, context: Context, quote: number): Token; +export declare function parseEscape(parser: Parser, context: Context, first: number, isTemplate?: 0 | 1): number; +export declare function handleStringError(parser: Parser, code: Escape, isTemplate: 0 | 1): void; diff --git a/node_modules/meriyah/dist/types/lexer/template.d.ts b/node_modules/meriyah/dist/types/lexer/template.d.ts new file mode 100644 index 0000000..6e646af --- /dev/null +++ b/node_modules/meriyah/dist/types/lexer/template.d.ts @@ -0,0 +1,5 @@ +import { Context } from '../common'; +import { type Parser } from '../parser/parser'; +import { Token } from '../token'; +export declare function scanTemplate(parser: Parser, context: Context): Token; +export declare function scanTemplateTail(parser: Parser, context: Context): Token; diff --git a/node_modules/meriyah/dist/types/meriyah.d.ts b/node_modules/meriyah/dist/types/meriyah.d.ts new file mode 100644 index 0000000..a3cd00a --- /dev/null +++ b/node_modules/meriyah/dist/types/meriyah.d.ts @@ -0,0 +1,8 @@ +import { type Program } from './estree'; +import { type Options } from './options'; +declare const version: string; +export declare function parseScript(source: string, options?: Options): Program; +export declare function parseModule(source: string, options?: Options): Program; +export declare function parse(source: string, options?: Options): Program; +export { type Options, version }; +export type * as ESTree from './estree'; diff --git a/node_modules/meriyah/dist/types/options.d.ts b/node_modules/meriyah/dist/types/options.d.ts new file mode 100644 index 0000000..6f29e6c --- /dev/null +++ b/node_modules/meriyah/dist/types/options.d.ts @@ -0,0 +1,29 @@ +import type * as ESTree from './estree'; +import { type Token } from './token'; +type OnInsertedSemicolon = (pos: number) => any; +export type OnToken = (token: string, start: number, end: number, loc: ESTree.SourceLocation) => any; +export type OnComment = (type: ESTree.CommentType, value: string, start: number, end: number, loc: ESTree.SourceLocation) => any; +export interface Options { + module?: boolean; + next?: boolean; + ranges?: boolean; + webcompat?: boolean; + loc?: boolean; + raw?: boolean; + globalReturn?: boolean; + impliedStrict?: boolean; + preserveParens?: boolean; + lexical?: boolean; + source?: string; + jsx?: boolean; + onComment?: ESTree.Comment[] | OnComment; + onInsertedSemicolon?: OnInsertedSemicolon; + onToken?: Token[] | OnToken; + uniqueKeyInPattern?: boolean; +} +export type NormalizedOptions = Omit & { + onComment?: OnComment; + onToken?: OnToken; +}; +export declare function normalizeOptions(rawOptions: Options): NormalizedOptions; +export {}; diff --git a/node_modules/meriyah/dist/types/parser.d.ts b/node_modules/meriyah/dist/types/parser.d.ts new file mode 100644 index 0000000..be743cc --- /dev/null +++ b/node_modules/meriyah/dist/types/parser.d.ts @@ -0,0 +1,9 @@ +import { Token } from './token'; +import type * as ESTree from './estree'; +import { Context, type Location } from './common'; +import { Parser } from './parser/parser'; +import { type Options } from './options'; +import { type Scope } from './parser/scope'; +export declare function parseSource(source: string, rawOptions?: Options, context?: Context): ESTree.Program; +export declare function parseModuleItem(parser: Parser, context: Context, scope: Scope | undefined): any; +export declare function parseDirective(parser: Parser, context: Context, expression: ESTree.ArgumentExpression | ESTree.SequenceExpression | ESTree.Expression, token: Token, start: Location): ESTree.ExpressionStatement; diff --git a/node_modules/meriyah/dist/types/parser/parser.d.ts b/node_modules/meriyah/dist/types/parser/parser.d.ts new file mode 100644 index 0000000..de4161b --- /dev/null +++ b/node_modules/meriyah/dist/types/parser/parser.d.ts @@ -0,0 +1,53 @@ +import { Token } from '../token'; +import type * as ESTree from '../estree'; +import { type Location, Flags, type AssignmentKind, type DestructuringKind } from '../common'; +import { Errors } from '../errors'; +import { type NormalizedOptions, type OnComment, type OnToken } from '../options'; +import { Scope, type ScopeKind } from './scope'; +import { PrivateScope } from './private-scope'; +export declare class Parser { + readonly source: string; + readonly options: NormalizedOptions; + private lastOnToken; + token: Token; + flags: Flags; + index: number; + line: number; + column: number; + startIndex: number; + end: number; + tokenIndex: number; + startColumn: number; + tokenColumn: number; + tokenLine: number; + startLine: number; + tokenValue: any; + tokenRaw: string; + tokenRegExp: void | { + pattern: string; + flags: string; + }; + currentChar: number; + exportedNames: Set; + exportedBindings: Set; + assignable: AssignmentKind | DestructuringKind; + destructible: AssignmentKind | DestructuringKind; + leadingDecorators: { + start?: Location; + decorators: ESTree.Decorator[]; + }; + constructor(source: string, options?: NormalizedOptions); + getToken(): Token; + setToken(value: Token, replaceLast?: boolean): Token; + get tokenStart(): Location; + get currentLocation(): Location; + finishNode(node: T, start: Location, end: Location | void): T; + addBindingToExports(name: string): void; + declareUnboundVariable(name: string): void; + report(type: Errors, ...params: string[]): never; + createScopeIfLexical(type?: ScopeKind, parent?: Scope): Scope | undefined; + createScope(type?: ScopeKind, parent?: Scope): Scope; + createPrivateScopeIfLexical(parent?: PrivateScope): PrivateScope | undefined; +} +export declare function pushComment(comments: ESTree.Comment[], options: NormalizedOptions): OnComment; +export declare function pushToken(tokens: Token[], options: NormalizedOptions): OnToken; diff --git a/node_modules/meriyah/dist/types/parser/private-scope.d.ts b/node_modules/meriyah/dist/types/parser/private-scope.d.ts new file mode 100644 index 0000000..2daf01f --- /dev/null +++ b/node_modules/meriyah/dist/types/parser/private-scope.d.ts @@ -0,0 +1,16 @@ +import { PropertyKind, type Location } from '../common'; +import { type Parser } from './parser'; +export declare class PrivateScope { + readonly parser: Parser; + readonly parent?: PrivateScope | undefined; + refs: { + [name: string]: Location[]; + }; + privateIdentifiers: Map; + constructor(parser: Parser, parent?: PrivateScope | undefined); + addPrivateIdentifier(name: string, kind: PropertyKind): void; + addPrivateIdentifierRef(name: string): void; + isPrivateIdentifierDefined(name: string): boolean; + validatePrivateIdentifierRefs(): void; + hasPrivateIdentifier(name: string): boolean; +} diff --git a/node_modules/meriyah/dist/types/parser/scope.d.ts b/node_modules/meriyah/dist/types/parser/scope.d.ts new file mode 100644 index 0000000..9d7eb02 --- /dev/null +++ b/node_modules/meriyah/dist/types/parser/scope.d.ts @@ -0,0 +1,38 @@ +import { Errors } from '../errors'; +import { type Location, Context, BindingKind, Origin } from '../common'; +import { type Parser } from './parser'; +export declare const enum ScopeKind { + ForStatement = 1, + Block = 2, + CatchStatement = 4, + SwitchStatement = 8, + TryStatement = 16, + CatchBlock = 32, + FunctionBody = 64, + FunctionRoot = 128, + FunctionParams = 256, + ArrowParams = 512 +} +interface ScopeError { + type: Errors; + params: string[]; + start: Location; + end: Location; +} +export declare class Scope { + readonly parser: Parser; + readonly type: ScopeKind; + readonly parent?: Scope | undefined; + scopeError?: ScopeError; + variableBindings: Map; + constructor(parser: Parser, type?: ScopeKind, parent?: Scope | undefined); + createChildScope(type?: ScopeKind): Scope; + addVarOrBlock(context: Context, name: string, kind: BindingKind, origin: Origin): void; + addVarName(context: Context, name: string, kind: BindingKind): void; + hasVariable(name: string): boolean; + addBlockName(context: Context, name: string, kind: BindingKind, origin: Origin): void; + recordScopeError(type: Errors, ...params: string[]): void; + reportScopeError(): void; +} +export declare function createArrowHeadParsingScope(parser: Parser, context: Context, value: string): Scope; +export {}; diff --git a/node_modules/meriyah/dist/types/token.d.ts b/node_modules/meriyah/dist/types/token.d.ts new file mode 100644 index 0000000..41f9547 --- /dev/null +++ b/node_modules/meriyah/dist/types/token.d.ts @@ -0,0 +1,167 @@ +export declare const enum Token { + Type = 255, + PrecedenceStart = 8, + Precedence = 3840, + Keyword = 4096, + Contextual = 12288, + Reserved = 20480, + FutureReserved = 36864, + IsExpressionStart = 65536, + IsIdentifier = 143360, + IsInOrOf = 262144, + IsLogical = 524288, + IsAutoSemicolon = 1048576, + IsPatternStart = 2097152, + IsAssignOp = 4194304, + IsBinaryOp = 8388608, + IsUnaryOp = 16842752, + IsUpdateOp = 33619968, + IsMemberOrCallExpression = 67108864, + IsStringOrNumber = 134217728, + IsCoalesce = 268435456, + IsEvalOrArguments = 537079808, + IsClassField = 1073741824, + IsEscaped = -2147483648, + EOF = 1048576, + Identifier = 208897, + NumericLiteral = 134283266, + StringLiteral = 134283267, + RegularExpression = 65540, + FalseKeyword = 86021, + TrueKeyword = 86022, + NullKeyword = 86023, + TemplateContinuation = 67174408, + TemplateSpan = 67174409, + Arrow = 10, + LeftParen = 67174411, + LeftBrace = 2162700, + Period = 67108877, + Ellipsis = 14, + RightBrace = 1074790415, + RightParen = 16, + Semicolon = 1074790417, + Comma = 18, + LeftBracket = 69271571, + RightBracket = 20, + Colon = 21, + QuestionMark = 22, + SingleQuote = 23, + DoubleQuote = 24, + Increment = 33619993, + Decrement = 33619994, + Assign = 1077936155, + ShiftLeftAssign = 4194332, + ShiftRightAssign = 4194333, + LogicalShiftRightAssign = 4194334, + ExponentiationAssign = 4194335, + AddAssign = 4194336, + SubtractAssign = 4194337, + MultiplyAssign = 4194338, + DivideAssign = 4259875, + ModuloAssign = 4194340, + BitwiseXorAssign = 4194341, + BitwiseOrAssign = 4194342, + BitwiseAndAssign = 4194343, + LogicalOrAssign = 4194344, + LogicalAndAssign = 4194345, + CoalesceAssign = 4194346, + TypeofKeyword = 16863275, + DeleteKeyword = 16863276, + VoidKeyword = 16863277, + Negate = 16842798, + Complement = 16842799, + Add = 25233968, + Subtract = 25233969, + InKeyword = 8673330, + InstanceofKeyword = 8411187, + Multiply = 8391476, + Modulo = 8391477, + Divide = 8457014, + Exponentiation = 8391735, + LogicalAnd = 8913720, + LogicalOr = 8913465, + StrictEqual = 8390458, + StrictNotEqual = 8390459, + LooseEqual = 8390460, + LooseNotEqual = 8390461, + LessThanOrEqual = 8390718, + GreaterThanOrEqual = 8390719, + LessThan = 8456256, + GreaterThan = 8390721, + ShiftLeft = 8390978, + ShiftRight = 8390979, + LogicalShiftRight = 8390980, + BitwiseAnd = 8390213, + BitwiseOr = 8389702, + BitwiseXor = 8389959, + VarKeyword = 86088, + LetKeyword = 241737, + ConstKeyword = 86090, + BreakKeyword = 20555, + CaseKeyword = 20556, + CatchKeyword = 20557, + ClassKeyword = 86094, + ContinueKeyword = 20559, + DebuggerKeyword = 20560, + DefaultKeyword = 20561, + DoKeyword = 20562, + ElseKeyword = 20563, + ExportKeyword = 20564, + ExtendsKeyword = 20565, + FinallyKeyword = 20566, + ForKeyword = 20567, + FunctionKeyword = 86104, + IfKeyword = 20569, + ImportKeyword = 86106, + NewKeyword = 86107, + ReturnKeyword = 20572, + SuperKeyword = 86109, + SwitchKeyword = 86110, + ThisKeyword = 86111, + ThrowKeyword = 86112, + TryKeyword = 20577, + WhileKeyword = 20578, + WithKeyword = 20579, + ImplementsKeyword = 36964, + InterfaceKeyword = 36965, + PackageKeyword = 36966, + PrivateKeyword = 36967, + ProtectedKeyword = 36968, + PublicKeyword = 36969, + StaticKeyword = 36970, + YieldKeyword = 241771, + AsKeyword = 77932, + AsyncKeyword = 209005, + AwaitKeyword = 209006, + ConstructorKeyword = 12399, + GetKeyword = 209008, + SetKeyword = 209009, + AccessorKeyword = 12402, + FromKeyword = 209011, + OfKeyword = 471156, + EnumKeyword = 86133, + Eval = 537079926, + Arguments = 537079927, + EscapedReserved = -2147483528, + EscapedFutureReserved = -2147483527, + AnyIdentifier = 209018, + PrivateIdentifier = 123, + BigIntLiteral = 134283388, + Coalesce = 276824445, + QuestionMarkPeriod = 67108990, + WhiteSpace = 127, + Illegal = 128, + CarriageReturn = 129, + PrivateField = 130, + Template = 131, + Decorator = 132, + Target = 209029, + Meta = 209030, + LineFeed = 135, + EscapeStart = 136, + JSXText = 137 +} +export declare const KeywordDescTable: string[]; +export declare const descKeywordTable: { + [key: string]: Token; +}; diff --git a/node_modules/meriyah/dist/types/unicode.d.ts b/node_modules/meriyah/dist/types/unicode.d.ts new file mode 100644 index 0000000..9477874 --- /dev/null +++ b/node_modules/meriyah/dist/types/unicode.d.ts @@ -0,0 +1,2 @@ +export declare const isIDContinue: (code: number) => boolean; +export declare const isIDStart: (code: number) => boolean; diff --git a/node_modules/meriyah/package.json b/node_modules/meriyah/package.json new file mode 100644 index 0000000..b63ee35 --- /dev/null +++ b/node_modules/meriyah/package.json @@ -0,0 +1,120 @@ +{ + "name": "meriyah", + "version": "6.1.4", + "description": "A 100% compliant, self-hosted javascript parser with high focus on both performance and stability", + "main": "dist/meriyah.cjs", + "module": "dist/meriyah.min.mjs", + "browser": "dist/meriyah.umd.min.js", + "unpkg": "dist/meriyah.umd.min.js", + "types": "dist/types/meriyah.d.ts", + "typings": "dist/types/meriyah.d.ts", + "exports": { + "types": "./dist/types/meriyah.d.ts", + "module-sync": "./dist/meriyah.mjs", + "require": "./dist/meriyah.cjs", + "default": "./dist/meriyah.mjs" + }, + "license": "ISC", + "homepage": "https://github.com/meriyah/meriyah", + "repository": { + "type": "git", + "url": "git+https://github.com/meriyah/meriyah.git" + }, + "bugs": { + "url": "https://github.com/meriyah/meriyah/issues" + }, + "author": { + "name": "Kenny F.", + "url": "https://github.com/KFlash" + }, + "contributors": [ + { + "name": "Chunpeng Huo", + "url": "https://github.com/3cp" + } + ], + "keywords": [ + "parsing", + "ecmascript", + "javascript", + "parser", + "estree", + "esnext", + "lexer", + "ast" + ], + "files": [ + "dist", + "README.md", + "CHANGELOG.md", + "LICENSE.md" + ], + "publishConfig": { + "access": "public" + }, + "scripts": { + "build": "node scripts/build.mjs", + "lint": "npm run lint:eslint && npm run lint:types && npm run lint:prettier && npm run lint:cspell && npm run lint:knip", + "lint:eslint": "eslint", + "lint:prettier": "prettier . --check", + "lint:cspell": "cspell . --gitignore", + "lint:types": "tsc", + "lint:knip": "knip", + "fix": "npm run fix:eslint && npm run fix:prettier", + "fix:eslint": "eslint --fix", + "fix:prettier": "prettier . --write", + "test": "vitest", + "test:watch": "vitest --watch", + "production-test": "npm run build && cross-env PRODUCTION_TEST=1 vitest test/production/production-tests.ts", + "prepare-nightly": "node scripts/bump-dev-version.mjs", + "coverage": "vitest --coverage", + "post_coverage": "cross-env cat ./coverage/lcov.info | coveralls", + "prepublishOnly": "npm run build", + "preversion": "npm test", + "version": "standard-changelog && git add CHANGELOG.md", + "postversion": "git push && git push --tags && npm publish", + "prepare": "husky", + "generate-unicode": "node scripts/generate-unicode.mjs", + "generate-test262-whitelist": "npm run build && node test262/generate-test262-whitelist.mjs" + }, + "devDependencies": { + "@babel/code-frame": "^7.27.1", + "@eslint/js": "^9.30.0", + "@rollup/plugin-json": "^6.1.0", + "@rollup/plugin-terser": "^0.4.4", + "@types/babel__code-frame": "^7.0.6", + "@types/node": "^24.0.7", + "@unicode/unicode-16.0.0": "^1.6.6", + "@vitest/coverage-v8": "^3.2.4", + "acorn": "^8.15.0", + "coveralls": "^3.1.1", + "cross-env": "^7.0.3", + "cspell": "^9.1.2", + "eslint": "^9.30.0", + "eslint-import-resolver-typescript": "^4.4.4", + "eslint-plugin-import-x": "^4.16.1", + "eslint-plugin-n": "^17.20.0", + "eslint-plugin-unicorn": "^59.0.1", + "globals": "^16.2.0", + "husky": "^9.1.7", + "knip": "^5.61.3", + "lint-staged": "^16.1.2", + "outdent": "^0.8.0", + "prettier": "3.6.2", + "rollup": "^4.44.1", + "rollup-plugin-typescript2": "^0.36.0", + "standard-changelog": "^7.0.1", + "test262-parser-runner": "^0.5.0", + "test262-stream": "^1.4.0", + "typescript": "^5.8.3", + "typescript-eslint": "^8.35.0", + "vitest": "^3.2.4" + }, + "engines": { + "node": ">=18.0.0" + }, + "lint-staged": { + "*.{ts,mts,cts,js,mjs,cjs}": "eslint --fix", + "*": "prettier --write --ignore-unknown" + } +} diff --git a/node_modules/youtubei.js/LICENSE b/node_modules/youtubei.js/LICENSE new file mode 100644 index 0000000..3659f9e --- /dev/null +++ b/node_modules/youtubei.js/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2021 LuanRT + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/node_modules/youtubei.js/README.md b/node_modules/youtubei.js/README.md new file mode 100644 index 0000000..8619287 --- /dev/null +++ b/node_modules/youtubei.js/README.md @@ -0,0 +1,77 @@ + +[npm]: https://www.npmjs.com/package/youtubei.js +[versions]: https://www.npmjs.com/package/youtubei.js?activeTab=versions +[codefactor]: https://www.codefactor.io/repository/github/luanrt/youtube.js +[actions]: https://github.com/LuanRT/YouTube.js/actions +[discord]: https://discord.gg/syDu7Yks54 + +
+
+

+ + YouTube.js Logo + +

+

A JavaScript client for YouTube's private API

+ +[![Discord](https://img.shields.io/badge/discord-online-brightgreen.svg)][discord] +[![CI](https://github.com/LuanRT/YouTube.js/actions/workflows/test.yml/badge.svg)][actions] +[![NPM Version](https://img.shields.io/npm/v/youtubei.js?color=%2335C757)][versions] +[![Downloads](https://img.shields.io/npm/dt/youtubei.js)][npm] +[![Codefactor](https://www.codefactor.io/repository/github/luanrt/youtube.js/badge)][codefactor] + +
+ +YouTube.js is a JavaScript client for YouTube's private API, known as "InnerTube". It allows you to interact with YouTube programmatically, providing access to videos, comments, live chats, streaming data and more. It works seamlessly across Node.js, Deno, and modern browsers. + +## Installation + +Before installing, make sure your environment meets the [prerequisites](https://ytjs.dev/guide/getting-started.html#prerequisites). + +```bash +# NPM +npm install youtubei.js@latest + +# Yarn +yarn add youtubei.js@latest + +# Git (edge version) +npm install github:LuanRT/YouTube.js + +# Deno +deno add npm:youtubei.js@latest +``` + +Deno (deprecated): +```ts +import { Innertube } from 'https://deno.land/x/youtubei/deno.ts'; +``` + +## Basic Usage + +```ts +import { Innertube } from 'youtubei.js'; +const innertube = await Innertube.create(/* options */); +``` + +For detailed usage, check out the [YouTube.js Guide and API Documentation](https://ytjs.dev). + +## Contributing +We welcome all contributions, issues and feature requests, whether small or large. If you want to contribute, feel free to check out our [issues page](https://github.com/LuanRT/YouTube.js/issues) and our [guidelines](https://github.com/LuanRT/YouTube.js/blob/main/CONTRIBUTING.md). + +## Contributors + + + + +## Disclaimer +This project is not affiliated with, endorsed, or sponsored by YouTube or any of its affiliates or subsidiaries. All trademarks, logos, and brand names used in this project are the property of their respective owners and are used solely to describe the services provided. + +As such, any usage of trademarks to refer to such services is considered nominative use. If you have any questions or concerns, please contact me. + +## License +Distributed under the [MIT](https://choosealicense.com/licenses/mit/) License. + +

+(back to top) +

diff --git a/node_modules/youtubei.js/bundle/browser.d.ts b/node_modules/youtubei.js/bundle/browser.d.ts new file mode 100644 index 0000000..92a96fb --- /dev/null +++ b/node_modules/youtubei.js/bundle/browser.d.ts @@ -0,0 +1 @@ +export * from '../dist/src/platform/lib.js'; \ No newline at end of file diff --git a/node_modules/youtubei.js/bundle/browser.js b/node_modules/youtubei.js/bundle/browser.js new file mode 100644 index 0000000..ad616ac --- /dev/null +++ b/node_modules/youtubei.js/bundle/browser.js @@ -0,0 +1,40798 @@ +/* eslint-disable */ +var __defProp = Object.defineProperty; +var __typeError = (msg) => { + throw TypeError(msg); +}; +var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value); +var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg); +var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj)); +var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value); +var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value); +var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method); +var __privateWrapper = (obj, member, setter, getter) => ({ + set _(value) { + __privateSet(obj, member, value, setter); + }, + get _() { + return __privateGet(obj, member, getter); + } +}); + +// dist/src/utils/Utils.js +var Utils_exports = {}; +__export(Utils_exports, { + ChannelError: () => ChannelError, + InnertubeError: () => InnertubeError, + MissingParamError: () => MissingParamError, + OAuth2Error: () => OAuth2Error, + ParsingError: () => ParsingError, + Platform: () => Platform, + PlayerError: () => PlayerError, + SessionError: () => SessionError, + base64ToU8: () => base64ToU8, + concatMemos: () => concatMemos, + debugFetch: () => debugFetch, + deepCompare: () => deepCompare, + escapeStringRegexp: () => escapeStringRegexp, + generateRandomString: () => generateRandomString, + generateSidAuth: () => generateSidAuth, + getCookie: () => getCookie, + getNsigProcessorFn: () => getNsigProcessorFn, + getRandomUserAgent: () => getRandomUserAgent, + getStringBetweenStrings: () => getStringBetweenStrings, + hasKeys: () => hasKeys, + isTextRun: () => isTextRun, + streamToIterable: () => streamToIterable, + throwIfMissing: () => throwIfMissing, + timeToSeconds: () => timeToSeconds, + u8ToBase64: () => u8ToBase64 +}); + +// dist/src/parser/helpers.js +var helpers_exports = {}; +__export(helpers_exports, { + Maybe: () => Maybe, + Memo: () => Memo, + SuperParsedResult: () => SuperParsedResult, + YTNode: () => YTNode, + observe: () => observe +}); + +// dist/src/utils/Log.js +var Log_exports = {}; +__export(Log_exports, { + Level: () => Level, + debug: () => debug, + error: () => error, + info: () => info, + setLevel: () => setLevel, + warn: () => warn, + warnOnce: () => warnOnce +}); +var YTJS_TAG = "YOUTUBEJS"; +var Level = { + NONE: 0, + ERROR: 1, + WARNING: 2, + INFO: 3, + DEBUG: 4 +}; +var log_map = { + [Level.ERROR]: (...args) => console.error(...args), + [Level.WARNING]: (...args) => console.warn(...args), + [Level.INFO]: (...args) => console.info(...args), + [Level.DEBUG]: (...args) => console.debug(...args) +}; +var log_level = [Level.WARNING]; +var one_time_warnings_issued = /* @__PURE__ */ new Set(); +function doLog(level, tag, args) { + if (!log_map[level] || !log_level.includes(level)) + return; + const tags = [`[${YTJS_TAG}]`]; + if (tag) + tags.push(`[${tag}]`); + log_map[level](`${tags.join("")}:`, ...args || []); +} +__name(doLog, "doLog"); +var warnOnce = /* @__PURE__ */ __name((id, ...args) => { + if (one_time_warnings_issued.has(id)) + return; + doLog(Level.WARNING, id, args); + one_time_warnings_issued.add(id); +}, "warnOnce"); +var warn = /* @__PURE__ */ __name((tag, ...args) => doLog(Level.WARNING, tag, args), "warn"); +var error = /* @__PURE__ */ __name((tag, ...args) => doLog(Level.ERROR, tag, args), "error"); +var info = /* @__PURE__ */ __name((tag, ...args) => doLog(Level.INFO, tag, args), "info"); +var debug = /* @__PURE__ */ __name((tag, ...args) => doLog(Level.DEBUG, tag, args), "debug"); +function setLevel(...args) { + log_level = args; +} +__name(setLevel, "setLevel"); + +// dist/src/parser/helpers.js +var isObserved = Symbol("ObservedArray.isObserved"); +var _YTNode = class _YTNode { + constructor() { + __publicField(this, "type"); + this.type = this.constructor.type; + } + /** + * Check if the node is of the given type. + * @param types - The type to check + * @returns whether the node is of the given type + */ + is(...types) { + return types.some((type) => this.type === type.type); + } + /** + * Cast to one of the given types. + * @param types - The types to cast to + * @returns The node cast to one of the given types + * @throws {ParsingError} If the node is not of the given type + */ + as(...types) { + if (!this.is(...types)) { + throw new ParsingError(`Cannot cast ${this.type} to one of ${types.map((t) => t.type).join(", ")}`); + } + return this; + } + /** + * Check for a key without asserting the type. + * @param key - The key to check + * @returns Whether the node has the key + */ + hasKey(key) { + return Reflect.has(this, key); + } + /** + * Assert that the node has the given key and return it. + * @param key - The key to check + * @returns The value of the key wrapped in a Maybe + * @throws {ParsingError} If the node does not have the key + */ + key(key) { + if (!this.hasKey(key)) { + throw new ParsingError(`Missing key ${key}`); + } + return new Maybe(this[key]); + } +}; +__name(_YTNode, "YTNode"); +__publicField(_YTNode, "type", "YTNode"); +var YTNode = _YTNode; +var MAYBE_TAG = "Maybe"; +var _value, _Maybe_instances, checkPrimitive_fn, assertPrimitive_fn; +var _Maybe = class _Maybe { + constructor(value) { + __privateAdd(this, _Maybe_instances); + __privateAdd(this, _value); + __privateSet(this, _value, value); + } + get typeof() { + return typeof __privateGet(this, _value); + } + string() { + return __privateMethod(this, _Maybe_instances, assertPrimitive_fn).call(this, "string"); + } + isString() { + return __privateMethod(this, _Maybe_instances, checkPrimitive_fn).call(this, "string"); + } + number() { + return __privateMethod(this, _Maybe_instances, assertPrimitive_fn).call(this, "number"); + } + isNumber() { + return __privateMethod(this, _Maybe_instances, checkPrimitive_fn).call(this, "number"); + } + bigint() { + return __privateMethod(this, _Maybe_instances, assertPrimitive_fn).call(this, "bigint"); + } + isBigint() { + return __privateMethod(this, _Maybe_instances, checkPrimitive_fn).call(this, "bigint"); + } + boolean() { + return __privateMethod(this, _Maybe_instances, assertPrimitive_fn).call(this, "boolean"); + } + isBoolean() { + return __privateMethod(this, _Maybe_instances, checkPrimitive_fn).call(this, "boolean"); + } + symbol() { + return __privateMethod(this, _Maybe_instances, assertPrimitive_fn).call(this, "symbol"); + } + isSymbol() { + return __privateMethod(this, _Maybe_instances, checkPrimitive_fn).call(this, "symbol"); + } + undefined() { + return __privateMethod(this, _Maybe_instances, assertPrimitive_fn).call(this, "undefined"); + } + isUndefined() { + return __privateMethod(this, _Maybe_instances, checkPrimitive_fn).call(this, "undefined"); + } + null() { + if (__privateGet(this, _value) !== null) + throw new TypeError(`Expected null, got ${typeof __privateGet(this, _value)}`); + return __privateGet(this, _value); + } + isNull() { + return __privateGet(this, _value) === null; + } + object() { + return __privateMethod(this, _Maybe_instances, assertPrimitive_fn).call(this, "object"); + } + isObject() { + return __privateMethod(this, _Maybe_instances, checkPrimitive_fn).call(this, "object"); + } + // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type + function() { + return __privateMethod(this, _Maybe_instances, assertPrimitive_fn).call(this, "function"); + } + isFunction() { + return __privateMethod(this, _Maybe_instances, checkPrimitive_fn).call(this, "function"); + } + /** + * Get the value as an array. + * @returns the value as any[]. + * @throws If the value is not an array. + */ + array() { + if (!Array.isArray(__privateGet(this, _value))) { + throw new TypeError(`Expected array, got ${typeof __privateGet(this, _value)}`); + } + return __privateGet(this, _value); + } + /** + * More typesafe variant of {@link Maybe#array}. + * @returns a proxied array which returns all the values as {@link Maybe}. + * @throws {TypeError} If the value is not an array + */ + arrayOfMaybe() { + const arrayProps = []; + return new Proxy(this.array(), { + get(target, prop) { + if (Reflect.has(arrayProps, prop)) { + return Reflect.get(target, prop); + } + return new _Maybe(Reflect.get(target, prop)); + } + }); + } + /** + * Check whether the value is an array. + * @returns whether the value is an array. + */ + isArray() { + return Array.isArray(__privateGet(this, _value)); + } + /** + * Get the value as a YTNode. + * @returns the value as a YTNode. + * @throws If the value is not a YTNode. + */ + node() { + if (!(__privateGet(this, _value) instanceof YTNode)) { + throw new TypeError(`Expected YTNode, got ${__privateGet(this, _value).constructor.name}`); + } + return __privateGet(this, _value); + } + /** + * Check if the value is a YTNode. + * @returns Whether the value is a YTNode. + */ + isNode() { + return __privateGet(this, _value) instanceof YTNode; + } + /** + * Get the value as a YTNode of the given type. + * @param types - The type(s) to cast to. + * @returns The node cast to the given type. + * @throws If the node is not of the given type. + */ + nodeOfType(...types) { + return this.node().as(...types); + } + /** + * Check if the value is a YTNode of the given type. + * @param types - the type(s) to check. + * @returns Whether the value is a YTNode of the given type. + */ + isNodeOfType(...types) { + return this.isNode() && this.node().is(...types); + } + /** + * Get the value as an ObservedArray. + * @returns the value of the Maybe as a ObservedArray. + */ + observed() { + if (!this.isObserved()) { + throw new TypeError(`Expected ObservedArray, got ${typeof __privateGet(this, _value)}`); + } + return __privateGet(this, _value); + } + /** + * Check if the value is an ObservedArray. + */ + isObserved() { + var _a; + return (_a = __privateGet(this, _value)) == null ? void 0 : _a[isObserved]; + } + /** + * Get the value of the Maybe as a SuperParsedResult. + * @returns the value as a SuperParsedResult. + * @throws If the value is not a SuperParsedResult. + */ + parsed() { + if (!(__privateGet(this, _value) instanceof SuperParsedResult)) { + throw new TypeError(`Expected SuperParsedResult, got ${typeof __privateGet(this, _value)}`); + } + return __privateGet(this, _value); + } + /** + * Is the result a SuperParsedResult? + */ + isParsed() { + return __privateGet(this, _value) instanceof SuperParsedResult; + } + /** + * @deprecated + * This call is not meant to be used outside of debugging. Please use the specific type getter instead. + */ + any() { + warn(MAYBE_TAG, "This call is not meant to be used outside of debugging. Please use the specific type getter instead."); + return __privateGet(this, _value); + } + /** + * Get the node as an instance of the given class. + * @param type - The type to check. + * @returns the value as the given type. + * @throws If the node is not of the given type. + */ + instanceof(type) { + if (!this.isInstanceof(type)) { + throw new TypeError(`Expected instance of ${type.name}, got ${__privateGet(this, _value).constructor.name}`); + } + return __privateGet(this, _value); + } + /** + * Check if the node is an instance of the given class. + * @param type - The type to check. + * @returns Whether the node is an instance of the given type. + */ + isInstanceof(type) { + return __privateGet(this, _value) instanceof type; + } +}; +_value = new WeakMap(); +_Maybe_instances = new WeakSet(); +checkPrimitive_fn = /* @__PURE__ */ __name(function(type) { + return typeof __privateGet(this, _value) === type; +}, "#checkPrimitive"); +assertPrimitive_fn = /* @__PURE__ */ __name(function(type) { + if (!__privateMethod(this, _Maybe_instances, checkPrimitive_fn).call(this, type)) { + throw new TypeError(`Expected ${type}, got ${this.typeof}`); + } + return __privateGet(this, _value); +}, "#assertPrimitive"); +__name(_Maybe, "Maybe"); +var Maybe = _Maybe; +var _result; +var _SuperParsedResult = class _SuperParsedResult { + constructor(result) { + __privateAdd(this, _result); + __privateSet(this, _result, result); + } + get is_null() { + return __privateGet(this, _result) === null; + } + get is_array() { + return !this.is_null && Array.isArray(__privateGet(this, _result)); + } + get is_node() { + return !this.is_array; + } + array() { + if (!this.is_array) { + throw new TypeError("Expected an array, got a node"); + } + return __privateGet(this, _result); + } + item() { + if (!this.is_node) { + throw new TypeError("Expected a node, got an array"); + } + return __privateGet(this, _result); + } +}; +_result = new WeakMap(); +__name(_SuperParsedResult, "SuperParsedResult"); +var SuperParsedResult = _SuperParsedResult; +function observe(obj) { + return new Proxy(obj, { + get(target, prop) { + if (prop == "get") { + return (rule, del_item) => target.find((obj2, index) => { + const match = deepCompare(rule, obj2); + if (match && del_item) { + target.splice(index, 1); + } + return match; + }); + } + if (prop == isObserved) { + return true; + } + if (prop == "getAll") { + return (rule, del_items) => target.filter((obj2, index) => { + const match = deepCompare(rule, obj2); + if (match && del_items) { + target.splice(index, 1); + } + return match; + }); + } + if (prop == "matchCondition") { + return (condition) => target.find((obj2) => { + return condition(obj2); + }); + } + if (prop == "filterType") { + return (...types) => { + return observe(target.filter((node) => { + return !!node.is(...types); + })); + }; + } + if (prop == "firstOfType") { + return (...types) => { + return target.find((node) => { + return !!node.is(...types); + }); + }; + } + if (prop == "first") { + return () => target[0]; + } + if (prop == "as") { + return (...types) => { + return observe(target.map((node) => { + if (node.is(...types)) + return node; + throw new ParsingError(`Expected node of any type ${types.map((type) => type.type).join(", ")}, got ${node.type}`); + })); + }; + } + if (prop == "remove") { + return (index) => target.splice(index, 1); + } + return Reflect.get(target, prop); + } + }); +} +__name(observe, "observe"); +var _Memo = class _Memo extends Map { + getType(...types) { + types = types.flat(); + return observe(types.flatMap((type) => this.get(type.type) || [])); + } +}; +__name(_Memo, "Memo"); +var Memo = _Memo; + +// dist/src/parser/misc.js +var misc_exports = {}; +__export(misc_exports, { + AccessibilityContext: () => AccessibilityContext, + AccessibilityData: () => AccessibilityData, + Author: () => Author, + ChildElement: () => ChildElement, + CommandContext: () => CommandContext, + EmojiRun: () => EmojiRun, + Format: () => Format, + RendererContext: () => RendererContext, + SubscriptionButton: () => SubscriptionButton, + Text: () => Text2, + TextRun: () => TextRun, + Thumbnail: () => Thumbnail, + VideoDetails: () => VideoDetails +}); + +// dist/src/parser/classes/misc/AccessibilityContext.js +var _AccessibilityContext = class _AccessibilityContext { + constructor(data) { + __publicField(this, "label"); + this.label = data.label; + } +}; +__name(_AccessibilityContext, "AccessibilityContext"); +var AccessibilityContext = _AccessibilityContext; + +// dist/src/parser/classes/misc/AccessibilityData.js +var _AccessibilityData = class _AccessibilityData { + constructor(data) { + __publicField(this, "accessibility_identifier"); + __publicField(this, "identifier"); + __publicField(this, "label"); + if ("accessibilityIdentifier" in data) { + this.accessibility_identifier = data.accessibilityIdentifier; + } + if ("identifier" in data) { + this.identifier = { + accessibility_id_type: data.identifier.accessibilityIdType + }; + } + if ("label" in data) { + this.label = data.label; + } + } +}; +__name(_AccessibilityData, "AccessibilityData"); +var AccessibilityData = _AccessibilityData; + +// dist/src/utils/Constants.js +var Constants_exports = {}; +__export(Constants_exports, { + CLIENTS: () => CLIENTS, + CLIENT_NAME_IDS: () => CLIENT_NAME_IDS, + INNERTUBE_HEADERS_BASE: () => INNERTUBE_HEADERS_BASE, + OAUTH: () => OAUTH, + STREAM_HEADERS: () => STREAM_HEADERS, + SUPPORTED_CLIENTS: () => SUPPORTED_CLIENTS, + URLS: () => URLS +}); +var URLS = { + YT_BASE: "https://www.youtube.com", + YT_MUSIC_BASE: "https://music.youtube.com", + YT_SUGGESTIONS: "https://suggestqueries-clients6.youtube.com", + YT_UPLOAD: "https://upload.youtube.com/", + API: { + BASE: "https://youtubei.googleapis.com", + PRODUCTION_1: "https://www.youtube.com/youtubei/", + PRODUCTION_2: "https://youtubei.googleapis.com/youtubei/", + STAGING: "https://green-youtubei.sandbox.googleapis.com/youtubei/", + RELEASE: "https://release-youtubei.sandbox.googleapis.com/youtubei/", + TEST: "https://test-youtubei.sandbox.googleapis.com/youtubei/", + CAMI: "http://cami-youtubei.sandbox.googleapis.com/youtubei/", + UYTFE: "https://uytfe.sandbox.google.com/youtubei/" + }, + GOOGLE_SEARCH_BASE: "https://www.google.com/" +}; +var OAUTH = { + REGEX: { + TV_SCRIPT: new RegExp(']*><\\/script>'), + CLIENT_IDENTITY: new RegExp('clientId:"(?[^"]+)",[^"]*?:"(?[^"]+)"') + } +}; +var CLIENTS = { + IOS: { + NAME: "iOS", + VERSION: "20.11.6", + USER_AGENT: "com.google.ios.youtube/20.11.6 (iPhone10,4; U; CPU iOS 16_7_7 like Mac OS X)", + DEVICE_MODEL: "iPhone10,4", + OS_NAME: "iOS", + OS_VERSION: "16.7.7.20H330" + }, + WEB: { + NAME: "WEB", + VERSION: "2.20260206.01.00", + API_KEY: "AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8", + API_VERSION: "v1", + STATIC_VISITOR_ID: "6zpwvWUNAco", + SUGG_EXP_ID: "ytzpb5_e2,ytpo.bo.lqp.elu=1,ytpo.bo.lqp.ecsc=1,ytpo.bo.lqp.mcsc=3,ytpo.bo.lqp.mec=1,ytpo.bo.lqp.rw=0.8,ytpo.bo.lqp.fw=0.2,ytpo.bo.lqp.szp=1,ytpo.bo.lqp.mz=3,ytpo.bo.lqp.al=en_us,ytpo.bo.lqp.zrm=1,ytpo.bo.lqp.er=1,ytpo.bo.ro.erl=1,ytpo.bo.ro.mlus=3,ytpo.bo.ro.erls=3,ytpo.bo.qfo.mlus=3,ytzprp.ppp.e=1,ytzprp.ppp.st=772,ytzprp.ppp.p=5" + }, + MWEB: { + NAME: "MWEB", + VERSION: "2.20260205.04.01", + API_VERSION: "v1" + }, + WEB_KIDS: { + NAME: "WEB_KIDS", + VERSION: "2.20260205.00.00" + }, + YTMUSIC: { + NAME: "WEB_REMIX", + VERSION: "1.20250219.01.00" + }, + ANDROID: { + NAME: "ANDROID", + VERSION: "21.03.36", + SDK_VERSION: 36, + USER_AGENT: "com.google.android.youtube/21.03.36(Linux; U; Android 16; en_US; SM-S908E Build/TP1A.220624.014) gzip" + }, + ANDROID_VR: { + NAME: "ANDROID_VR", + VERSION: "1.65.10", + SDK_VERSION: 32, + DEVICE_MAKE: "Oculus", + DEVICE_MODEL: "Quest 3", + USER_AGENT: "com.google.android.apps.youtube.vr.oculus/1.65.10 (Linux; U; Android 12L; eureka-user Build/SQ3A.220605.009.A1) gzip" + }, + YTSTUDIO_ANDROID: { + NAME: "ANDROID_CREATOR", + VERSION: "22.43.101" + }, + YTMUSIC_ANDROID: { + NAME: "ANDROID_MUSIC", + VERSION: "5.34.51" + }, + TV: { + NAME: "TVHTML5", + VERSION: "7.20260311.12.00", + USER_AGENT: "Mozilla/5.0 (ChromiumStylePlatform) Cobalt/Version" + }, + TV_SIMPLY: { + NAME: "TVHTML5_SIMPLY", + VERSION: "1.0" + }, + TV_EMBEDDED: { + NAME: "TVHTML5_SIMPLY_EMBEDDED_PLAYER", + VERSION: "2.0" + }, + WEB_EMBEDDED: { + NAME: "WEB_EMBEDDED_PLAYER", + VERSION: "1.20260206.01.00", + API_KEY: "AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8", + API_VERSION: "v1", + STATIC_VISITOR_ID: "6zpwvWUNAco" + }, + WEB_CREATOR: { + NAME: "WEB_CREATOR", + VERSION: "1.20241203.01.00", + API_KEY: "AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8", + API_VERSION: "v1", + STATIC_VISITOR_ID: "6zpwvWUNAco" + } +}; +var CLIENT_NAME_IDS = { + iOS: "5", + WEB: "1", + MWEB: "2", + WEB_KIDS: "76", + WEB_REMIX: "67", + ANDROID: "3", + ANDROID_CREATOR: "14", + ANDROID_MUSIC: "21", + ANDROID_VR: "28", + TVHTML5: "7", + TVHTML5_SIMPLY: "74", + TVHTML5_SIMPLY_EMBEDDED_PLAYER: "85", + WEB_EMBEDDED_PLAYER: "56", + WEB_CREATOR: "62" +}; +var STREAM_HEADERS = { + "accept": "*/*", + "origin": "https://www.youtube.com", + "referer": "https://www.youtube.com", + "DNT": "?1" +}; +var INNERTUBE_HEADERS_BASE = { + "accept": "*/*", + "accept-encoding": "gzip, deflate", + "content-type": "application/json" +}; +var SUPPORTED_CLIENTS = ["IOS", "WEB", "MWEB", "YTKIDS", "YTMUSIC", "ANDROID", "ANDROID_VR", "YTSTUDIO_ANDROID", "YTMUSIC_ANDROID", "TV", "TV_SIMPLY", "TV_EMBEDDED", "WEB_EMBEDDED", "WEB_CREATOR"]; + +// dist/src/parser/parser.js +var parser_exports = {}; +__export(parser_exports, { + addRuntimeParser: () => addRuntimeParser, + applyCommentsMutations: () => applyCommentsMutations, + applyMutations: () => applyMutations, + getDynamicParsers: () => getDynamicParsers, + getParserByName: () => getParserByName, + hasParser: () => hasParser, + parse: () => parse, + parseActions: () => parseActions, + parseArray: () => parseArray, + parseC: () => parseC, + parseCommand: () => parseCommand, + parseCommands: () => parseCommands, + parseFormats: () => parseFormats, + parseItem: () => parseItem, + parseLC: () => parseLC, + parseRR: () => parseRR, + parseResponse: () => parseResponse, + sanitizeClassName: () => sanitizeClassName, + setParserErrorHandler: () => setParserErrorHandler, + shouldIgnore: () => shouldIgnore +}); + +// dist/src/parser/nodes.js +var nodes_exports = {}; +__export(nodes_exports, { + AboutChannel: () => AboutChannel, + AboutChannelView: () => AboutChannelView, + AccountChannel: () => AccountChannel, + AccountItem: () => AccountItem, + AccountItemSection: () => AccountItemSection, + AccountItemSectionHeader: () => AccountItemSectionHeader, + AccountSectionList: () => AccountSectionList, + ActiveAccountHeader: () => ActiveAccountHeader, + AddBannerToLiveChatCommand: () => AddBannerToLiveChatCommand, + AddChatItemAction: () => AddChatItemAction, + AddLiveChatTickerItemAction: () => AddLiveChatTickerItemAction, + AddToPlaylist: () => AddToPlaylist, + AddToPlaylistCommand: () => AddToPlaylistCommand, + AddToPlaylistEndpoint: () => AddToPlaylistEndpoint, + AddToPlaylistServiceEndpoint: () => AddToPlaylistServiceEndpoint, + Alert: () => Alert, + AlertWithButton: () => AlertWithButton, + AnchoredSection: () => AnchoredSection, + AnimatedThumbnailOverlayView: () => AnimatedThumbnailOverlayView, + AppendContinuationItemsAction: () => AppendContinuationItemsAction, + AttributionView: () => AttributionView, + AudioOnlyPlayability: () => AudioOnlyPlayability, + AuthorCommentBadge: () => AuthorCommentBadge, + AutomixPreviewVideo: () => AutomixPreviewVideo, + AvatarStackView: () => AvatarStackView, + AvatarView: () => AvatarView, + BackgroundPromo: () => BackgroundPromo, + BackstageImage: () => BackstageImage, + BackstagePost: () => BackstagePost, + BackstagePostThread: () => BackstagePostThread, + BadgeView: () => BadgeView, + BrowseEndpoint: () => BrowseEndpoint, + BrowseFeedActions: () => BrowseFeedActions, + BrowserMediaSession: () => BrowserMediaSession, + BumperUserEduContentView: () => BumperUserEduContentView, + Button: () => Button, + ButtonCardView: () => ButtonCardView, + ButtonView: () => ButtonView, + C4TabbedHeader: () => C4TabbedHeader, + CallToActionButton: () => CallToActionButton, + Card: () => Card, + CardCollection: () => CardCollection, + CarouselHeader: () => CarouselHeader, + CarouselItem: () => CarouselItem, + CarouselItemView: () => CarouselItemView, + CarouselLockup: () => CarouselLockup, + CarouselTitleView: () => CarouselTitleView, + ChangeEngagementPanelVisibilityAction: () => ChangeEngagementPanelVisibilityAction, + Channel: () => Channel, + ChannelAboutFullMetadata: () => ChannelAboutFullMetadata, + ChannelAgeGate: () => ChannelAgeGate, + ChannelExternalLinkView: () => ChannelExternalLinkView, + ChannelFeaturedContent: () => ChannelFeaturedContent, + ChannelHeaderLinks: () => ChannelHeaderLinks, + ChannelHeaderLinksView: () => ChannelHeaderLinksView, + ChannelMetadata: () => ChannelMetadata, + ChannelMobileHeader: () => ChannelMobileHeader, + ChannelOptions: () => ChannelOptions, + ChannelOwnerEmptyState: () => ChannelOwnerEmptyState, + ChannelSubMenu: () => ChannelSubMenu, + ChannelSwitcherHeader: () => ChannelSwitcherHeader, + ChannelSwitcherPage: () => ChannelSwitcherPage, + ChannelTagline: () => ChannelTagline, + ChannelThumbnailWithLink: () => ChannelThumbnailWithLink, + ChannelVideoPlayer: () => ChannelVideoPlayer, + Chapter: () => Chapter, + ChildVideo: () => ChildVideo, + ChipBarView: () => ChipBarView, + ChipCloud: () => ChipCloud, + ChipCloudChip: () => ChipCloudChip, + ChipView: () => ChipView, + ClientSideToggleMenuItem: () => ClientSideToggleMenuItem, + ClipAdState: () => ClipAdState, + ClipCreation: () => ClipCreation, + ClipCreationScrubber: () => ClipCreationScrubber, + ClipCreationTextInput: () => ClipCreationTextInput, + ClipSection: () => ClipSection, + CollaboratorInfoCardContent: () => CollaboratorInfoCardContent, + CollageHeroImage: () => CollageHeroImage, + CollectionThumbnailView: () => CollectionThumbnailView, + CommandExecutorCommand: () => CommandExecutorCommand, + CommentActionButtons: () => CommentActionButtons, + CommentDialog: () => CommentDialog, + CommentReplies: () => CommentReplies, + CommentReplyDialog: () => CommentReplyDialog, + CommentSimplebox: () => CommentSimplebox, + CommentThread: () => CommentThread, + CommentView: () => CommentView, + CommentsEntryPointHeader: () => CommentsEntryPointHeader, + CommentsEntryPointTeaser: () => CommentsEntryPointTeaser, + CommentsHeader: () => CommentsHeader, + CommentsSimplebox: () => CommentsSimplebox, + CompactChannel: () => CompactChannel, + CompactLink: () => CompactLink, + CompactMix: () => CompactMix, + CompactMovie: () => CompactMovie, + CompactPlaylist: () => CompactPlaylist_default, + CompactStation: () => CompactStation, + CompactVideo: () => CompactVideo, + CompositeVideoPrimaryInfo: () => CompositeVideoPrimaryInfo, + ConfirmDialog: () => ConfirmDialog, + ContentMetadataView: () => ContentMetadataView, + ContentPreviewImageView: () => ContentPreviewImageView, + ContinuationCommand: () => ContinuationCommand, + ContinuationItem: () => ContinuationItem, + ConversationBar: () => ConversationBar, + CopyLink: () => CopyLink, + CreateCommentEndpoint: () => CreateCommentEndpoint, + CreatePlaylistDialog: () => CreatePlaylistDialog, + CreatePlaylistDialogFormView: () => CreatePlaylistDialogFormView, + CreatePlaylistServiceEndpoint: () => CreatePlaylistServiceEndpoint, + CreatorHeart: () => CreatorHeart, + CreatorHeartView: () => CreatorHeartView, + DecoratedAvatarView: () => DecoratedAvatarView, + DecoratedPlayerBar: () => DecoratedPlayerBar, + DefaultPromoPanel: () => DefaultPromoPanel, + DeletePlaylistEndpoint: () => DeletePlaylistEndpoint, + DescriptionPreviewView: () => DescriptionPreviewView, + DialogHeaderView: () => DialogHeaderView, + DialogView: () => DialogView, + DidYouMean: () => DidYouMean, + DimChatItemAction: () => DimChatItemAction, + DislikeButtonView: () => DislikeButtonView, + DismissableDialog: () => DismissableDialog, + DismissableDialogContentSection: () => DismissableDialogContentSection, + DownloadButton: () => DownloadButton, + Dropdown: () => Dropdown, + DropdownItem: () => DropdownItem, + DropdownView: () => DropdownView, + DynamicTextView: () => DynamicTextView, + Element: () => Element, + EmergencyOnebox: () => EmergencyOnebox, + EmojiPicker: () => EmojiPicker, + EmojiPickerCategory: () => EmojiPickerCategory, + EmojiPickerCategoryButton: () => EmojiPickerCategoryButton, + EmojiPickerUpsellCategory: () => EmojiPickerUpsellCategory, + EndScreenPlaylist: () => EndScreenPlaylist, + EndScreenVideo: () => EndScreenVideo, + Endscreen: () => Endscreen, + EndscreenElement: () => EndscreenElement, + EngagementPanelSectionList: () => EngagementPanelSectionList, + EngagementPanelTitleHeader: () => EngagementPanelTitleHeader, + EomSettingsDisclaimer: () => EomSettingsDisclaimer, + ExpandableMetadata: () => ExpandableMetadata, + ExpandableTab: () => ExpandableTab, + ExpandableVideoDescriptionBody: () => ExpandableVideoDescriptionBody, + ExpandedShelfContents: () => ExpandedShelfContents, + Factoid: () => Factoid, + FancyDismissibleDialog: () => FancyDismissibleDialog, + FeedFilterChipBar: () => FeedFilterChipBar, + FeedNudge: () => FeedNudge, + FeedTabbedHeader: () => FeedTabbedHeader, + FeedbackEndpoint: () => FeedbackEndpoint, + FlexibleActionsView: () => FlexibleActionsView, + Form: () => Form, + FormFooterView: () => FormFooterView, + FormPopup: () => FormPopup, + GameCard: () => GameCard, + GameDetails: () => GameDetails, + GetAccountsListInnertubeEndpoint: () => GetAccountsListInnertubeEndpoint, + GetKidsBlocklistPickerCommand: () => GetKidsBlocklistPickerCommand, + GetMultiPageMenuAction: () => GetMultiPageMenuAction, + Grid: () => Grid, + GridChannel: () => GridChannel, + GridHeader: () => GridHeader, + GridMix: () => GridMix, + GridMovie: () => GridMovie, + GridPlaylist: () => GridPlaylist, + GridShelfView: () => GridShelfView, + GridShow: () => GridShow, + GridVideo: () => GridVideo, + GuideCollapsibleEntry: () => GuideCollapsibleEntry, + GuideCollapsibleSectionEntry: () => GuideCollapsibleSectionEntry, + GuideDownloadsEntry: () => GuideDownloadsEntry, + GuideEntry: () => GuideEntry, + GuideSection: () => GuideSection, + GuideSubscriptionsSection: () => GuideSubscriptionsSection, + HashtagHeader: () => HashtagHeader, + HashtagTile: () => HashtagTile, + HeatMarker: () => HeatMarker, + Heatmap: () => Heatmap, + HeroPlaylistThumbnail: () => HeroPlaylistThumbnail, + HideEngagementPanelEndpoint: () => HideEngagementPanelEndpoint, + HighlightsCarousel: () => HighlightsCarousel, + HistorySuggestion: () => HistorySuggestion, + HorizontalCardList: () => HorizontalCardList, + HorizontalList: () => HorizontalList, + HorizontalMovieList: () => HorizontalMovieList, + HowThisWasMadeSectionView: () => HowThisWasMadeSectionView, + HypePointsFactoid: () => HypePointsFactoid, + IconLink: () => IconLink, + ImageBannerView: () => ImageBannerView, + IncludingResultsFor: () => IncludingResultsFor, + InfoPanelContainer: () => InfoPanelContainer, + InfoPanelContent: () => InfoPanelContent, + InfoRow: () => InfoRow, + InteractiveTabbedHeader: () => InteractiveTabbedHeader, + ItemSection: () => ItemSection, + ItemSectionHeader: () => ItemSectionHeader, + ItemSectionTab: () => ItemSectionTab, + ItemSectionTabbedHeader: () => ItemSectionTabbedHeader, + KidsBlocklistPicker: () => KidsBlocklistPicker, + KidsBlocklistPickerItem: () => KidsBlocklistPickerItem, + KidsCategoriesHeader: () => KidsCategoriesHeader, + KidsCategoryTab: () => KidsCategoryTab, + KidsHomeScreen: () => KidsHomeScreen, + LikeButton: () => LikeButton, + LikeButtonView: () => LikeButtonView, + LikeEndpoint: () => LikeEndpoint, + ListItemView: () => ListItemView, + ListView: () => ListView, + LiveChat: () => LiveChat, + LiveChatActionPanel: () => LiveChatActionPanel, + LiveChatAuthorBadge: () => LiveChatAuthorBadge, + LiveChatAutoModMessage: () => LiveChatAutoModMessage, + LiveChatBanner: () => LiveChatBanner, + LiveChatBannerChatSummary: () => LiveChatBannerChatSummary, + LiveChatBannerHeader: () => LiveChatBannerHeader, + LiveChatBannerPoll: () => LiveChatBannerPoll, + LiveChatBannerRedirect: () => LiveChatBannerRedirect, + LiveChatDialog: () => LiveChatDialog, + LiveChatHeader: () => LiveChatHeader, + LiveChatItemBumperView: () => LiveChatItemBumperView, + LiveChatItemContextMenuEndpoint: () => LiveChatItemContextMenuEndpoint, + LiveChatItemList: () => LiveChatItemList, + LiveChatMembershipItem: () => LiveChatMembershipItem, + LiveChatMessageInput: () => LiveChatMessageInput, + LiveChatModeChangeMessage: () => LiveChatModeChangeMessage, + LiveChatPaidMessage: () => LiveChatPaidMessage, + LiveChatPaidSticker: () => LiveChatPaidSticker, + LiveChatParticipant: () => LiveChatParticipant, + LiveChatParticipantsList: () => LiveChatParticipantsList, + LiveChatPlaceholderItem: () => LiveChatPlaceholderItem, + LiveChatProductItem: () => LiveChatProductItem, + LiveChatRestrictedParticipation: () => LiveChatRestrictedParticipation, + LiveChatSponsorshipsGiftPurchaseAnnouncement: () => LiveChatSponsorshipsGiftPurchaseAnnouncement, + LiveChatSponsorshipsGiftRedemptionAnnouncement: () => LiveChatSponsorshipsGiftRedemptionAnnouncement, + LiveChatSponsorshipsHeader: () => LiveChatSponsorshipsHeader, + LiveChatTextMessage: () => LiveChatTextMessage, + LiveChatTickerPaidMessageItem: () => LiveChatTickerPaidMessageItem, + LiveChatTickerPaidStickerItem: () => LiveChatTickerPaidStickerItem, + LiveChatTickerSponsorItem: () => LiveChatTickerSponsorItem, + LiveChatViewerEngagementMessage: () => LiveChatViewerEngagementMessage, + LockupMetadataView: () => LockupMetadataView, + LockupView: () => LockupView, + MacroMarkersInfoItem: () => MacroMarkersInfoItem, + MacroMarkersList: () => MacroMarkersList, + MacroMarkersListEntity: () => MacroMarkersListEntity, + MacroMarkersListItem: () => MacroMarkersListItem, + MarkChatItemAsDeletedAction: () => MarkChatItemAsDeletedAction, + MarkChatItemsByAuthorAsDeletedAction: () => MarkChatItemsByAuthorAsDeletedAction, + Menu: () => Menu, + MenuFlexibleItem: () => MenuFlexibleItem, + MenuNavigationItem: () => MenuNavigationItem, + MenuPopup: () => MenuPopup, + MenuServiceItem: () => MenuServiceItem, + MenuServiceItemDownload: () => MenuServiceItemDownload, + MenuTitle: () => MenuTitle, + MerchandiseItem: () => MerchandiseItem, + MerchandiseShelf: () => MerchandiseShelf, + Message: () => Message, + MetadataBadge: () => MetadataBadge, + MetadataRow: () => MetadataRow, + MetadataRowContainer: () => MetadataRowContainer, + MetadataRowHeader: () => MetadataRowHeader, + MetadataScreen: () => MetadataScreen, + MicroformatData: () => MicroformatData, + Mix: () => Mix, + MobileTopbar: () => MobileTopbar, + ModalWithTitleAndButton: () => ModalWithTitleAndButton, + ModifyChannelNotificationPreferenceEndpoint: () => ModifyChannelNotificationPreferenceEndpoint, + Movie: () => Movie, + MovingThumbnail: () => MovingThumbnail, + MultiMarkersPlayerBar: () => MultiMarkersPlayerBar, + MultiPageMenu: () => MultiPageMenu, + MultiPageMenuNotificationSection: () => MultiPageMenuNotificationSection, + MultiPageMenuSection: () => MultiPageMenuSection, + MusicCardShelf: () => MusicCardShelf, + MusicCardShelfHeaderBasic: () => MusicCardShelfHeaderBasic, + MusicCarouselShelf: () => MusicCarouselShelf, + MusicCarouselShelfBasicHeader: () => MusicCarouselShelfBasicHeader, + MusicDescriptionShelf: () => MusicDescriptionShelf, + MusicDetailHeader: () => MusicDetailHeader, + MusicDownloadStateBadge: () => MusicDownloadStateBadge, + MusicEditablePlaylistDetailHeader: () => MusicEditablePlaylistDetailHeader, + MusicElementHeader: () => MusicElementHeader, + MusicHeader: () => MusicHeader, + MusicImmersiveHeader: () => MusicImmersiveHeader, + MusicInlineBadge: () => MusicInlineBadge, + MusicItemThumbnailOverlay: () => MusicItemThumbnailOverlay, + MusicLargeCardItemCarousel: () => MusicLargeCardItemCarousel, + MusicMenuItemDivider: () => MusicMenuItemDivider, + MusicMultiRowListItem: () => MusicMultiRowListItem, + MusicMultiSelectMenu: () => MusicMultiSelectMenu, + MusicMultiSelectMenuItem: () => MusicMultiSelectMenuItem, + MusicNavigationButton: () => MusicNavigationButton, + MusicPlayButton: () => MusicPlayButton, + MusicPlaylistEditHeader: () => MusicPlaylistEditHeader, + MusicPlaylistShelf: () => MusicPlaylistShelf, + MusicQueue: () => MusicQueue, + MusicResponsiveHeader: () => MusicResponsiveHeader, + MusicResponsiveListItem: () => MusicResponsiveListItem, + MusicResponsiveListItemFixedColumn: () => MusicResponsiveListItemFixedColumn, + MusicResponsiveListItemFlexColumn: () => MusicResponsiveListItemFlexColumn, + MusicShelf: () => MusicShelf, + MusicSideAlignedItem: () => MusicSideAlignedItem, + MusicSortFilterButton: () => MusicSortFilterButton, + MusicTastebuilderShelf: () => MusicTasteBuilderShelf, + MusicTastebuilderShelfThumbnail: () => MusicTastebuilderShelfThumbnail, + MusicThumbnail: () => MusicThumbnail, + MusicTwoRowItem: () => MusicTwoRowItem, + MusicVisualHeader: () => MusicVisualHeader, + NavigationEndpoint: () => NavigationEndpoint, + Notification: () => Notification, + NotificationAction: () => NotificationAction, + OpenOnePickAddVideoModalCommand: () => OpenOnePickAddVideoModalCommand, + OpenPopupAction: () => OpenPopupAction, + PageHeader: () => PageHeader, + PageHeaderView: () => PageHeaderView, + PageIntroduction: () => PageIntroduction, + PanelFooterView: () => PanelFooterView, + PdgCommentChip: () => PdgCommentChip, + PdgReplyButtonView: () => PdgReplyButtonView, + PerformCommentActionEndpoint: () => PerformCommentActionEndpoint, + PivotBar: () => PivotBar, + PivotBarItem: () => PivotBarItem, + PivotButton: () => PivotButton, + PlayerAnnotationsExpanded: () => PlayerAnnotationsExpanded, + PlayerCaptchaView: () => PlayerCaptchaView, + PlayerCaptionsTracklist: () => PlayerCaptionsTracklist, + PlayerControlsOverlay: () => PlayerControlsOverlay, + PlayerErrorMessage: () => PlayerErrorMessage, + PlayerLegacyDesktopYpcOffer: () => PlayerLegacyDesktopYpcOffer, + PlayerLegacyDesktopYpcTrailer: () => PlayerLegacyDesktopYpcTrailer, + PlayerLiveStoryboardSpec: () => PlayerLiveStoryboardSpec, + PlayerMicroformat: () => PlayerMicroformat, + PlayerOverflow: () => PlayerOverflow, + PlayerOverlay: () => PlayerOverlay, + PlayerOverlayAutoplay: () => PlayerOverlayAutoplay, + PlayerOverlayVideoDetails: () => PlayerOverlayVideoDetails, + PlayerStoryboardSpec: () => PlayerStoryboardSpec, + Playlist: () => Playlist, + PlaylistAddToOption: () => PlaylistAddToOption, + PlaylistCustomThumbnail: () => PlaylistCustomThumbnail, + PlaylistEditEndpoint: () => PlaylistEditEndpoint, + PlaylistHeader: () => PlaylistHeader, + PlaylistInfoCardContent: () => PlaylistInfoCardContent, + PlaylistMetadata: () => PlaylistMetadata, + PlaylistPanel: () => PlaylistPanel, + PlaylistPanelVideo: () => PlaylistPanelVideo, + PlaylistPanelVideoWrapper: () => PlaylistPanelVideoWrapper, + PlaylistSidebar: () => PlaylistSidebar, + PlaylistSidebarPrimaryInfo: () => PlaylistSidebarPrimaryInfo, + PlaylistSidebarSecondaryInfo: () => PlaylistSidebarSecondaryInfo, + PlaylistThumbnailOverlay: () => PlaylistThumbnailOverlay, + PlaylistVideo: () => PlaylistVideo, + PlaylistVideoList: () => PlaylistVideoList, + PlaylistVideoThumbnail: () => PlaylistVideoThumbnail, + Poll: () => Poll, + PollHeader: () => PollHeader, + Post: () => Post, + PostMultiImage: () => PostMultiImage, + PrefetchWatchCommand: () => PrefetchWatchCommand, + PremiereTrailerBadge: () => PremiereTrailerBadge, + ProductList: () => ProductList, + ProductListHeader: () => ProductListHeader, + ProductListItem: () => ProductListItem, + ProfileColumn: () => ProfileColumn, + ProfileColumnStats: () => ProfileColumnStats, + ProfileColumnStatsEntry: () => ProfileColumnStatsEntry, + ProfileColumnUserInfo: () => ProfileColumnUserInfo, + Quiz: () => Quiz, + RecognitionShelf: () => RecognitionShelf, + ReelItem: () => ReelItem, + ReelPlayerHeader: () => ReelPlayerHeader, + ReelPlayerOverlay: () => ReelPlayerOverlay, + ReelShelf: () => ReelShelf, + ReelWatchEndpoint: () => ReelWatchEndpoint, + RelatedChipCloud: () => RelatedChipCloud, + RemoveBannerForLiveChatCommand: () => RemoveBannerForLiveChatCommand, + RemoveChatItemAction: () => RemoveChatItemAction, + RemoveChatItemByAuthorAction: () => RemoveChatItemByAuthorAction, + ReplaceChatItemAction: () => ReplaceChatItemAction, + ReplaceLiveChatAction: () => ReplaceLiveChatAction, + ReplayChatItemAction: () => ReplayChatItemAction, + RichGrid: () => RichGrid, + RichItem: () => RichItem, + RichListHeader: () => RichListHeader, + RichMetadata: () => RichMetadata, + RichMetadataRow: () => RichMetadataRow, + RichSection: () => RichSection, + RichShelf: () => RichShelf, + RunAttestationCommand: () => RunAttestationCommand, + SearchBox: () => SearchBox, + SearchEndpoint: () => SearchEndpoint, + SearchFilter: () => SearchFilter2, + SearchFilterGroup: () => SearchFilterGroup, + SearchFilterOptionsDialog: () => SearchFilterOptionsDialog, + SearchHeader: () => SearchHeader, + SearchRefinementCard: () => SearchRefinementCard, + SearchSubMenu: () => SearchSubMenu, + SearchSuggestion: () => SearchSuggestion, + SearchSuggestionsSection: () => SearchSuggestionsSection, + SecondarySearchContainer: () => SecondarySearchContainer, + SectionHeaderView: () => SectionHeaderView, + SectionList: () => SectionList, + SegmentedLikeDislikeButton: () => SegmentedLikeDislikeButton, + SegmentedLikeDislikeButtonView: () => SegmentedLikeDislikeButtonView, + SendFeedbackAction: () => SendFeedbackAction, + SettingBoolean: () => SettingBoolean, + SettingsCheckbox: () => SettingsCheckbox, + SettingsOptions: () => SettingsOptions, + SettingsSidebar: () => SettingsSidebar, + SettingsSwitch: () => SettingsSwitch, + ShareEndpoint: () => ShareEndpoint, + ShareEntityEndpoint: () => ShareEntityEndpoint, + ShareEntityServiceEndpoint: () => ShareEntityServiceEndpoint, + SharePanelHeader: () => SharePanelHeader, + SharePanelTitleV15: () => SharePanelTitleV15, + ShareTarget: () => ShareTarget, + SharedPost: () => SharedPost, + Shelf: () => Shelf, + ShortsLockupView: () => ShortsLockupView, + ShowCustomThumbnail: () => ShowCustomThumbnail, + ShowDialogCommand: () => ShowDialogCommand, + ShowEngagementPanelEndpoint: () => ShowEngagementPanelEndpoint, + ShowLiveChatActionPanelAction: () => ShowLiveChatActionPanelAction, + ShowLiveChatDialogAction: () => ShowLiveChatDialogAction, + ShowLiveChatTooltipCommand: () => ShowLiveChatTooltipCommand, + ShowingResultsFor: () => ShowingResultsFor, + SignalAction: () => SignalAction, + SignalServiceEndpoint: () => SignalServiceEndpoint, + SimpleCardContent: () => SimpleCardContent, + SimpleCardTeaser: () => SimpleCardTeaser, + SimpleMenuHeader: () => SimpleMenuHeader, + SimpleTextSection: () => SimpleTextSection, + SingleActionEmergencySupport: () => SingleActionEmergencySupport, + SingleColumnBrowseResults: () => SingleColumnBrowseResults, + SingleColumnMusicWatchNextResults: () => SingleColumnMusicWatchNextResults, + SingleHeroImage: () => SingleHeroImage, + SlimOwner: () => SlimOwner, + SlimVideoMetadata: () => SlimVideoMetadata, + SortFilterHeader: () => SortFilterHeader, + SortFilterSubMenu: () => SortFilterSubMenu, + SponsorCommentBadge: () => SponsorCommentBadge, + StartAt: () => StartAt, + StructuredDescriptionContent: () => StructuredDescriptionContent, + StructuredDescriptionPlaylistLockup: () => StructuredDescriptionPlaylistLockup, + SubFeedOption: () => SubFeedOption, + SubFeedSelector: () => SubFeedSelector, + SubscribeButton: () => SubscribeButton, + SubscribeButtonView: () => SubscribeButtonView, + SubscribeEndpoint: () => SubscribeEndpoint, + SubscriptionNotificationToggleButton: () => SubscriptionNotificationToggleButton, + Tab: () => Tab, + Tabbed: () => Tabbed, + TabbedSearchResults: () => TabbedSearchResults, + TextCarouselItemView: () => TextCarouselItemView, + TextFieldView: () => TextFieldView, + TextHeader: () => TextHeader, + ThirdPartyShareTargetSection: () => ThirdPartyShareTargetSection, + ThumbnailBadgeView: () => ThumbnailBadgeView, + ThumbnailBottomOverlayView: () => ThumbnailBottomOverlayView, + ThumbnailHoverOverlayToggleActionsView: () => ThumbnailHoverOverlayToggleActionsView, + ThumbnailHoverOverlayView: () => ThumbnailHoverOverlayView, + ThumbnailLandscapePortrait: () => ThumbnailLandscapePortrait, + ThumbnailOverlayBadgeView: () => ThumbnailOverlayBadgeView, + ThumbnailOverlayBottomPanel: () => ThumbnailOverlayBottomPanel, + ThumbnailOverlayEndorsement: () => ThumbnailOverlayEndorsement, + ThumbnailOverlayHoverText: () => ThumbnailOverlayHoverText, + ThumbnailOverlayInlineUnplayable: () => ThumbnailOverlayInlineUnplayable, + ThumbnailOverlayLoadingPreview: () => ThumbnailOverlayLoadingPreview, + ThumbnailOverlayNowPlaying: () => ThumbnailOverlayNowPlaying, + ThumbnailOverlayPinking: () => ThumbnailOverlayPinking, + ThumbnailOverlayPlaybackStatus: () => ThumbnailOverlayPlaybackStatus, + ThumbnailOverlayProgressBarView: () => ThumbnailOverlayProgressBarView, + ThumbnailOverlayResumePlayback: () => ThumbnailOverlayResumePlayback, + ThumbnailOverlaySidePanel: () => ThumbnailOverlaySidePanel, + ThumbnailOverlayTimeStatus: () => ThumbnailOverlayTimeStatus, + ThumbnailOverlayToggleButton: () => ThumbnailOverlayToggleButton, + ThumbnailView: () => ThumbnailView, + TimedMarkerDecoration: () => TimedMarkerDecoration, + TitleAndButtonListHeader: () => TitleAndButtonListHeader, + ToggleButton: () => ToggleButton, + ToggleButtonView: () => ToggleButtonView, + ToggleFormField: () => ToggleFormField, + ToggleMenuServiceItem: () => ToggleMenuServiceItem, + Tooltip: () => Tooltip, + TopbarMenuButton: () => TopbarMenuButton, + TopicChannelDetails: () => TopicChannelDetails, + Transcript: () => Transcript, + TranscriptFooter: () => TranscriptFooter, + TranscriptSearchBox: () => TranscriptSearchBox, + TranscriptSearchPanel: () => TranscriptSearchPanel, + TranscriptSectionHeader: () => TranscriptSectionHeader, + TranscriptSegment: () => TranscriptSegment, + TranscriptSegmentList: () => TranscriptSegmentList, + TwoColumnBrowseResults: () => TwoColumnBrowseResults, + TwoColumnSearchResults: () => TwoColumnSearchResults, + TwoColumnWatchNextResults: () => TwoColumnWatchNextResults, + UnifiedSharePanel: () => UnifiedSharePanel, + UniversalWatchCard: () => UniversalWatchCard, + UnsubscribeEndpoint: () => UnsubscribeEndpoint, + UpdateChannelSwitcherPageAction: () => UpdateChannelSwitcherPageAction, + UpdateDateTextAction: () => UpdateDateTextAction, + UpdateDescriptionAction: () => UpdateDescriptionAction, + UpdateEngagementPanelAction: () => UpdateEngagementPanelAction, + UpdateEngagementPanelContentCommand: () => UpdateEngagementPanelContentCommand, + UpdateLiveChatPollAction: () => UpdateLiveChatPollAction, + UpdateSubscribeButtonAction: () => UpdateSubscribeButtonAction, + UpdateTitleAction: () => UpdateTitleAction, + UpdateToggleButtonTextAction: () => UpdateToggleButtonTextAction, + UpdateViewershipAction: () => UpdateViewershipAction, + UploadTimeFactoid: () => UploadTimeFactoid, + UpsellDialog: () => UpsellDialog, + VerticalList: () => VerticalList, + VerticalWatchCardList: () => VerticalWatchCardList, + Video: () => Video, + VideoAttributeView: () => VideoAttributeView, + VideoAttributesSectionView: () => VideoAttributesSectionView, + VideoCard: () => VideoCard, + VideoDescriptionCourseSection: () => VideoDescriptionCourseSection, + VideoDescriptionHeader: () => VideoDescriptionHeader, + VideoDescriptionInfocardsSection: () => VideoDescriptionInfocardsSection, + VideoDescriptionMusicSection: () => VideoDescriptionMusicSection, + VideoDescriptionTranscriptSection: () => VideoDescriptionTranscriptSection, + VideoInfoCardContent: () => VideoInfoCardContent, + VideoMetadataCarouselView: () => VideoMetadataCarouselView, + VideoOwner: () => VideoOwner, + VideoPrimaryInfo: () => VideoPrimaryInfo, + VideoSecondaryInfo: () => VideoSecondaryInfo, + VideoSummaryContentView: () => VideoSummaryContentView, + VideoSummaryParagraphView: () => VideoSummaryParagraphView, + VideoViewCount: () => VideoViewCount, + ViewCountFactoid: () => ViewCountFactoid, + VoiceReplyContainerView: () => VoiceReplyContainerView, + WatchCardCompactVideo: () => WatchCardCompactVideo, + WatchCardHeroVideo: () => WatchCardHeroVideo, + WatchCardRichHeader: () => WatchCardRichHeader, + WatchCardSectionSequence: () => WatchCardSectionSequence, + WatchEndpoint: () => WatchEndpoint, + WatchNextEndScreen: () => WatchNextEndScreen, + WatchNextEndpoint: () => WatchNextEndpoint, + WatchNextTabbedResults: () => WatchNextTabbedResults, + YpcTrailer: () => YpcTrailer +}); + +// dist/src/utils/Cache.js +var _cache; +var _UniversalCache = class _UniversalCache { + constructor(persistent, persistent_directory) { + __privateAdd(this, _cache); + __privateSet(this, _cache, new Platform.shim.Cache(persistent, persistent_directory)); + } + get cache_dir() { + return __privateGet(this, _cache).cache_dir; + } + get(key) { + return __privateGet(this, _cache).get(key); + } + set(key, value) { + return __privateGet(this, _cache).set(key, value); + } + remove(key) { + return __privateGet(this, _cache).remove(key); + } +}; +_cache = new WeakMap(); +__name(_UniversalCache, "UniversalCache"); +var UniversalCache = _UniversalCache; + +// dist/src/utils/EventEmitterLike.js +var _legacy_listeners; +var _EventEmitterLike = class _EventEmitterLike extends EventTarget { + constructor() { + super(); + __privateAdd(this, _legacy_listeners, /* @__PURE__ */ new Map()); + } + emit(type, ...args) { + const event = new Platform.shim.CustomEvent(type, { detail: args }); + this.dispatchEvent(event); + } + on(type, listener) { + const wrapper = /* @__PURE__ */ __name((ev) => { + if (ev instanceof Platform.shim.CustomEvent) { + listener(...ev.detail); + } else { + listener(ev); + } + }, "wrapper"); + __privateGet(this, _legacy_listeners).set(listener, wrapper); + this.addEventListener(type, wrapper); + } + once(type, listener) { + const wrapper = /* @__PURE__ */ __name((ev) => { + if (ev instanceof Platform.shim.CustomEvent) { + listener(...ev.detail); + } else { + listener(ev); + } + this.off(type, listener); + }, "wrapper"); + __privateGet(this, _legacy_listeners).set(listener, wrapper); + this.addEventListener(type, wrapper); + } + off(type, listener) { + const wrapper = __privateGet(this, _legacy_listeners).get(listener); + if (wrapper) { + this.removeEventListener(type, wrapper); + __privateGet(this, _legacy_listeners).delete(listener); + } + } +}; +_legacy_listeners = new WeakMap(); +__name(_EventEmitterLike, "EventEmitterLike"); +var EventEmitterLike = _EventEmitterLike; + +// dist/src/utils/FormatUtils.js +var FormatUtils_exports = {}; +__export(FormatUtils_exports, { + chooseFormat: () => chooseFormat, + download: () => download, + toDash: () => toDash +}); + +// dist/src/utils/DashUtils.js +var XML_CHARACTER_MAP = { + "&": "&", + '"': """, + "'": "'", + "<": "<", + ">": ">" +}; +function escapeXMLString(str) { + return str.replace(/([&"<>'])/g, (_, item) => { + return XML_CHARACTER_MAP[item]; + }); +} +__name(escapeXMLString, "escapeXMLString"); +function normalizeTag(tag) { + return tag.charAt(0).toUpperCase() + tag.slice(1); +} +__name(normalizeTag, "normalizeTag"); +function createElement(tagNameOrFunction, props, ...children) { + const normalizedChildren = children.flat(); + if (typeof tagNameOrFunction === "function") { + return tagNameOrFunction({ ...props, children: normalizedChildren }); + } + return { + type: normalizeTag(tagNameOrFunction), + props: { + ...props, + children: normalizedChildren + } + }; +} +__name(createElement, "createElement"); +async function renderElementToString(element) { + if (typeof element === "string") + return escapeXMLString(element); + let dom = `<${element.type}`; + if (element.props) { + for (const key of Object.keys(element.props)) { + if (key !== "children" && element.props[key] !== void 0) { + dom += ` ${key}="${escapeXMLString(`${element.props[key]}`)}"`; + } + } + } + if (element.props.children) { + const children = await Promise.all((await Promise.all(element.props.children.flat())).flat().filter((child) => !!child).map((child) => renderElementToString(child))); + if (children.length > 0) { + dom += `>${children.join("")}`; + return dom; + } + } + return `${dom}/>`; +} +__name(renderElementToString, "renderElementToString"); +async function renderToString(root) { + const dom = await renderElementToString(await root); + return `${dom}`; +} +__name(renderToString, "renderToString"); +function Fragment(props) { + return props.children; +} +__name(Fragment, "Fragment"); + +// dist/src/parser/classes/PlayerStoryboardSpec.js +var _PlayerStoryboardSpec = class _PlayerStoryboardSpec extends YTNode { + constructor(data) { + super(); + __publicField(this, "boards"); + const parts = data.spec.split("|"); + const url = new URL(parts.shift()); + this.boards = parts.map((part, i) => { + const [thumbnail_width, thumbnail_height, thumbnail_count, columns, rows, interval, name, sigh] = part.split("#"); + url.searchParams.set("sigh", sigh); + const storyboard_count = Math.ceil(parseInt(thumbnail_count, 10) / (parseInt(columns, 10) * parseInt(rows, 10))); + return { + type: "vod", + template_url: url.toString().replace("$L", i).replace("$N", name), + thumbnail_width: parseInt(thumbnail_width, 10), + thumbnail_height: parseInt(thumbnail_height, 10), + thumbnail_count: parseInt(thumbnail_count, 10), + interval: parseInt(interval, 10), + columns: parseInt(columns, 10), + rows: parseInt(rows, 10), + storyboard_count + }; + }); + } +}; +__name(_PlayerStoryboardSpec, "PlayerStoryboardSpec"); +__publicField(_PlayerStoryboardSpec, "type", "PlayerStoryboardSpec"); +var PlayerStoryboardSpec = _PlayerStoryboardSpec; + +// dist/package.json +var package_default = { + name: "youtubei.js", + version: "17.0.1", + description: "A JavaScript client for YouTube's private API, known as InnerTube.", + type: "module", + types: "./dist/src/platform/lib.d.ts", + typesVersions: { + "*": { + agnostic: [ + "./dist/src/platform/lib.d.ts" + ], + web: [ + "./dist/src/platform/lib.d.ts" + ], + "react-native": [ + "./dist/src/platform/lib.d.ts" + ], + "web.bundle": [ + "./dist/src/platform/lib.d.ts" + ], + "web.bundle.min": [ + "./dist/src/platform/lib.d.ts" + ], + "cf-worker": [ + "./dist/src/platform/lib.d.ts" + ] + } + }, + exports: { + ".": { + deno: "./dist/src/platform/deno.js", + node: { + import: "./dist/src/platform/node.js", + default: "./dist/src/platform/node.js" + }, + types: "./dist/src/platform/lib.d.ts", + browser: "./dist/src/platform/web.js", + "react-native": "./dist/src/platform/react-native.js", + default: "./dist/src/platform/web.js" + }, + "./package.json": "./package.json", + "./agnostic": { + types: "./dist/src/platform/lib.d.ts", + default: "./dist/src/platform/lib.js" + }, + "./web": { + types: "./dist/src/platform/lib.d.ts", + default: "./dist/src/platform/web.js" + }, + "./react-native": { + types: "./dist/src/platform/lib.d.ts", + default: "./dist/src/platform/react-native.js" + }, + "./web.bundle": { + types: "./dist/src/platform/lib.d.ts", + default: "./bundle/browser.js" + }, + "./cf-worker": { + types: "./dist/src/platform/lib.d.ts", + default: "./dist/src/platform/cf-worker.js" + } + }, + author: "LuanRT (https://github.com/LuanRT)", + funding: [ + "https://github.com/sponsors/LuanRT" + ], + contributors: [ + "Wykerd (https://github.com/wykerd/)", + "MasterOfBob777 (https://github.com/MasterOfBob777)", + "patrickkfkan (https://github.com/patrickkfkan)", + "akkadaska (https://github.com/akkadaska)", + "Absidue (https://github.com/absidue)" + ], + scripts: { + test: "vitest run --reporter verbose", + lint: "eslint ./src", + "lint:fix": "eslint --fix ./src", + "clean:source-maps": "rimraf ./bundle/browser.js.map ./bundle/cf-worker.js.map ./bundle/react-native.js.map", + "clean:build-output": "rimraf ./dist ./bundle/browser.js ./bundle/cf-worker.js ./bundle/react-native.js ./deno", + build: "npm run clean:build-output && npm run clean:source-maps && npm run build:parser-map && npm run build:esm && npm run bundle:browser && npm run bundle:cf-worker && npm run bundle:react-native", + "build:esm": "tspc", + "build:deno": `cpy ./src ./deno && cpy ./protos ./deno && esbuild ./src/utils/DashManifest.tsx --keep-names --format=esm --platform=neutral --target=es2020 --outfile=./deno/src/utils/DashManifest.js && cpy ./package.json ./deno && replace ".js';" ".ts';" ./deno -r && replace '.js";' '.ts";' ./deno -r && replace "'./DashManifest.ts';" "'./DashManifest.js';" ./deno -r && replace "'jintr';" "'jsr:@luanrt/jintr';" ./deno -r && replace "@bufbuild/protobuf/wire" "https://esm.sh/@bufbuild/protobuf@2.0.0/wire" ./deno -r`, + "build:proto": "rimraf ./protos/generated && node ./dev-scripts/generate-proto.mjs", + "build:parser-map": "node ./dev-scripts/gen-parser-map.mjs", + "bundle:browser": 'esbuild ./dist/src/platform/web.js --banner:js="/* eslint-disable */" --bundle --sourcemap --target=chrome70 --keep-names --format=esm --define:global=globalThis --conditions=module --outfile=./bundle/browser.js --platform=browser', + "bundle:react-native": "esbuild ./dist/src/platform/react-native.js --bundle --sourcemap --target=es2020 --keep-names --format=esm --platform=neutral --define:global=globalThis --conditions=module --outfile=./bundle/react-native.js", + "bundle:cf-worker": 'esbuild ./dist/src/platform/cf-worker.js --banner:js="/* eslint-disable */" --bundle --sourcemap --target=es2020 --keep-names --format=esm --define:global=globalThis --conditions=module --outfile=./bundle/cf-worker.js --platform=node', + "build:docs": "typedoc", + prepare: "npm run build", + watch: "tspc --watch" + }, + repository: { + type: "git", + url: "git+https://github.com/LuanRT/YouTube.js.git" + }, + files: [ + "dist/", + "bundle/", + "package.json", + "README.md", + "LICENSE" + ], + license: "MIT", + dependencies: { + "@bufbuild/protobuf": "^2.0.0", + meriyah: "^6.1.4" + }, + devDependencies: { + "@eslint/js": "^9.37.0", + "@types/estree": "^1.0.6", + "@types/node": "^25.0.3", + "@typescript-eslint/eslint-plugin": "^8.46.0", + "@typescript-eslint/parser": "^8.46.0", + "cpy-cli": "^6.0.0", + esbuild: "^0.25.6", + eslint: "^9.37.0", + globals: "^17.0.0", + replace: "^1.2.2", + rimraf: "^6.0.1", + "ts-patch": "^3.0.2", + "ts-proto": "^2.2.0", + typedoc: "^0.28.14", + "typedoc-plugin-markdown": "^4.9.0", + typescript: "^5.9.3", + "typescript-eslint": "^8.46.0", + vitest: "^3.2.4" + }, + bugs: { + url: "https://github.com/LuanRT/YouTube.js/issues" + }, + homepage: "https://github.com/LuanRT/YouTube.js#readme", + keywords: [ + "api", + "youtube", + "innertube", + "livechat", + "youtube-music", + "ytdl", + "youtube-studio", + "downloader", + "ytmusic" + ] +}; + +// dist/src/utils/StreamingInfo.js +var TAG_ = "StreamingInfo"; +function getFormatGroupings(formats, is_post_live_dvr) { + var _a, _b, _c; + const group_info = /* @__PURE__ */ new Map(); + const has_multiple_audio_tracks = formats.some((fmt) => !!fmt.audio_track); + for (const format of formats) { + if ((!format.index_range || !format.init_range) && !format.is_type_otf && !is_post_live_dvr) { + continue; + } + const mime_type = format.mime_type.split(";")[0]; + const just_codec = (_a = getStringBetweenStrings(format.mime_type, 'codecs="', '"')) == null ? void 0 : _a.split(".")[0]; + const color_info = format.color_info ? Object.values(format.color_info).join("-") : ""; + const audio_track_id = ((_b = format.audio_track) == null ? void 0 : _b.id) || ""; + const drc = format.is_drc ? "drc" : ""; + const vb = format.is_vb ? "vb" : ""; + const group_id = `${mime_type}-${just_codec}-${color_info}-${audio_track_id}-${drc}-${vb}`; + if (!group_info.has(group_id)) { + group_info.set(group_id, []); + } + (_c = group_info.get(group_id)) == null ? void 0 : _c.push(format); + } + return { + groups: Array.from(group_info.values()), + has_multiple_audio_tracks + }; +} +__name(getFormatGroupings, "getFormatGroupings"); +function hoistCodecsIfPossible(formats, hoisted) { + if (formats.length > 1 && new Set(formats.map((format) => getStringBetweenStrings(format.mime_type, 'codecs="', '"'))).size === 1) { + hoisted.push("codecs"); + return getStringBetweenStrings(formats[0].mime_type, 'codecs="', '"'); + } +} +__name(hoistCodecsIfPossible, "hoistCodecsIfPossible"); +function hoistNumberAttributeIfPossible(formats, property, hoisted) { + if (formats.length > 1 && new Set(formats.map((format) => format.fps)).size === 1) { + hoisted.push(property); + return Number(formats[0][property]); + } +} +__name(hoistNumberAttributeIfPossible, "hoistNumberAttributeIfPossible"); +function hoistAudioChannelsIfPossible(formats, hoisted) { + if (formats.length > 1 && new Set(formats.map((format) => format.audio_channels || 2)).size === 1) { + hoisted.push("AudioChannelConfiguration"); + return formats[0].audio_channels; + } +} +__name(hoistAudioChannelsIfPossible, "hoistAudioChannelsIfPossible"); +async function getOTFSegmentTemplate(url, actions) { + var _a; + const response = await actions.session.http.fetch_function(`${url}&rn=0&sq=0`, { + method: "GET", + headers: STREAM_HEADERS, + redirect: "follow" + }); + const resolved_url = response.url.replace("&rn=0", "").replace("&sq=0", ""); + const response_text = await response.text(); + const segment_duration_strings = (_a = getStringBetweenStrings(response_text, "Segment-Durations-Ms:", "\r\n")) == null ? void 0 : _a.split(","); + if (!segment_duration_strings) { + throw new InnertubeError("Failed to extract the segment durations from this OTF stream", { url }); + } + const segment_durations = []; + for (const segment_duration_string of segment_duration_strings) { + const trimmed_segment_duration = segment_duration_string.trim(); + if (trimmed_segment_duration.length === 0) { + continue; + } + let repeat_count; + const repeat_count_string = getStringBetweenStrings(trimmed_segment_duration, "(r=", ")"); + if (repeat_count_string) { + repeat_count = parseInt(repeat_count_string); + } + segment_durations.push({ + duration: parseInt(trimmed_segment_duration), + repeat_count + }); + } + return { + init_url: `${resolved_url}&sq=0`, + media_url: `${resolved_url}&sq=$Number$`, + timeline: segment_durations + }; +} +__name(getOTFSegmentTemplate, "getOTFSegmentTemplate"); +async function getPostLiveDvrInfo(transformed_url, actions) { + const response = await actions.session.http.fetch_function(`${transformed_url}&rn=0&sq=0`, { + method: "HEAD", + headers: STREAM_HEADERS, + redirect: "follow" + }); + const duration_ms = parseInt(response.headers.get("X-Head-Time-Millis") || ""); + const segment_count = parseInt(response.headers.get("X-Head-Seqnum") || ""); + if (isNaN(duration_ms) || isNaN(segment_count)) { + throw new InnertubeError("Failed to extract the duration or segment count for this Post Live DVR video"); + } + return { + duration: duration_ms / 1e3, + segment_count + }; +} +__name(getPostLiveDvrInfo, "getPostLiveDvrInfo"); +async function getPostLiveDvrDuration(shared_post_live_dvr_info, format, url_transformer, actions, player, cpn) { + if (!shared_post_live_dvr_info.item) { + const url = new URL(await format.decipher(player)); + url.searchParams.set("cpn", cpn || ""); + const transformed_url = url_transformer(url).toString(); + shared_post_live_dvr_info.item = await getPostLiveDvrInfo(transformed_url, actions); + } + return shared_post_live_dvr_info.item.duration; +} +__name(getPostLiveDvrDuration, "getPostLiveDvrDuration"); +async function getSegmentInfo(format, url_transformer, actions, player, cpn, shared_post_live_dvr_info, is_sabr) { + let transformed_url = ""; + if (is_sabr) { + const formatKey = `${format.itag || ""}:${format.xtags || ""}`; + transformed_url = `sabr://${format.has_video ? "video" : "audio"}?key=${formatKey}`; + } else { + const url = new URL(await format.decipher(player)); + url.searchParams.set("cpn", cpn || ""); + transformed_url = url_transformer(url).toString(); + } + if (format.is_type_otf) { + if (!actions) + throw new InnertubeError("Unable to get segment durations for this OTF stream without an Actions instance", { format }); + const info3 = { + is_oft: true, + is_post_live_dvr: false, + getSegmentTemplate() { + return getOTFSegmentTemplate(transformed_url, actions); + } + }; + return info3; + } + if (shared_post_live_dvr_info) { + if (!actions) { + throw new InnertubeError("Unable to get segment count for this Post Live DVR video without an Actions instance", { format }); + } + const target_duration_dec = format.target_duration_dec; + if (typeof target_duration_dec !== "number") { + throw new InnertubeError("Format is missing target_duration_dec", { format }); + } + const info3 = { + is_oft: false, + is_post_live_dvr: true, + async getSegmentTemplate() { + if (!shared_post_live_dvr_info.item) { + shared_post_live_dvr_info.item = await getPostLiveDvrInfo(transformed_url, actions); + } + return { + media_url: `${transformed_url}&sq=$Number$`, + timeline: [ + { + duration: target_duration_dec * 1e3, + repeat_count: shared_post_live_dvr_info.item.segment_count + } + ] + }; + } + }; + return info3; + } + if (!format.index_range || !format.init_range) + throw new InnertubeError("Index and init ranges not available", { format }); + const info2 = { + is_oft: false, + is_post_live_dvr: false, + base_url: transformed_url, + index_range: format.index_range, + init_range: format.init_range + }; + return info2; +} +__name(getSegmentInfo, "getSegmentInfo"); +async function getAudioRepresentation(format, hoisted, url_transformer, actions, player, cpn, shared_post_live_dvr_info, is_sabr) { + const uid_parts = [format.itag.toString()]; + if (format.audio_track) { + uid_parts.push(format.audio_track.id); + } + if (format.is_drc) { + uid_parts.push("drc"); + } + if (format.is_vb) { + uid_parts.push("vb"); + } + const rep = { + uid: uid_parts.join("-"), + bitrate: format.bitrate, + codecs: !hoisted.includes("codecs") ? getStringBetweenStrings(format.mime_type, 'codecs="', '"') : void 0, + audio_sample_rate: !hoisted.includes("audio_sample_rate") ? format.audio_sample_rate : void 0, + channels: !hoisted.includes("AudioChannelConfiguration") ? format.audio_channels || 2 : void 0, + segment_info: await getSegmentInfo(format, url_transformer, actions, player, cpn, shared_post_live_dvr_info, is_sabr) + }; + return rep; +} +__name(getAudioRepresentation, "getAudioRepresentation"); +function getTrackRoles(format, has_drc_streams) { + if (!format.audio_track && !has_drc_streams) { + return; + } + const roles = [ + format.is_original ? "main" : "alternate" + ]; + if (format.is_dubbed || format.is_auto_dubbed) + roles.push("dub"); + if (format.is_descriptive) + roles.push("description"); + if (format.is_drc || format.is_vb) + roles.push("enhanced-audio-intelligibility"); + return roles; +} +__name(getTrackRoles, "getTrackRoles"); +async function getAudioSet(formats, url_transformer, actions, player, cpn, shared_post_live_dvr_info, drc_labels, vb_labels, is_sabr) { + var _a, _b; + const first_format = formats[0]; + const { audio_track } = first_format; + const hoisted = []; + const has_drc_streams = !!drc_labels; + const has_vb_streams = !!vb_labels; + let track_name; + if (audio_track) { + if (has_drc_streams && first_format.is_drc) { + track_name = drc_labels.label_drc_multiple(audio_track.display_name); + } else if (has_vb_streams && first_format.is_vb) { + track_name = vb_labels.label_vb_multiple(audio_track.display_name); + } else { + track_name = audio_track.display_name; + } + } else if (has_drc_streams || has_vb_streams) { + if (has_drc_streams && first_format.is_drc) { + track_name = drc_labels.label_drc; + } else if (has_vb_streams && first_format.is_vb) { + track_name = vb_labels.label_vb; + } else { + track_name = (_a = drc_labels || vb_labels) == null ? void 0 : _a.label_original; + } + } + const set = { + mime_type: first_format.mime_type.split(";")[0], + language: (_b = first_format.language) != null ? _b : void 0, + codecs: hoistCodecsIfPossible(formats, hoisted), + audio_sample_rate: hoistNumberAttributeIfPossible(formats, "audio_sample_rate", hoisted), + track_name, + track_roles: getTrackRoles(first_format, has_drc_streams), + channels: hoistAudioChannelsIfPossible(formats, hoisted), + drm_families: first_format.drm_families, + drm_track_type: first_format.drm_track_type, + representations: await Promise.all(formats.map((format) => getAudioRepresentation(format, hoisted, url_transformer, actions, player, cpn, shared_post_live_dvr_info, is_sabr))) + }; + return set; +} +__name(getAudioSet, "getAudioSet"); +var COLOR_PRIMARIES = { + BT709: "1", + BT2020: "9" +}; +var COLOR_TRANSFER_CHARACTERISTICS = { + BT709: "1", + BT2020_10: "14", + SMPTEST2084: "16", + ARIB_STD_B67: "18" +}; +var COLOR_MATRIX_COEFFICIENTS = { + BT709: "1", + BT2020_NCL: "14" +}; +function getColorInfo(format) { + var _a; + const color_info = format.color_info; + let primaries; + let transfer_characteristics; + let matrix_coefficients; + if (color_info) { + if (color_info.primaries) { + primaries = COLOR_PRIMARIES[color_info.primaries]; + } + if (color_info.transfer_characteristics) { + transfer_characteristics = COLOR_TRANSFER_CHARACTERISTICS[color_info.transfer_characteristics]; + } + if (color_info.matrix_coefficients) { + matrix_coefficients = COLOR_MATRIX_COEFFICIENTS[color_info.matrix_coefficients]; + if (!matrix_coefficients) { + const url = new URL(format.url); + const anonymisedFormat = JSON.parse(JSON.stringify(format)); + anonymisedFormat.url = "REDACTED"; + anonymisedFormat.signature_cipher = "REDACTED"; + anonymisedFormat.cipher = "REDACTED"; + warn(TAG_, `Unknown matrix coefficients "${color_info.matrix_coefficients}". The DASH manifest is still usable without this. +Please report it at ${package_default.bugs.url} so we can add support for it. +InnerTube client: ${url.searchParams.get("c")} +format:`, anonymisedFormat); + } + } + } else if ((_a = getStringBetweenStrings(format.mime_type, 'codecs="', '"')) == null ? void 0 : _a.startsWith("avc1")) { + transfer_characteristics = COLOR_TRANSFER_CHARACTERISTICS.BT709; + } + const info2 = { + primaries, + transfer_characteristics, + matrix_coefficients + }; + return info2; +} +__name(getColorInfo, "getColorInfo"); +async function getVideoRepresentation(format, url_transformer, hoisted, player, actions, cpn, shared_post_live_dvr_info, is_sabr) { + const rep = { + uid: format.itag.toString(), + bitrate: format.bitrate, + width: format.width, + height: format.height, + codecs: !hoisted.includes("codecs") ? getStringBetweenStrings(format.mime_type, 'codecs="', '"') : void 0, + fps: !hoisted.includes("fps") ? format.fps : void 0, + segment_info: await getSegmentInfo(format, url_transformer, actions, player, cpn, shared_post_live_dvr_info, is_sabr) + }; + return rep; +} +__name(getVideoRepresentation, "getVideoRepresentation"); +async function getVideoSet(formats, url_transformer, player, actions, cpn, shared_post_live_dvr_info, is_sabr) { + const first_format = formats[0]; + const color_info = getColorInfo(first_format); + const hoisted = []; + const set = { + mime_type: first_format.mime_type.split(";")[0], + color_info, + codecs: hoistCodecsIfPossible(formats, hoisted), + fps: hoistNumberAttributeIfPossible(formats, "fps", hoisted), + drm_families: first_format.drm_families, + drm_track_type: first_format.drm_track_type, + representations: await Promise.all(formats.map((format) => getVideoRepresentation(format, url_transformer, hoisted, player, actions, cpn, shared_post_live_dvr_info, is_sabr))) + }; + return set; +} +__name(getVideoSet, "getVideoSet"); +function getStoryboardInfo(storyboards) { + var _a; + const mime_info = /* @__PURE__ */ new Map(); + const boards = storyboards.is(PlayerStoryboardSpec) ? storyboards.boards : [storyboards.board]; + for (const storyboard of boards) { + const extension = new URL(storyboard.template_url).pathname.split(".").pop(); + const mime_type = `image/${extension === "jpg" ? "jpeg" : extension}`; + if (!mime_info.has(mime_type)) { + mime_info.set(mime_type, []); + } + (_a = mime_info.get(mime_type)) == null ? void 0 : _a.push(storyboard); + } + return mime_info; +} +__name(getStoryboardInfo, "getStoryboardInfo"); +async function getStoryboardMimeType(actions, board, transform_url, probable_mime_type, shared_response) { + const url = board.template_url; + const req_url = transform_url(new URL(url.replace("$M", "0"))); + const res_promise = shared_response.response ? shared_response.response : actions.session.http.fetch_function(req_url, { + method: "HEAD", + headers: STREAM_HEADERS + }); + shared_response.response = res_promise; + const res = await res_promise; + return res.headers.get("Content-Type") || probable_mime_type; +} +__name(getStoryboardMimeType, "getStoryboardMimeType"); +async function getStoryboardBitrate(actions, board, shared_response) { + const url = board.template_url; + const response_promises = []; + const request_limit = Math.min(board.type === "vod" ? board.storyboard_count : 5, 10); + for (let i = 0; i < request_limit; i++) { + const req_url = new URL(url.replace("$M", i.toString())); + const response_promise = i === 0 && shared_response.response ? shared_response.response : actions.session.http.fetch_function(req_url, { + method: "HEAD", + headers: STREAM_HEADERS + }); + if (i === 0) + shared_response.response = response_promise; + response_promises.push(response_promise); + } + const responses = await Promise.all(response_promises); + const content_lengths = []; + for (const response of responses) { + content_lengths.push(parseInt(response.headers.get("Content-Length") || "0")); + } + return Math.ceil(Math.max(...content_lengths) / (board.rows * board.columns) * 8); +} +__name(getStoryboardBitrate, "getStoryboardBitrate"); +function getImageRepresentation(duration, actions, board, transform_url, shared_response) { + const url = board.template_url; + const template_url = new URL(url.replace("$M", "$Number$")); + let template_duration; + if (board.type === "vod") { + template_duration = duration / board.storyboard_count; + } else { + template_duration = duration * board.columns * board.rows; + } + const rep = { + uid: `thumbnails_${board.thumbnail_width}x${board.thumbnail_height}`, + getBitrate() { + return getStoryboardBitrate(actions, board, shared_response); + }, + sheet_width: board.thumbnail_width * board.columns, + sheet_height: board.thumbnail_height * board.rows, + thumbnail_height: board.thumbnail_height, + thumbnail_width: board.thumbnail_width, + rows: board.rows, + columns: board.columns, + template_duration: Math.round(template_duration), + template_url: transform_url(template_url).toString(), + getURL(n) { + return template_url.toString().replace("$Number$", n.toString()); + } + }; + return rep; +} +__name(getImageRepresentation, "getImageRepresentation"); +function getImageSets(duration, actions, storyboards, transform_url) { + const mime_info = getStoryboardInfo(storyboards); + const shared_response = {}; + return Array.from(mime_info.entries()).map(([type, boards]) => ({ + probable_mime_type: type, + getMimeType() { + return getStoryboardMimeType(actions, boards[0], transform_url, type, shared_response); + }, + representations: boards.map((board) => getImageRepresentation(duration, actions, board, transform_url, shared_response)) + })); +} +__name(getImageSets, "getImageSets"); +function getTextSets(caption_tracks, format, transform_url) { + const mime_type = format === "vtt" ? "text/vtt" : "application/ttml+xml"; + return caption_tracks.map((caption_track) => { + const url = new URL(caption_track.base_url); + url.searchParams.set("fmt", format); + const track_roles = ["caption"]; + if (url.searchParams.has("tlang")) { + track_roles.push("dub"); + } + return { + mime_type, + language: caption_track.language_code, + track_name: caption_track.name.toString(), + track_roles, + representation: { + uid: `text-${caption_track.vss_id}`, + base_url: transform_url(url).toString() + } + }; + }); +} +__name(getTextSets, "getTextSets"); +async function getStreamingInfo(streaming_data, is_post_live_dvr = false, url_transformer = (url) => url, format_filter, cpn, player, actions, storyboards, caption_tracks, options) { + if (!streaming_data) + throw new InnertubeError("Streaming data not available"); + const formats = format_filter ? streaming_data.adaptive_formats.filter((fmt) => !format_filter(fmt)) : streaming_data.adaptive_formats; + let getDuration; + let shared_post_live_dvr_info; + if (is_post_live_dvr) { + shared_post_live_dvr_info = {}; + if (!actions) { + throw new InnertubeError("Unable to get duration or segment count for this Post Live DVR video without an Actions instance"); + } + getDuration = /* @__PURE__ */ __name(() => { + if (!shared_post_live_dvr_info) { + return Promise.resolve(0); + } + return getPostLiveDvrDuration(shared_post_live_dvr_info, formats[0], url_transformer, actions, player, cpn); + }, "getDuration"); + } else { + const duration = formats[0].approx_duration_ms / 1e3; + getDuration = /* @__PURE__ */ __name(() => Promise.resolve(duration), "getDuration"); + } + const { groups, has_multiple_audio_tracks } = getFormatGroupings(formats, is_post_live_dvr); + const { video_groups, audio_groups } = groups.reduce((acc, formats2) => { + if (formats2[0].has_audio) { + if (has_multiple_audio_tracks && !formats2[0].audio_track) + return acc; + acc.audio_groups.push(formats2); + return acc; + } + acc.video_groups.push(formats2); + return acc; + }, { + video_groups: [], + audio_groups: [] + }); + let drc_labels; + let vb_labels; + let hasDrc = false; + let hasVb = false; + for (const ag of audio_groups.flat()) { + if (hasDrc === false && ag.is_drc) { + hasDrc = true; + } + if (hasVb === false && ag.is_vb) { + hasVb = true; + } + } + if (hasDrc) { + drc_labels = { + label_original: (options == null ? void 0 : options.label_original) || "Original", + label_drc: (options == null ? void 0 : options.label_drc) || "Stable Volume", + label_drc_multiple: (options == null ? void 0 : options.label_drc_multiple) || ((display_name) => `${display_name} (Stable Volume)`) + }; + } + if (hasVb) { + vb_labels = { + label_original: (options == null ? void 0 : options.label_original) || "Original", + label_vb: (options == null ? void 0 : options.label_vb) || "Voice Boost", + label_vb_multiple: (options == null ? void 0 : options.label_vb_multiple) || ((display_name) => `${display_name} (Voice Boost)`) + }; + } + const audio_sets = await Promise.all(audio_groups.map((formats2) => getAudioSet(formats2, url_transformer, actions, player, cpn, shared_post_live_dvr_info, drc_labels, vb_labels, options == null ? void 0 : options.is_sabr))); + const video_sets = await Promise.all(video_groups.map((formats2) => getVideoSet(formats2, url_transformer, player, actions, cpn, shared_post_live_dvr_info, options == null ? void 0 : options.is_sabr))); + let image_sets = []; + if (storyboards && actions) { + let duration; + if (storyboards.is(PlayerStoryboardSpec)) { + duration = formats[0].approx_duration_ms / 1e3; + } else { + const target_duration_dec = formats[0].target_duration_dec; + if (target_duration_dec === void 0) + throw new InnertubeError("Format is missing target_duration_dec", { format: formats[0] }); + duration = target_duration_dec; + } + image_sets = getImageSets(duration, actions, storyboards, url_transformer); + } + let text_sets = []; + if (caption_tracks && (options == null ? void 0 : options.captions_format)) { + if (options.captions_format !== "vtt" && options.captions_format !== "ttml") { + throw new InnertubeError("Invalid captions format", options.captions_format); + } + text_sets = getTextSets(caption_tracks, options.captions_format, url_transformer); + } + const info2 = { + getDuration, + audio_sets, + video_sets, + image_sets, + text_sets + }; + return info2; +} +__name(getStreamingInfo, "getStreamingInfo"); + +// dist/src/utils/DashManifest.js +async function OTFPostLiveDvrSegmentInfo({ info: info2 }) { + if (!info2.is_oft && !info2.is_post_live_dvr) + return null; + const template = await info2.getSegmentTemplate(); + return createElement( + "segmentTemplate", + { startNumber: template.init_url ? "1" : "0", timescale: "1000", initialization: template.init_url, media: template.media_url }, + createElement("segmentTimeline", null, template.timeline.map((segment_duration) => createElement("s", { d: segment_duration.duration, r: segment_duration.repeat_count }))) + ); +} +__name(OTFPostLiveDvrSegmentInfo, "OTFPostLiveDvrSegmentInfo"); +function SegmentInfo({ info: info2 }) { + if (info2.is_oft || info2.is_post_live_dvr) { + return createElement(OTFPostLiveDvrSegmentInfo, { info: info2 }); + } + return createElement( + Fragment, + null, + createElement("baseURL", null, info2.base_url), + createElement( + "segmentBase", + { indexRange: `${info2.index_range.start}-${info2.index_range.end}` }, + createElement("initialization", { range: `${info2.init_range.start}-${info2.init_range.end}` }) + ) + ); +} +__name(SegmentInfo, "SegmentInfo"); +function getDrmSystemId(drm_family) { + switch (drm_family) { + case "WIDEVINE": + return "edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"; + case "PLAYREADY": + return "9a04f079-9840-4286-ab92-e65be0885f95"; + default: + return null; + } +} +__name(getDrmSystemId, "getDrmSystemId"); +async function DashManifest({ streamingData, isPostLiveDvr, transformURL, rejectFormat, cpn, player, actions, storyboards, captionTracks, options }) { + const { getDuration, audio_sets, video_sets, image_sets, text_sets } = await getStreamingInfo(streamingData, isPostLiveDvr, transformURL, rejectFormat, cpn, player, actions, storyboards, captionTracks, options); + return createElement( + "mPD", + { xmlns: "urn:mpeg:dash:schema:mpd:2011", minBufferTime: "PT1.500S", profiles: "urn:mpeg:dash:profile:isoff-main:2011", type: "static", mediaPresentationDuration: `PT${await getDuration()}S`, "xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance", "xsi:schemaLocation": "urn:mpeg:dash:schema:mpd:2011 http://standards.iso.org/ittf/PubliclyAvailableStandards/MPEG-DASH_schema_files/DASH-MPD.xsd" }, + createElement( + "period", + null, + audio_sets.map((set, index) => createElement( + "adaptationSet", + { id: index, mimeType: set.mime_type, startWithSAP: "1", subsegmentAlignment: "true", lang: set.language, codecs: set.codecs, audioSamplingRate: set.audio_sample_rate, contentType: "audio" }, + set.drm_families && set.drm_families.map((drm_family) => createElement("contentProtection", { schemeIdUri: `urn:uuid:${getDrmSystemId(drm_family)}` })), + set.track_roles && set.track_roles.map((role) => createElement("role", { schemeIdUri: "urn:mpeg:dash:role:2011", value: role })), + set.track_name && createElement("label", { id: index }, set.track_name), + set.channels && createElement("audioChannelConfiguration", { schemeIdUri: "urn:mpeg:dash:23003:3:audio_channel_configuration:2011", value: set.channels }), + set.representations.map((rep) => createElement( + "representation", + { id: rep.uid, bandwidth: rep.bitrate, codecs: rep.codecs, audioSamplingRate: rep.audio_sample_rate }, + rep.channels && createElement("audioChannelConfiguration", { schemeIdUri: "urn:mpeg:dash:23003:3:audio_channel_configuration:2011", value: rep.channels }), + createElement(SegmentInfo, { info: rep.segment_info }) + )) + )), + video_sets.map((set, index) => createElement( + "adaptationSet", + { id: index + audio_sets.length, mimeType: set.mime_type, startWithSAP: "1", subsegmentAlignment: "true", codecs: set.codecs, maxPlayoutRate: "1", frameRate: set.fps, contentType: "video" }, + set.drm_families && set.drm_families.map((drm_family) => createElement("contentProtection", { schemeIdUri: `urn:uuid:${getDrmSystemId(drm_family)}` })), + set.color_info.primaries && createElement("supplementalProperty", { schemeIdUri: "urn:mpeg:mpegB:cicp:ColourPrimaries", value: set.color_info.primaries }), + set.color_info.transfer_characteristics && createElement("supplementalProperty", { schemeIdUri: "urn:mpeg:mpegB:cicp:TransferCharacteristics", value: set.color_info.transfer_characteristics }), + set.color_info.matrix_coefficients && createElement("supplementalProperty", { schemeIdUri: "urn:mpeg:mpegB:cicp:MatrixCoefficients", value: set.color_info.matrix_coefficients }), + set.representations.map((rep) => createElement( + "representation", + { id: rep.uid, bandwidth: rep.bitrate, width: rep.width, height: rep.height, codecs: rep.codecs, frameRate: rep.fps }, + createElement(SegmentInfo, { info: rep.segment_info }) + )) + )), + image_sets.map(async (set, index) => { + return createElement("adaptationSet", { id: index + audio_sets.length + video_sets.length, mimeType: await set.getMimeType(), contentType: "image" }, set.representations.map(async (rep) => createElement( + "representation", + { id: `thumbnails_${rep.thumbnail_width}x${rep.thumbnail_height}`, bandwidth: await rep.getBitrate(), width: rep.sheet_width, height: rep.sheet_height }, + createElement("essentialProperty", { schemeIdUri: "http://dashif.org/thumbnail_tile", value: `${rep.columns}x${rep.rows}` }), + createElement("segmentTemplate", { media: rep.template_url, duration: rep.template_duration, startNumber: "0" }) + ))); + }), + text_sets.map((set, index) => { + return createElement( + "adaptationSet", + { id: index + audio_sets.length + video_sets.length + image_sets.length, mimeType: set.mime_type, lang: set.language, contentType: "text" }, + set.track_roles.map((role) => createElement("role", { schemeIdUri: "urn:mpeg:dash:role:2011", value: role })), + createElement("label", { id: index + audio_sets.length }, set.track_name), + createElement( + "representation", + { id: set.representation.uid, bandwidth: "0" }, + createElement("baseURL", null, set.representation.base_url) + ) + ); + }) + ) + ); +} +__name(DashManifest, "DashManifest"); +function toDash(streaming_data, is_post_live_dvr = false, url_transformer = (url) => url, format_filter, cpn, player, actions, storyboards, caption_tracks, options) { + if (!streaming_data) + throw new InnertubeError("Streaming data not available"); + return renderToString(createElement(DashManifest, { streamingData: streaming_data, isPostLiveDvr: is_post_live_dvr, transformURL: url_transformer, options, rejectFormat: format_filter, cpn, player, actions, storyboards, captionTracks: caption_tracks })); +} +__name(toDash, "toDash"); + +// dist/src/utils/FormatUtils.js +async function download(options, actions, playability_status, streaming_data, player, cpn) { + if ((playability_status == null ? void 0 : playability_status.status) === "UNPLAYABLE") + throw new InnertubeError("Video is unplayable", { error_type: "UNPLAYABLE" }); + if ((playability_status == null ? void 0 : playability_status.status) === "LOGIN_REQUIRED") + throw new InnertubeError("Video is login required", { error_type: "LOGIN_REQUIRED" }); + if (!streaming_data) + throw new InnertubeError("Streaming data not available.", { error_type: "NO_STREAMING_DATA" }); + const opts = { + quality: "360p", + type: "video+audio", + format: "mp4", + range: void 0, + ...options + }; + const format = chooseFormat(opts, streaming_data); + const format_url = await format.decipher(player); + if (opts.type === "video+audio" && !options.range) { + const response = await actions.session.http.fetch_function(`${format_url}&cpn=${cpn}`, { + method: "GET", + headers: STREAM_HEADERS, + redirect: "follow" + }); + if (!response.ok) + throw new InnertubeError("The server responded with a non 2xx status code", { error_type: "FETCH_FAILED", response }); + const body = response.body; + if (!body) + throw new InnertubeError("Could not get ReadableStream from fetch Response.", { error_type: "FETCH_FAILED", response }); + return body; + } + const chunk_size = 1048576 * 10; + let chunk_start = options.range ? options.range.start : 0; + let chunk_end = options.range ? options.range.end : chunk_size; + let must_end = false; + let cancel; + return new Platform.shim.ReadableStream({ + start() { + }, + pull: /* @__PURE__ */ __name(async (controller) => { + if (must_end) { + controller.close(); + return; + } + if (chunk_end >= (format.content_length ? format.content_length : 0) || options.range) { + must_end = true; + } + return new Promise(async (resolve, reject) => { + try { + cancel = new AbortController(); + const response = await actions.session.http.fetch_function(`${format_url}&cpn=${cpn}&range=${chunk_start}-${chunk_end || ""}`, { + method: "GET", + headers: { + ...STREAM_HEADERS + // XXX: use YouTube's range parameter instead of a Range header. + // Range: `bytes=${chunk_start}-${chunk_end}` + }, + signal: cancel.signal + }); + if (!response.ok) + throw new InnertubeError("The server responded with a non 2xx status code", { + error_type: "FETCH_FAILED", + response + }); + const body = response.body; + if (!body) + throw new InnertubeError("Could not get ReadableStream from fetch Response.", { + error_type: "FETCH_FAILED", + response + }); + for await (const chunk of streamToIterable(body)) { + controller.enqueue(chunk); + } + chunk_start = chunk_end + 1; + chunk_end += chunk_size; + resolve(); + } catch (e) { + reject(e); + } + }); + }, "pull"), + async cancel(reason) { + cancel.abort(reason); + } + }, { + highWaterMark: 1, + // TODO: better value? + size(chunk) { + return chunk.byteLength; + } + }); +} +__name(download, "download"); +function chooseFormat(options, streaming_data) { + if (!streaming_data) + throw new InnertubeError("Streaming data not available"); + const formats = [ + ...streaming_data.formats || [], + ...streaming_data.adaptive_formats || [] + ]; + if (options.itag) { + const candidates2 = formats.filter((format) => format.itag === options.itag); + if (!candidates2.length) + throw new InnertubeError("No matching formats found", { options }); + return candidates2[0]; + } + const requires_audio = options.type ? options.type.includes("audio") : true; + const requires_video = options.type ? options.type.includes("video") : true; + const language = options.language || "original"; + const quality = options.quality || "best"; + let best_width = -1; + const is_best = ["best", "bestefficiency"].includes(quality); + const use_most_efficient = quality !== "best"; + let candidates = formats.filter((format) => { + if (requires_audio && !format.has_audio) + return false; + if (requires_video && !format.has_video) + return false; + if (options.codec && !format.mime_type.includes(options.codec)) + return false; + if (options.format !== "any" && !format.mime_type.includes(options.format || "mp4")) + return false; + if (!is_best && format.quality_label !== quality) + return false; + if (format.width && best_width < format.width) + best_width = format.width; + return true; + }); + if (!candidates.length) + throw new InnertubeError("No matching formats found", { options }); + if (is_best && requires_video) + candidates = candidates.filter((format) => format.width === best_width); + if (requires_audio && !requires_video) { + const audio_only = candidates.filter((format) => { + if (language !== "original") { + return !format.has_video && !format.has_text && format.language === language; + } + return !format.has_video && !format.has_text && format.is_original; + }); + if (audio_only.length > 0) { + candidates = audio_only; + } + } + if (use_most_efficient) { + candidates.sort((a, b) => a.bitrate - b.bitrate); + } else { + candidates.sort((a, b) => b.bitrate - a.bitrate); + } + return candidates[0]; +} +__name(chooseFormat, "chooseFormat"); + +// dist/src/utils/HTTPClient.js +var _session, _cookie, _fetch, _HTTPClient_instances, processJsonPayload_fn, setupCommonHeaders_fn, adjustContext_fn; +var _HTTPClient = class _HTTPClient { + constructor(session, cookie, fetch) { + __privateAdd(this, _HTTPClient_instances); + __privateAdd(this, _session); + __privateAdd(this, _cookie); + __privateAdd(this, _fetch); + __privateSet(this, _session, session); + __privateSet(this, _cookie, cookie); + __privateSet(this, _fetch, fetch || Platform.shim.fetch); + } + get fetch_function() { + return __privateGet(this, _fetch); + } + async fetch(input, init) { + const session = __privateGet(this, _session); + const innertube_url = URLS.API.PRODUCTION_1 + session.api_version; + const baseURL = (init == null ? void 0 : init.baseURL) || innertube_url; + const request_url = typeof input === "string" ? new URL(`${baseURL}${baseURL.endsWith("/") || input.startsWith("/") ? "" : "/"}${input}`) : input instanceof URL ? input : new URL(input.url, baseURL); + const headers = (init == null ? void 0 : init.headers) || (input instanceof Platform.shim.Request ? input.headers : new Platform.shim.Headers()) || new Platform.shim.Headers(); + const body = (init == null ? void 0 : init.body) || (input instanceof Platform.shim.Request ? input.body : void 0); + const request_headers = new Platform.shim.Headers(headers); + __privateMethod(this, _HTTPClient_instances, setupCommonHeaders_fn).call(this, request_headers, session, request_url); + request_url.searchParams.set("prettyPrint", "false"); + request_url.searchParams.set("alt", "json"); + const content_type = request_headers.get("Content-Type"); + let request_body = body; + let is_web_kids = false; + const is_innertube_req = baseURL === innertube_url || baseURL === URLS.YT_UPLOAD; + if (content_type === "application/json" && is_innertube_req && typeof body === "string") { + const { newBody, isWebKids: processedIsWebKids, clientVersion: processedClientVersion, clientNameId: processedClientNameId, adjustedClientName } = __privateMethod(this, _HTTPClient_instances, processJsonPayload_fn).call(this, body, session); + request_body = newBody; + is_web_kids = processedIsWebKids; + if (processedClientVersion) { + request_headers.set("X-Youtube-Client-Version", processedClientVersion); + } + if (processedClientNameId) { + request_headers.set("X-Youtube-Client-Name", processedClientNameId); + } + if (adjustedClientName === CLIENTS.ANDROID.NAME || adjustedClientName === CLIENTS.YTMUSIC_ANDROID.NAME) { + request_headers.set("User-Agent", CLIENTS.ANDROID.USER_AGENT); + request_headers.set("X-GOOG-API-FORMAT-VERSION", "2"); + } else if (adjustedClientName === CLIENTS.IOS.NAME) { + request_headers.set("User-Agent", CLIENTS.IOS.USER_AGENT); + } + } else if (content_type === "application/x-protobuf") { + if (Platform.shim.server) { + request_headers.set("User-Agent", CLIENTS.ANDROID.USER_AGENT); + request_headers.set("X-GOOG-API-FORMAT-VERSION", "2"); + request_headers.delete("X-Youtube-Client-Version"); + } + } + if (session.logged_in && is_innertube_req && !is_web_kids) { + const oauth = session.oauth; + if (oauth.oauth2_tokens) { + if (oauth.shouldRefreshToken()) { + await oauth.refreshAccessToken(); + } + request_headers.set("Authorization", `Bearer ${oauth.oauth2_tokens.access_token}`); + } + const cookie = __privateGet(this, _cookie); + if (cookie) { + const sapisid = getCookie(cookie, "SAPISID"); + if (sapisid) { + request_headers.set("Authorization", await generateSidAuth(sapisid)); + request_headers.set("X-Goog-Authuser", session.account_index.toString()); + if (session.context.user.onBehalfOfUser) + request_headers.set("X-Goog-PageId", session.context.user.onBehalfOfUser); + } + request_headers.set("Cookie", cookie); + } + } + const request = new Platform.shim.Request(request_url, input instanceof Platform.shim.Request ? input : init); + const response = await __privateGet(this, _fetch).call(this, request, { + body: request_body, + headers: request_headers, + redirect: input instanceof Platform.shim.Request ? input.redirect : (init == null ? void 0 : init.redirect) || "follow", + ...Platform.shim.runtime !== "cf-worker" ? { credentials: "include" } : {} + }); + if (response.ok) { + return response; + } + throw new InnertubeError(`Request to ${response.url} failed with status code ${response.status}`, await response.text()); + } +}; +_session = new WeakMap(); +_cookie = new WeakMap(); +_fetch = new WeakMap(); +_HTTPClient_instances = new WeakSet(); +processJsonPayload_fn = /* @__PURE__ */ __name(function(json_body, session) { + const parsed_payload = JSON.parse(json_body); + const adjusted_context = JSON.parse(JSON.stringify(session.context)); + __privateMethod(this, _HTTPClient_instances, adjustContext_fn).call(this, adjusted_context, parsed_payload.client); + const new_payload = { + ...parsed_payload, + context: adjusted_context + }; + const clientVersion = new_payload.context.client.clientVersion; + const clientNameFromAdjustedContext = new_payload.context.client.clientName; + const clientNameId = CLIENT_NAME_IDS[clientNameFromAdjustedContext]; + delete new_payload.client; + const isWebKids = new_payload.context.client.clientName === CLIENTS.WEB_KIDS.NAME; + return { + newBody: JSON.stringify(new_payload), + isWebKids, + clientVersion, + clientNameId, + adjustedClientName: new_payload.context.client.clientName + }; +}, "#processJsonPayload"); +setupCommonHeaders_fn = /* @__PURE__ */ __name(function(request_headers, session, request_url) { + request_headers.set("Accept", "*/*"); + request_headers.set("Accept-Language", "*"); + request_headers.set("X-Goog-Visitor-Id", session.context.client.visitorData || ""); + request_headers.set("X-Youtube-Client-Version", session.context.client.clientVersion || ""); + const client_name_id = CLIENT_NAME_IDS[session.context.client.clientName]; + if (client_name_id) { + request_headers.set("X-Youtube-Client-Name", client_name_id); + } + if (Platform.shim.server) { + request_headers.set("User-Agent", session.user_agent || ""); + request_headers.set("Origin", request_url.origin); + } +}, "#setupCommonHeaders"); +adjustContext_fn = /* @__PURE__ */ __name(function(ctx, client) { + if (!client) + return; + const clientName = client.toUpperCase(); + if (!SUPPORTED_CLIENTS.includes(clientName)) { + throw new InnertubeError(`Invalid client: ${client}`, { + available_innertube_clients: SUPPORTED_CLIENTS + }); + } + if (clientName !== "WEB") { + delete ctx.client.configInfo; + } + if (clientName === "ANDROID" || clientName === "YTMUSIC_ANDROID" || clientName === "YTSTUDIO_ANDROID") { + ctx.client.androidSdkVersion = CLIENTS.ANDROID.SDK_VERSION; + ctx.client.userAgent = CLIENTS.ANDROID.USER_AGENT; + ctx.client.osName = "Android"; + ctx.client.osVersion = "13"; + ctx.client.platform = "MOBILE"; + } + switch (clientName) { + case "MWEB": + ctx.client.clientVersion = CLIENTS.MWEB.VERSION; + ctx.client.clientName = CLIENTS.MWEB.NAME; + ctx.client.clientFormFactor = "SMALL_FORM_FACTOR"; + ctx.client.platform = "MOBILE"; + break; + case "IOS": + ctx.client.deviceMake = "Apple"; + ctx.client.deviceModel = CLIENTS.IOS.DEVICE_MODEL; + ctx.client.clientVersion = CLIENTS.IOS.VERSION; + ctx.client.clientName = CLIENTS.IOS.NAME; + ctx.client.platform = "MOBILE"; + ctx.client.osName = CLIENTS.IOS.OS_NAME; + ctx.client.osVersion = CLIENTS.IOS.OS_VERSION; + delete ctx.client.browserName; + delete ctx.client.browserVersion; + break; + case "YTMUSIC": + ctx.client.clientVersion = CLIENTS.YTMUSIC.VERSION; + ctx.client.clientName = CLIENTS.YTMUSIC.NAME; + break; + case "ANDROID": + ctx.client.clientVersion = CLIENTS.ANDROID.VERSION; + ctx.client.clientFormFactor = "SMALL_FORM_FACTOR"; + ctx.client.clientName = CLIENTS.ANDROID.NAME; + break; + case "ANDROID_VR": + ctx.client.androidSdkVersion = 32; + ctx.client.osName = "Android"; + ctx.client.osVersion = "12L"; + ctx.client.platform = "MOBILE"; + ctx.client.userAgent = CLIENTS.ANDROID_VR.USER_AGENT; + ctx.client.deviceMake = CLIENTS.ANDROID_VR.DEVICE_MAKE; + ctx.client.deviceModel = CLIENTS.ANDROID_VR.DEVICE_MODEL; + ctx.client.clientVersion = CLIENTS.ANDROID_VR.VERSION; + ctx.client.clientFormFactor = "SMALL_FORM_FACTOR"; + ctx.client.clientName = CLIENTS.ANDROID_VR.NAME; + break; + case "YTMUSIC_ANDROID": + ctx.client.clientVersion = CLIENTS.YTMUSIC_ANDROID.VERSION; + ctx.client.clientFormFactor = "SMALL_FORM_FACTOR"; + ctx.client.clientName = CLIENTS.YTMUSIC_ANDROID.NAME; + break; + case "YTSTUDIO_ANDROID": + ctx.client.clientVersion = CLIENTS.YTSTUDIO_ANDROID.VERSION; + ctx.client.clientFormFactor = "SMALL_FORM_FACTOR"; + ctx.client.clientName = CLIENTS.YTSTUDIO_ANDROID.NAME; + break; + case "TV": + ctx.client.clientVersion = CLIENTS.TV.VERSION; + ctx.client.clientName = CLIENTS.TV.NAME; + ctx.client.userAgent = CLIENTS.TV.USER_AGENT; + break; + case "TV_SIMPLY": + ctx.client.clientVersion = CLIENTS.TV_SIMPLY.VERSION; + ctx.client.clientName = CLIENTS.TV_SIMPLY.NAME; + break; + case "TV_EMBEDDED": + ctx.client.clientName = CLIENTS.TV_EMBEDDED.NAME; + ctx.client.clientVersion = CLIENTS.TV_EMBEDDED.VERSION; + ctx.client.clientScreen = "EMBED"; + ctx.thirdParty = { embedUrl: URLS.YT_BASE }; + break; + case "YTKIDS": + ctx.client.clientVersion = CLIENTS.WEB_KIDS.VERSION; + ctx.client.clientName = CLIENTS.WEB_KIDS.NAME; + ctx.client.kidsAppInfo = { + categorySettings: { + enabledCategories: [ + "approved_for_you", + "black_joy", + "camp", + "collections", + "earth", + "explore", + "favorites", + "gaming", + "halloween", + "hero", + "learning", + "move", + "music", + "reading", + "shared_by_parents", + "shows", + "soccer", + "sports", + "spotlight", + "winter" + ] + }, + contentSettings: { + corpusPreference: "KIDS_CORPUS_PREFERENCE_YOUNGER", + kidsNoSearchMode: "YT_KIDS_NO_SEARCH_MODE_OFF" + } + }; + break; + case "WEB_EMBEDDED": + ctx.client.clientName = CLIENTS.WEB_EMBEDDED.NAME; + ctx.client.clientVersion = CLIENTS.WEB_EMBEDDED.VERSION; + ctx.client.clientScreen = "EMBED"; + ctx.thirdParty = { embedUrl: URLS.GOOGLE_SEARCH_BASE }; + break; + case "WEB_CREATOR": + ctx.client.clientName = CLIENTS.WEB_CREATOR.NAME; + ctx.client.clientVersion = CLIENTS.WEB_CREATOR.VERSION; + break; + default: + break; + } +}, "#adjustContext"); +__name(_HTTPClient, "HTTPClient"); +var HTTPClient = _HTTPClient; + +// dist/src/utils/LZW.js +var LZW_exports = {}; +__export(LZW_exports, { + compress: () => compress, + decompress: () => decompress +}); +function compress(input) { + const output = []; + const dictionary = {}; + for (let i = 0; i < 256; i++) { + dictionary[String.fromCharCode(i)] = i; + } + let current_string = ""; + let dictionary_size = 256; + for (let i = 0; i < input.length; i++) { + const current_char = input[i]; + const combined_string = current_string + current_char; + if (dictionary.hasOwnProperty(combined_string)) { + current_string = combined_string; + } else { + output.push(dictionary[current_string]); + dictionary[combined_string] = dictionary_size++; + current_string = current_char; + } + } + if (current_string !== "") { + output.push(dictionary[current_string]); + } + return output.map((code) => String.fromCharCode(code)).join(""); +} +__name(compress, "compress"); +function decompress(input) { + const dictionary = {}; + const input_data = input.split(""); + const output = [input_data.shift()]; + const input_length = input_data.length >>> 0; + let dictionary_code = 256; + let current_char = output[0]; + let current_string = current_char; + for (let i = 0; i < input_length; ++i) { + const current_code = input_data[i].charCodeAt(0); + const entry = current_code < 256 ? input_data[i] : dictionary[current_code] ? dictionary[current_code] : current_string + current_char; + output.push(entry); + current_char = entry.charAt(0); + dictionary[dictionary_code++] = current_string + current_char; + current_string = entry; + } + return output.join(""); +} +__name(decompress, "decompress"); + +// dist/src/utils/BinarySerializer.js +var BinarySerializer_exports = {}; +__export(BinarySerializer_exports, { + MAGIC_HEADER: () => MAGIC_HEADER, + VERSION: () => VERSION, + deserialize: () => deserialize, + serialize: () => serialize +}); +var MAGIC_HEADER = 5849684; +var VERSION = 1; +function serialize(data) { + const json_str = JSON.stringify(data); + const compressed = compress(json_str); + const compressed_bytes = new TextEncoder().encode(compressed); + const buffer = new ArrayBuffer(12 + compressed_bytes.byteLength); + const view = new DataView(buffer); + view.setUint32(0, MAGIC_HEADER, true); + view.setUint32(4, VERSION, true); + view.setUint32(8, compressed_bytes.byteLength, true); + new Uint8Array(buffer).set(compressed_bytes, 12); + return buffer; +} +__name(serialize, "serialize"); +function deserialize(buffer) { + if (buffer.byteLength < 12) + throw new Error("Invalid binary format: buffer too short"); + const view = new DataView(buffer.buffer, buffer.byteOffset); + const magic = view.getUint32(0, true); + if (magic !== MAGIC_HEADER) { + throw new Error("Invalid binary format: magic header mismatch"); + } + const version = view.getUint32(4, true); + if (version !== VERSION) { + throw new Error(`Unsupported binary format version: ${version}`); + } + const data_length = view.getUint32(8, true); + const compressed_data = buffer.slice(12, 12 + data_length); + const compressed = new TextDecoder().decode(compressed_data); + const json_str = decompress(compressed); + return JSON.parse(json_str); +} +__name(deserialize, "deserialize"); + +// dist/src/utils/ProtoUtils.js +var ProtoUtils_exports = {}; +__export(ProtoUtils_exports, { + decodeVisitorData: () => decodeVisitorData, + encodeCommentActionParams: () => encodeCommentActionParams, + encodeNextParams: () => encodeNextParams, + encodeVisitorData: () => encodeVisitorData +}); + +// node_modules/@bufbuild/protobuf/dist/esm/wire/varint.js +function varint64read() { + let lowBits = 0; + let highBits = 0; + for (let shift = 0; shift < 28; shift += 7) { + let b = this.buf[this.pos++]; + lowBits |= (b & 127) << shift; + if ((b & 128) == 0) { + this.assertBounds(); + return [lowBits, highBits]; + } + } + let middleByte = this.buf[this.pos++]; + lowBits |= (middleByte & 15) << 28; + highBits = (middleByte & 112) >> 4; + if ((middleByte & 128) == 0) { + this.assertBounds(); + return [lowBits, highBits]; + } + for (let shift = 3; shift <= 31; shift += 7) { + let b = this.buf[this.pos++]; + highBits |= (b & 127) << shift; + if ((b & 128) == 0) { + this.assertBounds(); + return [lowBits, highBits]; + } + } + throw new Error("invalid varint"); +} +__name(varint64read, "varint64read"); +function varint64write(lo, hi, bytes) { + for (let i = 0; i < 28; i = i + 7) { + const shift = lo >>> i; + const hasNext = !(shift >>> 7 == 0 && hi == 0); + const byte = (hasNext ? shift | 128 : shift) & 255; + bytes.push(byte); + if (!hasNext) { + return; + } + } + const splitBits = lo >>> 28 & 15 | (hi & 7) << 4; + const hasMoreBits = !(hi >> 3 == 0); + bytes.push((hasMoreBits ? splitBits | 128 : splitBits) & 255); + if (!hasMoreBits) { + return; + } + for (let i = 3; i < 31; i = i + 7) { + const shift = hi >>> i; + const hasNext = !(shift >>> 7 == 0); + const byte = (hasNext ? shift | 128 : shift) & 255; + bytes.push(byte); + if (!hasNext) { + return; + } + } + bytes.push(hi >>> 31 & 1); +} +__name(varint64write, "varint64write"); +var TWO_PWR_32_DBL = 4294967296; +function int64FromString(dec) { + const minus = dec[0] === "-"; + if (minus) { + dec = dec.slice(1); + } + const base = 1e6; + let lowBits = 0; + let highBits = 0; + function add1e6digit(begin, end) { + const digit1e6 = Number(dec.slice(begin, end)); + highBits *= base; + lowBits = lowBits * base + digit1e6; + if (lowBits >= TWO_PWR_32_DBL) { + highBits = highBits + (lowBits / TWO_PWR_32_DBL | 0); + lowBits = lowBits % TWO_PWR_32_DBL; + } + } + __name(add1e6digit, "add1e6digit"); + add1e6digit(-24, -18); + add1e6digit(-18, -12); + add1e6digit(-12, -6); + add1e6digit(-6); + return minus ? negate(lowBits, highBits) : newBits(lowBits, highBits); +} +__name(int64FromString, "int64FromString"); +function int64ToString(lo, hi) { + let bits = newBits(lo, hi); + const negative = bits.hi & 2147483648; + if (negative) { + bits = negate(bits.lo, bits.hi); + } + const result = uInt64ToString(bits.lo, bits.hi); + return negative ? "-" + result : result; +} +__name(int64ToString, "int64ToString"); +function uInt64ToString(lo, hi) { + ({ lo, hi } = toUnsigned(lo, hi)); + if (hi <= 2097151) { + return String(TWO_PWR_32_DBL * hi + lo); + } + const low = lo & 16777215; + const mid = (lo >>> 24 | hi << 8) & 16777215; + const high = hi >> 16 & 65535; + let digitA = low + mid * 6777216 + high * 6710656; + let digitB = mid + high * 8147497; + let digitC = high * 2; + const base = 1e7; + if (digitA >= base) { + digitB += Math.floor(digitA / base); + digitA %= base; + } + if (digitB >= base) { + digitC += Math.floor(digitB / base); + digitB %= base; + } + return digitC.toString() + decimalFrom1e7WithLeadingZeros(digitB) + decimalFrom1e7WithLeadingZeros(digitA); +} +__name(uInt64ToString, "uInt64ToString"); +function toUnsigned(lo, hi) { + return { lo: lo >>> 0, hi: hi >>> 0 }; +} +__name(toUnsigned, "toUnsigned"); +function newBits(lo, hi) { + return { lo: lo | 0, hi: hi | 0 }; +} +__name(newBits, "newBits"); +function negate(lowBits, highBits) { + highBits = ~highBits; + if (lowBits) { + lowBits = ~lowBits + 1; + } else { + highBits += 1; + } + return newBits(lowBits, highBits); +} +__name(negate, "negate"); +var decimalFrom1e7WithLeadingZeros = /* @__PURE__ */ __name((digit1e7) => { + const partial = String(digit1e7); + return "0000000".slice(partial.length) + partial; +}, "decimalFrom1e7WithLeadingZeros"); +function varint32write(value, bytes) { + if (value >= 0) { + while (value > 127) { + bytes.push(value & 127 | 128); + value = value >>> 7; + } + bytes.push(value); + } else { + for (let i = 0; i < 9; i++) { + bytes.push(value & 127 | 128); + value = value >> 7; + } + bytes.push(1); + } +} +__name(varint32write, "varint32write"); +function varint32read() { + let b = this.buf[this.pos++]; + let result = b & 127; + if ((b & 128) == 0) { + this.assertBounds(); + return result; + } + b = this.buf[this.pos++]; + result |= (b & 127) << 7; + if ((b & 128) == 0) { + this.assertBounds(); + return result; + } + b = this.buf[this.pos++]; + result |= (b & 127) << 14; + if ((b & 128) == 0) { + this.assertBounds(); + return result; + } + b = this.buf[this.pos++]; + result |= (b & 127) << 21; + if ((b & 128) == 0) { + this.assertBounds(); + return result; + } + b = this.buf[this.pos++]; + result |= (b & 15) << 28; + for (let readBytes = 5; (b & 128) !== 0 && readBytes < 10; readBytes++) + b = this.buf[this.pos++]; + if ((b & 128) != 0) + throw new Error("invalid varint"); + this.assertBounds(); + return result >>> 0; +} +__name(varint32read, "varint32read"); + +// node_modules/@bufbuild/protobuf/dist/esm/proto-int64.js +var protoInt64 = /* @__PURE__ */ makeInt64Support(); +function makeInt64Support() { + const dv = new DataView(new ArrayBuffer(8)); + const ok = typeof BigInt === "function" && typeof dv.getBigInt64 === "function" && typeof dv.getBigUint64 === "function" && typeof dv.setBigInt64 === "function" && typeof dv.setBigUint64 === "function" && (!!globalThis.Deno || typeof process != "object" || typeof process.env != "object" || process.env.BUF_BIGINT_DISABLE !== "1"); + if (ok) { + const MIN = BigInt("-9223372036854775808"); + const MAX = BigInt("9223372036854775807"); + const UMIN = BigInt("0"); + const UMAX = BigInt("18446744073709551615"); + return { + zero: BigInt(0), + supported: true, + parse(value) { + const bi = typeof value == "bigint" ? value : BigInt(value); + if (bi > MAX || bi < MIN) { + throw new Error(`invalid int64: ${value}`); + } + return bi; + }, + uParse(value) { + const bi = typeof value == "bigint" ? value : BigInt(value); + if (bi > UMAX || bi < UMIN) { + throw new Error(`invalid uint64: ${value}`); + } + return bi; + }, + enc(value) { + dv.setBigInt64(0, this.parse(value), true); + return { + lo: dv.getInt32(0, true), + hi: dv.getInt32(4, true) + }; + }, + uEnc(value) { + dv.setBigInt64(0, this.uParse(value), true); + return { + lo: dv.getInt32(0, true), + hi: dv.getInt32(4, true) + }; + }, + dec(lo, hi) { + dv.setInt32(0, lo, true); + dv.setInt32(4, hi, true); + return dv.getBigInt64(0, true); + }, + uDec(lo, hi) { + dv.setInt32(0, lo, true); + dv.setInt32(4, hi, true); + return dv.getBigUint64(0, true); + } + }; + } + return { + zero: "0", + supported: false, + parse(value) { + if (typeof value != "string") { + value = value.toString(); + } + assertInt64String(value); + return value; + }, + uParse(value) { + if (typeof value != "string") { + value = value.toString(); + } + assertUInt64String(value); + return value; + }, + enc(value) { + if (typeof value != "string") { + value = value.toString(); + } + assertInt64String(value); + return int64FromString(value); + }, + uEnc(value) { + if (typeof value != "string") { + value = value.toString(); + } + assertUInt64String(value); + return int64FromString(value); + }, + dec(lo, hi) { + return int64ToString(lo, hi); + }, + uDec(lo, hi) { + return uInt64ToString(lo, hi); + } + }; +} +__name(makeInt64Support, "makeInt64Support"); +function assertInt64String(value) { + if (!/^-?[0-9]+$/.test(value)) { + throw new Error("invalid int64: " + value); + } +} +__name(assertInt64String, "assertInt64String"); +function assertUInt64String(value) { + if (!/^[0-9]+$/.test(value)) { + throw new Error("invalid uint64: " + value); + } +} +__name(assertUInt64String, "assertUInt64String"); + +// node_modules/@bufbuild/protobuf/dist/esm/wire/text-encoding.js +var symbol = Symbol.for("@bufbuild/protobuf/text-encoding"); +function getTextEncoding() { + if (globalThis[symbol] == void 0) { + const te = new globalThis.TextEncoder(); + const td = new globalThis.TextDecoder(); + globalThis[symbol] = { + encodeUtf8(text) { + return te.encode(text); + }, + decodeUtf8(bytes) { + return td.decode(bytes); + }, + checkUtf8(text) { + try { + encodeURIComponent(text); + return true; + } catch (_) { + return false; + } + } + }; + } + return globalThis[symbol]; +} +__name(getTextEncoding, "getTextEncoding"); + +// node_modules/@bufbuild/protobuf/dist/esm/wire/binary-encoding.js +var WireType; +(function(WireType2) { + WireType2[WireType2["Varint"] = 0] = "Varint"; + WireType2[WireType2["Bit64"] = 1] = "Bit64"; + WireType2[WireType2["LengthDelimited"] = 2] = "LengthDelimited"; + WireType2[WireType2["StartGroup"] = 3] = "StartGroup"; + WireType2[WireType2["EndGroup"] = 4] = "EndGroup"; + WireType2[WireType2["Bit32"] = 5] = "Bit32"; +})(WireType || (WireType = {})); +var FLOAT32_MAX = 34028234663852886e22; +var FLOAT32_MIN = -34028234663852886e22; +var UINT32_MAX = 4294967295; +var INT32_MAX = 2147483647; +var INT32_MIN = -2147483648; +var _BinaryWriter = class _BinaryWriter { + constructor(encodeUtf8 = getTextEncoding().encodeUtf8) { + this.encodeUtf8 = encodeUtf8; + this.stack = []; + this.chunks = []; + this.buf = []; + } + /** + * Return all bytes written and reset this writer. + */ + finish() { + if (this.buf.length) { + this.chunks.push(new Uint8Array(this.buf)); + this.buf = []; + } + let len = 0; + for (let i = 0; i < this.chunks.length; i++) + len += this.chunks[i].length; + let bytes = new Uint8Array(len); + let offset = 0; + for (let i = 0; i < this.chunks.length; i++) { + bytes.set(this.chunks[i], offset); + offset += this.chunks[i].length; + } + this.chunks = []; + return bytes; + } + /** + * Start a new fork for length-delimited data like a message + * or a packed repeated field. + * + * Must be joined later with `join()`. + */ + fork() { + this.stack.push({ chunks: this.chunks, buf: this.buf }); + this.chunks = []; + this.buf = []; + return this; + } + /** + * Join the last fork. Write its length and bytes, then + * return to the previous state. + */ + join() { + let chunk = this.finish(); + let prev = this.stack.pop(); + if (!prev) + throw new Error("invalid state, fork stack empty"); + this.chunks = prev.chunks; + this.buf = prev.buf; + this.uint32(chunk.byteLength); + return this.raw(chunk); + } + /** + * Writes a tag (field number and wire type). + * + * Equivalent to `uint32( (fieldNo << 3 | type) >>> 0 )`. + * + * Generated code should compute the tag ahead of time and call `uint32()`. + */ + tag(fieldNo, type) { + return this.uint32((fieldNo << 3 | type) >>> 0); + } + /** + * Write a chunk of raw bytes. + */ + raw(chunk) { + if (this.buf.length) { + this.chunks.push(new Uint8Array(this.buf)); + this.buf = []; + } + this.chunks.push(chunk); + return this; + } + /** + * Write a `uint32` value, an unsigned 32 bit varint. + */ + uint32(value) { + assertUInt32(value); + while (value > 127) { + this.buf.push(value & 127 | 128); + value = value >>> 7; + } + this.buf.push(value); + return this; + } + /** + * Write a `int32` value, a signed 32 bit varint. + */ + int32(value) { + assertInt32(value); + varint32write(value, this.buf); + return this; + } + /** + * Write a `bool` value, a variant. + */ + bool(value) { + this.buf.push(value ? 1 : 0); + return this; + } + /** + * Write a `bytes` value, length-delimited arbitrary data. + */ + bytes(value) { + this.uint32(value.byteLength); + return this.raw(value); + } + /** + * Write a `string` value, length-delimited data converted to UTF-8 text. + */ + string(value) { + let chunk = this.encodeUtf8(value); + this.uint32(chunk.byteLength); + return this.raw(chunk); + } + /** + * Write a `float` value, 32-bit floating point number. + */ + float(value) { + assertFloat32(value); + let chunk = new Uint8Array(4); + new DataView(chunk.buffer).setFloat32(0, value, true); + return this.raw(chunk); + } + /** + * Write a `double` value, a 64-bit floating point number. + */ + double(value) { + let chunk = new Uint8Array(8); + new DataView(chunk.buffer).setFloat64(0, value, true); + return this.raw(chunk); + } + /** + * Write a `fixed32` value, an unsigned, fixed-length 32-bit integer. + */ + fixed32(value) { + assertUInt32(value); + let chunk = new Uint8Array(4); + new DataView(chunk.buffer).setUint32(0, value, true); + return this.raw(chunk); + } + /** + * Write a `sfixed32` value, a signed, fixed-length 32-bit integer. + */ + sfixed32(value) { + assertInt32(value); + let chunk = new Uint8Array(4); + new DataView(chunk.buffer).setInt32(0, value, true); + return this.raw(chunk); + } + /** + * Write a `sint32` value, a signed, zigzag-encoded 32-bit varint. + */ + sint32(value) { + assertInt32(value); + value = (value << 1 ^ value >> 31) >>> 0; + varint32write(value, this.buf); + return this; + } + /** + * Write a `fixed64` value, a signed, fixed-length 64-bit integer. + */ + sfixed64(value) { + let chunk = new Uint8Array(8), view = new DataView(chunk.buffer), tc = protoInt64.enc(value); + view.setInt32(0, tc.lo, true); + view.setInt32(4, tc.hi, true); + return this.raw(chunk); + } + /** + * Write a `fixed64` value, an unsigned, fixed-length 64 bit integer. + */ + fixed64(value) { + let chunk = new Uint8Array(8), view = new DataView(chunk.buffer), tc = protoInt64.uEnc(value); + view.setInt32(0, tc.lo, true); + view.setInt32(4, tc.hi, true); + return this.raw(chunk); + } + /** + * Write a `int64` value, a signed 64-bit varint. + */ + int64(value) { + let tc = protoInt64.enc(value); + varint64write(tc.lo, tc.hi, this.buf); + return this; + } + /** + * Write a `sint64` value, a signed, zig-zag-encoded 64-bit varint. + */ + sint64(value) { + const tc = protoInt64.enc(value), sign = tc.hi >> 31, lo = tc.lo << 1 ^ sign, hi = (tc.hi << 1 | tc.lo >>> 31) ^ sign; + varint64write(lo, hi, this.buf); + return this; + } + /** + * Write a `uint64` value, an unsigned 64-bit varint. + */ + uint64(value) { + const tc = protoInt64.uEnc(value); + varint64write(tc.lo, tc.hi, this.buf); + return this; + } +}; +__name(_BinaryWriter, "BinaryWriter"); +var BinaryWriter = _BinaryWriter; +var _BinaryReader = class _BinaryReader { + constructor(buf, decodeUtf8 = getTextEncoding().decodeUtf8) { + this.decodeUtf8 = decodeUtf8; + this.varint64 = varint64read; + this.uint32 = varint32read; + this.buf = buf; + this.len = buf.length; + this.pos = 0; + this.view = new DataView(buf.buffer, buf.byteOffset, buf.byteLength); + } + /** + * Reads a tag - field number and wire type. + */ + tag() { + let tag = this.uint32(), fieldNo = tag >>> 3, wireType = tag & 7; + if (fieldNo <= 0 || wireType < 0 || wireType > 5) + throw new Error("illegal tag: field no " + fieldNo + " wire type " + wireType); + return [fieldNo, wireType]; + } + /** + * Skip one element and return the skipped data. + * + * When skipping StartGroup, provide the tags field number to check for + * matching field number in the EndGroup tag. + */ + skip(wireType, fieldNo) { + let start = this.pos; + switch (wireType) { + case WireType.Varint: + while (this.buf[this.pos++] & 128) { + } + break; + // @ts-ignore TS7029: Fallthrough case in switch -- ignore instead of expect-error for compiler settings without noFallthroughCasesInSwitch: true + case WireType.Bit64: + this.pos += 4; + case WireType.Bit32: + this.pos += 4; + break; + case WireType.LengthDelimited: + let len = this.uint32(); + this.pos += len; + break; + case WireType.StartGroup: + for (; ; ) { + const [fn, wt] = this.tag(); + if (wt === WireType.EndGroup) { + if (fieldNo !== void 0 && fn !== fieldNo) { + throw new Error("invalid end group tag"); + } + break; + } + this.skip(wt, fn); + } + break; + default: + throw new Error("cant skip wire type " + wireType); + } + this.assertBounds(); + return this.buf.subarray(start, this.pos); + } + /** + * Throws error if position in byte array is out of range. + */ + assertBounds() { + if (this.pos > this.len) + throw new RangeError("premature EOF"); + } + /** + * Read a `int32` field, a signed 32 bit varint. + */ + int32() { + return this.uint32() | 0; + } + /** + * Read a `sint32` field, a signed, zigzag-encoded 32-bit varint. + */ + sint32() { + let zze = this.uint32(); + return zze >>> 1 ^ -(zze & 1); + } + /** + * Read a `int64` field, a signed 64-bit varint. + */ + int64() { + return protoInt64.dec(...this.varint64()); + } + /** + * Read a `uint64` field, an unsigned 64-bit varint. + */ + uint64() { + return protoInt64.uDec(...this.varint64()); + } + /** + * Read a `sint64` field, a signed, zig-zag-encoded 64-bit varint. + */ + sint64() { + let [lo, hi] = this.varint64(); + let s = -(lo & 1); + lo = (lo >>> 1 | (hi & 1) << 31) ^ s; + hi = hi >>> 1 ^ s; + return protoInt64.dec(lo, hi); + } + /** + * Read a `bool` field, a variant. + */ + bool() { + let [lo, hi] = this.varint64(); + return lo !== 0 || hi !== 0; + } + /** + * Read a `fixed32` field, an unsigned, fixed-length 32-bit integer. + */ + fixed32() { + return this.view.getUint32((this.pos += 4) - 4, true); + } + /** + * Read a `sfixed32` field, a signed, fixed-length 32-bit integer. + */ + sfixed32() { + return this.view.getInt32((this.pos += 4) - 4, true); + } + /** + * Read a `fixed64` field, an unsigned, fixed-length 64 bit integer. + */ + fixed64() { + return protoInt64.uDec(this.sfixed32(), this.sfixed32()); + } + /** + * Read a `fixed64` field, a signed, fixed-length 64-bit integer. + */ + sfixed64() { + return protoInt64.dec(this.sfixed32(), this.sfixed32()); + } + /** + * Read a `float` field, 32-bit floating point number. + */ + float() { + return this.view.getFloat32((this.pos += 4) - 4, true); + } + /** + * Read a `double` field, a 64-bit floating point number. + */ + double() { + return this.view.getFloat64((this.pos += 8) - 8, true); + } + /** + * Read a `bytes` field, length-delimited arbitrary data. + */ + bytes() { + let len = this.uint32(), start = this.pos; + this.pos += len; + this.assertBounds(); + return this.buf.subarray(start, start + len); + } + /** + * Read a `string` field, length-delimited data converted to UTF-8 text. + */ + string() { + return this.decodeUtf8(this.bytes()); + } +}; +__name(_BinaryReader, "BinaryReader"); +var BinaryReader = _BinaryReader; +function assertInt32(arg) { + if (typeof arg == "string") { + arg = Number(arg); + } else if (typeof arg != "number") { + throw new Error("invalid int32: " + typeof arg); + } + if (!Number.isInteger(arg) || arg > INT32_MAX || arg < INT32_MIN) + throw new Error("invalid int32: " + arg); +} +__name(assertInt32, "assertInt32"); +function assertUInt32(arg) { + if (typeof arg == "string") { + arg = Number(arg); + } else if (typeof arg != "number") { + throw new Error("invalid uint32: " + typeof arg); + } + if (!Number.isInteger(arg) || arg > UINT32_MAX || arg < 0) + throw new Error("invalid uint32: " + arg); +} +__name(assertUInt32, "assertUInt32"); +function assertFloat32(arg) { + if (typeof arg == "string") { + const o = arg; + arg = Number(arg); + if (Number.isNaN(arg) && o !== "NaN") { + throw new Error("invalid float32: " + o); + } + } else if (typeof arg != "number") { + throw new Error("invalid float32: " + typeof arg); + } + if (Number.isFinite(arg) && (arg > FLOAT32_MAX || arg < FLOAT32_MIN)) + throw new Error("invalid float32: " + arg); +} +__name(assertFloat32, "assertFloat32"); + +// dist/protos/generated/misc/params.js +var SearchFilter_Prioritize = { + RELEVANCE: 0, + 0: "RELEVANCE", + POPULARITY: 3, + 3: "POPULARITY", + UNRECOGNIZED: -1, + "-1": "UNRECOGNIZED" +}; +var SearchFilter_Filters_UploadDate = { + ANY_DATE: 0, + 0: "ANY_DATE", + TODAY: 2, + 2: "TODAY", + WEEK: 3, + 3: "WEEK", + MONTH: 4, + 4: "MONTH", + YEAR: 5, + 5: "YEAR", + UNRECOGNIZED: -1, + "-1": "UNRECOGNIZED" +}; +var SearchFilter_Filters_SearchType = { + ANY_TYPE: 0, + 0: "ANY_TYPE", + VIDEO: 1, + 1: "VIDEO", + CHANNEL: 2, + 2: "CHANNEL", + PLAYLIST: 3, + 3: "PLAYLIST", + MOVIE: 4, + 4: "MOVIE", + SHORTS: 9, + 9: "SHORTS", + UNRECOGNIZED: -1, + "-1": "UNRECOGNIZED" +}; +var SearchFilter_Filters_Duration = { + ANY_DURATION: 0, + 0: "ANY_DURATION", + OVER_TWENTY_MINS: 2, + 2: "OVER_TWENTY_MINS", + UNDER_THREE_MINS: 4, + 4: "UNDER_THREE_MINS", + THREE_TO_TWENTY_MINS: 5, + 5: "THREE_TO_TWENTY_MINS", + UNRECOGNIZED: -1, + "-1": "UNRECOGNIZED" +}; +function createBaseVisitorData() { + return { id: "", timestamp: 0 }; +} +__name(createBaseVisitorData, "createBaseVisitorData"); +var VisitorData = { + encode(message, writer = new BinaryWriter()) { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.timestamp !== 0) { + writer.uint32(40).int32(message.timestamp); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === void 0 ? reader.len : reader.pos + length; + const message = createBaseVisitorData(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + message.id = reader.string(); + continue; + } + case 5: { + if (tag !== 40) { + break; + } + message.timestamp = reader.int32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + } +}; +function createBaseSearchFilter() { + return { prioritize: void 0, filters: void 0 }; +} +__name(createBaseSearchFilter, "createBaseSearchFilter"); +var SearchFilter = { + encode(message, writer = new BinaryWriter()) { + if (message.prioritize !== void 0) { + writer.uint32(8).int32(message.prioritize); + } + if (message.filters !== void 0) { + SearchFilter_Filters.encode(message.filters, writer.uint32(18).fork()).join(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === void 0 ? reader.len : reader.pos + length; + const message = createBaseSearchFilter(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + message.prioritize = reader.int32(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + message.filters = SearchFilter_Filters.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + } +}; +function createBaseSearchFilter_Filters() { + return { + uploadDate: void 0, + type: void 0, + duration: void 0, + musicSearchType: void 0, + featuresHd: void 0, + featuresSubtitles: void 0, + featuresCreativeCommons: void 0, + features3d: void 0, + featuresLive: void 0, + featuresPurchased: void 0, + features4k: void 0, + features360: void 0, + featuresLocation: void 0, + featuresHdr: void 0, + featuresVr180: void 0 + }; +} +__name(createBaseSearchFilter_Filters, "createBaseSearchFilter_Filters"); +var SearchFilter_Filters = { + encode(message, writer = new BinaryWriter()) { + if (message.uploadDate !== void 0) { + writer.uint32(8).int32(message.uploadDate); + } + if (message.type !== void 0) { + writer.uint32(16).int32(message.type); + } + if (message.duration !== void 0) { + writer.uint32(24).int32(message.duration); + } + if (message.musicSearchType !== void 0) { + SearchFilter_Filters_MusicSearchType.encode(message.musicSearchType, writer.uint32(138).fork()).join(); + } + if (message.featuresHd !== void 0) { + writer.uint32(32).bool(message.featuresHd); + } + if (message.featuresSubtitles !== void 0) { + writer.uint32(40).bool(message.featuresSubtitles); + } + if (message.featuresCreativeCommons !== void 0) { + writer.uint32(48).bool(message.featuresCreativeCommons); + } + if (message.features3d !== void 0) { + writer.uint32(56).bool(message.features3d); + } + if (message.featuresLive !== void 0) { + writer.uint32(64).bool(message.featuresLive); + } + if (message.featuresPurchased !== void 0) { + writer.uint32(72).bool(message.featuresPurchased); + } + if (message.features4k !== void 0) { + writer.uint32(112).bool(message.features4k); + } + if (message.features360 !== void 0) { + writer.uint32(120).bool(message.features360); + } + if (message.featuresLocation !== void 0) { + writer.uint32(184).bool(message.featuresLocation); + } + if (message.featuresHdr !== void 0) { + writer.uint32(200).bool(message.featuresHdr); + } + if (message.featuresVr180 !== void 0) { + writer.uint32(208).bool(message.featuresVr180); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === void 0 ? reader.len : reader.pos + length; + const message = createBaseSearchFilter_Filters(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + message.uploadDate = reader.int32(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + message.type = reader.int32(); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + message.duration = reader.int32(); + continue; + } + case 17: { + if (tag !== 138) { + break; + } + message.musicSearchType = SearchFilter_Filters_MusicSearchType.decode(reader, reader.uint32()); + continue; + } + case 4: { + if (tag !== 32) { + break; + } + message.featuresHd = reader.bool(); + continue; + } + case 5: { + if (tag !== 40) { + break; + } + message.featuresSubtitles = reader.bool(); + continue; + } + case 6: { + if (tag !== 48) { + break; + } + message.featuresCreativeCommons = reader.bool(); + continue; + } + case 7: { + if (tag !== 56) { + break; + } + message.features3d = reader.bool(); + continue; + } + case 8: { + if (tag !== 64) { + break; + } + message.featuresLive = reader.bool(); + continue; + } + case 9: { + if (tag !== 72) { + break; + } + message.featuresPurchased = reader.bool(); + continue; + } + case 14: { + if (tag !== 112) { + break; + } + message.features4k = reader.bool(); + continue; + } + case 15: { + if (tag !== 120) { + break; + } + message.features360 = reader.bool(); + continue; + } + case 23: { + if (tag !== 184) { + break; + } + message.featuresLocation = reader.bool(); + continue; + } + case 25: { + if (tag !== 200) { + break; + } + message.featuresHdr = reader.bool(); + continue; + } + case 26: { + if (tag !== 208) { + break; + } + message.featuresVr180 = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + } +}; +function createBaseSearchFilter_Filters_MusicSearchType() { + return { song: void 0, video: void 0, album: void 0, artist: void 0, playlist: void 0 }; +} +__name(createBaseSearchFilter_Filters_MusicSearchType, "createBaseSearchFilter_Filters_MusicSearchType"); +var SearchFilter_Filters_MusicSearchType = { + encode(message, writer = new BinaryWriter()) { + if (message.song !== void 0) { + writer.uint32(8).bool(message.song); + } + if (message.video !== void 0) { + writer.uint32(16).bool(message.video); + } + if (message.album !== void 0) { + writer.uint32(24).bool(message.album); + } + if (message.artist !== void 0) { + writer.uint32(32).bool(message.artist); + } + if (message.playlist !== void 0) { + writer.uint32(40).bool(message.playlist); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === void 0 ? reader.len : reader.pos + length; + const message = createBaseSearchFilter_Filters_MusicSearchType(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + message.song = reader.bool(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + message.video = reader.bool(); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + message.album = reader.bool(); + continue; + } + case 4: { + if (tag !== 32) { + break; + } + message.artist = reader.bool(); + continue; + } + case 5: { + if (tag !== 40) { + break; + } + message.playlist = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + } +}; +function createBaseNotificationPreferences() { + return { channelId: "", prefId: void 0, number0: void 0, number1: void 0 }; +} +__name(createBaseNotificationPreferences, "createBaseNotificationPreferences"); +var NotificationPreferences = { + encode(message, writer = new BinaryWriter()) { + if (message.channelId !== "") { + writer.uint32(10).string(message.channelId); + } + if (message.prefId !== void 0) { + NotificationPreferences_Preference.encode(message.prefId, writer.uint32(18).fork()).join(); + } + if (message.number0 !== void 0) { + writer.uint32(24).int32(message.number0); + } + if (message.number1 !== void 0) { + writer.uint32(32).int32(message.number1); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === void 0 ? reader.len : reader.pos + length; + const message = createBaseNotificationPreferences(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + message.channelId = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + message.prefId = NotificationPreferences_Preference.decode(reader, reader.uint32()); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + message.number0 = reader.int32(); + continue; + } + case 4: { + if (tag !== 32) { + break; + } + message.number1 = reader.int32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + } +}; +function createBaseNotificationPreferences_Preference() { + return { index: 0 }; +} +__name(createBaseNotificationPreferences_Preference, "createBaseNotificationPreferences_Preference"); +var NotificationPreferences_Preference = { + encode(message, writer = new BinaryWriter()) { + if (message.index !== 0) { + writer.uint32(8).int32(message.index); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === void 0 ? reader.len : reader.pos + length; + const message = createBaseNotificationPreferences_Preference(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + message.index = reader.int32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + } +}; +function createBaseLiveMessageParams() { + return { params: void 0, number0: void 0, number1: void 0 }; +} +__name(createBaseLiveMessageParams, "createBaseLiveMessageParams"); +var LiveMessageParams = { + encode(message, writer = new BinaryWriter()) { + if (message.params !== void 0) { + LiveMessageParams_Params.encode(message.params, writer.uint32(10).fork()).join(); + } + if (message.number0 !== void 0) { + writer.uint32(16).int32(message.number0); + } + if (message.number1 !== void 0) { + writer.uint32(24).int32(message.number1); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === void 0 ? reader.len : reader.pos + length; + const message = createBaseLiveMessageParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + message.params = LiveMessageParams_Params.decode(reader, reader.uint32()); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + message.number0 = reader.int32(); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + message.number1 = reader.int32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + } +}; +function createBaseLiveMessageParams_Params() { + return { ids: void 0 }; +} +__name(createBaseLiveMessageParams_Params, "createBaseLiveMessageParams_Params"); +var LiveMessageParams_Params = { + encode(message, writer = new BinaryWriter()) { + if (message.ids !== void 0) { + LiveMessageParams_Params_Ids.encode(message.ids, writer.uint32(42).fork()).join(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === void 0 ? reader.len : reader.pos + length; + const message = createBaseLiveMessageParams_Params(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 5: { + if (tag !== 42) { + break; + } + message.ids = LiveMessageParams_Params_Ids.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + } +}; +function createBaseLiveMessageParams_Params_Ids() { + return { channelId: "", videoId: "" }; +} +__name(createBaseLiveMessageParams_Params_Ids, "createBaseLiveMessageParams_Params_Ids"); +var LiveMessageParams_Params_Ids = { + encode(message, writer = new BinaryWriter()) { + if (message.channelId !== "") { + writer.uint32(10).string(message.channelId); + } + if (message.videoId !== "") { + writer.uint32(18).string(message.videoId); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === void 0 ? reader.len : reader.pos + length; + const message = createBaseLiveMessageParams_Params_Ids(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + message.channelId = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + message.videoId = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + } +}; +function createBaseGetCommentsSectionParams() { + return { ctx: void 0, unkParam: 0, params: void 0 }; +} +__name(createBaseGetCommentsSectionParams, "createBaseGetCommentsSectionParams"); +var GetCommentsSectionParams = { + encode(message, writer = new BinaryWriter()) { + if (message.ctx !== void 0) { + GetCommentsSectionParams_Context.encode(message.ctx, writer.uint32(18).fork()).join(); + } + if (message.unkParam !== 0) { + writer.uint32(24).int32(message.unkParam); + } + if (message.params !== void 0) { + GetCommentsSectionParams_Params.encode(message.params, writer.uint32(50).fork()).join(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === void 0 ? reader.len : reader.pos + length; + const message = createBaseGetCommentsSectionParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + if (tag !== 18) { + break; + } + message.ctx = GetCommentsSectionParams_Context.decode(reader, reader.uint32()); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + message.unkParam = reader.int32(); + continue; + } + case 6: { + if (tag !== 50) { + break; + } + message.params = GetCommentsSectionParams_Params.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + } +}; +function createBaseGetCommentsSectionParams_Context() { + return { videoId: "" }; +} +__name(createBaseGetCommentsSectionParams_Context, "createBaseGetCommentsSectionParams_Context"); +var GetCommentsSectionParams_Context = { + encode(message, writer = new BinaryWriter()) { + if (message.videoId !== "") { + writer.uint32(18).string(message.videoId); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === void 0 ? reader.len : reader.pos + length; + const message = createBaseGetCommentsSectionParams_Context(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + if (tag !== 18) { + break; + } + message.videoId = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + } +}; +function createBaseGetCommentsSectionParams_Params() { + return { unkToken: void 0, opts: void 0, repliesOpts: void 0, page: void 0, target: "" }; +} +__name(createBaseGetCommentsSectionParams_Params, "createBaseGetCommentsSectionParams_Params"); +var GetCommentsSectionParams_Params = { + encode(message, writer = new BinaryWriter()) { + if (message.unkToken !== void 0) { + writer.uint32(10).string(message.unkToken); + } + if (message.opts !== void 0) { + GetCommentsSectionParams_Params_Options.encode(message.opts, writer.uint32(34).fork()).join(); + } + if (message.repliesOpts !== void 0) { + GetCommentsSectionParams_Params_RepliesOptions.encode(message.repliesOpts, writer.uint32(26).fork()).join(); + } + if (message.page !== void 0) { + writer.uint32(40).int32(message.page); + } + if (message.target !== "") { + writer.uint32(66).string(message.target); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === void 0 ? reader.len : reader.pos + length; + const message = createBaseGetCommentsSectionParams_Params(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + message.unkToken = reader.string(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + message.opts = GetCommentsSectionParams_Params_Options.decode(reader, reader.uint32()); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + message.repliesOpts = GetCommentsSectionParams_Params_RepliesOptions.decode(reader, reader.uint32()); + continue; + } + case 5: { + if (tag !== 40) { + break; + } + message.page = reader.int32(); + continue; + } + case 8: { + if (tag !== 66) { + break; + } + message.target = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + } +}; +function createBaseGetCommentsSectionParams_Params_Options() { + return { videoId: "", sortBy: 0, type: 0, commentId: void 0 }; +} +__name(createBaseGetCommentsSectionParams_Params_Options, "createBaseGetCommentsSectionParams_Params_Options"); +var GetCommentsSectionParams_Params_Options = { + encode(message, writer = new BinaryWriter()) { + if (message.videoId !== "") { + writer.uint32(34).string(message.videoId); + } + if (message.sortBy !== 0) { + writer.uint32(48).int32(message.sortBy); + } + if (message.type !== 0) { + writer.uint32(120).int32(message.type); + } + if (message.commentId !== void 0) { + writer.uint32(130).string(message.commentId); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === void 0 ? reader.len : reader.pos + length; + const message = createBaseGetCommentsSectionParams_Params_Options(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 4: { + if (tag !== 34) { + break; + } + message.videoId = reader.string(); + continue; + } + case 6: { + if (tag !== 48) { + break; + } + message.sortBy = reader.int32(); + continue; + } + case 15: { + if (tag !== 120) { + break; + } + message.type = reader.int32(); + continue; + } + case 16: { + if (tag !== 130) { + break; + } + message.commentId = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + } +}; +function createBaseGetCommentsSectionParams_Params_RepliesOptions() { + return { commentId: "", unkopts: void 0, channelId: void 0, videoId: "", unkParam1: 0, unkParam2: 0 }; +} +__name(createBaseGetCommentsSectionParams_Params_RepliesOptions, "createBaseGetCommentsSectionParams_Params_RepliesOptions"); +var GetCommentsSectionParams_Params_RepliesOptions = { + encode(message, writer = new BinaryWriter()) { + if (message.commentId !== "") { + writer.uint32(18).string(message.commentId); + } + if (message.unkopts !== void 0) { + GetCommentsSectionParams_Params_RepliesOptions_UnkOpts.encode(message.unkopts, writer.uint32(34).fork()).join(); + } + if (message.channelId !== void 0) { + writer.uint32(42).string(message.channelId); + } + if (message.videoId !== "") { + writer.uint32(50).string(message.videoId); + } + if (message.unkParam1 !== 0) { + writer.uint32(64).int32(message.unkParam1); + } + if (message.unkParam2 !== 0) { + writer.uint32(72).int32(message.unkParam2); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === void 0 ? reader.len : reader.pos + length; + const message = createBaseGetCommentsSectionParams_Params_RepliesOptions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + if (tag !== 18) { + break; + } + message.commentId = reader.string(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + message.unkopts = GetCommentsSectionParams_Params_RepliesOptions_UnkOpts.decode(reader, reader.uint32()); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + message.channelId = reader.string(); + continue; + } + case 6: { + if (tag !== 50) { + break; + } + message.videoId = reader.string(); + continue; + } + case 8: { + if (tag !== 64) { + break; + } + message.unkParam1 = reader.int32(); + continue; + } + case 9: { + if (tag !== 72) { + break; + } + message.unkParam2 = reader.int32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + } +}; +function createBaseGetCommentsSectionParams_Params_RepliesOptions_UnkOpts() { + return { unkParam: 0 }; +} +__name(createBaseGetCommentsSectionParams_Params_RepliesOptions_UnkOpts, "createBaseGetCommentsSectionParams_Params_RepliesOptions_UnkOpts"); +var GetCommentsSectionParams_Params_RepliesOptions_UnkOpts = { + encode(message, writer = new BinaryWriter()) { + if (message.unkParam !== 0) { + writer.uint32(8).int32(message.unkParam); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === void 0 ? reader.len : reader.pos + length; + const message = createBaseGetCommentsSectionParams_Params_RepliesOptions_UnkOpts(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + message.unkParam = reader.int32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + } +}; +function createBaseCreateCommentParams() { + return { videoId: "", params: void 0, number: 0 }; +} +__name(createBaseCreateCommentParams, "createBaseCreateCommentParams"); +var CreateCommentParams = { + encode(message, writer = new BinaryWriter()) { + if (message.videoId !== "") { + writer.uint32(18).string(message.videoId); + } + if (message.params !== void 0) { + CreateCommentParams_Params.encode(message.params, writer.uint32(42).fork()).join(); + } + if (message.number !== 0) { + writer.uint32(80).int32(message.number); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === void 0 ? reader.len : reader.pos + length; + const message = createBaseCreateCommentParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + if (tag !== 18) { + break; + } + message.videoId = reader.string(); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + message.params = CreateCommentParams_Params.decode(reader, reader.uint32()); + continue; + } + case 10: { + if (tag !== 80) { + break; + } + message.number = reader.int32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + } +}; +function createBaseCreateCommentParams_Params() { + return { index: 0 }; +} +__name(createBaseCreateCommentParams_Params, "createBaseCreateCommentParams_Params"); +var CreateCommentParams_Params = { + encode(message, writer = new BinaryWriter()) { + if (message.index !== 0) { + writer.uint32(8).int32(message.index); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === void 0 ? reader.len : reader.pos + length; + const message = createBaseCreateCommentParams_Params(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + message.index = reader.int32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + } +}; +function createBasePeformCommentActionParams() { + return { + type: 0, + commentId: "", + videoId: "", + unkNum: void 0, + channelId: void 0, + translateCommentParams: void 0 + }; +} +__name(createBasePeformCommentActionParams, "createBasePeformCommentActionParams"); +var PeformCommentActionParams = { + encode(message, writer = new BinaryWriter()) { + if (message.type !== 0) { + writer.uint32(8).int32(message.type); + } + if (message.commentId !== "") { + writer.uint32(26).string(message.commentId); + } + if (message.videoId !== "") { + writer.uint32(42).string(message.videoId); + } + if (message.unkNum !== void 0) { + writer.uint32(16).int32(message.unkNum); + } + if (message.channelId !== void 0) { + writer.uint32(186).string(message.channelId); + } + if (message.translateCommentParams !== void 0) { + PeformCommentActionParams_TranslateCommentParams.encode(message.translateCommentParams, writer.uint32(250).fork()).join(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === void 0 ? reader.len : reader.pos + length; + const message = createBasePeformCommentActionParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + message.type = reader.int32(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + message.commentId = reader.string(); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + message.videoId = reader.string(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + message.unkNum = reader.int32(); + continue; + } + case 23: { + if (tag !== 186) { + break; + } + message.channelId = reader.string(); + continue; + } + case 31: { + if (tag !== 250) { + break; + } + message.translateCommentParams = PeformCommentActionParams_TranslateCommentParams.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + } +}; +function createBasePeformCommentActionParams_TranslateCommentParams() { + return { params: void 0, commentId: "", targetLanguage: "" }; +} +__name(createBasePeformCommentActionParams_TranslateCommentParams, "createBasePeformCommentActionParams_TranslateCommentParams"); +var PeformCommentActionParams_TranslateCommentParams = { + encode(message, writer = new BinaryWriter()) { + if (message.params !== void 0) { + PeformCommentActionParams_TranslateCommentParams_Params.encode(message.params, writer.uint32(26).fork()).join(); + } + if (message.commentId !== "") { + writer.uint32(18).string(message.commentId); + } + if (message.targetLanguage !== "") { + writer.uint32(34).string(message.targetLanguage); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === void 0 ? reader.len : reader.pos + length; + const message = createBasePeformCommentActionParams_TranslateCommentParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + if (tag !== 26) { + break; + } + message.params = PeformCommentActionParams_TranslateCommentParams_Params.decode(reader, reader.uint32()); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + message.commentId = reader.string(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + message.targetLanguage = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + } +}; +function createBasePeformCommentActionParams_TranslateCommentParams_Params() { + return { comment: void 0 }; +} +__name(createBasePeformCommentActionParams_TranslateCommentParams_Params, "createBasePeformCommentActionParams_TranslateCommentParams_Params"); +var PeformCommentActionParams_TranslateCommentParams_Params = { + encode(message, writer = new BinaryWriter()) { + if (message.comment !== void 0) { + PeformCommentActionParams_TranslateCommentParams_Params_Comment.encode(message.comment, writer.uint32(10).fork()).join(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === void 0 ? reader.len : reader.pos + length; + const message = createBasePeformCommentActionParams_TranslateCommentParams_Params(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + message.comment = PeformCommentActionParams_TranslateCommentParams_Params_Comment.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + } +}; +function createBasePeformCommentActionParams_TranslateCommentParams_Params_Comment() { + return { text: "" }; +} +__name(createBasePeformCommentActionParams_TranslateCommentParams_Params_Comment, "createBasePeformCommentActionParams_TranslateCommentParams_Params_Comment"); +var PeformCommentActionParams_TranslateCommentParams_Params_Comment = { + encode(message, writer = new BinaryWriter()) { + if (message.text !== "") { + writer.uint32(10).string(message.text); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === void 0 ? reader.len : reader.pos + length; + const message = createBasePeformCommentActionParams_TranslateCommentParams_Params_Comment(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + message.text = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + } +}; +function createBaseHashtag() { + return { params: void 0 }; +} +__name(createBaseHashtag, "createBaseHashtag"); +var Hashtag = { + encode(message, writer = new BinaryWriter()) { + if (message.params !== void 0) { + Hashtag_Params.encode(message.params, writer.uint32(746).fork()).join(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === void 0 ? reader.len : reader.pos + length; + const message = createBaseHashtag(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 93: { + if (tag !== 746) { + break; + } + message.params = Hashtag_Params.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + } +}; +function createBaseHashtag_Params() { + return { hashtag: "", type: 0 }; +} +__name(createBaseHashtag_Params, "createBaseHashtag_Params"); +var Hashtag_Params = { + encode(message, writer = new BinaryWriter()) { + if (message.hashtag !== "") { + writer.uint32(10).string(message.hashtag); + } + if (message.type !== 0) { + writer.uint32(24).int32(message.type); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === void 0 ? reader.len : reader.pos + length; + const message = createBaseHashtag_Params(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + message.hashtag = reader.string(); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + message.type = reader.int32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + } +}; +function createBaseReelSequence() { + return { shortId: "", params: void 0, feature2: 0, feature3: 0 }; +} +__name(createBaseReelSequence, "createBaseReelSequence"); +var ReelSequence = { + encode(message, writer = new BinaryWriter()) { + if (message.shortId !== "") { + writer.uint32(10).string(message.shortId); + } + if (message.params !== void 0) { + ReelSequence_Params.encode(message.params, writer.uint32(42).fork()).join(); + } + if (message.feature2 !== 0) { + writer.uint32(80).int32(message.feature2); + } + if (message.feature3 !== 0) { + writer.uint32(104).int32(message.feature3); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === void 0 ? reader.len : reader.pos + length; + const message = createBaseReelSequence(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + message.shortId = reader.string(); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + message.params = ReelSequence_Params.decode(reader, reader.uint32()); + continue; + } + case 10: { + if (tag !== 80) { + break; + } + message.feature2 = reader.int32(); + continue; + } + case 13: { + if (tag !== 104) { + break; + } + message.feature3 = reader.int32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + } +}; +function createBaseReelSequence_Params() { + return { number: 0 }; +} +__name(createBaseReelSequence_Params, "createBaseReelSequence_Params"); +var ReelSequence_Params = { + encode(message, writer = new BinaryWriter()) { + if (message.number !== 0) { + writer.uint32(24).int32(message.number); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === void 0 ? reader.len : reader.pos + length; + const message = createBaseReelSequence_Params(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + if (tag !== 24) { + break; + } + message.number = reader.int32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + } +}; +function createBaseNextParams() { + return { videoId: [], playlistTitle: void 0 }; +} +__name(createBaseNextParams, "createBaseNextParams"); +var NextParams = { + encode(message, writer = new BinaryWriter()) { + for (const v of message.videoId) { + writer.uint32(42).string(v); + } + if (message.playlistTitle !== void 0) { + writer.uint32(50).string(message.playlistTitle); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === void 0 ? reader.len : reader.pos + length; + const message = createBaseNextParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 5: { + if (tag !== 42) { + break; + } + message.videoId.push(reader.string()); + continue; + } + case 6: { + if (tag !== 50) { + break; + } + message.playlistTitle = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + } +}; +function createBaseCommunityPostParams() { + return { f1: void 0 }; +} +__name(createBaseCommunityPostParams, "createBaseCommunityPostParams"); +var CommunityPostParams = { + encode(message, writer = new BinaryWriter()) { + if (message.f1 !== void 0) { + CommunityPostParams_Field1.encode(message.f1, writer.uint32(450).fork()).join(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === void 0 ? reader.len : reader.pos + length; + const message = createBaseCommunityPostParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 56: { + if (tag !== 450) { + break; + } + message.f1 = CommunityPostParams_Field1.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + } +}; +function createBaseCommunityPostParams_Field1() { + return { ucid1: "", postId: "", ucid2: "" }; +} +__name(createBaseCommunityPostParams_Field1, "createBaseCommunityPostParams_Field1"); +var CommunityPostParams_Field1 = { + encode(message, writer = new BinaryWriter()) { + if (message.ucid1 !== "") { + writer.uint32(18).string(message.ucid1); + } + if (message.postId !== "") { + writer.uint32(26).string(message.postId); + } + if (message.ucid2 !== "") { + writer.uint32(90).string(message.ucid2); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === void 0 ? reader.len : reader.pos + length; + const message = createBaseCommunityPostParams_Field1(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + if (tag !== 18) { + break; + } + message.ucid1 = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + message.postId = reader.string(); + continue; + } + case 11: { + if (tag !== 90) { + break; + } + message.ucid2 = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + } +}; +function createBaseCommunityPostCommentsParamContainer() { + return { f0: void 0 }; +} +__name(createBaseCommunityPostCommentsParamContainer, "createBaseCommunityPostCommentsParamContainer"); +var CommunityPostCommentsParamContainer = { + encode(message, writer = new BinaryWriter()) { + if (message.f0 !== void 0) { + CommunityPostCommentsParamContainer_Container.encode(message.f0, writer.uint32(641815778).fork()).join(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === void 0 ? reader.len : reader.pos + length; + const message = createBaseCommunityPostCommentsParamContainer(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 80226972: { + if (tag !== 641815778) { + break; + } + message.f0 = CommunityPostCommentsParamContainer_Container.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + } +}; +function createBaseCommunityPostCommentsParamContainer_Container() { + return { location: "", protoData: "" }; +} +__name(createBaseCommunityPostCommentsParamContainer_Container, "createBaseCommunityPostCommentsParamContainer_Container"); +var CommunityPostCommentsParamContainer_Container = { + encode(message, writer = new BinaryWriter()) { + if (message.location !== "") { + writer.uint32(18).string(message.location); + } + if (message.protoData !== "") { + writer.uint32(26).string(message.protoData); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === void 0 ? reader.len : reader.pos + length; + const message = createBaseCommunityPostCommentsParamContainer_Container(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + if (tag !== 18) { + break; + } + message.location = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + message.protoData = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + } +}; +function createBaseCommunityPostCommentsParam() { + return { title: "", commentDataContainer: void 0 }; +} +__name(createBaseCommunityPostCommentsParam, "createBaseCommunityPostCommentsParam"); +var CommunityPostCommentsParam = { + encode(message, writer = new BinaryWriter()) { + if (message.title !== "") { + writer.uint32(18).string(message.title); + } + if (message.commentDataContainer !== void 0) { + CommunityPostCommentsParam_CommentDataContainer.encode(message.commentDataContainer, writer.uint32(426).fork()).join(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === void 0 ? reader.len : reader.pos + length; + const message = createBaseCommunityPostCommentsParam(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + if (tag !== 18) { + break; + } + message.title = reader.string(); + continue; + } + case 53: { + if (tag !== 426) { + break; + } + message.commentDataContainer = CommunityPostCommentsParam_CommentDataContainer.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + } +}; +function createBaseCommunityPostCommentsParam_CommentDataContainer() { + return { commentData: void 0, f0: 0, title: "" }; +} +__name(createBaseCommunityPostCommentsParam_CommentDataContainer, "createBaseCommunityPostCommentsParam_CommentDataContainer"); +var CommunityPostCommentsParam_CommentDataContainer = { + encode(message, writer = new BinaryWriter()) { + if (message.commentData !== void 0) { + CommunityPostCommentsParam_CommentDataContainer_CommentData.encode(message.commentData, writer.uint32(34).fork()).join(); + } + if (message.f0 !== 0) { + writer.uint32(56).int32(message.f0); + } + if (message.title !== "") { + writer.uint32(66).string(message.title); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === void 0 ? reader.len : reader.pos + length; + const message = createBaseCommunityPostCommentsParam_CommentDataContainer(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 4: { + if (tag !== 34) { + break; + } + message.commentData = CommunityPostCommentsParam_CommentDataContainer_CommentData.decode(reader, reader.uint32()); + continue; + } + case 7: { + if (tag !== 56) { + break; + } + message.f0 = reader.int32(); + continue; + } + case 8: { + if (tag !== 66) { + break; + } + message.title = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + } +}; +function createBaseCommunityPostCommentsParam_CommentDataContainer_CommentData() { + return { sortBy: 0, f0: 0, f1: 0, postId: "", channelId: "" }; +} +__name(createBaseCommunityPostCommentsParam_CommentDataContainer_CommentData, "createBaseCommunityPostCommentsParam_CommentDataContainer_CommentData"); +var CommunityPostCommentsParam_CommentDataContainer_CommentData = { + encode(message, writer = new BinaryWriter()) { + if (message.sortBy !== 0) { + writer.uint32(48).int32(message.sortBy); + } + if (message.f0 !== 0) { + writer.uint32(120).int32(message.f0); + } + if (message.f1 !== 0) { + writer.uint32(200).int32(message.f1); + } + if (message.postId !== "") { + writer.uint32(234).string(message.postId); + } + if (message.channelId !== "") { + writer.uint32(242).string(message.channelId); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === void 0 ? reader.len : reader.pos + length; + const message = createBaseCommunityPostCommentsParam_CommentDataContainer_CommentData(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 6: { + if (tag !== 48) { + break; + } + message.sortBy = reader.int32(); + continue; + } + case 15: { + if (tag !== 120) { + break; + } + message.f0 = reader.int32(); + continue; + } + case 25: { + if (tag !== 200) { + break; + } + message.f1 = reader.int32(); + continue; + } + case 29: { + if (tag !== 234) { + break; + } + message.postId = reader.string(); + continue; + } + case 30: { + if (tag !== 242) { + break; + } + message.channelId = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + } +}; + +// dist/src/utils/ProtoUtils.js +function encodeVisitorData(id, timestamp) { + const writer = VisitorData.encode({ id, timestamp }); + return encodeURIComponent(u8ToBase64(writer.finish()).replace(/\+/g, "-").replace(/\//g, "_")); +} +__name(encodeVisitorData, "encodeVisitorData"); +function decodeVisitorData(visitor_data) { + return VisitorData.decode(base64ToU8(decodeURIComponent(visitor_data).replace(/-/g, "+").replace(/_/g, "/"))); +} +__name(decodeVisitorData, "decodeVisitorData"); +function encodeCommentActionParams(type, args = {}) { + const data = { + type, + commentId: args.comment_id || " ", + videoId: args.video_id || " ", + channelId: " ", + unkNum: 2 + }; + if (args.hasOwnProperty("text")) { + if (typeof args.target_language !== "string") + throw new Error("target_language must be a string"); + if (args.comment_id) + delete data.unkNum; + data.translateCommentParams = { + params: { + comment: { + text: args.text + } + }, + commentId: args.comment_id || " ", + targetLanguage: args.target_language + }; + } + const writer = PeformCommentActionParams.encode(data); + return encodeURIComponent(u8ToBase64(writer.finish())); +} +__name(encodeCommentActionParams, "encodeCommentActionParams"); +function encodeNextParams(video_ids, playlist_title) { + const writer = NextParams.encode({ videoId: video_ids, playlistTitle: playlist_title }); + return encodeURIComponent(u8ToBase64(writer.finish()).replace(/\+/g, "-").replace(/\//g, "_")); +} +__name(encodeNextParams, "encodeNextParams"); + +// dist/src/utils/javascript/helpers.js +var helpers_exports2 = {}; +__export(helpers_exports2, { + WALK_STOP: () => WALK_STOP, + createWrapperFunction: () => createWrapperFunction, + extractNodeSource: () => extractNodeSource, + getNodeSourceRange: () => getNodeSourceRange, + indent: () => indent, + jsBuiltIns: () => jsBuiltIns, + memberBaseName: () => memberBaseName, + memberToString: () => memberToString, + walkAst: () => walkAst +}); +var WALK_STOP = Symbol("WALK_STOP"); +var jsBuiltIns = /* @__PURE__ */ new Set([ + "AbortController", + "AbortSignal", + "Array", + "ArrayBuffer", + "AsyncContext", + "Atomics", + "AudioContext", + "BigInt", + "BigInt64Array", + "BigUint64Array", + "Blob", + "Boolean", + "BroadcastChannel", + "Buffer", + "CanvasRenderingContext2D", + "clearImmediate", + "clearInterval", + "clearTimeout", + "confirm", + "console", + "Crypto", + "CustomEvent", + "DataView", + "Date", + "decodeURI", + "decodeURIComponent", + "document", + "Element", + "encodeURI", + "encodeURIComponent", + "Error", + "escape", + "eval", + "Event", + "EventTarget", + "fetch", + "File", + "FileReader", + "Float32Array", + "Float64Array", + "FormData", + "function", + "global", + "globalThis", + "hasOwnProperty", + "Headers", + "History", + "HTMLElement", + "HTMLCollection", + "IDBKeyRange", + "Infinity", + "Int16Array", + "Int32Array", + "Int8Array", + "Intl", + "IntersectionObserver", + "isFinite", + "isNaN", + "isPrototypeOf", + "JSON", + "location", + "log", + "Map", + "Math", + "MediaRecorder", + "MediaSource", + "MediaStream", + "MemberExpression", + "MutationObserver", + "NaN", + "navigator", + "Node", + "NodeList", + "Number", + "Object", + "OfflineAudioContext", + "parse", + "parseFloat", + "parseInt", + "Performance", + "process", + "Promise", + "prompt", + "prototype", + "Proxy", + "ReadableStream", + "Reflect", + "RegExp", + "requestAnimationFrame", + "requestIdleCallback", + "Request", + "Response", + "ResizeObserver", + "Screen", + "setImmediate", + "setInterval", + "setTimeout", + "SharedArrayBuffer", + "SharedWorker", + "SourceBuffer", + "split", + "String", + "stringify", + "structuredClone", + "SubtleCrypto", + "Symbol", + "TextDecoder", + "TextEncoder", + "this", + "toString", + "TransformStream", + "Uint16Array", + "Uint32Array", + "Uint8Array", + "Uint8ClampedArray", + "undefined", + "unescape", + "URL", + "URLSearchParams", + "valueOf", + "WeakMap", + "WeakSet", + "WebAssembly", + "WebGLRenderingContext", + "window", + "Worker", + "WritableStream", + "XMLHttpRequest", + "alert", + "arguments", + "atob", + "btoa", + "cancelAnimationFrame", + "cancelIdleCallback", + "queueMicrotask" +]); +var indent = " "; +function walkAst(root, visitor) { + var _a, _b; + if (!root || typeof root !== "object") + return; + const stack = [{ node: root, parent: null, exit: false }]; + const ancestors = []; + const enter = typeof visitor === "function" ? visitor : (_a = visitor.enter) != null ? _a : null; + const leave = typeof visitor === "function" ? null : (_b = visitor.leave) != null ? _b : null; + let shouldStop = false; + while (!shouldStop && stack.length > 0) { + const frame = stack.pop(); + const { node, parent, exit } = frame; + if (exit) { + ancestors.pop(); + if (leave && leave(node, parent, ancestors) === WALK_STOP) { + shouldStop = true; + } + continue; + } + if (!node || typeof node.type !== "string") + continue; + const result = enter ? enter(node, parent, ancestors) : void 0; + if (result === WALK_STOP) { + shouldStop = true; + continue; + } + if (result === true) + continue; + stack.push({ node, parent, exit: true }); + ancestors.push(node); + for (const key in node) { + if (key === "loc" || key === "range" || key === "start" || key === "end") + continue; + if (!Object.prototype.hasOwnProperty.call(node, key)) + continue; + const value = node[key]; + if (!value) + continue; + if (Array.isArray(value)) { + for (let i = value.length - 1; i >= 0; i--) { + const item = value[i]; + if (item && typeof item.type === "string") { + stack.push({ node: item, parent: node, exit: false }); + } + } + } else if (typeof value === "object" && typeof value.type === "string") { + stack.push({ node: value, parent: node, exit: false }); + } + } + } +} +__name(walkAst, "walkAst"); +function getNodeSourceRange(node) { + if (!node) + return null; + if (Array.isArray(node.range)) + return node.range; + if (typeof node.start === "number" && typeof node.end === "number") + return [node.start, node.end]; + return null; +} +__name(getNodeSourceRange, "getNodeSourceRange"); +function extractNodeSource(node, source) { + const range = getNodeSourceRange(node); + return range ? source.slice(range[0], range[1]) : null; +} +__name(extractNodeSource, "extractNodeSource"); +function memberToString(memberExpression, source) { + if (memberExpression.type !== "MemberExpression") + return null; + const segments = []; + let cur = memberExpression; + while (cur && cur.type === "MemberExpression") { + const member = cur; + const prop = member.property; + if (!prop) + return null; + if (member.computed) { + const propSource = extractNodeSource(prop, source); + if (!propSource) + return null; + segments.unshift(`[${propSource.trim()}]`); + } else { + if (prop.type !== "Identifier") + return null; + segments.unshift(`.${prop.name}`); + } + cur = member.object; + } + let base = null; + if ((cur == null ? void 0 : cur.type) === "Identifier") { + base = cur.name; + } else if ((cur == null ? void 0 : cur.type) === "ThisExpression") { + base = "this"; + } + return base ? base + segments.join("") : null; +} +__name(memberToString, "memberToString"); +function memberBaseName(memberExpression, source) { + let target = memberExpression.object; + while (target && target.type === "MemberExpression") { + const parentName = memberToString(target, source); + if (parentName) + return parentName; + target = target.object; + } + if ((target == null ? void 0 : target.type) === "Identifier") + return target.name; + if ((target == null ? void 0 : target.type) === "ThisExpression") + return "this"; + return null; +} +__name(memberBaseName, "memberBaseName"); +function createWrapperFunction(analyzer, name, node) { + var _a; + if (node.type === "CallExpression" && node.callee.type === "Identifier" && analyzer.declaredVariables.has(node.callee.name)) { + return generateWrapper(name, node.callee.name, parseFunctionArguments(analyzer, node.arguments)); + } else if (node.type === "VariableDeclarator" && ((_a = node.init) == null ? void 0 : _a.type) === "FunctionExpression" && node.id.type === "Identifier") { + return generateWrapper(name, node.id.name, parseFunctionArguments(analyzer, node.init.params)); + } else if (node.type === "NewExpression" && node.callee.type === "MemberExpression" && node.callee.object.type === "Identifier") { + const targetFunction = memberToString(node.callee, analyzer.getSource()); + if (!targetFunction) + return void 0; + return generateWrapper(name, targetFunction, parseFunctionArguments(analyzer, node.arguments), true); + } +} +__name(createWrapperFunction, "createWrapperFunction"); +function generateWrapper(functionName, targetFunction, args, useNew = false) { + return [ + `${indent}function ${functionName}(${args.join(", ")}) {`, + `${indent}${indent}return ${useNew ? "new " : ""}${targetFunction}(${args.join(", ")});`, + `${indent}}` + ].join("\n"); +} +__name(generateWrapper, "generateWrapper"); +function parseFunctionArguments(analyzer, args) { + const params = []; + for (const arg of args) { + if (arg.type === "Identifier" && analyzer.declaredVariables.has(arg.name)) { + params.push(arg.name); + } else if (arg.type === "Literal" && (typeof arg.value === "string" || typeof arg.value === "number")) { + params.push(JSON.stringify(arg.value)); + } else if (arg.type === "UnaryExpression") { + const argSource = extractNodeSource(arg, analyzer.getSource()); + if (argSource) { + params.push(argSource.trim()); + } + } else if (arg.type === "AssignmentPattern" && arg.left.type === "Identifier") { + params.push(arg.left.name); + } else if (arg.type === "Identifier") { + params.push(arg.name); + } else if (!params.includes("input")) + params.push("input"); + } + return params; +} +__name(parseFunctionArguments, "parseFunctionArguments"); + +// dist/src/utils/javascript/matchers.js +var matchers_exports = {}; +__export(matchers_exports, { + nsigMatcher: () => nsigMatcher, + timestampMatcher: () => timestampMatcher +}); +function nsigMatcher(node) { + if (node.type !== "VariableDeclarator") + return false; + const init = node.init; + if (!init || init.type !== "FunctionExpression") + return false; + if (init.params.length < 3) + return false; + const [url, sigName, sigValue] = init.params; + if (url.type !== "Identifier" || sigName.type !== "AssignmentPattern" || sigValue.type !== "AssignmentPattern") + return false; + const body = init.body; + const blockStatementBody = (body == null ? void 0 : body.body) || []; + let hasUrlCtor = false; + let hasSetAlr = false; + for (const statement of blockStatementBody) { + if (statement.type !== "ExpressionStatement") + continue; + const expr = statement.expression; + if (expr.type === "AssignmentExpression" && expr.operator === "=" && expr.left.type === "Identifier" && expr.left.name === url.name) { + const right = expr.right; + if (right.type === "NewExpression" && right.callee.type === "MemberExpression") { + hasUrlCtor = true; + } + } + if (expr.type === "CallExpression" && expr.callee.type === "MemberExpression") { + const args = expr.arguments; + if (args.length === 2 && args[0].type === "Literal" && args[0].value === "alr" && args[1].type === "Literal" && args[1].value === "yes") { + hasSetAlr = true; + } + } + } + if (!hasUrlCtor || !hasSetAlr) + return false; + return node; +} +__name(nsigMatcher, "nsigMatcher"); +function timestampMatcher(node) { + var _a; + if (node.type !== "VariableDeclarator" || ((_a = node.init) == null ? void 0 : _a.type) !== "FunctionExpression") { + return false; + } + const funcBody = node.init.body; + if (!funcBody) + return false; + let foundObject = null; + walkAst(funcBody, (innerNode) => { + if (innerNode.type === "ObjectExpression") { + for (const prop of innerNode.properties) { + if (prop.type === "Property" && prop.key.type === "Identifier" && prop.key.name === "signatureTimestamp") { + foundObject = prop; + return WALK_STOP; + } + } + } + }); + return foundObject || false; +} +__name(timestampMatcher, "timestampMatcher"); + +// node_modules/meriyah/dist/meriyah.mjs +var unicodeLookup = ((compressed, lookup) => { + const result = new Uint32Array(69632); + let index = 0; + let subIndex = 0; + while (index < 2571) { + const inst = compressed[index++]; + if (inst < 0) { + subIndex -= inst; + } else { + let code = compressed[index++]; + if (inst & 2) + code = lookup[code]; + if (inst & 1) { + result.fill(code, subIndex, subIndex += compressed[index++]); + } else { + result[subIndex++] = code; + } + } + } + return result; +})([-1, 2, 26, 2, 27, 2, 5, -1, 0, 77595648, 3, 44, 2, 3, 0, 14, 2, 63, 2, 64, 3, 0, 3, 0, 3168796671, 0, 4294956992, 2, 1, 2, 0, 2, 41, 3, 0, 4, 0, 4294966523, 3, 0, 4, 2, 16, 2, 65, 2, 0, 0, 4294836735, 0, 3221225471, 0, 4294901942, 2, 66, 0, 134152192, 3, 0, 2, 0, 4294951935, 3, 0, 2, 0, 2683305983, 0, 2684354047, 2, 18, 2, 0, 0, 4294961151, 3, 0, 2, 2, 19, 2, 0, 0, 608174079, 2, 0, 2, 60, 2, 7, 2, 6, 0, 4286611199, 3, 0, 2, 2, 1, 3, 0, 3, 0, 4294901711, 2, 40, 0, 4089839103, 0, 2961209759, 0, 1342439375, 0, 4294543342, 0, 3547201023, 0, 1577204103, 0, 4194240, 0, 4294688750, 2, 2, 0, 80831, 0, 4261478351, 0, 4294549486, 2, 2, 0, 2967484831, 0, 196559, 0, 3594373100, 0, 3288319768, 0, 8469959, 0, 65472, 2, 3, 0, 4093640191, 0, 660618719, 0, 65487, 0, 4294828015, 0, 4092591615, 0, 1616920031, 0, 982991, 2, 3, 2, 0, 0, 2163244511, 0, 4227923919, 0, 4236247022, 2, 71, 0, 4284449919, 0, 851904, 2, 4, 2, 12, 0, 67076095, -1, 2, 72, 0, 1073741743, 0, 4093607775, -1, 0, 50331649, 0, 3265266687, 2, 33, 0, 4294844415, 0, 4278190047, 2, 20, 2, 137, -1, 3, 0, 2, 2, 23, 2, 0, 2, 10, 2, 0, 2, 15, 2, 22, 3, 0, 10, 2, 74, 2, 0, 2, 75, 2, 76, 2, 77, 2, 0, 2, 78, 2, 0, 2, 11, 0, 261632, 2, 25, 3, 0, 2, 2, 13, 2, 4, 3, 0, 18, 2, 79, 2, 5, 3, 0, 2, 2, 80, 0, 2151677951, 2, 29, 2, 9, 0, 909311, 3, 0, 2, 0, 814743551, 2, 49, 0, 67090432, 3, 0, 2, 2, 42, 2, 0, 2, 6, 2, 0, 2, 30, 2, 8, 0, 268374015, 2, 110, 2, 51, 2, 0, 2, 81, 0, 134153215, -1, 2, 7, 2, 0, 2, 8, 0, 2684354559, 0, 67044351, 0, 3221160064, 2, 17, -1, 3, 0, 2, 2, 53, 0, 1046528, 3, 0, 3, 2, 9, 2, 0, 2, 54, 0, 4294960127, 2, 10, 2, 6, 2, 11, 0, 4294377472, 2, 12, 3, 0, 16, 2, 13, 2, 0, 2, 82, 2, 10, 2, 0, 2, 83, 2, 84, 2, 85, 0, 12288, 2, 55, 0, 1048577, 2, 86, 2, 14, -1, 2, 14, 0, 131042, 2, 87, 2, 88, 2, 89, 2, 0, 2, 34, -83, 3, 0, 7, 0, 1046559, 2, 0, 2, 15, 2, 0, 0, 2147516671, 2, 21, 3, 90, 2, 2, 0, -16, 2, 91, 0, 524222462, 2, 4, 2, 0, 0, 4269801471, 2, 4, 3, 0, 2, 2, 28, 2, 16, 3, 0, 2, 2, 17, 2, 0, -1, 2, 18, -16, 3, 0, 206, -2, 3, 0, 692, 2, 73, -1, 2, 18, 2, 10, 3, 0, 8, 2, 93, 2, 133, 2, 0, 0, 3220242431, 3, 0, 3, 2, 19, 2, 94, 2, 95, 3, 0, 2, 2, 96, 2, 0, 2, 97, 2, 46, 2, 0, 0, 4351, 2, 0, 2, 9, 3, 0, 2, 0, 67043391, 0, 3909091327, 2, 0, 2, 24, 2, 9, 2, 20, 3, 0, 2, 0, 67076097, 2, 8, 2, 0, 2, 21, 0, 67059711, 0, 4236247039, 3, 0, 2, 0, 939524103, 0, 8191999, 2, 101, 2, 102, 2, 22, 2, 23, 3, 0, 3, 0, 67057663, 3, 0, 349, 2, 103, 2, 104, 2, 7, -264, 3, 0, 11, 2, 24, 3, 0, 2, 2, 32, -1, 0, 3774349439, 2, 105, 2, 106, 3, 0, 2, 2, 19, 2, 107, 3, 0, 10, 2, 10, 2, 18, 2, 0, 2, 47, 2, 0, 2, 31, 2, 108, 2, 25, 0, 1638399, 0, 57344, 2, 109, 3, 0, 3, 2, 20, 2, 26, 2, 27, 2, 5, 2, 28, 2, 0, 2, 8, 2, 111, -1, 2, 112, 2, 113, 2, 114, -1, 3, 0, 3, 2, 12, -2, 2, 0, 2, 29, -3, 0, 536870912, -4, 2, 20, 2, 0, 2, 36, 0, 1, 2, 0, 2, 67, 2, 6, 2, 12, 2, 10, 2, 0, 2, 115, -1, 3, 0, 4, 2, 10, 2, 23, 2, 116, 2, 7, 2, 0, 2, 117, 2, 0, 2, 118, 2, 119, 2, 120, 2, 0, 2, 9, 3, 0, 9, 2, 21, 2, 30, 2, 31, 2, 121, 2, 122, -2, 2, 123, 2, 124, 2, 30, 2, 21, 2, 8, -2, 2, 125, 2, 30, 2, 32, -2, 2, 0, 2, 39, -2, 0, 4277137519, 0, 2269118463, -1, 3, 20, 2, -1, 2, 33, 2, 38, 2, 0, 3, 30, 2, 2, 35, 2, 19, -3, 3, 0, 2, 2, 34, -1, 2, 0, 2, 35, 2, 0, 2, 35, 2, 0, 2, 48, 2, 0, 0, 4294950463, 2, 37, -7, 2, 0, 0, 203775, 2, 57, 0, 4026531840, 2, 20, 2, 43, 2, 36, 2, 18, 2, 37, 2, 18, 2, 126, 2, 21, 3, 0, 2, 2, 38, 0, 2151677888, 2, 0, 2, 12, 0, 4294901764, 2, 144, 2, 0, 2, 58, 2, 56, 0, 5242879, 3, 0, 2, 0, 402644511, -1, 2, 128, 2, 39, 0, 3, -1, 2, 129, 2, 130, 2, 0, 0, 67045375, 2, 40, 0, 4226678271, 0, 3766565279, 0, 2039759, 2, 132, 2, 41, 0, 1046437, 0, 6, 3, 0, 2, 0, 3288270847, 0, 3, 3, 0, 2, 0, 67043519, -5, 2, 0, 0, 4282384383, 0, 1056964609, -1, 3, 0, 2, 0, 67043345, -1, 2, 0, 2, 42, 2, 23, 2, 50, 2, 11, 2, 61, 2, 38, -5, 2, 0, 2, 12, -3, 3, 0, 2, 0, 2147484671, 2, 134, 0, 4190109695, 2, 52, -2, 2, 135, 0, 4244635647, 0, 27, 2, 0, 2, 8, 2, 43, 2, 0, 2, 68, 2, 18, 2, 0, 2, 42, -6, 2, 0, 2, 45, 2, 59, 2, 44, 2, 45, 2, 46, 2, 47, 0, 8388351, -2, 2, 136, 0, 3028287487, 2, 48, 2, 138, 0, 33259519, 2, 49, -9, 2, 21, 0, 4294836223, 0, 3355443199, 0, 134152199, -2, 2, 69, -2, 3, 0, 28, 2, 32, -3, 3, 0, 3, 2, 17, 3, 0, 6, 2, 50, -81, 2, 18, 3, 0, 2, 2, 36, 3, 0, 33, 2, 25, 2, 30, 3, 0, 124, 2, 12, 3, 0, 18, 2, 38, -213, 2, 0, 2, 32, -54, 3, 0, 17, 2, 42, 2, 8, 2, 23, 2, 0, 2, 8, 2, 23, 2, 51, 2, 0, 2, 21, 2, 52, 2, 139, 2, 25, -13, 2, 0, 2, 53, -6, 3, 0, 2, -4, 3, 0, 2, 0, 4294936575, 2, 0, 0, 4294934783, -2, 0, 196635, 3, 0, 191, 2, 54, 3, 0, 38, 2, 30, 2, 55, 2, 34, -278, 2, 140, 3, 0, 9, 2, 141, 2, 142, 2, 56, 3, 0, 11, 2, 7, -72, 3, 0, 3, 2, 143, 0, 1677656575, -130, 2, 26, -16, 2, 0, 2, 24, 2, 38, -16, 0, 4161266656, 0, 4071, 0, 15360, -4, 2, 57, -13, 3, 0, 2, 2, 58, 2, 0, 2, 145, 2, 146, 2, 62, 2, 0, 2, 147, 2, 148, 2, 149, 3, 0, 10, 2, 150, 2, 151, 2, 22, 3, 58, 2, 3, 152, 2, 3, 59, 2, 0, 4294954999, 2, 0, -16, 2, 0, 2, 92, 2, 0, 0, 2105343, 0, 4160749584, 0, 65534, -34, 2, 8, 2, 154, -6, 0, 4194303871, 0, 4294903771, 2, 0, 2, 60, 2, 100, -3, 2, 0, 0, 1073684479, 0, 17407, -9, 2, 18, 2, 17, 2, 0, 2, 32, -14, 2, 18, 2, 32, -6, 2, 18, 2, 12, -15, 2, 155, 3, 0, 6, 0, 8323103, -1, 3, 0, 2, 2, 61, -37, 2, 62, 2, 156, 2, 157, 2, 158, 2, 159, 2, 160, -105, 2, 26, -32, 3, 0, 1335, -1, 3, 0, 129, 2, 32, 3, 0, 6, 2, 10, 3, 0, 180, 2, 161, 3, 0, 233, 2, 162, 3, 0, 18, 2, 10, -77, 3, 0, 16, 2, 10, -47, 3, 0, 154, 2, 6, 3, 0, 130, 2, 25, -22250, 3, 0, 7, 2, 25, -6130, 3, 5, 2, -1, 0, 69207040, 3, 44, 2, 3, 0, 14, 2, 63, 2, 64, -3, 0, 3168731136, 0, 4294956864, 2, 1, 2, 0, 2, 41, 3, 0, 4, 0, 4294966275, 3, 0, 4, 2, 16, 2, 65, 2, 0, 2, 34, -1, 2, 18, 2, 66, -1, 2, 0, 0, 2047, 0, 4294885376, 3, 0, 2, 0, 3145727, 0, 2617294944, 0, 4294770688, 2, 25, 2, 67, 3, 0, 2, 0, 131135, 2, 98, 0, 70256639, 0, 71303167, 0, 272, 2, 42, 2, 6, 0, 32511, 2, 0, 2, 49, -1, 2, 99, 2, 68, 0, 4278255616, 0, 4294836227, 0, 4294549473, 0, 600178175, 0, 2952806400, 0, 268632067, 0, 4294543328, 0, 57540095, 0, 1577058304, 0, 1835008, 0, 4294688736, 2, 70, 2, 69, 0, 33554435, 2, 131, 2, 70, 0, 2952790016, 0, 131075, 0, 3594373096, 0, 67094296, 2, 69, -1, 0, 4294828e3, 0, 603979263, 0, 654311424, 0, 3, 0, 4294828001, 0, 602930687, 0, 1610612736, 0, 393219, 0, 4294828016, 0, 671088639, 0, 2154840064, 0, 4227858435, 0, 4236247008, 2, 71, 2, 38, -1, 2, 4, 0, 917503, 2, 38, -1, 2, 72, 0, 537788335, 0, 4026531935, -1, 0, 1, -1, 2, 33, 2, 73, 0, 7936, -3, 2, 0, 0, 2147485695, 0, 1010761728, 0, 4292984930, 0, 16387, 2, 0, 2, 15, 2, 22, 3, 0, 10, 2, 74, 2, 0, 2, 75, 2, 76, 2, 77, 2, 0, 2, 78, 2, 0, 2, 12, -1, 2, 25, 3, 0, 2, 2, 13, 2, 4, 3, 0, 18, 2, 79, 2, 5, 3, 0, 2, 2, 80, 0, 2147745791, 3, 19, 2, 0, 122879, 2, 0, 2, 9, 0, 276824064, -2, 3, 0, 2, 2, 42, 2, 0, 0, 4294903295, 2, 0, 2, 30, 2, 8, -1, 2, 18, 2, 51, 2, 0, 2, 81, 2, 49, -1, 2, 21, 2, 0, 2, 29, -2, 0, 128, -2, 2, 28, 2, 9, 0, 8160, -1, 2, 127, 0, 4227907585, 2, 0, 2, 37, 2, 0, 2, 50, 0, 4227915776, 2, 10, 2, 6, 2, 11, -1, 0, 74440192, 3, 0, 6, -2, 3, 0, 8, 2, 13, 2, 0, 2, 82, 2, 10, 2, 0, 2, 83, 2, 84, 2, 85, -3, 2, 86, 2, 14, -3, 2, 87, 2, 88, 2, 89, 2, 0, 2, 34, -83, 3, 0, 7, 0, 817183, 2, 0, 2, 15, 2, 0, 0, 33023, 2, 21, 3, 90, 2, -17, 2, 91, 0, 524157950, 2, 4, 2, 0, 2, 92, 2, 4, 2, 0, 2, 22, 2, 28, 2, 16, 3, 0, 2, 2, 17, 2, 0, -1, 2, 18, -16, 3, 0, 206, -2, 3, 0, 692, 2, 73, -1, 2, 18, 2, 10, 3, 0, 8, 2, 93, 0, 3072, 2, 0, 0, 2147516415, 2, 10, 3, 0, 2, 2, 25, 2, 94, 2, 95, 3, 0, 2, 2, 96, 2, 0, 2, 97, 2, 46, 0, 4294965179, 0, 7, 2, 0, 2, 9, 2, 95, 2, 9, -1, 0, 1761345536, 2, 98, 0, 4294901823, 2, 38, 2, 20, 2, 99, 2, 35, 2, 100, 0, 2080440287, 2, 0, 2, 34, 2, 153, 0, 3296722943, 2, 0, 0, 1046675455, 0, 939524101, 0, 1837055, 2, 101, 2, 102, 2, 22, 2, 23, 3, 0, 3, 0, 7, 3, 0, 349, 2, 103, 2, 104, 2, 7, -264, 3, 0, 11, 2, 24, 3, 0, 2, 2, 32, -1, 0, 2700607615, 2, 105, 2, 106, 3, 0, 2, 2, 19, 2, 107, 3, 0, 10, 2, 10, 2, 18, 2, 0, 2, 47, 2, 0, 2, 31, 2, 108, -3, 2, 109, 3, 0, 3, 2, 20, -1, 3, 5, 2, 2, 110, 2, 0, 2, 8, 2, 111, -1, 2, 112, 2, 113, 2, 114, -1, 3, 0, 3, 2, 12, -2, 2, 0, 2, 29, -8, 2, 20, 2, 0, 2, 36, -1, 2, 0, 2, 67, 2, 6, 2, 30, 2, 10, 2, 0, 2, 115, -1, 3, 0, 4, 2, 10, 2, 18, 2, 116, 2, 7, 2, 0, 2, 117, 2, 0, 2, 118, 2, 119, 2, 120, 2, 0, 2, 9, 3, 0, 9, 2, 21, 2, 30, 2, 31, 2, 121, 2, 122, -2, 2, 123, 2, 124, 2, 30, 2, 21, 2, 8, -2, 2, 125, 2, 30, 2, 32, -2, 2, 0, 2, 39, -2, 0, 4277075969, 2, 30, -1, 3, 20, 2, -1, 2, 33, 2, 126, 2, 0, 3, 30, 2, 2, 35, 2, 19, -3, 3, 0, 2, 2, 34, -1, 2, 0, 2, 35, 2, 0, 2, 35, 2, 0, 2, 50, 2, 98, 0, 4294934591, 2, 37, -7, 2, 0, 0, 197631, 2, 57, -1, 2, 20, 2, 43, 2, 37, 2, 18, 0, 3, 2, 18, 2, 126, 2, 21, 2, 127, 2, 54, -1, 0, 2490368, 2, 127, 2, 25, 2, 18, 2, 34, 2, 127, 2, 38, 0, 4294901904, 0, 4718591, 2, 127, 2, 35, 0, 335544350, -1, 2, 128, 0, 2147487743, 0, 1, -1, 2, 129, 2, 130, 2, 8, -1, 2, 131, 2, 70, 0, 3758161920, 0, 3, 2, 132, 0, 12582911, 0, 655360, -1, 2, 0, 2, 29, 0, 2147485568, 0, 3, 2, 0, 2, 25, 0, 176, -5, 2, 0, 2, 17, 0, 251658240, -1, 2, 0, 2, 25, 0, 16, -1, 2, 0, 0, 16779263, -2, 2, 12, -1, 2, 38, -5, 2, 0, 2, 133, -3, 3, 0, 2, 2, 55, 2, 134, 0, 2147549183, 0, 2, -2, 2, 135, 2, 36, 0, 10, 0, 4294965249, 0, 67633151, 0, 4026597376, 2, 0, 0, 536871935, 2, 18, 2, 0, 2, 42, -6, 2, 0, 0, 1, 2, 59, 2, 17, 0, 1, 2, 46, 2, 25, -3, 2, 136, 2, 36, 2, 137, 2, 138, 0, 16778239, -10, 2, 35, 0, 4294836212, 2, 9, -3, 2, 69, -2, 3, 0, 28, 2, 32, -3, 3, 0, 3, 2, 17, 3, 0, 6, 2, 50, -81, 2, 18, 3, 0, 2, 2, 36, 3, 0, 33, 2, 25, 0, 126, 3, 0, 124, 2, 12, 3, 0, 18, 2, 38, -213, 2, 10, -55, 3, 0, 17, 2, 42, 2, 8, 2, 18, 2, 0, 2, 8, 2, 18, 2, 60, 2, 0, 2, 25, 2, 50, 2, 139, 2, 25, -13, 2, 0, 2, 73, -6, 3, 0, 2, -4, 3, 0, 2, 0, 67583, -1, 2, 107, -2, 0, 11, 3, 0, 191, 2, 54, 3, 0, 38, 2, 30, 2, 55, 2, 34, -278, 2, 140, 3, 0, 9, 2, 141, 2, 142, 2, 56, 3, 0, 11, 2, 7, -72, 3, 0, 3, 2, 143, 2, 144, -187, 3, 0, 2, 2, 58, 2, 0, 2, 145, 2, 146, 2, 62, 2, 0, 2, 147, 2, 148, 2, 149, 3, 0, 10, 2, 150, 2, 151, 2, 22, 3, 58, 2, 3, 152, 2, 3, 59, 2, 2, 153, -57, 2, 8, 2, 154, -7, 2, 18, 2, 0, 2, 60, -4, 2, 0, 0, 1065361407, 0, 16384, -9, 2, 18, 2, 60, 2, 0, 2, 133, -14, 2, 18, 2, 133, -6, 2, 18, 0, 81919, -15, 2, 155, 3, 0, 6, 2, 126, -1, 3, 0, 2, 0, 2063, -37, 2, 62, 2, 156, 2, 157, 2, 158, 2, 159, 2, 160, -138, 3, 0, 1335, -1, 3, 0, 129, 2, 32, 3, 0, 6, 2, 10, 3, 0, 180, 2, 161, 3, 0, 233, 2, 162, 3, 0, 18, 2, 10, -77, 3, 0, 16, 2, 10, -47, 3, 0, 154, 2, 6, 3, 0, 130, 2, 25, -28386], [4294967295, 4294967291, 4092460543, 4294828031, 4294967294, 134217726, 4294903807, 268435455, 2147483647, 1048575, 1073741823, 3892314111, 134217727, 1061158911, 536805376, 4294910143, 4294901759, 32767, 4294901760, 262143, 536870911, 8388607, 4160749567, 4294902783, 4294918143, 65535, 67043328, 2281701374, 4294967264, 2097151, 4194303, 255, 67108863, 4294967039, 511, 524287, 131071, 63, 127, 3238002687, 4294549487, 4290772991, 33554431, 4294901888, 4286578687, 67043329, 4294705152, 4294770687, 67043583, 1023, 15, 2047999, 67043343, 67051519, 16777215, 2147483648, 4294902e3, 28, 4292870143, 4294966783, 16383, 67047423, 4294967279, 262083, 20511, 41943039, 493567, 4294959104, 603979775, 65536, 602799615, 805044223, 4294965206, 8191, 1031749119, 4294917631, 2134769663, 4286578493, 4282253311, 4294942719, 33540095, 4294905855, 2868854591, 1608515583, 265232348, 534519807, 2147614720, 1060109444, 4093640016, 17376, 2139062143, 224, 4169138175, 4294909951, 4286578688, 4294967292, 4294965759, 535511039, 4294966272, 4294967280, 32768, 8289918, 4294934399, 4294901775, 4294965375, 1602223615, 4294967259, 4294443008, 268369920, 4292804608, 4294967232, 486341884, 4294963199, 3087007615, 1073692671, 4128527, 4279238655, 4294902015, 4160684047, 4290246655, 469499899, 4294967231, 134086655, 4294966591, 2445279231, 3670015, 31, 4294967288, 4294705151, 3221208447, 4294902271, 4294549472, 4294921215, 4095, 4285526655, 4294966527, 4294966143, 64, 4294966719, 3774873592, 1877934080, 262151, 2555904, 536807423, 67043839, 3758096383, 3959414372, 3755993023, 2080374783, 4294835295, 4294967103, 4160749565, 4294934527, 4087, 2016, 2147446655, 184024726, 2862017156, 1593309078, 268434431, 268434414, 4294901763, 4294901761]); +var isIDContinue = /* @__PURE__ */ __name((code) => (unicodeLookup[(code >>> 5) + 0] >>> code & 31 & 1) !== 0, "isIDContinue"); +var isIDStart = /* @__PURE__ */ __name((code) => (unicodeLookup[(code >>> 5) + 34816] >>> code & 31 & 1) !== 0, "isIDStart"); +function advanceChar(parser) { + parser.column++; + return parser.currentChar = parser.source.charCodeAt(++parser.index); +} +__name(advanceChar, "advanceChar"); +function consumePossibleSurrogatePair(parser) { + const hi = parser.currentChar; + if ((hi & 64512) !== 55296) + return 0; + const lo = parser.source.charCodeAt(parser.index + 1); + if ((lo & 64512) !== 56320) + return 0; + return 65536 + ((hi & 1023) << 10) + (lo & 1023); +} +__name(consumePossibleSurrogatePair, "consumePossibleSurrogatePair"); +function consumeLineFeed(parser, state) { + parser.currentChar = parser.source.charCodeAt(++parser.index); + parser.flags |= 1; + if ((state & 4) === 0) { + parser.column = 0; + parser.line++; + } +} +__name(consumeLineFeed, "consumeLineFeed"); +function scanNewLine(parser) { + parser.flags |= 1; + parser.currentChar = parser.source.charCodeAt(++parser.index); + parser.column = 0; + parser.line++; +} +__name(scanNewLine, "scanNewLine"); +function isExoticECMAScriptWhitespace(ch) { + return ch === 160 || ch === 65279 || ch === 133 || ch === 5760 || ch >= 8192 && ch <= 8203 || ch === 8239 || ch === 8287 || ch === 12288 || ch === 8201 || ch === 65519; +} +__name(isExoticECMAScriptWhitespace, "isExoticECMAScriptWhitespace"); +function toHex(code) { + return code < 65 ? code - 48 : code - 65 + 10 & 15; +} +__name(toHex, "toHex"); +function convertTokenType(t) { + switch (t) { + case 134283266: + return "NumericLiteral"; + case 134283267: + return "StringLiteral"; + case 86021: + case 86022: + return "BooleanLiteral"; + case 86023: + return "NullLiteral"; + case 65540: + return "RegularExpression"; + case 67174408: + case 67174409: + case 131: + return "TemplateLiteral"; + default: + if ((t & 143360) === 143360) + return "Identifier"; + if ((t & 4096) === 4096) + return "Keyword"; + return "Punctuator"; + } +} +__name(convertTokenType, "convertTokenType"); +var CharTypes = [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 8 | 1024, + 0, + 0, + 8 | 2048, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 8192, + 0, + 1 | 2, + 0, + 0, + 8192, + 0, + 0, + 0, + 256, + 0, + 256 | 32768, + 0, + 0, + 2 | 16 | 128 | 32 | 64, + 2 | 16 | 128 | 32 | 64, + 2 | 16 | 32 | 64, + 2 | 16 | 32 | 64, + 2 | 16 | 32 | 64, + 2 | 16 | 32 | 64, + 2 | 16 | 32 | 64, + 2 | 16 | 32 | 64, + 2 | 16 | 512 | 64, + 2 | 16 | 512 | 64, + 0, + 0, + 16384, + 0, + 0, + 0, + 0, + 1 | 2 | 64, + 1 | 2 | 64, + 1 | 2 | 64, + 1 | 2 | 64, + 1 | 2 | 64, + 1 | 2 | 64, + 1 | 2, + 1 | 2, + 1 | 2, + 1 | 2, + 1 | 2, + 1 | 2, + 1 | 2, + 1 | 2, + 1 | 2, + 1 | 2, + 1 | 2, + 1 | 2, + 1 | 2, + 1 | 2, + 1 | 2, + 1 | 2, + 1 | 2, + 1 | 2, + 1 | 2, + 1 | 2, + 0, + 1, + 0, + 0, + 1 | 2 | 4096, + 0, + 1 | 2 | 4 | 64, + 1 | 2 | 4 | 64, + 1 | 2 | 4 | 64, + 1 | 2 | 4 | 64, + 1 | 2 | 4 | 64, + 1 | 2 | 4 | 64, + 1 | 2 | 4, + 1 | 2 | 4, + 1 | 2 | 4, + 1 | 2 | 4, + 1 | 2 | 4, + 1 | 2 | 4, + 1 | 2 | 4, + 1 | 2 | 4, + 1 | 2 | 4, + 1 | 2 | 4, + 1 | 2 | 4, + 1 | 2 | 4, + 1 | 2 | 4, + 1 | 2 | 4, + 1 | 2 | 4, + 1 | 2 | 4, + 1 | 2 | 4, + 1 | 2 | 4, + 1 | 2 | 4, + 1 | 2 | 4, + 16384, + 0, + 0, + 0, + 0 +]; +var isIdStart = [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 0, + 0, + 0, + 0, + 1, + 0, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 0, + 0, + 0, + 0, + 0 +]; +var isIdPart = [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 0, + 0, + 0, + 0, + 1, + 0, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 0, + 0, + 0, + 0, + 0 +]; +function isIdentifierStart(code) { + return code <= 127 ? isIdStart[code] > 0 : isIDStart(code); +} +__name(isIdentifierStart, "isIdentifierStart"); +function isIdentifierPart(code) { + return code <= 127 ? isIdPart[code] > 0 : isIDContinue(code) || (code === 8204 || code === 8205); +} +__name(isIdentifierPart, "isIdentifierPart"); +var CommentTypes = ["SingleLine", "MultiLine", "HTMLOpen", "HTMLClose", "HashbangComment"]; +function skipHashBang(parser) { + const { source } = parser; + if (parser.currentChar === 35 && source.charCodeAt(parser.index + 1) === 33) { + advanceChar(parser); + advanceChar(parser); + skipSingleLineComment(parser, source, 0, 4, parser.tokenStart); + } +} +__name(skipHashBang, "skipHashBang"); +function skipSingleHTMLComment(parser, source, state, context, type, start) { + if (context & 2) + parser.report(0); + return skipSingleLineComment(parser, source, state, type, start); +} +__name(skipSingleHTMLComment, "skipSingleHTMLComment"); +function skipSingleLineComment(parser, source, state, type, start) { + const { index } = parser; + parser.tokenIndex = parser.index; + parser.tokenLine = parser.line; + parser.tokenColumn = parser.column; + while (parser.index < parser.end) { + if (CharTypes[parser.currentChar] & 8) { + const isCR = parser.currentChar === 13; + scanNewLine(parser); + if (isCR && parser.index < parser.end && parser.currentChar === 10) + parser.currentChar = source.charCodeAt(++parser.index); + break; + } else if ((parser.currentChar ^ 8232) <= 1) { + scanNewLine(parser); + break; + } + advanceChar(parser); + parser.tokenIndex = parser.index; + parser.tokenLine = parser.line; + parser.tokenColumn = parser.column; + } + if (parser.options.onComment) { + const loc = { + start: { + line: start.line, + column: start.column + }, + end: { + line: parser.tokenLine, + column: parser.tokenColumn + } + }; + parser.options.onComment(CommentTypes[type & 255], source.slice(index, parser.tokenIndex), start.index, parser.tokenIndex, loc); + } + return state | 1; +} +__name(skipSingleLineComment, "skipSingleLineComment"); +function skipMultiLineComment(parser, source, state) { + const { index } = parser; + while (parser.index < parser.end) { + if (parser.currentChar < 43) { + let skippedOneAsterisk = false; + while (parser.currentChar === 42) { + if (!skippedOneAsterisk) { + state &= -5; + skippedOneAsterisk = true; + } + if (advanceChar(parser) === 47) { + advanceChar(parser); + if (parser.options.onComment) { + const loc = { + start: { + line: parser.tokenLine, + column: parser.tokenColumn + }, + end: { + line: parser.line, + column: parser.column + } + }; + parser.options.onComment(CommentTypes[1 & 255], source.slice(index, parser.index - 2), index - 2, parser.index, loc); + } + parser.tokenIndex = parser.index; + parser.tokenLine = parser.line; + parser.tokenColumn = parser.column; + return state; + } + } + if (skippedOneAsterisk) { + continue; + } + if (CharTypes[parser.currentChar] & 8) { + if (parser.currentChar === 13) { + state |= 1 | 4; + scanNewLine(parser); + } else { + consumeLineFeed(parser, state); + state = state & -5 | 1; + } + } else { + advanceChar(parser); + } + } else if ((parser.currentChar ^ 8232) <= 1) { + state = state & -5 | 1; + scanNewLine(parser); + } else { + state &= -5; + advanceChar(parser); + } + } + parser.report(18); +} +__name(skipMultiLineComment, "skipMultiLineComment"); +var RegexState; +(function(RegexState2) { + RegexState2[RegexState2["Empty"] = 0] = "Empty"; + RegexState2[RegexState2["Escape"] = 1] = "Escape"; + RegexState2[RegexState2["Class"] = 2] = "Class"; +})(RegexState || (RegexState = {})); +var RegexFlags; +(function(RegexFlags2) { + RegexFlags2[RegexFlags2["Empty"] = 0] = "Empty"; + RegexFlags2[RegexFlags2["IgnoreCase"] = 1] = "IgnoreCase"; + RegexFlags2[RegexFlags2["Global"] = 2] = "Global"; + RegexFlags2[RegexFlags2["Multiline"] = 4] = "Multiline"; + RegexFlags2[RegexFlags2["Unicode"] = 16] = "Unicode"; + RegexFlags2[RegexFlags2["Sticky"] = 8] = "Sticky"; + RegexFlags2[RegexFlags2["DotAll"] = 32] = "DotAll"; + RegexFlags2[RegexFlags2["Indices"] = 64] = "Indices"; + RegexFlags2[RegexFlags2["UnicodeSets"] = 128] = "UnicodeSets"; +})(RegexFlags || (RegexFlags = {})); +function scanRegularExpression(parser) { + const bodyStart = parser.index; + let preparseState = RegexState.Empty; + loop: while (true) { + const ch = parser.currentChar; + advanceChar(parser); + if (preparseState & RegexState.Escape) { + preparseState &= ~RegexState.Escape; + } else { + switch (ch) { + case 47: + if (!preparseState) + break loop; + else + break; + case 92: + preparseState |= RegexState.Escape; + break; + case 91: + preparseState |= RegexState.Class; + break; + case 93: + preparseState &= RegexState.Escape; + break; + } + } + if (ch === 13 || ch === 10 || ch === 8232 || ch === 8233) { + parser.report(34); + } + if (parser.index >= parser.source.length) { + return parser.report(34); + } + } + const bodyEnd = parser.index - 1; + let mask = RegexFlags.Empty; + let char = parser.currentChar; + const { index: flagStart } = parser; + while (isIdentifierPart(char)) { + switch (char) { + case 103: + if (mask & RegexFlags.Global) + parser.report(36, "g"); + mask |= RegexFlags.Global; + break; + case 105: + if (mask & RegexFlags.IgnoreCase) + parser.report(36, "i"); + mask |= RegexFlags.IgnoreCase; + break; + case 109: + if (mask & RegexFlags.Multiline) + parser.report(36, "m"); + mask |= RegexFlags.Multiline; + break; + case 117: + if (mask & RegexFlags.Unicode) + parser.report(36, "u"); + if (mask & RegexFlags.UnicodeSets) + parser.report(36, "vu"); + mask |= RegexFlags.Unicode; + break; + case 118: + if (mask & RegexFlags.Unicode) + parser.report(36, "uv"); + if (mask & RegexFlags.UnicodeSets) + parser.report(36, "v"); + mask |= RegexFlags.UnicodeSets; + break; + case 121: + if (mask & RegexFlags.Sticky) + parser.report(36, "y"); + mask |= RegexFlags.Sticky; + break; + case 115: + if (mask & RegexFlags.DotAll) + parser.report(36, "s"); + mask |= RegexFlags.DotAll; + break; + case 100: + if (mask & RegexFlags.Indices) + parser.report(36, "d"); + mask |= RegexFlags.Indices; + break; + default: + parser.report(35); + } + char = advanceChar(parser); + } + const flags = parser.source.slice(flagStart, parser.index); + const pattern = parser.source.slice(bodyStart, bodyEnd); + parser.tokenRegExp = { pattern, flags }; + if (parser.options.raw) + parser.tokenRaw = parser.source.slice(parser.tokenIndex, parser.index); + parser.tokenValue = validate(parser, pattern, flags); + return 65540; +} +__name(scanRegularExpression, "scanRegularExpression"); +function validate(parser, pattern, flags) { + try { + return new RegExp(pattern, flags); + } catch { + try { + new RegExp(pattern, flags); + return null; + } catch { + parser.report(34); + } + } +} +__name(validate, "validate"); +function scanString(parser, context, quote) { + const { index: start } = parser; + let ret = ""; + let char = advanceChar(parser); + let marker = parser.index; + while ((CharTypes[char] & 8) === 0) { + if (char === quote) { + ret += parser.source.slice(marker, parser.index); + advanceChar(parser); + if (parser.options.raw) + parser.tokenRaw = parser.source.slice(start, parser.index); + parser.tokenValue = ret; + return 134283267; + } + if ((char & 8) === 8 && char === 92) { + ret += parser.source.slice(marker, parser.index); + char = advanceChar(parser); + if (char < 127 || char === 8232 || char === 8233) { + const code = parseEscape(parser, context, char); + if (code >= 0) + ret += String.fromCodePoint(code); + else + handleStringError(parser, code, 0); + } else { + ret += String.fromCodePoint(char); + } + marker = parser.index + 1; + } else if (char === 8232 || char === 8233) { + parser.column = -1; + parser.line++; + } + if (parser.index >= parser.end) + parser.report(16); + char = advanceChar(parser); + } + parser.report(16); +} +__name(scanString, "scanString"); +function parseEscape(parser, context, first, isTemplate = 0) { + switch (first) { + case 98: + return 8; + case 102: + return 12; + case 114: + return 13; + case 110: + return 10; + case 116: + return 9; + case 118: + return 11; + case 13: { + if (parser.index < parser.end) { + const nextChar = parser.source.charCodeAt(parser.index + 1); + if (nextChar === 10) { + parser.index = parser.index + 1; + parser.currentChar = nextChar; + } + } + } + case 10: + case 8232: + case 8233: + parser.column = -1; + parser.line++; + return -1; + case 48: + case 49: + case 50: + case 51: { + let code = first - 48; + let index = parser.index + 1; + let column = parser.column + 1; + if (index < parser.end) { + const next = parser.source.charCodeAt(index); + if ((CharTypes[next] & 32) === 0) { + if (code !== 0 || CharTypes[next] & 512) { + if (context & 1 || isTemplate) + return -2; + parser.flags |= 64; + } + } else if (context & 1 || isTemplate) { + return -2; + } else { + parser.currentChar = next; + code = code << 3 | next - 48; + index++; + column++; + if (index < parser.end) { + const next2 = parser.source.charCodeAt(index); + if (CharTypes[next2] & 32) { + parser.currentChar = next2; + code = code << 3 | next2 - 48; + index++; + column++; + } + } + parser.flags |= 64; + } + parser.index = index - 1; + parser.column = column - 1; + } + return code; + } + case 52: + case 53: + case 54: + case 55: { + if (isTemplate || context & 1) + return -2; + let code = first - 48; + const index = parser.index + 1; + const column = parser.column + 1; + if (index < parser.end) { + const next = parser.source.charCodeAt(index); + if (CharTypes[next] & 32) { + code = code << 3 | next - 48; + parser.currentChar = next; + parser.index = index; + parser.column = column; + } + } + parser.flags |= 64; + return code; + } + case 120: { + const ch1 = advanceChar(parser); + if ((CharTypes[ch1] & 64) === 0) + return -4; + const hi = toHex(ch1); + const ch2 = advanceChar(parser); + if ((CharTypes[ch2] & 64) === 0) + return -4; + const lo = toHex(ch2); + return hi << 4 | lo; + } + case 117: { + const ch = advanceChar(parser); + if (parser.currentChar === 123) { + let code = 0; + while ((CharTypes[advanceChar(parser)] & 64) !== 0) { + code = code << 4 | toHex(parser.currentChar); + if (code > 1114111) + return -5; + } + if (parser.currentChar < 1 || parser.currentChar !== 125) { + return -4; + } + return code; + } else { + if ((CharTypes[ch] & 64) === 0) + return -4; + const ch2 = parser.source.charCodeAt(parser.index + 1); + if ((CharTypes[ch2] & 64) === 0) + return -4; + const ch3 = parser.source.charCodeAt(parser.index + 2); + if ((CharTypes[ch3] & 64) === 0) + return -4; + const ch4 = parser.source.charCodeAt(parser.index + 3); + if ((CharTypes[ch4] & 64) === 0) + return -4; + parser.index += 3; + parser.column += 3; + parser.currentChar = parser.source.charCodeAt(parser.index); + return toHex(ch) << 12 | toHex(ch2) << 8 | toHex(ch3) << 4 | toHex(ch4); + } + } + case 56: + case 57: + if (isTemplate || !parser.options.webcompat || context & 1) + return -3; + parser.flags |= 4096; + default: + return first; + } +} +__name(parseEscape, "parseEscape"); +function handleStringError(parser, code, isTemplate) { + switch (code) { + case -1: + return; + case -2: + parser.report(isTemplate ? 2 : 1); + case -3: + parser.report(isTemplate ? 3 : 14); + case -4: + parser.report(7); + case -5: + parser.report(104); + } +} +__name(handleStringError, "handleStringError"); +function scanTemplate(parser, context) { + const { index: start } = parser; + let token = 67174409; + let ret = ""; + let char = advanceChar(parser); + while (char !== 96) { + if (char === 36 && parser.source.charCodeAt(parser.index + 1) === 123) { + advanceChar(parser); + token = 67174408; + break; + } else if (char === 92) { + char = advanceChar(parser); + if (char > 126) { + ret += String.fromCodePoint(char); + } else { + const { index, line, column } = parser; + const code = parseEscape(parser, context | 1, char, 1); + if (code >= 0) { + ret += String.fromCodePoint(code); + } else if (code !== -1 && context & 64) { + parser.index = index; + parser.line = line; + parser.column = column; + ret = null; + char = scanBadTemplate(parser, char); + if (char < 0) + token = 67174408; + break; + } else { + handleStringError(parser, code, 1); + } + } + } else if (parser.index < parser.end) { + if (char === 13 && parser.source.charCodeAt(parser.index) === 10) { + ret += String.fromCodePoint(char); + parser.currentChar = parser.source.charCodeAt(++parser.index); + } + if ((char & 83) < 3 && char === 10 || (char ^ 8232) <= 1) { + parser.column = -1; + parser.line++; + } + ret += String.fromCodePoint(char); + } + if (parser.index >= parser.end) + parser.report(17); + char = advanceChar(parser); + } + advanceChar(parser); + parser.tokenValue = ret; + parser.tokenRaw = parser.source.slice(start + 1, parser.index - (token === 67174409 ? 1 : 2)); + return token; +} +__name(scanTemplate, "scanTemplate"); +function scanBadTemplate(parser, ch) { + while (ch !== 96) { + switch (ch) { + case 36: { + const index = parser.index + 1; + if (index < parser.end && parser.source.charCodeAt(index) === 123) { + parser.index = index; + parser.column++; + return -ch; + } + break; + } + case 10: + case 8232: + case 8233: + parser.column = -1; + parser.line++; + } + if (parser.index >= parser.end) + parser.report(17); + ch = advanceChar(parser); + } + return ch; +} +__name(scanBadTemplate, "scanBadTemplate"); +function scanTemplateTail(parser, context) { + if (parser.index >= parser.end) + parser.report(0); + parser.index--; + parser.column--; + return scanTemplate(parser, context); +} +__name(scanTemplateTail, "scanTemplateTail"); +var errorMessages = { + [0]: "Unexpected token", + [30]: "Unexpected token: '%0'", + [1]: "Octal escape sequences are not allowed in strict mode", + [2]: "Octal escape sequences are not allowed in template strings", + [3]: "\\8 and \\9 are not allowed in template strings", + [4]: "Private identifier #%0 is not defined", + [5]: "Illegal Unicode escape sequence", + [6]: "Invalid code point %0", + [7]: "Invalid hexadecimal escape sequence", + [9]: "Octal literals are not allowed in strict mode", + [8]: "Decimal integer literals with a leading zero are forbidden in strict mode", + [10]: "Expected number in radix %0", + [151]: "Invalid left-hand side assignment to a destructible right-hand side", + [11]: "Non-number found after exponent indicator", + [12]: "Invalid BigIntLiteral", + [13]: "No identifiers allowed directly after numeric literal", + [14]: "Escapes \\8 or \\9 are not syntactically valid escapes", + [15]: "Escapes \\8 or \\9 are not allowed in strict mode", + [16]: "Unterminated string literal", + [17]: "Unterminated template literal", + [18]: "Multiline comment was not closed properly", + [19]: "The identifier contained dynamic unicode escape that was not closed", + [20]: "Illegal character '%0'", + [21]: "Missing hexadecimal digits", + [22]: "Invalid implicit octal", + [23]: "Invalid line break in string literal", + [24]: "Only unicode escapes are legal in identifier names", + [25]: "Expected '%0'", + [26]: "Invalid left-hand side in assignment", + [27]: "Invalid left-hand side in async arrow", + [28]: 'Calls to super must be in the "constructor" method of a class expression or class declaration that has a superclass', + [29]: "Member access on super must be in a method", + [31]: "Await expression not allowed in formal parameter", + [32]: "Yield expression not allowed in formal parameter", + [95]: "Unexpected token: 'escaped keyword'", + [33]: "Unary expressions as the left operand of an exponentiation expression must be disambiguated with parentheses", + [123]: "Async functions can only be declared at the top level or inside a block", + [34]: "Unterminated regular expression", + [35]: "Unexpected regular expression flag", + [36]: "Duplicate regular expression flag '%0'", + [37]: "%0 functions must have exactly %1 argument%2", + [38]: "Setter function argument must not be a rest parameter", + [39]: "%0 declaration must have a name in this context", + [40]: "Function name may not contain any reserved words or be eval or arguments in strict mode", + [41]: "The rest operator is missing an argument", + [42]: "A getter cannot be a generator", + [43]: "A setter cannot be a generator", + [44]: "A computed property name must be followed by a colon or paren", + [134]: "Object literal keys that are strings or numbers must be a method or have a colon", + [46]: "Found `* async x(){}` but this should be `async * x(){}`", + [45]: "Getters and setters can not be generators", + [47]: "'%0' can not be generator method", + [48]: "No line break is allowed after '=>'", + [49]: "The left-hand side of the arrow can only be destructed through assignment", + [50]: "The binding declaration is not destructible", + [51]: "Async arrow can not be followed by new expression", + [52]: "Classes may not have a static property named 'prototype'", + [53]: "Class constructor may not be a %0", + [54]: "Duplicate constructor method in class", + [55]: "Invalid increment/decrement operand", + [56]: "Invalid use of `new` keyword on an increment/decrement expression", + [57]: "`=>` is an invalid assignment target", + [58]: "Rest element may not have a trailing comma", + [59]: "Missing initializer in %0 declaration", + [60]: "'for-%0' loop head declarations can not have an initializer", + [61]: "Invalid left-hand side in for-%0 loop: Must have a single binding", + [62]: "Invalid shorthand property initializer", + [63]: "Property name __proto__ appears more than once in object literal", + [64]: "Let is disallowed as a lexically bound name", + [65]: "Invalid use of '%0' inside new expression", + [66]: "Illegal 'use strict' directive in function with non-simple parameter list", + [67]: 'Identifier "let" disallowed as left-hand side expression in strict mode', + [68]: "Illegal continue statement", + [69]: "Illegal break statement", + [70]: "Cannot have `let[...]` as a var name in strict mode", + [71]: "Invalid destructuring assignment target", + [72]: "Rest parameter may not have a default initializer", + [73]: "The rest argument must the be last parameter", + [74]: "Invalid rest argument", + [76]: "In strict mode code, functions can only be declared at top level or inside a block", + [77]: "In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement", + [78]: "Without web compatibility enabled functions can not be declared at top level, inside a block, or as the body of an if statement", + [79]: "Class declaration can't appear in single-statement context", + [80]: "Invalid left-hand side in for-%0", + [81]: "Invalid assignment in for-%0", + [82]: "for await (... of ...) is only valid in async functions and async generators", + [83]: "The first token after the template expression should be a continuation of the template", + [85]: "`let` declaration not allowed here and `let` cannot be a regular var name in strict mode", + [84]: "`let \n [` is a restricted production at the start of a statement", + [86]: "Catch clause requires exactly one parameter, not more (and no trailing comma)", + [87]: "Catch clause parameter does not support default values", + [88]: "Missing catch or finally after try", + [89]: "More than one default clause in switch statement", + [90]: "Illegal newline after throw", + [91]: "Strict mode code may not include a with statement", + [92]: "Illegal return statement", + [93]: "The left hand side of the for-header binding declaration is not destructible", + [94]: "new.target only allowed within functions or static blocks", + [96]: "'#' not followed by identifier", + [102]: "Invalid keyword", + [101]: "Can not use 'let' as a class name", + [100]: "'A lexical declaration can't define a 'let' binding", + [99]: "Can not use `let` as variable name in strict mode", + [97]: "'%0' may not be used as an identifier in this context", + [98]: "Await is only valid in async functions", + [103]: "The %0 keyword can only be used with the module goal", + [104]: "Unicode codepoint must not be greater than 0x10FFFF", + [105]: "%0 source must be string", + [106]: "Only a identifier or string can be used to indicate alias", + [107]: "Only '*' or '{...}' can be imported after default", + [108]: "Trailing decorator may be followed by method", + [109]: "Decorators can't be used with a constructor", + [110]: "Can not use `await` as identifier in module or async func", + [111]: "Can not use `await` as identifier in module", + [112]: "HTML comments are only allowed with web compatibility (Annex B)", + [113]: "The identifier 'let' must not be in expression position in strict mode", + [114]: "Cannot assign to `eval` and `arguments` in strict mode", + [115]: "The left-hand side of a for-of loop may not start with 'let'", + [116]: "Block body arrows can not be immediately invoked without a group", + [117]: "Block body arrows can not be immediately accessed without a group", + [118]: "Unexpected strict mode reserved word", + [119]: "Unexpected eval or arguments in strict mode", + [120]: "Decorators must not be followed by a semicolon", + [121]: "Calling delete on expression not allowed in strict mode", + [122]: "Pattern can not have a tail", + [124]: "Can not have a `yield` expression on the left side of a ternary", + [125]: "An arrow function can not have a postfix update operator", + [126]: "Invalid object literal key character after generator star", + [127]: "Private fields can not be deleted", + [129]: "Classes may not have a field called constructor", + [128]: "Classes may not have a private element named constructor", + [130]: "A class field initializer or static block may not contain arguments", + [131]: "Generators can only be declared at the top level or inside a block", + [132]: "Async methods are a restricted production and cannot have a newline following it", + [133]: "Unexpected character after object literal property name", + [135]: "Invalid key token", + [136]: "Label '%0' has already been declared", + [137]: "continue statement must be nested within an iteration statement", + [138]: "Undefined label '%0'", + [139]: "Trailing comma is disallowed inside import(...) arguments", + [140]: "Invalid binding in JSON import", + [141]: "import() requires exactly one argument", + [142]: "Cannot use new with import(...)", + [143]: "... is not allowed in import()", + [144]: "Expected '=>'", + [145]: "Duplicate binding '%0'", + [146]: "Duplicate private identifier #%0", + [147]: "Cannot export a duplicate name '%0'", + [150]: "Duplicate %0 for-binding", + [148]: "Exported binding '%0' needs to refer to a top-level declared variable", + [149]: "Unexpected private field", + [153]: "Numeric separators are not allowed at the end of numeric literals", + [152]: "Only one underscore is allowed as numeric separator", + [154]: "JSX value should be either an expression or a quoted JSX text", + [155]: "Expected corresponding JSX closing tag for %0", + [156]: "Adjacent JSX elements must be wrapped in an enclosing tag", + [157]: "JSX attributes must only be assigned a non-empty 'expression'", + [158]: "'%0' has already been declared", + [159]: "'%0' shadowed a catch clause binding", + [160]: "Dot property must be an identifier", + [161]: "Encountered invalid input after spread/rest argument", + [162]: "Catch without try", + [163]: "Finally without try", + [164]: "Expected corresponding closing tag for JSX fragment", + [165]: "Coalescing and logical operators used together in the same expression must be disambiguated with parentheses", + [166]: "Invalid tagged template on optional chain", + [167]: "Invalid optional chain from super property", + [168]: "Invalid optional chain from new expression", + [169]: 'Cannot use "import.meta" outside a module', + [170]: "Leading decorators must be attached to a class declaration", + [171]: "An export name cannot include a lone surrogate, found %0", + [172]: "A string literal cannot be used as an exported binding without `from`", + [173]: "Private fields can't be accessed on super", + [174]: "The only valid meta property for import is 'import.meta'", + [175]: "'import.meta' must not contain escaped characters", + [176]: 'cannot use "await" as identifier inside an async function', + [177]: 'cannot use "await" in static blocks' +}; +var _ParseError = class _ParseError extends SyntaxError { + constructor(start, end, type, ...params) { + const description = errorMessages[type].replace(/%(\d+)/g, (_, i) => params[i]); + const message = "[" + start.line + ":" + start.column + "-" + end.line + ":" + end.column + "]: " + description; + super(message); + __publicField(this, "start"); + __publicField(this, "end"); + __publicField(this, "range"); + __publicField(this, "loc"); + __publicField(this, "description"); + this.start = start.index; + this.end = end.index; + this.range = [start.index, end.index]; + this.loc = { + start: { line: start.line, column: start.column }, + end: { line: end.line, column: end.column } + }; + this.description = description; + } +}; +__name(_ParseError, "ParseError"); +var ParseError = _ParseError; +function scanNumber(parser, context, kind) { + let char = parser.currentChar; + let value = 0; + let digit = 9; + let atStart = kind & 64 ? 0 : 1; + let digits = 0; + let allowSeparator = 0; + if (kind & 64) { + value = "." + scanDecimalDigitsOrSeparator(parser, char); + char = parser.currentChar; + if (char === 110) + parser.report(12); + } else { + if (char === 48) { + char = advanceChar(parser); + if ((char | 32) === 120) { + kind = 8 | 128; + char = advanceChar(parser); + while (CharTypes[char] & (64 | 4096)) { + if (char === 95) { + if (!allowSeparator) + parser.report(152); + allowSeparator = 0; + char = advanceChar(parser); + continue; + } + allowSeparator = 1; + value = value * 16 + toHex(char); + digits++; + char = advanceChar(parser); + } + if (digits === 0 || !allowSeparator) { + parser.report(digits === 0 ? 21 : 153); + } + } else if ((char | 32) === 111) { + kind = 4 | 128; + char = advanceChar(parser); + while (CharTypes[char] & (32 | 4096)) { + if (char === 95) { + if (!allowSeparator) { + parser.report(152); + } + allowSeparator = 0; + char = advanceChar(parser); + continue; + } + allowSeparator = 1; + value = value * 8 + (char - 48); + digits++; + char = advanceChar(parser); + } + if (digits === 0 || !allowSeparator) { + parser.report(digits === 0 ? 0 : 153); + } + } else if ((char | 32) === 98) { + kind = 2 | 128; + char = advanceChar(parser); + while (CharTypes[char] & (128 | 4096)) { + if (char === 95) { + if (!allowSeparator) { + parser.report(152); + } + allowSeparator = 0; + char = advanceChar(parser); + continue; + } + allowSeparator = 1; + value = value * 2 + (char - 48); + digits++; + char = advanceChar(parser); + } + if (digits === 0 || !allowSeparator) { + parser.report(digits === 0 ? 0 : 153); + } + } else if (CharTypes[char] & 32) { + if (context & 1) + parser.report(1); + kind = 1; + while (CharTypes[char] & 16) { + if (CharTypes[char] & 512) { + kind = 32; + atStart = 0; + break; + } + value = value * 8 + (char - 48); + char = advanceChar(parser); + } + } else if (CharTypes[char] & 512) { + if (context & 1) + parser.report(1); + parser.flags |= 64; + kind = 32; + } else if (char === 95) { + parser.report(0); + } + } + if (kind & 48) { + if (atStart) { + while (digit >= 0 && CharTypes[char] & (16 | 4096)) { + if (char === 95) { + char = advanceChar(parser); + if (char === 95 || kind & 32) { + throw new ParseError(parser.currentLocation, { index: parser.index + 1, line: parser.line, column: parser.column }, 152); + } + allowSeparator = 1; + continue; + } + allowSeparator = 0; + value = 10 * value + (char - 48); + char = advanceChar(parser); + --digit; + } + if (allowSeparator) { + throw new ParseError(parser.currentLocation, { index: parser.index + 1, line: parser.line, column: parser.column }, 153); + } + if (digit >= 0 && !isIdentifierStart(char) && char !== 46) { + parser.tokenValue = value; + if (parser.options.raw) + parser.tokenRaw = parser.source.slice(parser.tokenIndex, parser.index); + return 134283266; + } + } + value += scanDecimalDigitsOrSeparator(parser, char); + char = parser.currentChar; + if (char === 46) { + if (advanceChar(parser) === 95) + parser.report(0); + kind = 64; + value += "." + scanDecimalDigitsOrSeparator(parser, parser.currentChar); + char = parser.currentChar; + } + } + } + const end = parser.index; + let isBigInt = 0; + if (char === 110 && kind & 128) { + isBigInt = 1; + char = advanceChar(parser); + } else { + if ((char | 32) === 101) { + char = advanceChar(parser); + if (CharTypes[char] & 256) + char = advanceChar(parser); + const { index } = parser; + if ((CharTypes[char] & 16) === 0) + parser.report(11); + value += parser.source.substring(end, index) + scanDecimalDigitsOrSeparator(parser, char); + char = parser.currentChar; + } + } + if (parser.index < parser.end && CharTypes[char] & 16 || isIdentifierStart(char)) { + parser.report(13); + } + if (isBigInt) { + parser.tokenRaw = parser.source.slice(parser.tokenIndex, parser.index); + parser.tokenValue = BigInt(parser.tokenRaw.slice(0, -1).replaceAll("_", "")); + return 134283388; + } + parser.tokenValue = kind & (1 | 2 | 8 | 4) ? value : kind & 32 ? parseFloat(parser.source.substring(parser.tokenIndex, parser.index)) : +value; + if (parser.options.raw) + parser.tokenRaw = parser.source.slice(parser.tokenIndex, parser.index); + return 134283266; +} +__name(scanNumber, "scanNumber"); +function scanDecimalDigitsOrSeparator(parser, char) { + let allowSeparator = 0; + let start = parser.index; + let ret = ""; + while (CharTypes[char] & (16 | 4096)) { + if (char === 95) { + const { index } = parser; + char = advanceChar(parser); + if (char === 95) { + throw new ParseError(parser.currentLocation, { index: parser.index + 1, line: parser.line, column: parser.column }, 152); + } + allowSeparator = 1; + ret += parser.source.substring(start, index); + start = parser.index; + continue; + } + allowSeparator = 0; + char = advanceChar(parser); + } + if (allowSeparator) { + throw new ParseError(parser.currentLocation, { index: parser.index + 1, line: parser.line, column: parser.column }, 153); + } + return ret + parser.source.substring(start, parser.index); +} +__name(scanDecimalDigitsOrSeparator, "scanDecimalDigitsOrSeparator"); +var KeywordDescTable = [ + "end of source", + "identifier", + "number", + "string", + "regular expression", + "false", + "true", + "null", + "template continuation", + "template tail", + "=>", + "(", + "{", + ".", + "...", + "}", + ")", + ";", + ",", + "[", + "]", + ":", + "?", + "'", + '"', + "++", + "--", + "=", + "<<=", + ">>=", + ">>>=", + "**=", + "+=", + "-=", + "*=", + "/=", + "%=", + "^=", + "|=", + "&=", + "||=", + "&&=", + "??=", + "typeof", + "delete", + "void", + "!", + "~", + "+", + "-", + "in", + "instanceof", + "*", + "%", + "/", + "**", + "&&", + "||", + "===", + "!==", + "==", + "!=", + "<=", + ">=", + "<", + ">", + "<<", + ">>", + ">>>", + "&", + "|", + "^", + "var", + "let", + "const", + "break", + "case", + "catch", + "class", + "continue", + "debugger", + "default", + "do", + "else", + "export", + "extends", + "finally", + "for", + "function", + "if", + "import", + "new", + "return", + "super", + "switch", + "this", + "throw", + "try", + "while", + "with", + "implements", + "interface", + "package", + "private", + "protected", + "public", + "static", + "yield", + "as", + "async", + "await", + "constructor", + "get", + "set", + "accessor", + "from", + "of", + "enum", + "eval", + "arguments", + "escaped keyword", + "escaped future reserved keyword", + "reserved if strict", + "#", + "BigIntLiteral", + "??", + "?.", + "WhiteSpace", + "Illegal", + "LineTerminator", + "PrivateField", + "Template", + "@", + "target", + "meta", + "LineFeed", + "Escaped", + "JSXText" +]; +var descKeywordTable = { + this: 86111, + function: 86104, + if: 20569, + return: 20572, + var: 86088, + else: 20563, + for: 20567, + new: 86107, + in: 8673330, + typeof: 16863275, + while: 20578, + case: 20556, + break: 20555, + try: 20577, + catch: 20557, + delete: 16863276, + throw: 86112, + switch: 86110, + continue: 20559, + default: 20561, + instanceof: 8411187, + do: 20562, + void: 16863277, + finally: 20566, + async: 209005, + await: 209006, + class: 86094, + const: 86090, + constructor: 12399, + debugger: 20560, + export: 20564, + extends: 20565, + false: 86021, + from: 209011, + get: 209008, + implements: 36964, + import: 86106, + interface: 36965, + let: 241737, + null: 86023, + of: 471156, + package: 36966, + private: 36967, + protected: 36968, + public: 36969, + set: 209009, + static: 36970, + super: 86109, + true: 86022, + with: 20579, + yield: 241771, + enum: 86133, + eval: 537079926, + as: 77932, + arguments: 537079927, + target: 209029, + meta: 209030, + accessor: 12402 +}; +function matchOrInsertSemicolon(parser, context) { + var _a, _b; + if ((parser.flags & 1) === 0 && (parser.getToken() & 1048576) !== 1048576) { + parser.report(30, KeywordDescTable[parser.getToken() & 255]); + } + if (!consumeOpt(parser, context, 1074790417)) { + (_b = (_a = parser.options).onInsertedSemicolon) == null ? void 0 : _b.call(_a, parser.startIndex); + } +} +__name(matchOrInsertSemicolon, "matchOrInsertSemicolon"); +function isValidStrictMode(parser, index, tokenIndex, tokenValue) { + if (index - tokenIndex < 13 && tokenValue === "use strict") { + if ((parser.getToken() & 1048576) === 1048576 || parser.flags & 1) { + return 1; + } + } + return 0; +} +__name(isValidStrictMode, "isValidStrictMode"); +function optionalBit(parser, context, t) { + if (parser.getToken() !== t) + return 0; + nextToken(parser, context); + return 1; +} +__name(optionalBit, "optionalBit"); +function consumeOpt(parser, context, t) { + if (parser.getToken() !== t) + return false; + nextToken(parser, context); + return true; +} +__name(consumeOpt, "consumeOpt"); +function consume(parser, context, t) { + if (parser.getToken() !== t) + parser.report(25, KeywordDescTable[t & 255]); + nextToken(parser, context); +} +__name(consume, "consume"); +function reinterpretToPattern(parser, node) { + switch (node.type) { + case "ArrayExpression": { + node.type = "ArrayPattern"; + const { elements } = node; + for (let i = 0, n = elements.length; i < n; ++i) { + const element = elements[i]; + if (element) + reinterpretToPattern(parser, element); + } + return; + } + case "ObjectExpression": { + node.type = "ObjectPattern"; + const { properties } = node; + for (let i = 0, n = properties.length; i < n; ++i) { + reinterpretToPattern(parser, properties[i]); + } + return; + } + case "AssignmentExpression": + node.type = "AssignmentPattern"; + if (node.operator !== "=") + parser.report(71); + delete node.operator; + reinterpretToPattern(parser, node.left); + return; + case "Property": + reinterpretToPattern(parser, node.value); + return; + case "SpreadElement": + node.type = "RestElement"; + reinterpretToPattern(parser, node.argument); + } +} +__name(reinterpretToPattern, "reinterpretToPattern"); +function validateBindingIdentifier(parser, context, kind, t, skipEvalArgCheck) { + if (context & 1) { + if ((t & 36864) === 36864) { + parser.report(118); + } + if (!skipEvalArgCheck && (t & 537079808) === 537079808) { + parser.report(119); + } + } + if ((t & 20480) === 20480 || t === -2147483528) { + parser.report(102); + } + if (kind & (8 | 16) && (t & 255) === (241737 & 255)) { + parser.report(100); + } + if (context & (2048 | 2) && t === 209006) { + parser.report(110); + } + if (context & (1024 | 1) && t === 241771) { + parser.report(97, "yield"); + } +} +__name(validateBindingIdentifier, "validateBindingIdentifier"); +function validateFunctionName(parser, context, t) { + if (context & 1) { + if ((t & 36864) === 36864) { + parser.report(118); + } + if ((t & 537079808) === 537079808) { + parser.report(119); + } + if (t === -2147483527) { + parser.report(95); + } + if (t === -2147483528) { + parser.report(95); + } + } + if ((t & 20480) === 20480) { + parser.report(102); + } + if (context & (2048 | 2) && t === 209006) { + parser.report(110); + } + if (context & (1024 | 1) && t === 241771) { + parser.report(97, "yield"); + } +} +__name(validateFunctionName, "validateFunctionName"); +function isStrictReservedWord(parser, context, t) { + if (t === 209006) { + if (context & (2048 | 2)) + parser.report(110); + parser.destructible |= 128; + } + if (t === 241771 && context & 1024) + parser.report(97, "yield"); + return (t & 20480) === 20480 || (t & 36864) === 36864 || t == -2147483527; +} +__name(isStrictReservedWord, "isStrictReservedWord"); +function isPropertyWithPrivateFieldKey(expr) { + return !expr.property ? false : expr.property.type === "PrivateIdentifier"; +} +__name(isPropertyWithPrivateFieldKey, "isPropertyWithPrivateFieldKey"); +function isValidLabel(parser, labels, name, isIterationStatement) { + while (labels) { + if (labels["$" + name]) { + if (isIterationStatement) + parser.report(137); + return 1; + } + if (isIterationStatement && labels.loop) + isIterationStatement = 0; + labels = labels["$"]; + } + return 0; +} +__name(isValidLabel, "isValidLabel"); +function validateAndDeclareLabel(parser, labels, name) { + let set = labels; + while (set) { + if (set["$" + name]) + parser.report(136, name); + set = set["$"]; + } + labels["$" + name] = 1; +} +__name(validateAndDeclareLabel, "validateAndDeclareLabel"); +function isEqualTagName(elementName) { + switch (elementName.type) { + case "JSXIdentifier": + return elementName.name; + case "JSXNamespacedName": + return elementName.namespace + ":" + elementName.name; + case "JSXMemberExpression": + return isEqualTagName(elementName.object) + "." + isEqualTagName(elementName.property); + } +} +__name(isEqualTagName, "isEqualTagName"); +function isValidIdentifier(context, t) { + if (context & (1 | 1024)) { + if (context & 2 && t === 209006) + return false; + if (context & 1024 && t === 241771) + return false; + return (t & 12288) === 12288; + } + return (t & 12288) === 12288 || (t & 36864) === 36864; +} +__name(isValidIdentifier, "isValidIdentifier"); +function classifyIdentifier(parser, context, t) { + if ((t & 537079808) === 537079808) { + if (context & 1) + parser.report(119); + parser.flags |= 512; + } + if (!isValidIdentifier(context, t)) + parser.report(0); +} +__name(classifyIdentifier, "classifyIdentifier"); +function getOwnProperty(object, key) { + return Object.hasOwn(object, key) ? object[key] : void 0; +} +__name(getOwnProperty, "getOwnProperty"); +function scanIdentifier(parser, context, isValidAsKeyword) { + var _a; + while (isIdPart[advanceChar(parser)]) + ; + parser.tokenValue = parser.source.slice(parser.tokenIndex, parser.index); + return parser.currentChar !== 92 && parser.currentChar <= 126 ? (_a = getOwnProperty(descKeywordTable, parser.tokenValue)) != null ? _a : 208897 : scanIdentifierSlowCase(parser, context, 0, isValidAsKeyword); +} +__name(scanIdentifier, "scanIdentifier"); +function scanUnicodeIdentifier(parser, context) { + const cookedChar = scanIdentifierUnicodeEscape(parser); + if (!isIdentifierStart(cookedChar)) + parser.report(5); + parser.tokenValue = String.fromCodePoint(cookedChar); + return scanIdentifierSlowCase(parser, context, 1, CharTypes[cookedChar] & 4); +} +__name(scanUnicodeIdentifier, "scanUnicodeIdentifier"); +function scanIdentifierSlowCase(parser, context, hasEscape, isValidAsKeyword) { + let start = parser.index; + while (parser.index < parser.end) { + if (parser.currentChar === 92) { + parser.tokenValue += parser.source.slice(start, parser.index); + hasEscape = 1; + const code = scanIdentifierUnicodeEscape(parser); + if (!isIdentifierPart(code)) + parser.report(5); + isValidAsKeyword = isValidAsKeyword && CharTypes[code] & 4; + parser.tokenValue += String.fromCodePoint(code); + start = parser.index; + } else { + const merged = consumePossibleSurrogatePair(parser); + if (merged > 0) { + if (!isIdentifierPart(merged)) { + parser.report(20, String.fromCodePoint(merged)); + } + parser.currentChar = merged; + parser.index++; + parser.column++; + } else if (!isIdentifierPart(parser.currentChar)) { + break; + } + advanceChar(parser); + } + } + if (parser.index <= parser.end) { + parser.tokenValue += parser.source.slice(start, parser.index); + } + const { length } = parser.tokenValue; + if (isValidAsKeyword && length >= 2 && length <= 11) { + const token = getOwnProperty(descKeywordTable, parser.tokenValue); + if (token === void 0) + return 208897 | (hasEscape ? -2147483648 : 0); + if (!hasEscape) + return token; + if (token === 209006) { + if ((context & (2 | 2048)) === 0) { + return token | -2147483648; + } + return -2147483528; + } + if (context & 1) { + if (token === 36970) { + return -2147483527; + } + if ((token & 36864) === 36864) { + return -2147483527; + } + if ((token & 20480) === 20480) { + if (context & 262144 && (context & 8) === 0) { + return token | -2147483648; + } else { + return -2147483528; + } + } + return 209018 | -2147483648; + } + if (context & 262144 && (context & 8) === 0 && (token & 20480) === 20480) { + return token | -2147483648; + } + if (token === 241771) { + return context & 262144 ? 209018 | -2147483648 : context & 1024 ? -2147483528 : token | -2147483648; + } + if (token === 209005) { + return 209018 | -2147483648; + } + if ((token & 36864) === 36864) { + return token | 12288 | -2147483648; + } + return -2147483528; + } + return 208897 | (hasEscape ? -2147483648 : 0); +} +__name(scanIdentifierSlowCase, "scanIdentifierSlowCase"); +function scanPrivateIdentifier(parser) { + let char = advanceChar(parser); + if (char === 92) + return 130; + const merged = consumePossibleSurrogatePair(parser); + if (merged) + char = merged; + if (!isIdentifierStart(char)) + parser.report(96); + return 130; +} +__name(scanPrivateIdentifier, "scanPrivateIdentifier"); +function scanIdentifierUnicodeEscape(parser) { + if (parser.source.charCodeAt(parser.index + 1) !== 117) { + parser.report(5); + } + parser.currentChar = parser.source.charCodeAt(parser.index += 2); + parser.column += 2; + return scanUnicodeEscape(parser); +} +__name(scanIdentifierUnicodeEscape, "scanIdentifierUnicodeEscape"); +function scanUnicodeEscape(parser) { + let codePoint = 0; + const char = parser.currentChar; + if (char === 123) { + const begin = parser.index - 2; + while (CharTypes[advanceChar(parser)] & 64) { + codePoint = codePoint << 4 | toHex(parser.currentChar); + if (codePoint > 1114111) + throw new ParseError({ index: begin, line: parser.line, column: parser.column }, parser.currentLocation, 104); + } + if (parser.currentChar !== 125) { + throw new ParseError({ index: begin, line: parser.line, column: parser.column }, parser.currentLocation, 7); + } + advanceChar(parser); + return codePoint; + } + if ((CharTypes[char] & 64) === 0) + parser.report(7); + const char2 = parser.source.charCodeAt(parser.index + 1); + if ((CharTypes[char2] & 64) === 0) + parser.report(7); + const char3 = parser.source.charCodeAt(parser.index + 2); + if ((CharTypes[char3] & 64) === 0) + parser.report(7); + const char4 = parser.source.charCodeAt(parser.index + 3); + if ((CharTypes[char4] & 64) === 0) + parser.report(7); + codePoint = toHex(char) << 12 | toHex(char2) << 8 | toHex(char3) << 4 | toHex(char4); + parser.currentChar = parser.source.charCodeAt(parser.index += 4); + parser.column += 4; + return codePoint; +} +__name(scanUnicodeEscape, "scanUnicodeEscape"); +var TokenLookup = [ + 128, + 128, + 128, + 128, + 128, + 128, + 128, + 128, + 128, + 127, + 135, + 127, + 127, + 129, + 128, + 128, + 128, + 128, + 128, + 128, + 128, + 128, + 128, + 128, + 128, + 128, + 128, + 128, + 128, + 128, + 128, + 128, + 127, + 16842798, + 134283267, + 130, + 208897, + 8391477, + 8390213, + 134283267, + 67174411, + 16, + 8391476, + 25233968, + 18, + 25233969, + 67108877, + 8457014, + 134283266, + 134283266, + 134283266, + 134283266, + 134283266, + 134283266, + 134283266, + 134283266, + 134283266, + 134283266, + 21, + 1074790417, + 8456256, + 1077936155, + 8390721, + 22, + 132, + 208897, + 208897, + 208897, + 208897, + 208897, + 208897, + 208897, + 208897, + 208897, + 208897, + 208897, + 208897, + 208897, + 208897, + 208897, + 208897, + 208897, + 208897, + 208897, + 208897, + 208897, + 208897, + 208897, + 208897, + 208897, + 208897, + 69271571, + 136, + 20, + 8389959, + 208897, + 131, + 4096, + 4096, + 4096, + 4096, + 4096, + 4096, + 4096, + 208897, + 4096, + 208897, + 208897, + 4096, + 208897, + 4096, + 208897, + 4096, + 208897, + 4096, + 4096, + 4096, + 208897, + 4096, + 4096, + 208897, + 4096, + 4096, + 2162700, + 8389702, + 1074790415, + 16842799, + 128 +]; +function nextToken(parser, context) { + parser.flags = (parser.flags | 1) ^ 1; + parser.startIndex = parser.index; + parser.startColumn = parser.column; + parser.startLine = parser.line; + parser.setToken(scanSingleToken(parser, context, 0)); +} +__name(nextToken, "nextToken"); +function scanSingleToken(parser, context, state) { + const isStartOfLine = parser.index === 0; + const { source } = parser; + let start = parser.currentLocation; + while (parser.index < parser.end) { + parser.tokenIndex = parser.index; + parser.tokenColumn = parser.column; + parser.tokenLine = parser.line; + let char = parser.currentChar; + if (char <= 126) { + const token = TokenLookup[char]; + switch (token) { + case 67174411: + case 16: + case 2162700: + case 1074790415: + case 69271571: + case 20: + case 21: + case 1074790417: + case 18: + case 16842799: + case 132: + case 128: + advanceChar(parser); + return token; + case 208897: + return scanIdentifier(parser, context, 0); + case 4096: + return scanIdentifier(parser, context, 1); + case 134283266: + return scanNumber(parser, context, 16 | 128); + case 134283267: + return scanString(parser, context, char); + case 131: + return scanTemplate(parser, context); + case 136: + return scanUnicodeIdentifier(parser, context); + case 130: + return scanPrivateIdentifier(parser); + case 127: + advanceChar(parser); + break; + case 129: + state |= 1 | 4; + scanNewLine(parser); + break; + case 135: + consumeLineFeed(parser, state); + state = state & -5 | 1; + break; + case 8456256: { + const ch = advanceChar(parser); + if (parser.index < parser.end) { + if (ch === 60) { + if (parser.index < parser.end && advanceChar(parser) === 61) { + advanceChar(parser); + return 4194332; + } + return 8390978; + } else if (ch === 61) { + advanceChar(parser); + return 8390718; + } + if (ch === 33) { + const index = parser.index + 1; + if (index + 1 < parser.end && source.charCodeAt(index) === 45 && source.charCodeAt(index + 1) == 45) { + parser.column += 3; + parser.currentChar = source.charCodeAt(parser.index += 3); + state = skipSingleHTMLComment(parser, source, state, context, 2, parser.tokenStart); + start = parser.tokenStart; + continue; + } + return 8456256; + } + } + return 8456256; + } + case 1077936155: { + advanceChar(parser); + const ch = parser.currentChar; + if (ch === 61) { + if (advanceChar(parser) === 61) { + advanceChar(parser); + return 8390458; + } + return 8390460; + } + if (ch === 62) { + advanceChar(parser); + return 10; + } + return 1077936155; + } + case 16842798: + if (advanceChar(parser) !== 61) { + return 16842798; + } + if (advanceChar(parser) !== 61) { + return 8390461; + } + advanceChar(parser); + return 8390459; + case 8391477: + if (advanceChar(parser) !== 61) + return 8391477; + advanceChar(parser); + return 4194340; + case 8391476: { + advanceChar(parser); + if (parser.index >= parser.end) + return 8391476; + const ch = parser.currentChar; + if (ch === 61) { + advanceChar(parser); + return 4194338; + } + if (ch !== 42) + return 8391476; + if (advanceChar(parser) !== 61) + return 8391735; + advanceChar(parser); + return 4194335; + } + case 8389959: + if (advanceChar(parser) !== 61) + return 8389959; + advanceChar(parser); + return 4194341; + case 25233968: { + advanceChar(parser); + const ch = parser.currentChar; + if (ch === 43) { + advanceChar(parser); + return 33619993; + } + if (ch === 61) { + advanceChar(parser); + return 4194336; + } + return 25233968; + } + case 25233969: { + advanceChar(parser); + const ch = parser.currentChar; + if (ch === 45) { + advanceChar(parser); + if ((state & 1 || isStartOfLine) && parser.currentChar === 62) { + if (!parser.options.webcompat) + parser.report(112); + advanceChar(parser); + state = skipSingleHTMLComment(parser, source, state, context, 3, start); + start = parser.tokenStart; + continue; + } + return 33619994; + } + if (ch === 61) { + advanceChar(parser); + return 4194337; + } + return 25233969; + } + case 8457014: { + advanceChar(parser); + if (parser.index < parser.end) { + const ch = parser.currentChar; + if (ch === 47) { + advanceChar(parser); + state = skipSingleLineComment(parser, source, state, 0, parser.tokenStart); + start = parser.tokenStart; + continue; + } + if (ch === 42) { + advanceChar(parser); + state = skipMultiLineComment(parser, source, state); + start = parser.tokenStart; + continue; + } + if (context & 32) { + return scanRegularExpression(parser); + } + if (ch === 61) { + advanceChar(parser); + return 4259875; + } + } + return 8457014; + } + case 67108877: { + const next = advanceChar(parser); + if (next >= 48 && next <= 57) + return scanNumber(parser, context, 64 | 16); + if (next === 46) { + const index = parser.index + 1; + if (index < parser.end && source.charCodeAt(index) === 46) { + parser.column += 2; + parser.currentChar = source.charCodeAt(parser.index += 2); + return 14; + } + } + return 67108877; + } + case 8389702: { + advanceChar(parser); + const ch = parser.currentChar; + if (ch === 124) { + advanceChar(parser); + if (parser.currentChar === 61) { + advanceChar(parser); + return 4194344; + } + return 8913465; + } + if (ch === 61) { + advanceChar(parser); + return 4194342; + } + return 8389702; + } + case 8390721: { + advanceChar(parser); + const ch = parser.currentChar; + if (ch === 61) { + advanceChar(parser); + return 8390719; + } + if (ch !== 62) + return 8390721; + advanceChar(parser); + if (parser.index < parser.end) { + const ch2 = parser.currentChar; + if (ch2 === 62) { + if (advanceChar(parser) === 61) { + advanceChar(parser); + return 4194334; + } + return 8390980; + } + if (ch2 === 61) { + advanceChar(parser); + return 4194333; + } + } + return 8390979; + } + case 8390213: { + advanceChar(parser); + const ch = parser.currentChar; + if (ch === 38) { + advanceChar(parser); + if (parser.currentChar === 61) { + advanceChar(parser); + return 4194345; + } + return 8913720; + } + if (ch === 61) { + advanceChar(parser); + return 4194343; + } + return 8390213; + } + case 22: { + let ch = advanceChar(parser); + if (ch === 63) { + advanceChar(parser); + if (parser.currentChar === 61) { + advanceChar(parser); + return 4194346; + } + return 276824445; + } + if (ch === 46) { + const index = parser.index + 1; + if (index < parser.end) { + ch = source.charCodeAt(index); + if (!(ch >= 48 && ch <= 57)) { + advanceChar(parser); + return 67108990; + } + } + } + return 22; + } + } + } else { + if ((char ^ 8232) <= 1) { + state = state & -5 | 1; + scanNewLine(parser); + continue; + } + const merged = consumePossibleSurrogatePair(parser); + if (merged > 0) + char = merged; + if (isIDStart(char)) { + parser.tokenValue = ""; + return scanIdentifierSlowCase(parser, context, 0, 0); + } + if (isExoticECMAScriptWhitespace(char)) { + advanceChar(parser); + continue; + } + parser.report(20, String.fromCodePoint(char)); + } + } + return 1048576; +} +__name(scanSingleToken, "scanSingleToken"); +var entities = { + AElig: "\xC6", + AMP: "&", + Aacute: "\xC1", + Abreve: "\u0102", + Acirc: "\xC2", + Acy: "\u0410", + Afr: "\u{1D504}", + Agrave: "\xC0", + Alpha: "\u0391", + Amacr: "\u0100", + And: "\u2A53", + Aogon: "\u0104", + Aopf: "\u{1D538}", + ApplyFunction: "\u2061", + Aring: "\xC5", + Ascr: "\u{1D49C}", + Assign: "\u2254", + Atilde: "\xC3", + Auml: "\xC4", + Backslash: "\u2216", + Barv: "\u2AE7", + Barwed: "\u2306", + Bcy: "\u0411", + Because: "\u2235", + Bernoullis: "\u212C", + Beta: "\u0392", + Bfr: "\u{1D505}", + Bopf: "\u{1D539}", + Breve: "\u02D8", + Bscr: "\u212C", + Bumpeq: "\u224E", + CHcy: "\u0427", + COPY: "\xA9", + Cacute: "\u0106", + Cap: "\u22D2", + CapitalDifferentialD: "\u2145", + Cayleys: "\u212D", + Ccaron: "\u010C", + Ccedil: "\xC7", + Ccirc: "\u0108", + Cconint: "\u2230", + Cdot: "\u010A", + Cedilla: "\xB8", + CenterDot: "\xB7", + Cfr: "\u212D", + Chi: "\u03A7", + CircleDot: "\u2299", + CircleMinus: "\u2296", + CirclePlus: "\u2295", + CircleTimes: "\u2297", + ClockwiseContourIntegral: "\u2232", + CloseCurlyDoubleQuote: "\u201D", + CloseCurlyQuote: "\u2019", + Colon: "\u2237", + Colone: "\u2A74", + Congruent: "\u2261", + Conint: "\u222F", + ContourIntegral: "\u222E", + Copf: "\u2102", + Coproduct: "\u2210", + CounterClockwiseContourIntegral: "\u2233", + Cross: "\u2A2F", + Cscr: "\u{1D49E}", + Cup: "\u22D3", + CupCap: "\u224D", + DD: "\u2145", + DDotrahd: "\u2911", + DJcy: "\u0402", + DScy: "\u0405", + DZcy: "\u040F", + Dagger: "\u2021", + Darr: "\u21A1", + Dashv: "\u2AE4", + Dcaron: "\u010E", + Dcy: "\u0414", + Del: "\u2207", + Delta: "\u0394", + Dfr: "\u{1D507}", + DiacriticalAcute: "\xB4", + DiacriticalDot: "\u02D9", + DiacriticalDoubleAcute: "\u02DD", + DiacriticalGrave: "`", + DiacriticalTilde: "\u02DC", + Diamond: "\u22C4", + DifferentialD: "\u2146", + Dopf: "\u{1D53B}", + Dot: "\xA8", + DotDot: "\u20DC", + DotEqual: "\u2250", + DoubleContourIntegral: "\u222F", + DoubleDot: "\xA8", + DoubleDownArrow: "\u21D3", + DoubleLeftArrow: "\u21D0", + DoubleLeftRightArrow: "\u21D4", + DoubleLeftTee: "\u2AE4", + DoubleLongLeftArrow: "\u27F8", + DoubleLongLeftRightArrow: "\u27FA", + DoubleLongRightArrow: "\u27F9", + DoubleRightArrow: "\u21D2", + DoubleRightTee: "\u22A8", + DoubleUpArrow: "\u21D1", + DoubleUpDownArrow: "\u21D5", + DoubleVerticalBar: "\u2225", + DownArrow: "\u2193", + DownArrowBar: "\u2913", + DownArrowUpArrow: "\u21F5", + DownBreve: "\u0311", + DownLeftRightVector: "\u2950", + DownLeftTeeVector: "\u295E", + DownLeftVector: "\u21BD", + DownLeftVectorBar: "\u2956", + DownRightTeeVector: "\u295F", + DownRightVector: "\u21C1", + DownRightVectorBar: "\u2957", + DownTee: "\u22A4", + DownTeeArrow: "\u21A7", + Downarrow: "\u21D3", + Dscr: "\u{1D49F}", + Dstrok: "\u0110", + ENG: "\u014A", + ETH: "\xD0", + Eacute: "\xC9", + Ecaron: "\u011A", + Ecirc: "\xCA", + Ecy: "\u042D", + Edot: "\u0116", + Efr: "\u{1D508}", + Egrave: "\xC8", + Element: "\u2208", + Emacr: "\u0112", + EmptySmallSquare: "\u25FB", + EmptyVerySmallSquare: "\u25AB", + Eogon: "\u0118", + Eopf: "\u{1D53C}", + Epsilon: "\u0395", + Equal: "\u2A75", + EqualTilde: "\u2242", + Equilibrium: "\u21CC", + Escr: "\u2130", + Esim: "\u2A73", + Eta: "\u0397", + Euml: "\xCB", + Exists: "\u2203", + ExponentialE: "\u2147", + Fcy: "\u0424", + Ffr: "\u{1D509}", + FilledSmallSquare: "\u25FC", + FilledVerySmallSquare: "\u25AA", + Fopf: "\u{1D53D}", + ForAll: "\u2200", + Fouriertrf: "\u2131", + Fscr: "\u2131", + GJcy: "\u0403", + GT: ">", + Gamma: "\u0393", + Gammad: "\u03DC", + Gbreve: "\u011E", + Gcedil: "\u0122", + Gcirc: "\u011C", + Gcy: "\u0413", + Gdot: "\u0120", + Gfr: "\u{1D50A}", + Gg: "\u22D9", + Gopf: "\u{1D53E}", + GreaterEqual: "\u2265", + GreaterEqualLess: "\u22DB", + GreaterFullEqual: "\u2267", + GreaterGreater: "\u2AA2", + GreaterLess: "\u2277", + GreaterSlantEqual: "\u2A7E", + GreaterTilde: "\u2273", + Gscr: "\u{1D4A2}", + Gt: "\u226B", + HARDcy: "\u042A", + Hacek: "\u02C7", + Hat: "^", + Hcirc: "\u0124", + Hfr: "\u210C", + HilbertSpace: "\u210B", + Hopf: "\u210D", + HorizontalLine: "\u2500", + Hscr: "\u210B", + Hstrok: "\u0126", + HumpDownHump: "\u224E", + HumpEqual: "\u224F", + IEcy: "\u0415", + IJlig: "\u0132", + IOcy: "\u0401", + Iacute: "\xCD", + Icirc: "\xCE", + Icy: "\u0418", + Idot: "\u0130", + Ifr: "\u2111", + Igrave: "\xCC", + Im: "\u2111", + Imacr: "\u012A", + ImaginaryI: "\u2148", + Implies: "\u21D2", + Int: "\u222C", + Integral: "\u222B", + Intersection: "\u22C2", + InvisibleComma: "\u2063", + InvisibleTimes: "\u2062", + Iogon: "\u012E", + Iopf: "\u{1D540}", + Iota: "\u0399", + Iscr: "\u2110", + Itilde: "\u0128", + Iukcy: "\u0406", + Iuml: "\xCF", + Jcirc: "\u0134", + Jcy: "\u0419", + Jfr: "\u{1D50D}", + Jopf: "\u{1D541}", + Jscr: "\u{1D4A5}", + Jsercy: "\u0408", + Jukcy: "\u0404", + KHcy: "\u0425", + KJcy: "\u040C", + Kappa: "\u039A", + Kcedil: "\u0136", + Kcy: "\u041A", + Kfr: "\u{1D50E}", + Kopf: "\u{1D542}", + Kscr: "\u{1D4A6}", + LJcy: "\u0409", + LT: "<", + Lacute: "\u0139", + Lambda: "\u039B", + Lang: "\u27EA", + Laplacetrf: "\u2112", + Larr: "\u219E", + Lcaron: "\u013D", + Lcedil: "\u013B", + Lcy: "\u041B", + LeftAngleBracket: "\u27E8", + LeftArrow: "\u2190", + LeftArrowBar: "\u21E4", + LeftArrowRightArrow: "\u21C6", + LeftCeiling: "\u2308", + LeftDoubleBracket: "\u27E6", + LeftDownTeeVector: "\u2961", + LeftDownVector: "\u21C3", + LeftDownVectorBar: "\u2959", + LeftFloor: "\u230A", + LeftRightArrow: "\u2194", + LeftRightVector: "\u294E", + LeftTee: "\u22A3", + LeftTeeArrow: "\u21A4", + LeftTeeVector: "\u295A", + LeftTriangle: "\u22B2", + LeftTriangleBar: "\u29CF", + LeftTriangleEqual: "\u22B4", + LeftUpDownVector: "\u2951", + LeftUpTeeVector: "\u2960", + LeftUpVector: "\u21BF", + LeftUpVectorBar: "\u2958", + LeftVector: "\u21BC", + LeftVectorBar: "\u2952", + Leftarrow: "\u21D0", + Leftrightarrow: "\u21D4", + LessEqualGreater: "\u22DA", + LessFullEqual: "\u2266", + LessGreater: "\u2276", + LessLess: "\u2AA1", + LessSlantEqual: "\u2A7D", + LessTilde: "\u2272", + Lfr: "\u{1D50F}", + Ll: "\u22D8", + Lleftarrow: "\u21DA", + Lmidot: "\u013F", + LongLeftArrow: "\u27F5", + LongLeftRightArrow: "\u27F7", + LongRightArrow: "\u27F6", + Longleftarrow: "\u27F8", + Longleftrightarrow: "\u27FA", + Longrightarrow: "\u27F9", + Lopf: "\u{1D543}", + LowerLeftArrow: "\u2199", + LowerRightArrow: "\u2198", + Lscr: "\u2112", + Lsh: "\u21B0", + Lstrok: "\u0141", + Lt: "\u226A", + Map: "\u2905", + Mcy: "\u041C", + MediumSpace: "\u205F", + Mellintrf: "\u2133", + Mfr: "\u{1D510}", + MinusPlus: "\u2213", + Mopf: "\u{1D544}", + Mscr: "\u2133", + Mu: "\u039C", + NJcy: "\u040A", + Nacute: "\u0143", + Ncaron: "\u0147", + Ncedil: "\u0145", + Ncy: "\u041D", + NegativeMediumSpace: "\u200B", + NegativeThickSpace: "\u200B", + NegativeThinSpace: "\u200B", + NegativeVeryThinSpace: "\u200B", + NestedGreaterGreater: "\u226B", + NestedLessLess: "\u226A", + NewLine: "\n", + Nfr: "\u{1D511}", + NoBreak: "\u2060", + NonBreakingSpace: "\xA0", + Nopf: "\u2115", + Not: "\u2AEC", + NotCongruent: "\u2262", + NotCupCap: "\u226D", + NotDoubleVerticalBar: "\u2226", + NotElement: "\u2209", + NotEqual: "\u2260", + NotEqualTilde: "\u2242\u0338", + NotExists: "\u2204", + NotGreater: "\u226F", + NotGreaterEqual: "\u2271", + NotGreaterFullEqual: "\u2267\u0338", + NotGreaterGreater: "\u226B\u0338", + NotGreaterLess: "\u2279", + NotGreaterSlantEqual: "\u2A7E\u0338", + NotGreaterTilde: "\u2275", + NotHumpDownHump: "\u224E\u0338", + NotHumpEqual: "\u224F\u0338", + NotLeftTriangle: "\u22EA", + NotLeftTriangleBar: "\u29CF\u0338", + NotLeftTriangleEqual: "\u22EC", + NotLess: "\u226E", + NotLessEqual: "\u2270", + NotLessGreater: "\u2278", + NotLessLess: "\u226A\u0338", + NotLessSlantEqual: "\u2A7D\u0338", + NotLessTilde: "\u2274", + NotNestedGreaterGreater: "\u2AA2\u0338", + NotNestedLessLess: "\u2AA1\u0338", + NotPrecedes: "\u2280", + NotPrecedesEqual: "\u2AAF\u0338", + NotPrecedesSlantEqual: "\u22E0", + NotReverseElement: "\u220C", + NotRightTriangle: "\u22EB", + NotRightTriangleBar: "\u29D0\u0338", + NotRightTriangleEqual: "\u22ED", + NotSquareSubset: "\u228F\u0338", + NotSquareSubsetEqual: "\u22E2", + NotSquareSuperset: "\u2290\u0338", + NotSquareSupersetEqual: "\u22E3", + NotSubset: "\u2282\u20D2", + NotSubsetEqual: "\u2288", + NotSucceeds: "\u2281", + NotSucceedsEqual: "\u2AB0\u0338", + NotSucceedsSlantEqual: "\u22E1", + NotSucceedsTilde: "\u227F\u0338", + NotSuperset: "\u2283\u20D2", + NotSupersetEqual: "\u2289", + NotTilde: "\u2241", + NotTildeEqual: "\u2244", + NotTildeFullEqual: "\u2247", + NotTildeTilde: "\u2249", + NotVerticalBar: "\u2224", + Nscr: "\u{1D4A9}", + Ntilde: "\xD1", + Nu: "\u039D", + OElig: "\u0152", + Oacute: "\xD3", + Ocirc: "\xD4", + Ocy: "\u041E", + Odblac: "\u0150", + Ofr: "\u{1D512}", + Ograve: "\xD2", + Omacr: "\u014C", + Omega: "\u03A9", + Omicron: "\u039F", + Oopf: "\u{1D546}", + OpenCurlyDoubleQuote: "\u201C", + OpenCurlyQuote: "\u2018", + Or: "\u2A54", + Oscr: "\u{1D4AA}", + Oslash: "\xD8", + Otilde: "\xD5", + Otimes: "\u2A37", + Ouml: "\xD6", + OverBar: "\u203E", + OverBrace: "\u23DE", + OverBracket: "\u23B4", + OverParenthesis: "\u23DC", + PartialD: "\u2202", + Pcy: "\u041F", + Pfr: "\u{1D513}", + Phi: "\u03A6", + Pi: "\u03A0", + PlusMinus: "\xB1", + Poincareplane: "\u210C", + Popf: "\u2119", + Pr: "\u2ABB", + Precedes: "\u227A", + PrecedesEqual: "\u2AAF", + PrecedesSlantEqual: "\u227C", + PrecedesTilde: "\u227E", + Prime: "\u2033", + Product: "\u220F", + Proportion: "\u2237", + Proportional: "\u221D", + Pscr: "\u{1D4AB}", + Psi: "\u03A8", + QUOT: '"', + Qfr: "\u{1D514}", + Qopf: "\u211A", + Qscr: "\u{1D4AC}", + RBarr: "\u2910", + REG: "\xAE", + Racute: "\u0154", + Rang: "\u27EB", + Rarr: "\u21A0", + Rarrtl: "\u2916", + Rcaron: "\u0158", + Rcedil: "\u0156", + Rcy: "\u0420", + Re: "\u211C", + ReverseElement: "\u220B", + ReverseEquilibrium: "\u21CB", + ReverseUpEquilibrium: "\u296F", + Rfr: "\u211C", + Rho: "\u03A1", + RightAngleBracket: "\u27E9", + RightArrow: "\u2192", + RightArrowBar: "\u21E5", + RightArrowLeftArrow: "\u21C4", + RightCeiling: "\u2309", + RightDoubleBracket: "\u27E7", + RightDownTeeVector: "\u295D", + RightDownVector: "\u21C2", + RightDownVectorBar: "\u2955", + RightFloor: "\u230B", + RightTee: "\u22A2", + RightTeeArrow: "\u21A6", + RightTeeVector: "\u295B", + RightTriangle: "\u22B3", + RightTriangleBar: "\u29D0", + RightTriangleEqual: "\u22B5", + RightUpDownVector: "\u294F", + RightUpTeeVector: "\u295C", + RightUpVector: "\u21BE", + RightUpVectorBar: "\u2954", + RightVector: "\u21C0", + RightVectorBar: "\u2953", + Rightarrow: "\u21D2", + Ropf: "\u211D", + RoundImplies: "\u2970", + Rrightarrow: "\u21DB", + Rscr: "\u211B", + Rsh: "\u21B1", + RuleDelayed: "\u29F4", + SHCHcy: "\u0429", + SHcy: "\u0428", + SOFTcy: "\u042C", + Sacute: "\u015A", + Sc: "\u2ABC", + Scaron: "\u0160", + Scedil: "\u015E", + Scirc: "\u015C", + Scy: "\u0421", + Sfr: "\u{1D516}", + ShortDownArrow: "\u2193", + ShortLeftArrow: "\u2190", + ShortRightArrow: "\u2192", + ShortUpArrow: "\u2191", + Sigma: "\u03A3", + SmallCircle: "\u2218", + Sopf: "\u{1D54A}", + Sqrt: "\u221A", + Square: "\u25A1", + SquareIntersection: "\u2293", + SquareSubset: "\u228F", + SquareSubsetEqual: "\u2291", + SquareSuperset: "\u2290", + SquareSupersetEqual: "\u2292", + SquareUnion: "\u2294", + Sscr: "\u{1D4AE}", + Star: "\u22C6", + Sub: "\u22D0", + Subset: "\u22D0", + SubsetEqual: "\u2286", + Succeeds: "\u227B", + SucceedsEqual: "\u2AB0", + SucceedsSlantEqual: "\u227D", + SucceedsTilde: "\u227F", + SuchThat: "\u220B", + Sum: "\u2211", + Sup: "\u22D1", + Superset: "\u2283", + SupersetEqual: "\u2287", + Supset: "\u22D1", + THORN: "\xDE", + TRADE: "\u2122", + TSHcy: "\u040B", + TScy: "\u0426", + Tab: " ", + Tau: "\u03A4", + Tcaron: "\u0164", + Tcedil: "\u0162", + Tcy: "\u0422", + Tfr: "\u{1D517}", + Therefore: "\u2234", + Theta: "\u0398", + ThickSpace: "\u205F\u200A", + ThinSpace: "\u2009", + Tilde: "\u223C", + TildeEqual: "\u2243", + TildeFullEqual: "\u2245", + TildeTilde: "\u2248", + Topf: "\u{1D54B}", + TripleDot: "\u20DB", + Tscr: "\u{1D4AF}", + Tstrok: "\u0166", + Uacute: "\xDA", + Uarr: "\u219F", + Uarrocir: "\u2949", + Ubrcy: "\u040E", + Ubreve: "\u016C", + Ucirc: "\xDB", + Ucy: "\u0423", + Udblac: "\u0170", + Ufr: "\u{1D518}", + Ugrave: "\xD9", + Umacr: "\u016A", + UnderBar: "_", + UnderBrace: "\u23DF", + UnderBracket: "\u23B5", + UnderParenthesis: "\u23DD", + Union: "\u22C3", + UnionPlus: "\u228E", + Uogon: "\u0172", + Uopf: "\u{1D54C}", + UpArrow: "\u2191", + UpArrowBar: "\u2912", + UpArrowDownArrow: "\u21C5", + UpDownArrow: "\u2195", + UpEquilibrium: "\u296E", + UpTee: "\u22A5", + UpTeeArrow: "\u21A5", + Uparrow: "\u21D1", + Updownarrow: "\u21D5", + UpperLeftArrow: "\u2196", + UpperRightArrow: "\u2197", + Upsi: "\u03D2", + Upsilon: "\u03A5", + Uring: "\u016E", + Uscr: "\u{1D4B0}", + Utilde: "\u0168", + Uuml: "\xDC", + VDash: "\u22AB", + Vbar: "\u2AEB", + Vcy: "\u0412", + Vdash: "\u22A9", + Vdashl: "\u2AE6", + Vee: "\u22C1", + Verbar: "\u2016", + Vert: "\u2016", + VerticalBar: "\u2223", + VerticalLine: "|", + VerticalSeparator: "\u2758", + VerticalTilde: "\u2240", + VeryThinSpace: "\u200A", + Vfr: "\u{1D519}", + Vopf: "\u{1D54D}", + Vscr: "\u{1D4B1}", + Vvdash: "\u22AA", + Wcirc: "\u0174", + Wedge: "\u22C0", + Wfr: "\u{1D51A}", + Wopf: "\u{1D54E}", + Wscr: "\u{1D4B2}", + Xfr: "\u{1D51B}", + Xi: "\u039E", + Xopf: "\u{1D54F}", + Xscr: "\u{1D4B3}", + YAcy: "\u042F", + YIcy: "\u0407", + YUcy: "\u042E", + Yacute: "\xDD", + Ycirc: "\u0176", + Ycy: "\u042B", + Yfr: "\u{1D51C}", + Yopf: "\u{1D550}", + Yscr: "\u{1D4B4}", + Yuml: "\u0178", + ZHcy: "\u0416", + Zacute: "\u0179", + Zcaron: "\u017D", + Zcy: "\u0417", + Zdot: "\u017B", + ZeroWidthSpace: "\u200B", + Zeta: "\u0396", + Zfr: "\u2128", + Zopf: "\u2124", + Zscr: "\u{1D4B5}", + aacute: "\xE1", + abreve: "\u0103", + ac: "\u223E", + acE: "\u223E\u0333", + acd: "\u223F", + acirc: "\xE2", + acute: "\xB4", + acy: "\u0430", + aelig: "\xE6", + af: "\u2061", + afr: "\u{1D51E}", + agrave: "\xE0", + alefsym: "\u2135", + aleph: "\u2135", + alpha: "\u03B1", + amacr: "\u0101", + amalg: "\u2A3F", + amp: "&", + and: "\u2227", + andand: "\u2A55", + andd: "\u2A5C", + andslope: "\u2A58", + andv: "\u2A5A", + ang: "\u2220", + ange: "\u29A4", + angle: "\u2220", + angmsd: "\u2221", + angmsdaa: "\u29A8", + angmsdab: "\u29A9", + angmsdac: "\u29AA", + angmsdad: "\u29AB", + angmsdae: "\u29AC", + angmsdaf: "\u29AD", + angmsdag: "\u29AE", + angmsdah: "\u29AF", + angrt: "\u221F", + angrtvb: "\u22BE", + angrtvbd: "\u299D", + angsph: "\u2222", + angst: "\xC5", + angzarr: "\u237C", + aogon: "\u0105", + aopf: "\u{1D552}", + ap: "\u2248", + apE: "\u2A70", + apacir: "\u2A6F", + ape: "\u224A", + apid: "\u224B", + apos: "'", + approx: "\u2248", + approxeq: "\u224A", + aring: "\xE5", + ascr: "\u{1D4B6}", + ast: "*", + asymp: "\u2248", + asympeq: "\u224D", + atilde: "\xE3", + auml: "\xE4", + awconint: "\u2233", + awint: "\u2A11", + bNot: "\u2AED", + backcong: "\u224C", + backepsilon: "\u03F6", + backprime: "\u2035", + backsim: "\u223D", + backsimeq: "\u22CD", + barvee: "\u22BD", + barwed: "\u2305", + barwedge: "\u2305", + bbrk: "\u23B5", + bbrktbrk: "\u23B6", + bcong: "\u224C", + bcy: "\u0431", + bdquo: "\u201E", + becaus: "\u2235", + because: "\u2235", + bemptyv: "\u29B0", + bepsi: "\u03F6", + bernou: "\u212C", + beta: "\u03B2", + beth: "\u2136", + between: "\u226C", + bfr: "\u{1D51F}", + bigcap: "\u22C2", + bigcirc: "\u25EF", + bigcup: "\u22C3", + bigodot: "\u2A00", + bigoplus: "\u2A01", + bigotimes: "\u2A02", + bigsqcup: "\u2A06", + bigstar: "\u2605", + bigtriangledown: "\u25BD", + bigtriangleup: "\u25B3", + biguplus: "\u2A04", + bigvee: "\u22C1", + bigwedge: "\u22C0", + bkarow: "\u290D", + blacklozenge: "\u29EB", + blacksquare: "\u25AA", + blacktriangle: "\u25B4", + blacktriangledown: "\u25BE", + blacktriangleleft: "\u25C2", + blacktriangleright: "\u25B8", + blank: "\u2423", + blk12: "\u2592", + blk14: "\u2591", + blk34: "\u2593", + block: "\u2588", + bne: "=\u20E5", + bnequiv: "\u2261\u20E5", + bnot: "\u2310", + bopf: "\u{1D553}", + bot: "\u22A5", + bottom: "\u22A5", + bowtie: "\u22C8", + boxDL: "\u2557", + boxDR: "\u2554", + boxDl: "\u2556", + boxDr: "\u2553", + boxH: "\u2550", + boxHD: "\u2566", + boxHU: "\u2569", + boxHd: "\u2564", + boxHu: "\u2567", + boxUL: "\u255D", + boxUR: "\u255A", + boxUl: "\u255C", + boxUr: "\u2559", + boxV: "\u2551", + boxVH: "\u256C", + boxVL: "\u2563", + boxVR: "\u2560", + boxVh: "\u256B", + boxVl: "\u2562", + boxVr: "\u255F", + boxbox: "\u29C9", + boxdL: "\u2555", + boxdR: "\u2552", + boxdl: "\u2510", + boxdr: "\u250C", + boxh: "\u2500", + boxhD: "\u2565", + boxhU: "\u2568", + boxhd: "\u252C", + boxhu: "\u2534", + boxminus: "\u229F", + boxplus: "\u229E", + boxtimes: "\u22A0", + boxuL: "\u255B", + boxuR: "\u2558", + boxul: "\u2518", + boxur: "\u2514", + boxv: "\u2502", + boxvH: "\u256A", + boxvL: "\u2561", + boxvR: "\u255E", + boxvh: "\u253C", + boxvl: "\u2524", + boxvr: "\u251C", + bprime: "\u2035", + breve: "\u02D8", + brvbar: "\xA6", + bscr: "\u{1D4B7}", + bsemi: "\u204F", + bsim: "\u223D", + bsime: "\u22CD", + bsol: "\\", + bsolb: "\u29C5", + bsolhsub: "\u27C8", + bull: "\u2022", + bullet: "\u2022", + bump: "\u224E", + bumpE: "\u2AAE", + bumpe: "\u224F", + bumpeq: "\u224F", + cacute: "\u0107", + cap: "\u2229", + capand: "\u2A44", + capbrcup: "\u2A49", + capcap: "\u2A4B", + capcup: "\u2A47", + capdot: "\u2A40", + caps: "\u2229\uFE00", + caret: "\u2041", + caron: "\u02C7", + ccaps: "\u2A4D", + ccaron: "\u010D", + ccedil: "\xE7", + ccirc: "\u0109", + ccups: "\u2A4C", + ccupssm: "\u2A50", + cdot: "\u010B", + cedil: "\xB8", + cemptyv: "\u29B2", + cent: "\xA2", + centerdot: "\xB7", + cfr: "\u{1D520}", + chcy: "\u0447", + check: "\u2713", + checkmark: "\u2713", + chi: "\u03C7", + cir: "\u25CB", + cirE: "\u29C3", + circ: "\u02C6", + circeq: "\u2257", + circlearrowleft: "\u21BA", + circlearrowright: "\u21BB", + circledR: "\xAE", + circledS: "\u24C8", + circledast: "\u229B", + circledcirc: "\u229A", + circleddash: "\u229D", + cire: "\u2257", + cirfnint: "\u2A10", + cirmid: "\u2AEF", + cirscir: "\u29C2", + clubs: "\u2663", + clubsuit: "\u2663", + colon: ":", + colone: "\u2254", + coloneq: "\u2254", + comma: ",", + commat: "@", + comp: "\u2201", + compfn: "\u2218", + complement: "\u2201", + complexes: "\u2102", + cong: "\u2245", + congdot: "\u2A6D", + conint: "\u222E", + copf: "\u{1D554}", + coprod: "\u2210", + copy: "\xA9", + copysr: "\u2117", + crarr: "\u21B5", + cross: "\u2717", + cscr: "\u{1D4B8}", + csub: "\u2ACF", + csube: "\u2AD1", + csup: "\u2AD0", + csupe: "\u2AD2", + ctdot: "\u22EF", + cudarrl: "\u2938", + cudarrr: "\u2935", + cuepr: "\u22DE", + cuesc: "\u22DF", + cularr: "\u21B6", + cularrp: "\u293D", + cup: "\u222A", + cupbrcap: "\u2A48", + cupcap: "\u2A46", + cupcup: "\u2A4A", + cupdot: "\u228D", + cupor: "\u2A45", + cups: "\u222A\uFE00", + curarr: "\u21B7", + curarrm: "\u293C", + curlyeqprec: "\u22DE", + curlyeqsucc: "\u22DF", + curlyvee: "\u22CE", + curlywedge: "\u22CF", + curren: "\xA4", + curvearrowleft: "\u21B6", + curvearrowright: "\u21B7", + cuvee: "\u22CE", + cuwed: "\u22CF", + cwconint: "\u2232", + cwint: "\u2231", + cylcty: "\u232D", + dArr: "\u21D3", + dHar: "\u2965", + dagger: "\u2020", + daleth: "\u2138", + darr: "\u2193", + dash: "\u2010", + dashv: "\u22A3", + dbkarow: "\u290F", + dblac: "\u02DD", + dcaron: "\u010F", + dcy: "\u0434", + dd: "\u2146", + ddagger: "\u2021", + ddarr: "\u21CA", + ddotseq: "\u2A77", + deg: "\xB0", + delta: "\u03B4", + demptyv: "\u29B1", + dfisht: "\u297F", + dfr: "\u{1D521}", + dharl: "\u21C3", + dharr: "\u21C2", + diam: "\u22C4", + diamond: "\u22C4", + diamondsuit: "\u2666", + diams: "\u2666", + die: "\xA8", + digamma: "\u03DD", + disin: "\u22F2", + div: "\xF7", + divide: "\xF7", + divideontimes: "\u22C7", + divonx: "\u22C7", + djcy: "\u0452", + dlcorn: "\u231E", + dlcrop: "\u230D", + dollar: "$", + dopf: "\u{1D555}", + dot: "\u02D9", + doteq: "\u2250", + doteqdot: "\u2251", + dotminus: "\u2238", + dotplus: "\u2214", + dotsquare: "\u22A1", + doublebarwedge: "\u2306", + downarrow: "\u2193", + downdownarrows: "\u21CA", + downharpoonleft: "\u21C3", + downharpoonright: "\u21C2", + drbkarow: "\u2910", + drcorn: "\u231F", + drcrop: "\u230C", + dscr: "\u{1D4B9}", + dscy: "\u0455", + dsol: "\u29F6", + dstrok: "\u0111", + dtdot: "\u22F1", + dtri: "\u25BF", + dtrif: "\u25BE", + duarr: "\u21F5", + duhar: "\u296F", + dwangle: "\u29A6", + dzcy: "\u045F", + dzigrarr: "\u27FF", + eDDot: "\u2A77", + eDot: "\u2251", + eacute: "\xE9", + easter: "\u2A6E", + ecaron: "\u011B", + ecir: "\u2256", + ecirc: "\xEA", + ecolon: "\u2255", + ecy: "\u044D", + edot: "\u0117", + ee: "\u2147", + efDot: "\u2252", + efr: "\u{1D522}", + eg: "\u2A9A", + egrave: "\xE8", + egs: "\u2A96", + egsdot: "\u2A98", + el: "\u2A99", + elinters: "\u23E7", + ell: "\u2113", + els: "\u2A95", + elsdot: "\u2A97", + emacr: "\u0113", + empty: "\u2205", + emptyset: "\u2205", + emptyv: "\u2205", + emsp13: "\u2004", + emsp14: "\u2005", + emsp: "\u2003", + eng: "\u014B", + ensp: "\u2002", + eogon: "\u0119", + eopf: "\u{1D556}", + epar: "\u22D5", + eparsl: "\u29E3", + eplus: "\u2A71", + epsi: "\u03B5", + epsilon: "\u03B5", + epsiv: "\u03F5", + eqcirc: "\u2256", + eqcolon: "\u2255", + eqsim: "\u2242", + eqslantgtr: "\u2A96", + eqslantless: "\u2A95", + equals: "=", + equest: "\u225F", + equiv: "\u2261", + equivDD: "\u2A78", + eqvparsl: "\u29E5", + erDot: "\u2253", + erarr: "\u2971", + escr: "\u212F", + esdot: "\u2250", + esim: "\u2242", + eta: "\u03B7", + eth: "\xF0", + euml: "\xEB", + euro: "\u20AC", + excl: "!", + exist: "\u2203", + expectation: "\u2130", + exponentiale: "\u2147", + fallingdotseq: "\u2252", + fcy: "\u0444", + female: "\u2640", + ffilig: "\uFB03", + fflig: "\uFB00", + ffllig: "\uFB04", + ffr: "\u{1D523}", + filig: "\uFB01", + fjlig: "fj", + flat: "\u266D", + fllig: "\uFB02", + fltns: "\u25B1", + fnof: "\u0192", + fopf: "\u{1D557}", + forall: "\u2200", + fork: "\u22D4", + forkv: "\u2AD9", + fpartint: "\u2A0D", + frac12: "\xBD", + frac13: "\u2153", + frac14: "\xBC", + frac15: "\u2155", + frac16: "\u2159", + frac18: "\u215B", + frac23: "\u2154", + frac25: "\u2156", + frac34: "\xBE", + frac35: "\u2157", + frac38: "\u215C", + frac45: "\u2158", + frac56: "\u215A", + frac58: "\u215D", + frac78: "\u215E", + frasl: "\u2044", + frown: "\u2322", + fscr: "\u{1D4BB}", + gE: "\u2267", + gEl: "\u2A8C", + gacute: "\u01F5", + gamma: "\u03B3", + gammad: "\u03DD", + gap: "\u2A86", + gbreve: "\u011F", + gcirc: "\u011D", + gcy: "\u0433", + gdot: "\u0121", + ge: "\u2265", + gel: "\u22DB", + geq: "\u2265", + geqq: "\u2267", + geqslant: "\u2A7E", + ges: "\u2A7E", + gescc: "\u2AA9", + gesdot: "\u2A80", + gesdoto: "\u2A82", + gesdotol: "\u2A84", + gesl: "\u22DB\uFE00", + gesles: "\u2A94", + gfr: "\u{1D524}", + gg: "\u226B", + ggg: "\u22D9", + gimel: "\u2137", + gjcy: "\u0453", + gl: "\u2277", + glE: "\u2A92", + gla: "\u2AA5", + glj: "\u2AA4", + gnE: "\u2269", + gnap: "\u2A8A", + gnapprox: "\u2A8A", + gne: "\u2A88", + gneq: "\u2A88", + gneqq: "\u2269", + gnsim: "\u22E7", + gopf: "\u{1D558}", + grave: "`", + gscr: "\u210A", + gsim: "\u2273", + gsime: "\u2A8E", + gsiml: "\u2A90", + gt: ">", + gtcc: "\u2AA7", + gtcir: "\u2A7A", + gtdot: "\u22D7", + gtlPar: "\u2995", + gtquest: "\u2A7C", + gtrapprox: "\u2A86", + gtrarr: "\u2978", + gtrdot: "\u22D7", + gtreqless: "\u22DB", + gtreqqless: "\u2A8C", + gtrless: "\u2277", + gtrsim: "\u2273", + gvertneqq: "\u2269\uFE00", + gvnE: "\u2269\uFE00", + hArr: "\u21D4", + hairsp: "\u200A", + half: "\xBD", + hamilt: "\u210B", + hardcy: "\u044A", + harr: "\u2194", + harrcir: "\u2948", + harrw: "\u21AD", + hbar: "\u210F", + hcirc: "\u0125", + hearts: "\u2665", + heartsuit: "\u2665", + hellip: "\u2026", + hercon: "\u22B9", + hfr: "\u{1D525}", + hksearow: "\u2925", + hkswarow: "\u2926", + hoarr: "\u21FF", + homtht: "\u223B", + hookleftarrow: "\u21A9", + hookrightarrow: "\u21AA", + hopf: "\u{1D559}", + horbar: "\u2015", + hscr: "\u{1D4BD}", + hslash: "\u210F", + hstrok: "\u0127", + hybull: "\u2043", + hyphen: "\u2010", + iacute: "\xED", + ic: "\u2063", + icirc: "\xEE", + icy: "\u0438", + iecy: "\u0435", + iexcl: "\xA1", + iff: "\u21D4", + ifr: "\u{1D526}", + igrave: "\xEC", + ii: "\u2148", + iiiint: "\u2A0C", + iiint: "\u222D", + iinfin: "\u29DC", + iiota: "\u2129", + ijlig: "\u0133", + imacr: "\u012B", + image: "\u2111", + imagline: "\u2110", + imagpart: "\u2111", + imath: "\u0131", + imof: "\u22B7", + imped: "\u01B5", + in: "\u2208", + incare: "\u2105", + infin: "\u221E", + infintie: "\u29DD", + inodot: "\u0131", + int: "\u222B", + intcal: "\u22BA", + integers: "\u2124", + intercal: "\u22BA", + intlarhk: "\u2A17", + intprod: "\u2A3C", + iocy: "\u0451", + iogon: "\u012F", + iopf: "\u{1D55A}", + iota: "\u03B9", + iprod: "\u2A3C", + iquest: "\xBF", + iscr: "\u{1D4BE}", + isin: "\u2208", + isinE: "\u22F9", + isindot: "\u22F5", + isins: "\u22F4", + isinsv: "\u22F3", + isinv: "\u2208", + it: "\u2062", + itilde: "\u0129", + iukcy: "\u0456", + iuml: "\xEF", + jcirc: "\u0135", + jcy: "\u0439", + jfr: "\u{1D527}", + jmath: "\u0237", + jopf: "\u{1D55B}", + jscr: "\u{1D4BF}", + jsercy: "\u0458", + jukcy: "\u0454", + kappa: "\u03BA", + kappav: "\u03F0", + kcedil: "\u0137", + kcy: "\u043A", + kfr: "\u{1D528}", + kgreen: "\u0138", + khcy: "\u0445", + kjcy: "\u045C", + kopf: "\u{1D55C}", + kscr: "\u{1D4C0}", + lAarr: "\u21DA", + lArr: "\u21D0", + lAtail: "\u291B", + lBarr: "\u290E", + lE: "\u2266", + lEg: "\u2A8B", + lHar: "\u2962", + lacute: "\u013A", + laemptyv: "\u29B4", + lagran: "\u2112", + lambda: "\u03BB", + lang: "\u27E8", + langd: "\u2991", + langle: "\u27E8", + lap: "\u2A85", + laquo: "\xAB", + larr: "\u2190", + larrb: "\u21E4", + larrbfs: "\u291F", + larrfs: "\u291D", + larrhk: "\u21A9", + larrlp: "\u21AB", + larrpl: "\u2939", + larrsim: "\u2973", + larrtl: "\u21A2", + lat: "\u2AAB", + latail: "\u2919", + late: "\u2AAD", + lates: "\u2AAD\uFE00", + lbarr: "\u290C", + lbbrk: "\u2772", + lbrace: "{", + lbrack: "[", + lbrke: "\u298B", + lbrksld: "\u298F", + lbrkslu: "\u298D", + lcaron: "\u013E", + lcedil: "\u013C", + lceil: "\u2308", + lcub: "{", + lcy: "\u043B", + ldca: "\u2936", + ldquo: "\u201C", + ldquor: "\u201E", + ldrdhar: "\u2967", + ldrushar: "\u294B", + ldsh: "\u21B2", + le: "\u2264", + leftarrow: "\u2190", + leftarrowtail: "\u21A2", + leftharpoondown: "\u21BD", + leftharpoonup: "\u21BC", + leftleftarrows: "\u21C7", + leftrightarrow: "\u2194", + leftrightarrows: "\u21C6", + leftrightharpoons: "\u21CB", + leftrightsquigarrow: "\u21AD", + leftthreetimes: "\u22CB", + leg: "\u22DA", + leq: "\u2264", + leqq: "\u2266", + leqslant: "\u2A7D", + les: "\u2A7D", + lescc: "\u2AA8", + lesdot: "\u2A7F", + lesdoto: "\u2A81", + lesdotor: "\u2A83", + lesg: "\u22DA\uFE00", + lesges: "\u2A93", + lessapprox: "\u2A85", + lessdot: "\u22D6", + lesseqgtr: "\u22DA", + lesseqqgtr: "\u2A8B", + lessgtr: "\u2276", + lesssim: "\u2272", + lfisht: "\u297C", + lfloor: "\u230A", + lfr: "\u{1D529}", + lg: "\u2276", + lgE: "\u2A91", + lhard: "\u21BD", + lharu: "\u21BC", + lharul: "\u296A", + lhblk: "\u2584", + ljcy: "\u0459", + ll: "\u226A", + llarr: "\u21C7", + llcorner: "\u231E", + llhard: "\u296B", + lltri: "\u25FA", + lmidot: "\u0140", + lmoust: "\u23B0", + lmoustache: "\u23B0", + lnE: "\u2268", + lnap: "\u2A89", + lnapprox: "\u2A89", + lne: "\u2A87", + lneq: "\u2A87", + lneqq: "\u2268", + lnsim: "\u22E6", + loang: "\u27EC", + loarr: "\u21FD", + lobrk: "\u27E6", + longleftarrow: "\u27F5", + longleftrightarrow: "\u27F7", + longmapsto: "\u27FC", + longrightarrow: "\u27F6", + looparrowleft: "\u21AB", + looparrowright: "\u21AC", + lopar: "\u2985", + lopf: "\u{1D55D}", + loplus: "\u2A2D", + lotimes: "\u2A34", + lowast: "\u2217", + lowbar: "_", + loz: "\u25CA", + lozenge: "\u25CA", + lozf: "\u29EB", + lpar: "(", + lparlt: "\u2993", + lrarr: "\u21C6", + lrcorner: "\u231F", + lrhar: "\u21CB", + lrhard: "\u296D", + lrm: "\u200E", + lrtri: "\u22BF", + lsaquo: "\u2039", + lscr: "\u{1D4C1}", + lsh: "\u21B0", + lsim: "\u2272", + lsime: "\u2A8D", + lsimg: "\u2A8F", + lsqb: "[", + lsquo: "\u2018", + lsquor: "\u201A", + lstrok: "\u0142", + lt: "<", + ltcc: "\u2AA6", + ltcir: "\u2A79", + ltdot: "\u22D6", + lthree: "\u22CB", + ltimes: "\u22C9", + ltlarr: "\u2976", + ltquest: "\u2A7B", + ltrPar: "\u2996", + ltri: "\u25C3", + ltrie: "\u22B4", + ltrif: "\u25C2", + lurdshar: "\u294A", + luruhar: "\u2966", + lvertneqq: "\u2268\uFE00", + lvnE: "\u2268\uFE00", + mDDot: "\u223A", + macr: "\xAF", + male: "\u2642", + malt: "\u2720", + maltese: "\u2720", + map: "\u21A6", + mapsto: "\u21A6", + mapstodown: "\u21A7", + mapstoleft: "\u21A4", + mapstoup: "\u21A5", + marker: "\u25AE", + mcomma: "\u2A29", + mcy: "\u043C", + mdash: "\u2014", + measuredangle: "\u2221", + mfr: "\u{1D52A}", + mho: "\u2127", + micro: "\xB5", + mid: "\u2223", + midast: "*", + midcir: "\u2AF0", + middot: "\xB7", + minus: "\u2212", + minusb: "\u229F", + minusd: "\u2238", + minusdu: "\u2A2A", + mlcp: "\u2ADB", + mldr: "\u2026", + mnplus: "\u2213", + models: "\u22A7", + mopf: "\u{1D55E}", + mp: "\u2213", + mscr: "\u{1D4C2}", + mstpos: "\u223E", + mu: "\u03BC", + multimap: "\u22B8", + mumap: "\u22B8", + nGg: "\u22D9\u0338", + nGt: "\u226B\u20D2", + nGtv: "\u226B\u0338", + nLeftarrow: "\u21CD", + nLeftrightarrow: "\u21CE", + nLl: "\u22D8\u0338", + nLt: "\u226A\u20D2", + nLtv: "\u226A\u0338", + nRightarrow: "\u21CF", + nVDash: "\u22AF", + nVdash: "\u22AE", + nabla: "\u2207", + nacute: "\u0144", + nang: "\u2220\u20D2", + nap: "\u2249", + napE: "\u2A70\u0338", + napid: "\u224B\u0338", + napos: "\u0149", + napprox: "\u2249", + natur: "\u266E", + natural: "\u266E", + naturals: "\u2115", + nbsp: "\xA0", + nbump: "\u224E\u0338", + nbumpe: "\u224F\u0338", + ncap: "\u2A43", + ncaron: "\u0148", + ncedil: "\u0146", + ncong: "\u2247", + ncongdot: "\u2A6D\u0338", + ncup: "\u2A42", + ncy: "\u043D", + ndash: "\u2013", + ne: "\u2260", + neArr: "\u21D7", + nearhk: "\u2924", + nearr: "\u2197", + nearrow: "\u2197", + nedot: "\u2250\u0338", + nequiv: "\u2262", + nesear: "\u2928", + nesim: "\u2242\u0338", + nexist: "\u2204", + nexists: "\u2204", + nfr: "\u{1D52B}", + ngE: "\u2267\u0338", + nge: "\u2271", + ngeq: "\u2271", + ngeqq: "\u2267\u0338", + ngeqslant: "\u2A7E\u0338", + nges: "\u2A7E\u0338", + ngsim: "\u2275", + ngt: "\u226F", + ngtr: "\u226F", + nhArr: "\u21CE", + nharr: "\u21AE", + nhpar: "\u2AF2", + ni: "\u220B", + nis: "\u22FC", + nisd: "\u22FA", + niv: "\u220B", + njcy: "\u045A", + nlArr: "\u21CD", + nlE: "\u2266\u0338", + nlarr: "\u219A", + nldr: "\u2025", + nle: "\u2270", + nleftarrow: "\u219A", + nleftrightarrow: "\u21AE", + nleq: "\u2270", + nleqq: "\u2266\u0338", + nleqslant: "\u2A7D\u0338", + nles: "\u2A7D\u0338", + nless: "\u226E", + nlsim: "\u2274", + nlt: "\u226E", + nltri: "\u22EA", + nltrie: "\u22EC", + nmid: "\u2224", + nopf: "\u{1D55F}", + not: "\xAC", + notin: "\u2209", + notinE: "\u22F9\u0338", + notindot: "\u22F5\u0338", + notinva: "\u2209", + notinvb: "\u22F7", + notinvc: "\u22F6", + notni: "\u220C", + notniva: "\u220C", + notnivb: "\u22FE", + notnivc: "\u22FD", + npar: "\u2226", + nparallel: "\u2226", + nparsl: "\u2AFD\u20E5", + npart: "\u2202\u0338", + npolint: "\u2A14", + npr: "\u2280", + nprcue: "\u22E0", + npre: "\u2AAF\u0338", + nprec: "\u2280", + npreceq: "\u2AAF\u0338", + nrArr: "\u21CF", + nrarr: "\u219B", + nrarrc: "\u2933\u0338", + nrarrw: "\u219D\u0338", + nrightarrow: "\u219B", + nrtri: "\u22EB", + nrtrie: "\u22ED", + nsc: "\u2281", + nsccue: "\u22E1", + nsce: "\u2AB0\u0338", + nscr: "\u{1D4C3}", + nshortmid: "\u2224", + nshortparallel: "\u2226", + nsim: "\u2241", + nsime: "\u2244", + nsimeq: "\u2244", + nsmid: "\u2224", + nspar: "\u2226", + nsqsube: "\u22E2", + nsqsupe: "\u22E3", + nsub: "\u2284", + nsubE: "\u2AC5\u0338", + nsube: "\u2288", + nsubset: "\u2282\u20D2", + nsubseteq: "\u2288", + nsubseteqq: "\u2AC5\u0338", + nsucc: "\u2281", + nsucceq: "\u2AB0\u0338", + nsup: "\u2285", + nsupE: "\u2AC6\u0338", + nsupe: "\u2289", + nsupset: "\u2283\u20D2", + nsupseteq: "\u2289", + nsupseteqq: "\u2AC6\u0338", + ntgl: "\u2279", + ntilde: "\xF1", + ntlg: "\u2278", + ntriangleleft: "\u22EA", + ntrianglelefteq: "\u22EC", + ntriangleright: "\u22EB", + ntrianglerighteq: "\u22ED", + nu: "\u03BD", + num: "#", + numero: "\u2116", + numsp: "\u2007", + nvDash: "\u22AD", + nvHarr: "\u2904", + nvap: "\u224D\u20D2", + nvdash: "\u22AC", + nvge: "\u2265\u20D2", + nvgt: ">\u20D2", + nvinfin: "\u29DE", + nvlArr: "\u2902", + nvle: "\u2264\u20D2", + nvlt: "<\u20D2", + nvltrie: "\u22B4\u20D2", + nvrArr: "\u2903", + nvrtrie: "\u22B5\u20D2", + nvsim: "\u223C\u20D2", + nwArr: "\u21D6", + nwarhk: "\u2923", + nwarr: "\u2196", + nwarrow: "\u2196", + nwnear: "\u2927", + oS: "\u24C8", + oacute: "\xF3", + oast: "\u229B", + ocir: "\u229A", + ocirc: "\xF4", + ocy: "\u043E", + odash: "\u229D", + odblac: "\u0151", + odiv: "\u2A38", + odot: "\u2299", + odsold: "\u29BC", + oelig: "\u0153", + ofcir: "\u29BF", + ofr: "\u{1D52C}", + ogon: "\u02DB", + ograve: "\xF2", + ogt: "\u29C1", + ohbar: "\u29B5", + ohm: "\u03A9", + oint: "\u222E", + olarr: "\u21BA", + olcir: "\u29BE", + olcross: "\u29BB", + oline: "\u203E", + olt: "\u29C0", + omacr: "\u014D", + omega: "\u03C9", + omicron: "\u03BF", + omid: "\u29B6", + ominus: "\u2296", + oopf: "\u{1D560}", + opar: "\u29B7", + operp: "\u29B9", + oplus: "\u2295", + or: "\u2228", + orarr: "\u21BB", + ord: "\u2A5D", + order: "\u2134", + orderof: "\u2134", + ordf: "\xAA", + ordm: "\xBA", + origof: "\u22B6", + oror: "\u2A56", + orslope: "\u2A57", + orv: "\u2A5B", + oscr: "\u2134", + oslash: "\xF8", + osol: "\u2298", + otilde: "\xF5", + otimes: "\u2297", + otimesas: "\u2A36", + ouml: "\xF6", + ovbar: "\u233D", + par: "\u2225", + para: "\xB6", + parallel: "\u2225", + parsim: "\u2AF3", + parsl: "\u2AFD", + part: "\u2202", + pcy: "\u043F", + percnt: "%", + period: ".", + permil: "\u2030", + perp: "\u22A5", + pertenk: "\u2031", + pfr: "\u{1D52D}", + phi: "\u03C6", + phiv: "\u03D5", + phmmat: "\u2133", + phone: "\u260E", + pi: "\u03C0", + pitchfork: "\u22D4", + piv: "\u03D6", + planck: "\u210F", + planckh: "\u210E", + plankv: "\u210F", + plus: "+", + plusacir: "\u2A23", + plusb: "\u229E", + pluscir: "\u2A22", + plusdo: "\u2214", + plusdu: "\u2A25", + pluse: "\u2A72", + plusmn: "\xB1", + plussim: "\u2A26", + plustwo: "\u2A27", + pm: "\xB1", + pointint: "\u2A15", + popf: "\u{1D561}", + pound: "\xA3", + pr: "\u227A", + prE: "\u2AB3", + prap: "\u2AB7", + prcue: "\u227C", + pre: "\u2AAF", + prec: "\u227A", + precapprox: "\u2AB7", + preccurlyeq: "\u227C", + preceq: "\u2AAF", + precnapprox: "\u2AB9", + precneqq: "\u2AB5", + precnsim: "\u22E8", + precsim: "\u227E", + prime: "\u2032", + primes: "\u2119", + prnE: "\u2AB5", + prnap: "\u2AB9", + prnsim: "\u22E8", + prod: "\u220F", + profalar: "\u232E", + profline: "\u2312", + profsurf: "\u2313", + prop: "\u221D", + propto: "\u221D", + prsim: "\u227E", + prurel: "\u22B0", + pscr: "\u{1D4C5}", + psi: "\u03C8", + puncsp: "\u2008", + qfr: "\u{1D52E}", + qint: "\u2A0C", + qopf: "\u{1D562}", + qprime: "\u2057", + qscr: "\u{1D4C6}", + quaternions: "\u210D", + quatint: "\u2A16", + quest: "?", + questeq: "\u225F", + quot: '"', + rAarr: "\u21DB", + rArr: "\u21D2", + rAtail: "\u291C", + rBarr: "\u290F", + rHar: "\u2964", + race: "\u223D\u0331", + racute: "\u0155", + radic: "\u221A", + raemptyv: "\u29B3", + rang: "\u27E9", + rangd: "\u2992", + range: "\u29A5", + rangle: "\u27E9", + raquo: "\xBB", + rarr: "\u2192", + rarrap: "\u2975", + rarrb: "\u21E5", + rarrbfs: "\u2920", + rarrc: "\u2933", + rarrfs: "\u291E", + rarrhk: "\u21AA", + rarrlp: "\u21AC", + rarrpl: "\u2945", + rarrsim: "\u2974", + rarrtl: "\u21A3", + rarrw: "\u219D", + ratail: "\u291A", + ratio: "\u2236", + rationals: "\u211A", + rbarr: "\u290D", + rbbrk: "\u2773", + rbrace: "}", + rbrack: "]", + rbrke: "\u298C", + rbrksld: "\u298E", + rbrkslu: "\u2990", + rcaron: "\u0159", + rcedil: "\u0157", + rceil: "\u2309", + rcub: "}", + rcy: "\u0440", + rdca: "\u2937", + rdldhar: "\u2969", + rdquo: "\u201D", + rdquor: "\u201D", + rdsh: "\u21B3", + real: "\u211C", + realine: "\u211B", + realpart: "\u211C", + reals: "\u211D", + rect: "\u25AD", + reg: "\xAE", + rfisht: "\u297D", + rfloor: "\u230B", + rfr: "\u{1D52F}", + rhard: "\u21C1", + rharu: "\u21C0", + rharul: "\u296C", + rho: "\u03C1", + rhov: "\u03F1", + rightarrow: "\u2192", + rightarrowtail: "\u21A3", + rightharpoondown: "\u21C1", + rightharpoonup: "\u21C0", + rightleftarrows: "\u21C4", + rightleftharpoons: "\u21CC", + rightrightarrows: "\u21C9", + rightsquigarrow: "\u219D", + rightthreetimes: "\u22CC", + ring: "\u02DA", + risingdotseq: "\u2253", + rlarr: "\u21C4", + rlhar: "\u21CC", + rlm: "\u200F", + rmoust: "\u23B1", + rmoustache: "\u23B1", + rnmid: "\u2AEE", + roang: "\u27ED", + roarr: "\u21FE", + robrk: "\u27E7", + ropar: "\u2986", + ropf: "\u{1D563}", + roplus: "\u2A2E", + rotimes: "\u2A35", + rpar: ")", + rpargt: "\u2994", + rppolint: "\u2A12", + rrarr: "\u21C9", + rsaquo: "\u203A", + rscr: "\u{1D4C7}", + rsh: "\u21B1", + rsqb: "]", + rsquo: "\u2019", + rsquor: "\u2019", + rthree: "\u22CC", + rtimes: "\u22CA", + rtri: "\u25B9", + rtrie: "\u22B5", + rtrif: "\u25B8", + rtriltri: "\u29CE", + ruluhar: "\u2968", + rx: "\u211E", + sacute: "\u015B", + sbquo: "\u201A", + sc: "\u227B", + scE: "\u2AB4", + scap: "\u2AB8", + scaron: "\u0161", + sccue: "\u227D", + sce: "\u2AB0", + scedil: "\u015F", + scirc: "\u015D", + scnE: "\u2AB6", + scnap: "\u2ABA", + scnsim: "\u22E9", + scpolint: "\u2A13", + scsim: "\u227F", + scy: "\u0441", + sdot: "\u22C5", + sdotb: "\u22A1", + sdote: "\u2A66", + seArr: "\u21D8", + searhk: "\u2925", + searr: "\u2198", + searrow: "\u2198", + sect: "\xA7", + semi: ";", + seswar: "\u2929", + setminus: "\u2216", + setmn: "\u2216", + sext: "\u2736", + sfr: "\u{1D530}", + sfrown: "\u2322", + sharp: "\u266F", + shchcy: "\u0449", + shcy: "\u0448", + shortmid: "\u2223", + shortparallel: "\u2225", + shy: "\xAD", + sigma: "\u03C3", + sigmaf: "\u03C2", + sigmav: "\u03C2", + sim: "\u223C", + simdot: "\u2A6A", + sime: "\u2243", + simeq: "\u2243", + simg: "\u2A9E", + simgE: "\u2AA0", + siml: "\u2A9D", + simlE: "\u2A9F", + simne: "\u2246", + simplus: "\u2A24", + simrarr: "\u2972", + slarr: "\u2190", + smallsetminus: "\u2216", + smashp: "\u2A33", + smeparsl: "\u29E4", + smid: "\u2223", + smile: "\u2323", + smt: "\u2AAA", + smte: "\u2AAC", + smtes: "\u2AAC\uFE00", + softcy: "\u044C", + sol: "/", + solb: "\u29C4", + solbar: "\u233F", + sopf: "\u{1D564}", + spades: "\u2660", + spadesuit: "\u2660", + spar: "\u2225", + sqcap: "\u2293", + sqcaps: "\u2293\uFE00", + sqcup: "\u2294", + sqcups: "\u2294\uFE00", + sqsub: "\u228F", + sqsube: "\u2291", + sqsubset: "\u228F", + sqsubseteq: "\u2291", + sqsup: "\u2290", + sqsupe: "\u2292", + sqsupset: "\u2290", + sqsupseteq: "\u2292", + squ: "\u25A1", + square: "\u25A1", + squarf: "\u25AA", + squf: "\u25AA", + srarr: "\u2192", + sscr: "\u{1D4C8}", + ssetmn: "\u2216", + ssmile: "\u2323", + sstarf: "\u22C6", + star: "\u2606", + starf: "\u2605", + straightepsilon: "\u03F5", + straightphi: "\u03D5", + strns: "\xAF", + sub: "\u2282", + subE: "\u2AC5", + subdot: "\u2ABD", + sube: "\u2286", + subedot: "\u2AC3", + submult: "\u2AC1", + subnE: "\u2ACB", + subne: "\u228A", + subplus: "\u2ABF", + subrarr: "\u2979", + subset: "\u2282", + subseteq: "\u2286", + subseteqq: "\u2AC5", + subsetneq: "\u228A", + subsetneqq: "\u2ACB", + subsim: "\u2AC7", + subsub: "\u2AD5", + subsup: "\u2AD3", + succ: "\u227B", + succapprox: "\u2AB8", + succcurlyeq: "\u227D", + succeq: "\u2AB0", + succnapprox: "\u2ABA", + succneqq: "\u2AB6", + succnsim: "\u22E9", + succsim: "\u227F", + sum: "\u2211", + sung: "\u266A", + sup1: "\xB9", + sup2: "\xB2", + sup3: "\xB3", + sup: "\u2283", + supE: "\u2AC6", + supdot: "\u2ABE", + supdsub: "\u2AD8", + supe: "\u2287", + supedot: "\u2AC4", + suphsol: "\u27C9", + suphsub: "\u2AD7", + suplarr: "\u297B", + supmult: "\u2AC2", + supnE: "\u2ACC", + supne: "\u228B", + supplus: "\u2AC0", + supset: "\u2283", + supseteq: "\u2287", + supseteqq: "\u2AC6", + supsetneq: "\u228B", + supsetneqq: "\u2ACC", + supsim: "\u2AC8", + supsub: "\u2AD4", + supsup: "\u2AD6", + swArr: "\u21D9", + swarhk: "\u2926", + swarr: "\u2199", + swarrow: "\u2199", + swnwar: "\u292A", + szlig: "\xDF", + target: "\u2316", + tau: "\u03C4", + tbrk: "\u23B4", + tcaron: "\u0165", + tcedil: "\u0163", + tcy: "\u0442", + tdot: "\u20DB", + telrec: "\u2315", + tfr: "\u{1D531}", + there4: "\u2234", + therefore: "\u2234", + theta: "\u03B8", + thetasym: "\u03D1", + thetav: "\u03D1", + thickapprox: "\u2248", + thicksim: "\u223C", + thinsp: "\u2009", + thkap: "\u2248", + thksim: "\u223C", + thorn: "\xFE", + tilde: "\u02DC", + times: "\xD7", + timesb: "\u22A0", + timesbar: "\u2A31", + timesd: "\u2A30", + tint: "\u222D", + toea: "\u2928", + top: "\u22A4", + topbot: "\u2336", + topcir: "\u2AF1", + topf: "\u{1D565}", + topfork: "\u2ADA", + tosa: "\u2929", + tprime: "\u2034", + trade: "\u2122", + triangle: "\u25B5", + triangledown: "\u25BF", + triangleleft: "\u25C3", + trianglelefteq: "\u22B4", + triangleq: "\u225C", + triangleright: "\u25B9", + trianglerighteq: "\u22B5", + tridot: "\u25EC", + trie: "\u225C", + triminus: "\u2A3A", + triplus: "\u2A39", + trisb: "\u29CD", + tritime: "\u2A3B", + trpezium: "\u23E2", + tscr: "\u{1D4C9}", + tscy: "\u0446", + tshcy: "\u045B", + tstrok: "\u0167", + twixt: "\u226C", + twoheadleftarrow: "\u219E", + twoheadrightarrow: "\u21A0", + uArr: "\u21D1", + uHar: "\u2963", + uacute: "\xFA", + uarr: "\u2191", + ubrcy: "\u045E", + ubreve: "\u016D", + ucirc: "\xFB", + ucy: "\u0443", + udarr: "\u21C5", + udblac: "\u0171", + udhar: "\u296E", + ufisht: "\u297E", + ufr: "\u{1D532}", + ugrave: "\xF9", + uharl: "\u21BF", + uharr: "\u21BE", + uhblk: "\u2580", + ulcorn: "\u231C", + ulcorner: "\u231C", + ulcrop: "\u230F", + ultri: "\u25F8", + umacr: "\u016B", + uml: "\xA8", + uogon: "\u0173", + uopf: "\u{1D566}", + uparrow: "\u2191", + updownarrow: "\u2195", + upharpoonleft: "\u21BF", + upharpoonright: "\u21BE", + uplus: "\u228E", + upsi: "\u03C5", + upsih: "\u03D2", + upsilon: "\u03C5", + upuparrows: "\u21C8", + urcorn: "\u231D", + urcorner: "\u231D", + urcrop: "\u230E", + uring: "\u016F", + urtri: "\u25F9", + uscr: "\u{1D4CA}", + utdot: "\u22F0", + utilde: "\u0169", + utri: "\u25B5", + utrif: "\u25B4", + uuarr: "\u21C8", + uuml: "\xFC", + uwangle: "\u29A7", + vArr: "\u21D5", + vBar: "\u2AE8", + vBarv: "\u2AE9", + vDash: "\u22A8", + vangrt: "\u299C", + varepsilon: "\u03F5", + varkappa: "\u03F0", + varnothing: "\u2205", + varphi: "\u03D5", + varpi: "\u03D6", + varpropto: "\u221D", + varr: "\u2195", + varrho: "\u03F1", + varsigma: "\u03C2", + varsubsetneq: "\u228A\uFE00", + varsubsetneqq: "\u2ACB\uFE00", + varsupsetneq: "\u228B\uFE00", + varsupsetneqq: "\u2ACC\uFE00", + vartheta: "\u03D1", + vartriangleleft: "\u22B2", + vartriangleright: "\u22B3", + vcy: "\u0432", + vdash: "\u22A2", + vee: "\u2228", + veebar: "\u22BB", + veeeq: "\u225A", + vellip: "\u22EE", + verbar: "|", + vert: "|", + vfr: "\u{1D533}", + vltri: "\u22B2", + vnsub: "\u2282\u20D2", + vnsup: "\u2283\u20D2", + vopf: "\u{1D567}", + vprop: "\u221D", + vrtri: "\u22B3", + vscr: "\u{1D4CB}", + vsubnE: "\u2ACB\uFE00", + vsubne: "\u228A\uFE00", + vsupnE: "\u2ACC\uFE00", + vsupne: "\u228B\uFE00", + vzigzag: "\u299A", + wcirc: "\u0175", + wedbar: "\u2A5F", + wedge: "\u2227", + wedgeq: "\u2259", + weierp: "\u2118", + wfr: "\u{1D534}", + wopf: "\u{1D568}", + wp: "\u2118", + wr: "\u2240", + wreath: "\u2240", + wscr: "\u{1D4CC}", + xcap: "\u22C2", + xcirc: "\u25EF", + xcup: "\u22C3", + xdtri: "\u25BD", + xfr: "\u{1D535}", + xhArr: "\u27FA", + xharr: "\u27F7", + xi: "\u03BE", + xlArr: "\u27F8", + xlarr: "\u27F5", + xmap: "\u27FC", + xnis: "\u22FB", + xodot: "\u2A00", + xopf: "\u{1D569}", + xoplus: "\u2A01", + xotime: "\u2A02", + xrArr: "\u27F9", + xrarr: "\u27F6", + xscr: "\u{1D4CD}", + xsqcup: "\u2A06", + xuplus: "\u2A04", + xutri: "\u25B3", + xvee: "\u22C1", + xwedge: "\u22C0", + yacute: "\xFD", + yacy: "\u044F", + ycirc: "\u0177", + ycy: "\u044B", + yen: "\xA5", + yfr: "\u{1D536}", + yicy: "\u0457", + yopf: "\u{1D56A}", + yscr: "\u{1D4CE}", + yucy: "\u044E", + yuml: "\xFF", + zacute: "\u017A", + zcaron: "\u017E", + zcy: "\u0437", + zdot: "\u017C", + zeetrf: "\u2128", + zeta: "\u03B6", + zfr: "\u{1D537}", + zhcy: "\u0436", + zigrarr: "\u21DD", + zopf: "\u{1D56B}", + zscr: "\u{1D4CF}", + zwj: "\u200D", + zwnj: "\u200C" +}; +var decodeMap = { + "0": 65533, + "128": 8364, + "130": 8218, + "131": 402, + "132": 8222, + "133": 8230, + "134": 8224, + "135": 8225, + "136": 710, + "137": 8240, + "138": 352, + "139": 8249, + "140": 338, + "142": 381, + "145": 8216, + "146": 8217, + "147": 8220, + "148": 8221, + "149": 8226, + "150": 8211, + "151": 8212, + "152": 732, + "153": 8482, + "154": 353, + "155": 8250, + "156": 339, + "158": 382, + "159": 376 +}; +function decodeHTMLStrict(text) { + return text.replace(/&(?:[a-zA-Z]+|#[xX][\da-fA-F]+|#\d+);/g, (key) => { + var _a; + if (key.charAt(1) === "#") { + const secondChar = key.charAt(2); + const codePoint = secondChar === "X" || secondChar === "x" ? parseInt(key.slice(3), 16) : parseInt(key.slice(2), 10); + return decodeCodePoint(codePoint); + } + return (_a = getOwnProperty(entities, key.slice(1, -1))) != null ? _a : key; + }); +} +__name(decodeHTMLStrict, "decodeHTMLStrict"); +function decodeCodePoint(codePoint) { + var _a; + if (codePoint >= 55296 && codePoint <= 57343 || codePoint > 1114111) { + return "\uFFFD"; + } + return String.fromCodePoint((_a = getOwnProperty(decodeMap, codePoint)) != null ? _a : codePoint); +} +__name(decodeCodePoint, "decodeCodePoint"); +function scanJSXAttributeValue(parser, context) { + parser.startIndex = parser.tokenIndex = parser.index; + parser.startColumn = parser.tokenColumn = parser.column; + parser.startLine = parser.tokenLine = parser.line; + parser.setToken(CharTypes[parser.currentChar] & 8192 ? scanJSXString(parser) : scanSingleToken(parser, context, 0)); + return parser.getToken(); +} +__name(scanJSXAttributeValue, "scanJSXAttributeValue"); +function scanJSXString(parser) { + const quote = parser.currentChar; + let char = advanceChar(parser); + const start = parser.index; + while (char !== quote) { + if (parser.index >= parser.end) + parser.report(16); + char = advanceChar(parser); + } + if (char !== quote) + parser.report(16); + parser.tokenValue = parser.source.slice(start, parser.index); + advanceChar(parser); + if (parser.options.raw) + parser.tokenRaw = parser.source.slice(parser.tokenIndex, parser.index); + return 134283267; +} +__name(scanJSXString, "scanJSXString"); +function nextJSXToken(parser) { + parser.startIndex = parser.tokenIndex = parser.index; + parser.startColumn = parser.tokenColumn = parser.column; + parser.startLine = parser.tokenLine = parser.line; + if (parser.index >= parser.end) { + parser.setToken(1048576); + return; + } + if (parser.currentChar === 60) { + advanceChar(parser); + parser.setToken(8456256); + return; + } + if (parser.currentChar === 123) { + advanceChar(parser); + parser.setToken(2162700); + return; + } + let state = 0; + while (parser.index < parser.end) { + const type = CharTypes[parser.source.charCodeAt(parser.index)]; + if (type & 1024) { + state |= 1 | 4; + scanNewLine(parser); + } else if (type & 2048) { + consumeLineFeed(parser, state); + state = state & -5 | 1; + } else { + advanceChar(parser); + } + if (CharTypes[parser.currentChar] & 16384) + break; + } + if (parser.tokenIndex === parser.index) + parser.report(0); + const raw = parser.source.slice(parser.tokenIndex, parser.index); + if (parser.options.raw) + parser.tokenRaw = raw; + parser.tokenValue = decodeHTMLStrict(raw); + parser.setToken(137); +} +__name(nextJSXToken, "nextJSXToken"); +function rescanJSXIdentifier(parser) { + if ((parser.getToken() & 143360) === 143360) { + const { index } = parser; + let char = parser.currentChar; + while (CharTypes[char] & (32768 | 2)) { + char = advanceChar(parser); + } + parser.tokenValue += parser.source.slice(index, parser.index); + parser.setToken(208897, true); + } + return parser.getToken(); +} +__name(rescanJSXIdentifier, "rescanJSXIdentifier"); +var _Scope = class _Scope { + constructor(parser, type = 2, parent) { + __publicField(this, "parser"); + __publicField(this, "type"); + __publicField(this, "parent"); + __publicField(this, "scopeError"); + __publicField(this, "variableBindings", /* @__PURE__ */ new Map()); + this.parser = parser; + this.type = type; + this.parent = parent; + } + createChildScope(type) { + return new _Scope(this.parser, type, this); + } + addVarOrBlock(context, name, kind, origin) { + if (kind & 4) { + this.addVarName(context, name, kind); + } else { + this.addBlockName(context, name, kind, origin); + } + if (origin & 64) { + this.parser.declareUnboundVariable(name); + } + } + addVarName(context, name, kind) { + const { parser } = this; + let currentScope = this; + while (currentScope && (currentScope.type & 128) === 0) { + const { variableBindings } = currentScope; + const value = variableBindings.get(name); + if (value && value & 248) { + if (parser.options.webcompat && (context & 1) === 0 && (kind & 128 && value & 68 || value & 128 && kind & 68)) ; + else { + parser.report(145, name); + } + } + if (currentScope === this) { + if (value && value & 1 && kind & 1) { + currentScope.recordScopeError(145, name); + } + } + if (value && (value & 256 || value & 512 && !parser.options.webcompat)) { + parser.report(145, name); + } + currentScope.variableBindings.set(name, kind); + currentScope = currentScope.parent; + } + } + hasVariable(name) { + return this.variableBindings.has(name); + } + addBlockName(context, name, kind, origin) { + var _a; + const { parser } = this; + const value = this.variableBindings.get(name); + if (value && (value & 2) === 0) { + if (kind & 1) { + this.recordScopeError(145, name); + } else if (parser.options.webcompat && (context & 1) === 0 && origin & 2 && value === 64 && kind === 64) ; + else { + parser.report(145, name); + } + } + if (this.type & 64 && ((_a = this.parent) == null ? void 0 : _a.hasVariable(name)) && (this.parent.variableBindings.get(name) & 2) === 0) { + parser.report(145, name); + } + if (this.type & 512 && value && (value & 2) === 0) { + if (kind & 1) { + this.recordScopeError(145, name); + } + } + if (this.type & 32) { + if (this.parent.variableBindings.get(name) & 768) + parser.report(159, name); + } + this.variableBindings.set(name, kind); + } + recordScopeError(type, ...params) { + this.scopeError = { + type, + params, + start: this.parser.tokenStart, + end: this.parser.currentLocation + }; + } + reportScopeError() { + const { scopeError } = this; + if (!scopeError) { + return; + } + throw new ParseError(scopeError.start, scopeError.end, scopeError.type, ...scopeError.params); + } +}; +__name(_Scope, "Scope"); +var Scope = _Scope; +function createArrowHeadParsingScope(parser, context, value) { + const scope = parser.createScope().createChildScope(512); + scope.addBlockName(context, value, 1, 0); + return scope; +} +__name(createArrowHeadParsingScope, "createArrowHeadParsingScope"); +var _PrivateScope = class _PrivateScope { + constructor(parser, parent) { + __publicField(this, "parser"); + __publicField(this, "parent"); + __publicField(this, "refs", /* @__PURE__ */ Object.create(null)); + __publicField(this, "privateIdentifiers", /* @__PURE__ */ new Map()); + this.parser = parser; + this.parent = parent; + } + addPrivateIdentifier(name, kind) { + const { privateIdentifiers } = this; + let focusKind = kind & (32 | 768); + if (!(focusKind & 768)) + focusKind |= 768; + const value = privateIdentifiers.get(name); + if (this.hasPrivateIdentifier(name) && ((value & 32) !== (focusKind & 32) || value & focusKind & 768)) { + this.parser.report(146, name); + } + privateIdentifiers.set(name, this.hasPrivateIdentifier(name) ? value | focusKind : focusKind); + } + addPrivateIdentifierRef(name) { + var _a, _b; + (_b = (_a = this.refs)[name]) != null ? _b : _a[name] = []; + this.refs[name].push(this.parser.tokenStart); + } + isPrivateIdentifierDefined(name) { + var _a; + return this.hasPrivateIdentifier(name) || Boolean((_a = this.parent) == null ? void 0 : _a.isPrivateIdentifierDefined(name)); + } + validatePrivateIdentifierRefs() { + for (const name in this.refs) { + if (!this.isPrivateIdentifierDefined(name)) { + const { index, line, column } = this.refs[name][0]; + throw new ParseError({ index, line, column }, { index: index + name.length, line, column: column + name.length }, 4, name); + } + } + } + hasPrivateIdentifier(name) { + return this.privateIdentifiers.has(name); + } +}; +__name(_PrivateScope, "PrivateScope"); +var PrivateScope = _PrivateScope; +var _Parser = class _Parser { + constructor(source, options = {}) { + __publicField(this, "source"); + __publicField(this, "options"); + __publicField(this, "lastOnToken", null); + __publicField(this, "token", 1048576); + __publicField(this, "flags", 0); + __publicField(this, "index", 0); + __publicField(this, "line", 1); + __publicField(this, "column", 0); + __publicField(this, "startIndex", 0); + __publicField(this, "end", 0); + __publicField(this, "tokenIndex", 0); + __publicField(this, "startColumn", 0); + __publicField(this, "tokenColumn", 0); + __publicField(this, "tokenLine", 1); + __publicField(this, "startLine", 1); + __publicField(this, "tokenValue", ""); + __publicField(this, "tokenRaw", ""); + __publicField(this, "tokenRegExp"); + __publicField(this, "currentChar", 0); + __publicField(this, "exportedNames", /* @__PURE__ */ new Set()); + __publicField(this, "exportedBindings", /* @__PURE__ */ new Set()); + __publicField(this, "assignable", 1); + __publicField(this, "destructible", 0); + __publicField(this, "leadingDecorators", { decorators: [] }); + this.source = source; + this.options = options; + this.end = source.length; + this.currentChar = source.charCodeAt(0); + } + getToken() { + return this.token; + } + setToken(value, replaceLast = false) { + this.token = value; + const { onToken } = this.options; + if (onToken) { + if (value !== 1048576) { + const loc = { + start: { + line: this.tokenLine, + column: this.tokenColumn + }, + end: { + line: this.line, + column: this.column + } + }; + if (!replaceLast && this.lastOnToken) { + onToken(...this.lastOnToken); + } + this.lastOnToken = [convertTokenType(value), this.tokenIndex, this.index, loc]; + } else { + if (this.lastOnToken) { + onToken(...this.lastOnToken); + this.lastOnToken = null; + } + } + } + return value; + } + get tokenStart() { + return { + index: this.tokenIndex, + line: this.tokenLine, + column: this.tokenColumn + }; + } + get currentLocation() { + return { index: this.index, line: this.line, column: this.column }; + } + finishNode(node, start, end) { + if (this.options.ranges) { + node.start = start.index; + const endIndex = end ? end.index : this.startIndex; + node.end = endIndex; + node.range = [start.index, endIndex]; + } + if (this.options.loc) { + node.loc = { + start: { + line: start.line, + column: start.column + }, + end: end ? { line: end.line, column: end.column } : { line: this.startLine, column: this.startColumn } + }; + if (this.options.source) { + node.loc.source = this.options.source; + } + } + return node; + } + addBindingToExports(name) { + this.exportedBindings.add(name); + } + declareUnboundVariable(name) { + const { exportedNames } = this; + if (exportedNames.has(name)) { + this.report(147, name); + } + exportedNames.add(name); + } + report(type, ...params) { + throw new ParseError(this.tokenStart, this.currentLocation, type, ...params); + } + createScopeIfLexical(type, parent) { + if (this.options.lexical) { + return this.createScope(type, parent); + } + return void 0; + } + createScope(type, parent) { + return new Scope(this, type, parent); + } + createPrivateScopeIfLexical(parent) { + if (this.options.lexical) { + return new PrivateScope(this, parent); + } + return void 0; + } +}; +__name(_Parser, "Parser"); +var Parser = _Parser; +function pushComment(comments, options) { + return function(type, value, start, end, loc) { + const comment = { + type, + value + }; + if (options.ranges) { + comment.start = start; + comment.end = end; + comment.range = [start, end]; + } + if (options.loc) { + comment.loc = loc; + } + comments.push(comment); + }; +} +__name(pushComment, "pushComment"); +function pushToken(tokens, options) { + return function(type, start, end, loc) { + const token = { + token: type + }; + if (options.ranges) { + token.start = start; + token.end = end; + token.range = [start, end]; + } + if (options.loc) { + token.loc = loc; + } + tokens.push(token); + }; +} +__name(pushToken, "pushToken"); +function normalizeOptions(rawOptions) { + const options = { ...rawOptions }; + if (options.onComment) { + options.onComment = Array.isArray(options.onComment) ? pushComment(options.onComment, options) : options.onComment; + } + if (options.onToken) { + options.onToken = Array.isArray(options.onToken) ? pushToken(options.onToken, options) : options.onToken; + } + return options; +} +__name(normalizeOptions, "normalizeOptions"); +function parseSource(source, rawOptions = {}, context = 0) { + const options = normalizeOptions(rawOptions); + if (options.module) + context |= 2 | 1; + if (options.globalReturn) + context |= 4096; + if (options.impliedStrict) + context |= 1; + const parser = new Parser(source, options); + skipHashBang(parser); + const scope = parser.createScopeIfLexical(); + let body = []; + let sourceType = "script"; + if (context & 2) { + sourceType = "module"; + body = parseModuleItemList(parser, context | 8, scope); + if (scope) { + for (const name of parser.exportedBindings) { + if (!scope.hasVariable(name)) + parser.report(148, name); + } + } + } else { + body = parseStatementList(parser, context | 8, scope); + } + return parser.finishNode({ + type: "Program", + sourceType, + body + }, { index: 0, line: 1, column: 0 }, parser.currentLocation); +} +__name(parseSource, "parseSource"); +function parseStatementList(parser, context, scope) { + nextToken(parser, context | 32 | 262144); + const statements = []; + while (parser.getToken() === 134283267) { + const { index, tokenValue, tokenStart, tokenIndex } = parser; + const token = parser.getToken(); + const expr = parseLiteral(parser, context); + if (isValidStrictMode(parser, index, tokenIndex, tokenValue)) { + context |= 1; + if (parser.flags & 64) { + throw new ParseError(parser.tokenStart, parser.currentLocation, 9); + } + if (parser.flags & 4096) { + throw new ParseError(parser.tokenStart, parser.currentLocation, 15); + } + } + statements.push(parseDirective(parser, context, expr, token, tokenStart)); + } + while (parser.getToken() !== 1048576) { + statements.push(parseStatementListItem(parser, context, scope, void 0, 4, {})); + } + return statements; +} +__name(parseStatementList, "parseStatementList"); +function parseModuleItemList(parser, context, scope) { + nextToken(parser, context | 32); + const statements = []; + while (parser.getToken() === 134283267) { + const { tokenStart } = parser; + const token = parser.getToken(); + statements.push(parseDirective(parser, context, parseLiteral(parser, context), token, tokenStart)); + } + while (parser.getToken() !== 1048576) { + statements.push(parseModuleItem(parser, context, scope)); + } + return statements; +} +__name(parseModuleItemList, "parseModuleItemList"); +function parseModuleItem(parser, context, scope) { + var _a; + if (parser.getToken() === 132) { + Object.assign(parser.leadingDecorators, { + start: parser.tokenStart, + decorators: parseDecorators(parser, context, void 0) + }); + } + let moduleItem; + switch (parser.getToken()) { + case 20564: + moduleItem = parseExportDeclaration(parser, context, scope); + break; + case 86106: + moduleItem = parseImportDeclaration(parser, context, scope); + break; + default: + moduleItem = parseStatementListItem(parser, context, scope, void 0, 4, {}); + } + if ((_a = parser.leadingDecorators) == null ? void 0 : _a.decorators.length) { + parser.report(170); + } + return moduleItem; +} +__name(parseModuleItem, "parseModuleItem"); +function parseStatementListItem(parser, context, scope, privateScope, origin, labels) { + const start = parser.tokenStart; + switch (parser.getToken()) { + case 86104: + return parseFunctionDeclaration(parser, context, scope, privateScope, origin, 1, 0, 0, start); + case 132: + case 86094: + return parseClassDeclaration(parser, context, scope, privateScope, 0); + case 86090: + return parseLexicalDeclaration(parser, context, scope, privateScope, 16, 0); + case 241737: + return parseLetIdentOrVarDeclarationStatement(parser, context, scope, privateScope, origin); + case 20564: + parser.report(103, "export"); + case 86106: + nextToken(parser, context); + switch (parser.getToken()) { + case 67174411: + return parseImportCallDeclaration(parser, context, privateScope, start); + case 67108877: + return parseImportMetaDeclaration(parser, context, start); + default: + parser.report(103, "import"); + } + case 209005: + return parseAsyncArrowOrAsyncFunctionDeclaration(parser, context, scope, privateScope, origin, labels, 1); + default: + return parseStatement(parser, context, scope, privateScope, origin, labels, 1); + } +} +__name(parseStatementListItem, "parseStatementListItem"); +function parseStatement(parser, context, scope, privateScope, origin, labels, allowFuncDecl) { + switch (parser.getToken()) { + case 86088: + return parseVariableStatement(parser, context, scope, privateScope, 0); + case 20572: + return parseReturnStatement(parser, context, privateScope); + case 20569: + return parseIfStatement(parser, context, scope, privateScope, labels); + case 20567: + return parseForStatement(parser, context, scope, privateScope, labels); + case 20562: + return parseDoWhileStatement(parser, context, scope, privateScope, labels); + case 20578: + return parseWhileStatement(parser, context, scope, privateScope, labels); + case 86110: + return parseSwitchStatement(parser, context, scope, privateScope, labels); + case 1074790417: + return parseEmptyStatement(parser, context); + case 2162700: + return parseBlock(parser, context, scope == null ? void 0 : scope.createChildScope(), privateScope, labels, parser.tokenStart); + case 86112: + return parseThrowStatement(parser, context, privateScope); + case 20555: + return parseBreakStatement(parser, context, labels); + case 20559: + return parseContinueStatement(parser, context, labels); + case 20577: + return parseTryStatement(parser, context, scope, privateScope, labels); + case 20579: + return parseWithStatement(parser, context, scope, privateScope, labels); + case 20560: + return parseDebuggerStatement(parser, context); + case 209005: + return parseAsyncArrowOrAsyncFunctionDeclaration(parser, context, scope, privateScope, origin, labels, 0); + case 20557: + parser.report(162); + case 20566: + parser.report(163); + case 86104: + parser.report(context & 1 ? 76 : !parser.options.webcompat ? 78 : 77); + case 86094: + parser.report(79); + default: + return parseExpressionOrLabelledStatement(parser, context, scope, privateScope, origin, labels, allowFuncDecl); + } +} +__name(parseStatement, "parseStatement"); +function parseExpressionOrLabelledStatement(parser, context, scope, privateScope, origin, labels, allowFuncDecl) { + const { tokenValue, tokenStart } = parser; + const token = parser.getToken(); + let expr; + switch (token) { + case 241737: + expr = parseIdentifier(parser, context); + if (context & 1) + parser.report(85); + if (parser.getToken() === 69271571) + parser.report(84); + break; + default: + expr = parsePrimaryExpression(parser, context, privateScope, 2, 0, 1, 0, 1, parser.tokenStart); + } + if (token & 143360 && parser.getToken() === 21) { + return parseLabelledStatement(parser, context, scope, privateScope, origin, labels, tokenValue, expr, token, allowFuncDecl, tokenStart); + } + expr = parseMemberOrUpdateExpression(parser, context, privateScope, expr, 0, 0, tokenStart); + expr = parseAssignmentExpression(parser, context, privateScope, 0, 0, tokenStart, expr); + if (parser.getToken() === 18) { + expr = parseSequenceExpression(parser, context, privateScope, 0, tokenStart, expr); + } + return parseExpressionStatement(parser, context, expr, tokenStart); +} +__name(parseExpressionOrLabelledStatement, "parseExpressionOrLabelledStatement"); +function parseBlock(parser, context, scope, privateScope, labels, start = parser.tokenStart, type = "BlockStatement") { + const body = []; + consume(parser, context | 32, 2162700); + while (parser.getToken() !== 1074790415) { + body.push(parseStatementListItem(parser, context, scope, privateScope, 2, { $: labels })); + } + consume(parser, context | 32, 1074790415); + return parser.finishNode({ + type, + body + }, start); +} +__name(parseBlock, "parseBlock"); +function parseReturnStatement(parser, context, privateScope) { + if ((context & 4096) === 0) + parser.report(92); + const start = parser.tokenStart; + nextToken(parser, context | 32); + const argument = parser.flags & 1 || parser.getToken() & 1048576 ? null : parseExpressions(parser, context, privateScope, 0, 1, parser.tokenStart); + matchOrInsertSemicolon(parser, context | 32); + return parser.finishNode({ + type: "ReturnStatement", + argument + }, start); +} +__name(parseReturnStatement, "parseReturnStatement"); +function parseExpressionStatement(parser, context, expression, start) { + matchOrInsertSemicolon(parser, context | 32); + return parser.finishNode({ + type: "ExpressionStatement", + expression + }, start); +} +__name(parseExpressionStatement, "parseExpressionStatement"); +function parseLabelledStatement(parser, context, scope, privateScope, origin, labels, value, expr, token, allowFuncDecl, start) { + validateBindingIdentifier(parser, context, 0, token, 1); + validateAndDeclareLabel(parser, labels, value); + nextToken(parser, context | 32); + const body = allowFuncDecl && (context & 1) === 0 && parser.options.webcompat && parser.getToken() === 86104 ? parseFunctionDeclaration(parser, context, scope == null ? void 0 : scope.createChildScope(), privateScope, origin, 0, 0, 0, parser.tokenStart) : parseStatement(parser, context, scope, privateScope, origin, labels, allowFuncDecl); + return parser.finishNode({ + type: "LabeledStatement", + label: expr, + body + }, start); +} +__name(parseLabelledStatement, "parseLabelledStatement"); +function parseAsyncArrowOrAsyncFunctionDeclaration(parser, context, scope, privateScope, origin, labels, allowFuncDecl) { + const { tokenValue, tokenStart: start } = parser; + const token = parser.getToken(); + let expr = parseIdentifier(parser, context); + if (parser.getToken() === 21) { + return parseLabelledStatement(parser, context, scope, privateScope, origin, labels, tokenValue, expr, token, 1, start); + } + const asyncNewLine = parser.flags & 1; + if (!asyncNewLine) { + if (parser.getToken() === 86104) { + if (!allowFuncDecl) + parser.report(123); + return parseFunctionDeclaration(parser, context, scope, privateScope, origin, 1, 0, 1, start); + } + if (isValidIdentifier(context, parser.getToken())) { + expr = parseAsyncArrowAfterIdent(parser, context, privateScope, 1, start); + if (parser.getToken() === 18) + expr = parseSequenceExpression(parser, context, privateScope, 0, start, expr); + return parseExpressionStatement(parser, context, expr, start); + } + } + if (parser.getToken() === 67174411) { + expr = parseAsyncArrowOrCallExpression(parser, context, privateScope, expr, 1, 1, 0, asyncNewLine, start); + } else { + if (parser.getToken() === 10) { + classifyIdentifier(parser, context, token); + if ((token & 36864) === 36864) { + parser.flags |= 256; + } + expr = parseArrowFromIdentifier(parser, context | 2048, privateScope, parser.tokenValue, expr, 0, 1, 0, start); + } + parser.assignable = 1; + } + expr = parseMemberOrUpdateExpression(parser, context, privateScope, expr, 0, 0, start); + expr = parseAssignmentExpression(parser, context, privateScope, 0, 0, start, expr); + parser.assignable = 1; + if (parser.getToken() === 18) { + expr = parseSequenceExpression(parser, context, privateScope, 0, start, expr); + } + return parseExpressionStatement(parser, context, expr, start); +} +__name(parseAsyncArrowOrAsyncFunctionDeclaration, "parseAsyncArrowOrAsyncFunctionDeclaration"); +function parseDirective(parser, context, expression, token, start) { + const endIndex = parser.startIndex; + if (token !== 1074790417) { + parser.assignable = 2; + expression = parseMemberOrUpdateExpression(parser, context, void 0, expression, 0, 0, start); + if (parser.getToken() !== 1074790417) { + expression = parseAssignmentExpression(parser, context, void 0, 0, 0, start, expression); + if (parser.getToken() === 18) { + expression = parseSequenceExpression(parser, context, void 0, 0, start, expression); + } + } + matchOrInsertSemicolon(parser, context | 32); + } + const node = { + type: "ExpressionStatement", + expression + }; + if (expression.type === "Literal" && typeof expression.value === "string") { + node.directive = parser.source.slice(start.index + 1, endIndex - 1); + } + return parser.finishNode(node, start); +} +__name(parseDirective, "parseDirective"); +function parseEmptyStatement(parser, context) { + const start = parser.tokenStart; + nextToken(parser, context | 32); + return parser.finishNode({ + type: "EmptyStatement" + }, start); +} +__name(parseEmptyStatement, "parseEmptyStatement"); +function parseThrowStatement(parser, context, privateScope) { + const start = parser.tokenStart; + nextToken(parser, context | 32); + if (parser.flags & 1) + parser.report(90); + const argument = parseExpressions(parser, context, privateScope, 0, 1, parser.tokenStart); + matchOrInsertSemicolon(parser, context | 32); + return parser.finishNode({ + type: "ThrowStatement", + argument + }, start); +} +__name(parseThrowStatement, "parseThrowStatement"); +function parseIfStatement(parser, context, scope, privateScope, labels) { + const start = parser.tokenStart; + nextToken(parser, context); + consume(parser, context | 32, 67174411); + parser.assignable = 1; + const test = parseExpressions(parser, context, privateScope, 0, 1, parser.tokenStart); + consume(parser, context | 32, 16); + const consequent = parseConsequentOrAlternative(parser, context, scope, privateScope, labels); + let alternate = null; + if (parser.getToken() === 20563) { + nextToken(parser, context | 32); + alternate = parseConsequentOrAlternative(parser, context, scope, privateScope, labels); + } + return parser.finishNode({ + type: "IfStatement", + test, + consequent, + alternate + }, start); +} +__name(parseIfStatement, "parseIfStatement"); +function parseConsequentOrAlternative(parser, context, scope, privateScope, labels) { + const { tokenStart } = parser; + return context & 1 || !parser.options.webcompat || parser.getToken() !== 86104 ? parseStatement(parser, context, scope, privateScope, 0, { $: labels }, 0) : parseFunctionDeclaration(parser, context, scope == null ? void 0 : scope.createChildScope(), privateScope, 0, 0, 0, 0, tokenStart); +} +__name(parseConsequentOrAlternative, "parseConsequentOrAlternative"); +function parseSwitchStatement(parser, context, scope, privateScope, labels) { + const start = parser.tokenStart; + nextToken(parser, context); + consume(parser, context | 32, 67174411); + const discriminant = parseExpressions(parser, context, privateScope, 0, 1, parser.tokenStart); + consume(parser, context, 16); + consume(parser, context, 2162700); + const cases = []; + let seenDefault = 0; + scope = scope == null ? void 0 : scope.createChildScope(8); + while (parser.getToken() !== 1074790415) { + const { tokenStart } = parser; + let test = null; + const consequent = []; + if (consumeOpt(parser, context | 32, 20556)) { + test = parseExpressions(parser, context, privateScope, 0, 1, parser.tokenStart); + } else { + consume(parser, context | 32, 20561); + if (seenDefault) + parser.report(89); + seenDefault = 1; + } + consume(parser, context | 32, 21); + while (parser.getToken() !== 20556 && parser.getToken() !== 1074790415 && parser.getToken() !== 20561) { + consequent.push(parseStatementListItem(parser, context | 4, scope, privateScope, 2, { + $: labels + })); + } + cases.push(parser.finishNode({ + type: "SwitchCase", + test, + consequent + }, tokenStart)); + } + consume(parser, context | 32, 1074790415); + return parser.finishNode({ + type: "SwitchStatement", + discriminant, + cases + }, start); +} +__name(parseSwitchStatement, "parseSwitchStatement"); +function parseWhileStatement(parser, context, scope, privateScope, labels) { + const start = parser.tokenStart; + nextToken(parser, context); + consume(parser, context | 32, 67174411); + const test = parseExpressions(parser, context, privateScope, 0, 1, parser.tokenStart); + consume(parser, context | 32, 16); + const body = parseIterationStatementBody(parser, context, scope, privateScope, labels); + return parser.finishNode({ + type: "WhileStatement", + test, + body + }, start); +} +__name(parseWhileStatement, "parseWhileStatement"); +function parseIterationStatementBody(parser, context, scope, privateScope, labels) { + return parseStatement(parser, (context | 131072) ^ 131072 | 128, scope, privateScope, 0, { loop: 1, $: labels }, 0); +} +__name(parseIterationStatementBody, "parseIterationStatementBody"); +function parseContinueStatement(parser, context, labels) { + if ((context & 128) === 0) + parser.report(68); + const start = parser.tokenStart; + nextToken(parser, context); + let label = null; + if ((parser.flags & 1) === 0 && parser.getToken() & 143360) { + const { tokenValue } = parser; + label = parseIdentifier(parser, context | 32); + if (!isValidLabel(parser, labels, tokenValue, 1)) + parser.report(138, tokenValue); + } + matchOrInsertSemicolon(parser, context | 32); + return parser.finishNode({ + type: "ContinueStatement", + label + }, start); +} +__name(parseContinueStatement, "parseContinueStatement"); +function parseBreakStatement(parser, context, labels) { + const start = parser.tokenStart; + nextToken(parser, context | 32); + let label = null; + if ((parser.flags & 1) === 0 && parser.getToken() & 143360) { + const { tokenValue } = parser; + label = parseIdentifier(parser, context | 32); + if (!isValidLabel(parser, labels, tokenValue, 0)) + parser.report(138, tokenValue); + } else if ((context & (4 | 128)) === 0) { + parser.report(69); + } + matchOrInsertSemicolon(parser, context | 32); + return parser.finishNode({ + type: "BreakStatement", + label + }, start); +} +__name(parseBreakStatement, "parseBreakStatement"); +function parseWithStatement(parser, context, scope, privateScope, labels) { + const start = parser.tokenStart; + nextToken(parser, context); + if (context & 1) + parser.report(91); + consume(parser, context | 32, 67174411); + const object = parseExpressions(parser, context, privateScope, 0, 1, parser.tokenStart); + consume(parser, context | 32, 16); + const body = parseStatement(parser, context, scope, privateScope, 2, labels, 0); + return parser.finishNode({ + type: "WithStatement", + object, + body + }, start); +} +__name(parseWithStatement, "parseWithStatement"); +function parseDebuggerStatement(parser, context) { + const start = parser.tokenStart; + nextToken(parser, context | 32); + matchOrInsertSemicolon(parser, context | 32); + return parser.finishNode({ + type: "DebuggerStatement" + }, start); +} +__name(parseDebuggerStatement, "parseDebuggerStatement"); +function parseTryStatement(parser, context, scope, privateScope, labels) { + const start = parser.tokenStart; + nextToken(parser, context | 32); + const firstScope = scope == null ? void 0 : scope.createChildScope(16); + const block = parseBlock(parser, context, firstScope, privateScope, { $: labels }); + const { tokenStart } = parser; + const handler = consumeOpt(parser, context | 32, 20557) ? parseCatchBlock(parser, context, scope, privateScope, labels, tokenStart) : null; + let finalizer = null; + if (parser.getToken() === 20566) { + nextToken(parser, context | 32); + const finalizerScope = scope == null ? void 0 : scope.createChildScope(4); + const block2 = parseBlock(parser, context, finalizerScope, privateScope, { $: labels }); + finalizer = block2; + } + if (!handler && !finalizer) { + parser.report(88); + } + return parser.finishNode({ + type: "TryStatement", + block, + handler, + finalizer + }, start); +} +__name(parseTryStatement, "parseTryStatement"); +function parseCatchBlock(parser, context, scope, privateScope, labels, start) { + let param = null; + let additionalScope = scope; + if (consumeOpt(parser, context, 67174411)) { + scope = scope == null ? void 0 : scope.createChildScope(4); + param = parseBindingPattern(parser, context, scope, privateScope, (parser.getToken() & 2097152) === 2097152 ? 256 : 512, 0); + if (parser.getToken() === 18) { + parser.report(86); + } else if (parser.getToken() === 1077936155) { + parser.report(87); + } + consume(parser, context | 32, 16); + } + additionalScope = scope == null ? void 0 : scope.createChildScope(32); + const body = parseBlock(parser, context, additionalScope, privateScope, { $: labels }); + return parser.finishNode({ + type: "CatchClause", + param, + body + }, start); +} +__name(parseCatchBlock, "parseCatchBlock"); +function parseStaticBlock(parser, context, scope, privateScope, start) { + scope = scope == null ? void 0 : scope.createChildScope(); + const ctorContext = 512 | 4096 | 1024 | 4 | 128; + context = (context | ctorContext) ^ ctorContext | 256 | 2048 | 524288 | 65536; + return parseBlock(parser, context, scope, privateScope, {}, start, "StaticBlock"); +} +__name(parseStaticBlock, "parseStaticBlock"); +function parseDoWhileStatement(parser, context, scope, privateScope, labels) { + const start = parser.tokenStart; + nextToken(parser, context | 32); + const body = parseIterationStatementBody(parser, context, scope, privateScope, labels); + consume(parser, context, 20578); + consume(parser, context | 32, 67174411); + const test = parseExpressions(parser, context, privateScope, 0, 1, parser.tokenStart); + consume(parser, context | 32, 16); + consumeOpt(parser, context | 32, 1074790417); + return parser.finishNode({ + type: "DoWhileStatement", + body, + test + }, start); +} +__name(parseDoWhileStatement, "parseDoWhileStatement"); +function parseLetIdentOrVarDeclarationStatement(parser, context, scope, privateScope, origin) { + const { tokenValue, tokenStart } = parser; + const token = parser.getToken(); + let expr = parseIdentifier(parser, context); + if (parser.getToken() & (143360 | 2097152)) { + const declarations = parseVariableDeclarationList(parser, context, scope, privateScope, 8, 0); + matchOrInsertSemicolon(parser, context | 32); + return parser.finishNode({ + type: "VariableDeclaration", + kind: "let", + declarations + }, tokenStart); + } + parser.assignable = 1; + if (context & 1) + parser.report(85); + if (parser.getToken() === 21) { + return parseLabelledStatement(parser, context, scope, privateScope, origin, {}, tokenValue, expr, token, 0, tokenStart); + } + if (parser.getToken() === 10) { + let scope2 = void 0; + if (parser.options.lexical) + scope2 = createArrowHeadParsingScope(parser, context, tokenValue); + parser.flags = (parser.flags | 128) ^ 128; + expr = parseArrowFunctionExpression(parser, context, scope2, privateScope, [expr], 0, tokenStart); + } else { + expr = parseMemberOrUpdateExpression(parser, context, privateScope, expr, 0, 0, tokenStart); + expr = parseAssignmentExpression(parser, context, privateScope, 0, 0, tokenStart, expr); + } + if (parser.getToken() === 18) { + expr = parseSequenceExpression(parser, context, privateScope, 0, tokenStart, expr); + } + return parseExpressionStatement(parser, context, expr, tokenStart); +} +__name(parseLetIdentOrVarDeclarationStatement, "parseLetIdentOrVarDeclarationStatement"); +function parseLexicalDeclaration(parser, context, scope, privateScope, kind, origin) { + const start = parser.tokenStart; + nextToken(parser, context); + const declarations = parseVariableDeclarationList(parser, context, scope, privateScope, kind, origin); + matchOrInsertSemicolon(parser, context | 32); + return parser.finishNode({ + type: "VariableDeclaration", + kind: kind & 8 ? "let" : "const", + declarations + }, start); +} +__name(parseLexicalDeclaration, "parseLexicalDeclaration"); +function parseVariableStatement(parser, context, scope, privateScope, origin) { + const start = parser.tokenStart; + nextToken(parser, context); + const declarations = parseVariableDeclarationList(parser, context, scope, privateScope, 4, origin); + matchOrInsertSemicolon(parser, context | 32); + return parser.finishNode({ + type: "VariableDeclaration", + kind: "var", + declarations + }, start); +} +__name(parseVariableStatement, "parseVariableStatement"); +function parseVariableDeclarationList(parser, context, scope, privateScope, kind, origin) { + let bindingCount = 1; + const list = [ + parseVariableDeclaration(parser, context, scope, privateScope, kind, origin) + ]; + while (consumeOpt(parser, context, 18)) { + bindingCount++; + list.push(parseVariableDeclaration(parser, context, scope, privateScope, kind, origin)); + } + if (bindingCount > 1 && origin & 32 && parser.getToken() & 262144) { + parser.report(61, KeywordDescTable[parser.getToken() & 255]); + } + return list; +} +__name(parseVariableDeclarationList, "parseVariableDeclarationList"); +function parseVariableDeclaration(parser, context, scope, privateScope, kind, origin) { + const { tokenStart } = parser; + const token = parser.getToken(); + let init = null; + const id = parseBindingPattern(parser, context, scope, privateScope, kind, origin); + if (parser.getToken() === 1077936155) { + nextToken(parser, context | 32); + init = parseExpression(parser, context, privateScope, 1, 0, parser.tokenStart); + if (origin & 32 || (token & 2097152) === 0) { + if (parser.getToken() === 471156 || parser.getToken() === 8673330 && (token & 2097152 || (kind & 4) === 0 || context & 1)) { + throw new ParseError(tokenStart, parser.currentLocation, 60, parser.getToken() === 471156 ? "of" : "in"); + } + } + } else if ((kind & 16 || (token & 2097152) > 0) && (parser.getToken() & 262144) !== 262144) { + parser.report(59, kind & 16 ? "const" : "destructuring"); + } + return parser.finishNode({ + type: "VariableDeclarator", + id, + init + }, tokenStart); +} +__name(parseVariableDeclaration, "parseVariableDeclaration"); +function parseForStatement(parser, context, scope, privateScope, labels) { + const start = parser.tokenStart; + nextToken(parser, context); + const forAwait = ((context & 2048) > 0 || (context & 2) > 0 && (context & 8) > 0) && consumeOpt(parser, context, 209006); + consume(parser, context | 32, 67174411); + scope = scope == null ? void 0 : scope.createChildScope(1); + let test = null; + let update = null; + let destructible = 0; + let init = null; + let isVarDecl = parser.getToken() === 86088 || parser.getToken() === 241737 || parser.getToken() === 86090; + let right; + const { tokenStart } = parser; + const token = parser.getToken(); + if (isVarDecl) { + if (token === 241737) { + init = parseIdentifier(parser, context); + if (parser.getToken() & (143360 | 2097152)) { + if (parser.getToken() === 8673330) { + if (context & 1) + parser.report(67); + } else { + init = parser.finishNode({ + type: "VariableDeclaration", + kind: "let", + declarations: parseVariableDeclarationList(parser, context | 131072, scope, privateScope, 8, 32) + }, tokenStart); + } + parser.assignable = 1; + } else if (context & 1) { + parser.report(67); + } else { + isVarDecl = false; + parser.assignable = 1; + init = parseMemberOrUpdateExpression(parser, context, privateScope, init, 0, 0, tokenStart); + if (parser.getToken() === 471156) + parser.report(115); + } + } else { + nextToken(parser, context); + init = parser.finishNode(token === 86088 ? { + type: "VariableDeclaration", + kind: "var", + declarations: parseVariableDeclarationList(parser, context | 131072, scope, privateScope, 4, 32) + } : { + type: "VariableDeclaration", + kind: "const", + declarations: parseVariableDeclarationList(parser, context | 131072, scope, privateScope, 16, 32) + }, tokenStart); + parser.assignable = 1; + } + } else if (token === 1074790417) { + if (forAwait) + parser.report(82); + } else if ((token & 2097152) === 2097152) { + const patternStart = parser.tokenStart; + init = token === 2162700 ? parseObjectLiteralOrPattern(parser, context, void 0, privateScope, 1, 0, 0, 2, 32) : parseArrayExpressionOrPattern(parser, context, void 0, privateScope, 1, 0, 0, 2, 32); + destructible = parser.destructible; + if (destructible & 64) { + parser.report(63); + } + parser.assignable = destructible & 16 ? 2 : 1; + init = parseMemberOrUpdateExpression(parser, context | 131072, privateScope, init, 0, 0, patternStart); + } else { + init = parseLeftHandSideExpression(parser, context | 131072, privateScope, 1, 0, 1); + } + if ((parser.getToken() & 262144) === 262144) { + if (parser.getToken() === 471156) { + if (parser.assignable & 2) + parser.report(80, forAwait ? "await" : "of"); + reinterpretToPattern(parser, init); + nextToken(parser, context | 32); + right = parseExpression(parser, context, privateScope, 1, 0, parser.tokenStart); + consume(parser, context | 32, 16); + const body3 = parseIterationStatementBody(parser, context, scope, privateScope, labels); + return parser.finishNode({ + type: "ForOfStatement", + left: init, + right, + body: body3, + await: forAwait + }, start); + } + if (parser.assignable & 2) + parser.report(80, "in"); + reinterpretToPattern(parser, init); + nextToken(parser, context | 32); + if (forAwait) + parser.report(82); + right = parseExpressions(parser, context, privateScope, 0, 1, parser.tokenStart); + consume(parser, context | 32, 16); + const body2 = parseIterationStatementBody(parser, context, scope, privateScope, labels); + return parser.finishNode({ + type: "ForInStatement", + body: body2, + left: init, + right + }, start); + } + if (forAwait) + parser.report(82); + if (!isVarDecl) { + if (destructible & 8 && parser.getToken() !== 1077936155) { + parser.report(80, "loop"); + } + init = parseAssignmentExpression(parser, context | 131072, privateScope, 0, 0, tokenStart, init); + } + if (parser.getToken() === 18) + init = parseSequenceExpression(parser, context, privateScope, 0, tokenStart, init); + consume(parser, context | 32, 1074790417); + if (parser.getToken() !== 1074790417) + test = parseExpressions(parser, context, privateScope, 0, 1, parser.tokenStart); + consume(parser, context | 32, 1074790417); + if (parser.getToken() !== 16) + update = parseExpressions(parser, context, privateScope, 0, 1, parser.tokenStart); + consume(parser, context | 32, 16); + const body = parseIterationStatementBody(parser, context, scope, privateScope, labels); + return parser.finishNode({ + type: "ForStatement", + init, + test, + update, + body + }, start); +} +__name(parseForStatement, "parseForStatement"); +function parseRestrictedIdentifier(parser, context, scope) { + if (!isValidIdentifier(context, parser.getToken())) + parser.report(118); + if ((parser.getToken() & 537079808) === 537079808) + parser.report(119); + scope == null ? void 0 : scope.addBlockName(context, parser.tokenValue, 8, 0); + return parseIdentifier(parser, context); +} +__name(parseRestrictedIdentifier, "parseRestrictedIdentifier"); +function parseImportDeclaration(parser, context, scope) { + const start = parser.tokenStart; + nextToken(parser, context); + let source = null; + const { tokenStart } = parser; + let specifiers = []; + if (parser.getToken() === 134283267) { + source = parseLiteral(parser, context); + } else { + if (parser.getToken() & 143360) { + const local = parseRestrictedIdentifier(parser, context, scope); + specifiers = [ + parser.finishNode({ + type: "ImportDefaultSpecifier", + local + }, tokenStart) + ]; + if (consumeOpt(parser, context, 18)) { + switch (parser.getToken()) { + case 8391476: + specifiers.push(parseImportNamespaceSpecifier(parser, context, scope)); + break; + case 2162700: + parseImportSpecifierOrNamedImports(parser, context, scope, specifiers); + break; + default: + parser.report(107); + } + } + } else { + switch (parser.getToken()) { + case 8391476: + specifiers = [parseImportNamespaceSpecifier(parser, context, scope)]; + break; + case 2162700: + parseImportSpecifierOrNamedImports(parser, context, scope, specifiers); + break; + case 67174411: + return parseImportCallDeclaration(parser, context, void 0, start); + case 67108877: + return parseImportMetaDeclaration(parser, context, start); + default: + parser.report(30, KeywordDescTable[parser.getToken() & 255]); + } + } + source = parseModuleSpecifier(parser, context); + } + const attributes = parseImportAttributes(parser, context); + const node = { + type: "ImportDeclaration", + specifiers, + source, + attributes + }; + matchOrInsertSemicolon(parser, context | 32); + return parser.finishNode(node, start); +} +__name(parseImportDeclaration, "parseImportDeclaration"); +function parseImportNamespaceSpecifier(parser, context, scope) { + const { tokenStart } = parser; + nextToken(parser, context); + consume(parser, context, 77932); + if ((parser.getToken() & 134217728) === 134217728) { + throw new ParseError(tokenStart, parser.currentLocation, 30, KeywordDescTable[parser.getToken() & 255]); + } + return parser.finishNode({ + type: "ImportNamespaceSpecifier", + local: parseRestrictedIdentifier(parser, context, scope) + }, tokenStart); +} +__name(parseImportNamespaceSpecifier, "parseImportNamespaceSpecifier"); +function parseModuleSpecifier(parser, context) { + consume(parser, context, 209011); + if (parser.getToken() !== 134283267) + parser.report(105, "Import"); + return parseLiteral(parser, context); +} +__name(parseModuleSpecifier, "parseModuleSpecifier"); +function parseImportSpecifierOrNamedImports(parser, context, scope, specifiers) { + nextToken(parser, context); + while (parser.getToken() & 143360 || parser.getToken() === 134283267) { + let { tokenValue, tokenStart } = parser; + const token = parser.getToken(); + const imported = parseModuleExportName(parser, context); + let local; + if (consumeOpt(parser, context, 77932)) { + if ((parser.getToken() & 134217728) === 134217728 || parser.getToken() === 18) { + parser.report(106); + } else { + validateBindingIdentifier(parser, context, 16, parser.getToken(), 0); + } + tokenValue = parser.tokenValue; + local = parseIdentifier(parser, context); + } else if (imported.type === "Identifier") { + validateBindingIdentifier(parser, context, 16, token, 0); + local = imported; + } else { + parser.report(25, KeywordDescTable[77932 & 255]); + } + scope == null ? void 0 : scope.addBlockName(context, tokenValue, 8, 0); + specifiers.push(parser.finishNode({ + type: "ImportSpecifier", + local, + imported + }, tokenStart)); + if (parser.getToken() !== 1074790415) + consume(parser, context, 18); + } + consume(parser, context, 1074790415); + return specifiers; +} +__name(parseImportSpecifierOrNamedImports, "parseImportSpecifierOrNamedImports"); +function parseImportMetaDeclaration(parser, context, start) { + let expr = parseImportMetaExpression(parser, context, parser.finishNode({ + type: "Identifier", + name: "import" + }, start), start); + expr = parseMemberOrUpdateExpression(parser, context, void 0, expr, 0, 0, start); + expr = parseAssignmentExpression(parser, context, void 0, 0, 0, start, expr); + if (parser.getToken() === 18) { + expr = parseSequenceExpression(parser, context, void 0, 0, start, expr); + } + return parseExpressionStatement(parser, context, expr, start); +} +__name(parseImportMetaDeclaration, "parseImportMetaDeclaration"); +function parseImportCallDeclaration(parser, context, privateScope, start) { + let expr = parseImportExpression(parser, context, privateScope, 0, start); + expr = parseMemberOrUpdateExpression(parser, context, privateScope, expr, 0, 0, start); + if (parser.getToken() === 18) { + expr = parseSequenceExpression(parser, context, privateScope, 0, start, expr); + } + return parseExpressionStatement(parser, context, expr, start); +} +__name(parseImportCallDeclaration, "parseImportCallDeclaration"); +function parseExportDeclaration(parser, context, scope) { + const start = parser.leadingDecorators.decorators.length ? parser.leadingDecorators.start : parser.tokenStart; + nextToken(parser, context | 32); + const specifiers = []; + let declaration = null; + let source = null; + let attributes = []; + if (consumeOpt(parser, context | 32, 20561)) { + switch (parser.getToken()) { + case 86104: { + declaration = parseFunctionDeclaration(parser, context, scope, void 0, 4, 1, 1, 0, parser.tokenStart); + break; + } + case 132: + case 86094: + declaration = parseClassDeclaration(parser, context, scope, void 0, 1); + break; + case 209005: { + const { tokenStart } = parser; + declaration = parseIdentifier(parser, context); + const { flags } = parser; + if ((flags & 1) === 0) { + if (parser.getToken() === 86104) { + declaration = parseFunctionDeclaration(parser, context, scope, void 0, 4, 1, 1, 1, tokenStart); + } else { + if (parser.getToken() === 67174411) { + declaration = parseAsyncArrowOrCallExpression(parser, context, void 0, declaration, 1, 1, 0, flags, tokenStart); + declaration = parseMemberOrUpdateExpression(parser, context, void 0, declaration, 0, 0, tokenStart); + declaration = parseAssignmentExpression(parser, context, void 0, 0, 0, tokenStart, declaration); + } else if (parser.getToken() & 143360) { + if (scope) + scope = createArrowHeadParsingScope(parser, context, parser.tokenValue); + declaration = parseIdentifier(parser, context); + declaration = parseArrowFunctionExpression(parser, context, scope, void 0, [declaration], 1, tokenStart); + } + } + } + break; + } + default: + declaration = parseExpression(parser, context, void 0, 1, 0, parser.tokenStart); + matchOrInsertSemicolon(parser, context | 32); + } + if (scope) + parser.declareUnboundVariable("default"); + return parser.finishNode({ + type: "ExportDefaultDeclaration", + declaration + }, start); + } + switch (parser.getToken()) { + case 8391476: { + nextToken(parser, context); + let exported = null; + const isNamedDeclaration = consumeOpt(parser, context, 77932); + if (isNamedDeclaration) { + if (scope) + parser.declareUnboundVariable(parser.tokenValue); + exported = parseModuleExportName(parser, context); + } + consume(parser, context, 209011); + if (parser.getToken() !== 134283267) + parser.report(105, "Export"); + source = parseLiteral(parser, context); + const attributes2 = parseImportAttributes(parser, context); + const node2 = { + type: "ExportAllDeclaration", + source, + exported, + attributes: attributes2 + }; + matchOrInsertSemicolon(parser, context | 32); + return parser.finishNode(node2, start); + } + case 2162700: { + nextToken(parser, context); + const tmpExportedNames = []; + const tmpExportedBindings = []; + let hasLiteralLocal = 0; + while (parser.getToken() & 143360 || parser.getToken() === 134283267) { + const { tokenStart, tokenValue } = parser; + const local = parseModuleExportName(parser, context); + if (local.type === "Literal") { + hasLiteralLocal = 1; + } + let exported; + if (parser.getToken() === 77932) { + nextToken(parser, context); + if ((parser.getToken() & 143360) === 0 && parser.getToken() !== 134283267) { + parser.report(106); + } + if (scope) { + tmpExportedNames.push(parser.tokenValue); + tmpExportedBindings.push(tokenValue); + } + exported = parseModuleExportName(parser, context); + } else { + if (scope) { + tmpExportedNames.push(parser.tokenValue); + tmpExportedBindings.push(parser.tokenValue); + } + exported = local; + } + specifiers.push(parser.finishNode({ + type: "ExportSpecifier", + local, + exported + }, tokenStart)); + if (parser.getToken() !== 1074790415) + consume(parser, context, 18); + } + consume(parser, context, 1074790415); + if (consumeOpt(parser, context, 209011)) { + if (parser.getToken() !== 134283267) + parser.report(105, "Export"); + source = parseLiteral(parser, context); + attributes = parseImportAttributes(parser, context); + if (scope) { + tmpExportedNames.forEach((n) => parser.declareUnboundVariable(n)); + } + } else { + if (hasLiteralLocal) { + parser.report(172); + } + if (scope) { + tmpExportedNames.forEach((n) => parser.declareUnboundVariable(n)); + tmpExportedBindings.forEach((b) => parser.addBindingToExports(b)); + } + } + matchOrInsertSemicolon(parser, context | 32); + break; + } + case 132: + case 86094: + declaration = parseClassDeclaration(parser, context, scope, void 0, 2); + break; + case 86104: + declaration = parseFunctionDeclaration(parser, context, scope, void 0, 4, 1, 2, 0, parser.tokenStart); + break; + case 241737: + declaration = parseLexicalDeclaration(parser, context, scope, void 0, 8, 64); + break; + case 86090: + declaration = parseLexicalDeclaration(parser, context, scope, void 0, 16, 64); + break; + case 86088: + declaration = parseVariableStatement(parser, context, scope, void 0, 64); + break; + case 209005: { + const { tokenStart } = parser; + nextToken(parser, context); + if ((parser.flags & 1) === 0 && parser.getToken() === 86104) { + declaration = parseFunctionDeclaration(parser, context, scope, void 0, 4, 1, 2, 1, tokenStart); + break; + } + } + default: + parser.report(30, KeywordDescTable[parser.getToken() & 255]); + } + const node = { + type: "ExportNamedDeclaration", + declaration, + specifiers, + source, + attributes + }; + return parser.finishNode(node, start); +} +__name(parseExportDeclaration, "parseExportDeclaration"); +function parseExpression(parser, context, privateScope, canAssign, inGroup, start) { + let expr = parsePrimaryExpression(parser, context, privateScope, 2, 0, canAssign, inGroup, 1, start); + expr = parseMemberOrUpdateExpression(parser, context, privateScope, expr, inGroup, 0, start); + return parseAssignmentExpression(parser, context, privateScope, inGroup, 0, start, expr); +} +__name(parseExpression, "parseExpression"); +function parseSequenceExpression(parser, context, privateScope, inGroup, start, expr) { + const expressions = [expr]; + while (consumeOpt(parser, context | 32, 18)) { + expressions.push(parseExpression(parser, context, privateScope, 1, inGroup, parser.tokenStart)); + } + return parser.finishNode({ + type: "SequenceExpression", + expressions + }, start); +} +__name(parseSequenceExpression, "parseSequenceExpression"); +function parseExpressions(parser, context, privateScope, inGroup, canAssign, start) { + const expr = parseExpression(parser, context, privateScope, canAssign, inGroup, start); + return parser.getToken() === 18 ? parseSequenceExpression(parser, context, privateScope, inGroup, start, expr) : expr; +} +__name(parseExpressions, "parseExpressions"); +function parseAssignmentExpression(parser, context, privateScope, inGroup, isPattern, start, left) { + const token = parser.getToken(); + if ((token & 4194304) === 4194304) { + if (parser.assignable & 2) + parser.report(26); + if (!isPattern && token === 1077936155 && left.type === "ArrayExpression" || left.type === "ObjectExpression") { + reinterpretToPattern(parser, left); + } + nextToken(parser, context | 32); + const right = parseExpression(parser, context, privateScope, 1, inGroup, parser.tokenStart); + parser.assignable = 2; + return parser.finishNode(isPattern ? { + type: "AssignmentPattern", + left, + right + } : { + type: "AssignmentExpression", + left, + operator: KeywordDescTable[token & 255], + right + }, start); + } + if ((token & 8388608) === 8388608) { + left = parseBinaryExpression(parser, context, privateScope, inGroup, start, 4, token, left); + } + if (consumeOpt(parser, context | 32, 22)) { + left = parseConditionalExpression(parser, context, privateScope, left, start); + } + return left; +} +__name(parseAssignmentExpression, "parseAssignmentExpression"); +function parseAssignmentExpressionOrPattern(parser, context, privateScope, inGroup, isPattern, start, left) { + const token = parser.getToken(); + nextToken(parser, context | 32); + const right = parseExpression(parser, context, privateScope, 1, inGroup, parser.tokenStart); + left = parser.finishNode(isPattern ? { + type: "AssignmentPattern", + left, + right + } : { + type: "AssignmentExpression", + left, + operator: KeywordDescTable[token & 255], + right + }, start); + parser.assignable = 2; + return left; +} +__name(parseAssignmentExpressionOrPattern, "parseAssignmentExpressionOrPattern"); +function parseConditionalExpression(parser, context, privateScope, test, start) { + const consequent = parseExpression(parser, (context | 131072) ^ 131072, privateScope, 1, 0, parser.tokenStart); + consume(parser, context | 32, 21); + parser.assignable = 1; + const alternate = parseExpression(parser, context, privateScope, 1, 0, parser.tokenStart); + parser.assignable = 2; + return parser.finishNode({ + type: "ConditionalExpression", + test, + consequent, + alternate + }, start); +} +__name(parseConditionalExpression, "parseConditionalExpression"); +function parseBinaryExpression(parser, context, privateScope, inGroup, start, minPrecedence, operator, left) { + const bit = -((context & 131072) > 0) & 8673330; + let t; + let precedence; + parser.assignable = 2; + while (parser.getToken() & 8388608) { + t = parser.getToken(); + precedence = t & 3840; + if (t & 524288 && operator & 268435456 || operator & 524288 && t & 268435456) { + parser.report(165); + } + if (precedence + ((t === 8391735) << 8) - ((bit === t) << 12) <= minPrecedence) + break; + nextToken(parser, context | 32); + left = parser.finishNode({ + type: t & 524288 || t & 268435456 ? "LogicalExpression" : "BinaryExpression", + left, + right: parseBinaryExpression(parser, context, privateScope, inGroup, parser.tokenStart, precedence, t, parseLeftHandSideExpression(parser, context, privateScope, 0, inGroup, 1)), + operator: KeywordDescTable[t & 255] + }, start); + } + if (parser.getToken() === 1077936155) + parser.report(26); + return left; +} +__name(parseBinaryExpression, "parseBinaryExpression"); +function parseUnaryExpression(parser, context, privateScope, isLHS, inGroup) { + if (!isLHS) + parser.report(0); + const { tokenStart } = parser; + const unaryOperator = parser.getToken(); + nextToken(parser, context | 32); + const arg = parseLeftHandSideExpression(parser, context, privateScope, 0, inGroup, 1); + if (parser.getToken() === 8391735) + parser.report(33); + if (context & 1 && unaryOperator === 16863276) { + if (arg.type === "Identifier") { + parser.report(121); + } else if (isPropertyWithPrivateFieldKey(arg)) { + parser.report(127); + } + } + parser.assignable = 2; + return parser.finishNode({ + type: "UnaryExpression", + operator: KeywordDescTable[unaryOperator & 255], + argument: arg, + prefix: true + }, tokenStart); +} +__name(parseUnaryExpression, "parseUnaryExpression"); +function parseAsyncExpression(parser, context, privateScope, inGroup, isLHS, canAssign, inNew, start) { + const token = parser.getToken(); + const expr = parseIdentifier(parser, context); + const { flags } = parser; + if ((flags & 1) === 0) { + if (parser.getToken() === 86104) { + return parseFunctionExpression(parser, context, privateScope, 1, inGroup, start); + } + if (isValidIdentifier(context, parser.getToken())) { + if (!isLHS) + parser.report(0); + if ((parser.getToken() & 36864) === 36864) { + parser.flags |= 256; + } + return parseAsyncArrowAfterIdent(parser, context, privateScope, canAssign, start); + } + } + if (!inNew && parser.getToken() === 67174411) { + return parseAsyncArrowOrCallExpression(parser, context, privateScope, expr, canAssign, 1, 0, flags, start); + } + if (parser.getToken() === 10) { + classifyIdentifier(parser, context, token); + if (inNew) + parser.report(51); + if ((token & 36864) === 36864) { + parser.flags |= 256; + } + return parseArrowFromIdentifier(parser, context, privateScope, parser.tokenValue, expr, inNew, canAssign, 0, start); + } + parser.assignable = 1; + return expr; +} +__name(parseAsyncExpression, "parseAsyncExpression"); +function parseYieldExpressionOrIdentifier(parser, context, privateScope, inGroup, canAssign, start) { + if (inGroup) + parser.destructible |= 256; + if (context & 1024) { + nextToken(parser, context | 32); + if (context & 8192) + parser.report(32); + if (!canAssign) + parser.report(26); + if (parser.getToken() === 22) + parser.report(124); + let argument = null; + let delegate = false; + if ((parser.flags & 1) === 0) { + delegate = consumeOpt(parser, context | 32, 8391476); + if (parser.getToken() & (12288 | 65536) || delegate) { + argument = parseExpression(parser, context, privateScope, 1, 0, parser.tokenStart); + } + } else if (parser.getToken() === 8391476) { + parser.report(30, KeywordDescTable[parser.getToken() & 255]); + } + parser.assignable = 2; + return parser.finishNode({ + type: "YieldExpression", + argument, + delegate + }, start); + } + if (context & 1) + parser.report(97, "yield"); + return parseIdentifierOrArrow(parser, context, privateScope); +} +__name(parseYieldExpressionOrIdentifier, "parseYieldExpressionOrIdentifier"); +function parseAwaitExpressionOrIdentifier(parser, context, privateScope, inNew, inGroup, start) { + if (inGroup) + parser.destructible |= 128; + if (context & 524288) + parser.report(177); + const possibleIdentifierOrArrowFunc = parseIdentifierOrArrow(parser, context, privateScope); + const isIdentifier = possibleIdentifierOrArrowFunc.type === "ArrowFunctionExpression" || (parser.getToken() & 65536) === 0; + if (isIdentifier) { + if (context & 2048) + throw new ParseError(start, { index: parser.startIndex, line: parser.startLine, column: parser.startColumn }, 176); + if (context & 2) + throw new ParseError(start, { index: parser.startIndex, line: parser.startLine, column: parser.startColumn }, 110); + if (context & 8192 && context & 2048) + throw new ParseError(start, { index: parser.startIndex, line: parser.startLine, column: parser.startColumn }, 110); + return possibleIdentifierOrArrowFunc; + } + if (context & 8192) { + throw new ParseError(start, { index: parser.startIndex, line: parser.startLine, column: parser.startColumn }, 31); + } + if (context & 2048 || context & 2 && context & 8) { + if (inNew) + throw new ParseError(start, { index: parser.startIndex, line: parser.startLine, column: parser.startColumn }, 0); + const argument = parseLeftHandSideExpression(parser, context, privateScope, 0, 0, 1); + if (parser.getToken() === 8391735) + parser.report(33); + parser.assignable = 2; + return parser.finishNode({ + type: "AwaitExpression", + argument + }, start); + } + if (context & 2) + throw new ParseError(start, { index: parser.startIndex, line: parser.startLine, column: parser.startColumn }, 98); + return possibleIdentifierOrArrowFunc; +} +__name(parseAwaitExpressionOrIdentifier, "parseAwaitExpressionOrIdentifier"); +function parseFunctionBody(parser, context, scope, privateScope, origin, funcNameToken, functionScope) { + const { tokenStart } = parser; + consume(parser, context | 32, 2162700); + const body = []; + if (parser.getToken() !== 1074790415) { + while (parser.getToken() === 134283267) { + const { index, tokenStart: tokenStart2, tokenIndex, tokenValue } = parser; + const token = parser.getToken(); + const expr = parseLiteral(parser, context); + if (isValidStrictMode(parser, index, tokenIndex, tokenValue)) { + context |= 1; + if (parser.flags & 128) { + throw new ParseError(tokenStart2, parser.currentLocation, 66); + } + if (parser.flags & 64) { + throw new ParseError(tokenStart2, parser.currentLocation, 9); + } + if (parser.flags & 4096) { + throw new ParseError(tokenStart2, parser.currentLocation, 15); + } + functionScope == null ? void 0 : functionScope.reportScopeError(); + } + body.push(parseDirective(parser, context, expr, token, tokenStart2)); + } + if (context & 1) { + if (funcNameToken) { + if ((funcNameToken & 537079808) === 537079808) { + parser.report(119); + } + if ((funcNameToken & 36864) === 36864) { + parser.report(40); + } + } + if (parser.flags & 512) + parser.report(119); + if (parser.flags & 256) + parser.report(118); + } + } + parser.flags = (parser.flags | 512 | 256 | 64 | 4096) ^ (512 | 256 | 64 | 4096); + parser.destructible = (parser.destructible | 256) ^ 256; + while (parser.getToken() !== 1074790415) { + body.push(parseStatementListItem(parser, context, scope, privateScope, 4, {})); + } + consume(parser, origin & (16 | 8) ? context | 32 : context, 1074790415); + parser.flags &= -4289; + if (parser.getToken() === 1077936155) + parser.report(26); + return parser.finishNode({ + type: "BlockStatement", + body + }, tokenStart); +} +__name(parseFunctionBody, "parseFunctionBody"); +function parseSuperExpression(parser, context) { + const { tokenStart } = parser; + nextToken(parser, context); + switch (parser.getToken()) { + case 67108990: + parser.report(167); + case 67174411: { + if ((context & 512) === 0) + parser.report(28); + parser.assignable = 2; + break; + } + case 69271571: + case 67108877: { + if ((context & 256) === 0) + parser.report(29); + parser.assignable = 1; + break; + } + default: + parser.report(30, "super"); + } + return parser.finishNode({ type: "Super" }, tokenStart); +} +__name(parseSuperExpression, "parseSuperExpression"); +function parseLeftHandSideExpression(parser, context, privateScope, canAssign, inGroup, isLHS) { + const start = parser.tokenStart; + const expression = parsePrimaryExpression(parser, context, privateScope, 2, 0, canAssign, inGroup, isLHS, start); + return parseMemberOrUpdateExpression(parser, context, privateScope, expression, inGroup, 0, start); +} +__name(parseLeftHandSideExpression, "parseLeftHandSideExpression"); +function parseUpdateExpression(parser, context, expr, start) { + if (parser.assignable & 2) + parser.report(55); + const token = parser.getToken(); + nextToken(parser, context); + parser.assignable = 2; + return parser.finishNode({ + type: "UpdateExpression", + argument: expr, + operator: KeywordDescTable[token & 255], + prefix: false + }, start); +} +__name(parseUpdateExpression, "parseUpdateExpression"); +function parseMemberOrUpdateExpression(parser, context, privateScope, expr, inGroup, inChain, start) { + if ((parser.getToken() & 33619968) === 33619968 && (parser.flags & 1) === 0) { + expr = parseUpdateExpression(parser, context, expr, start); + } else if ((parser.getToken() & 67108864) === 67108864) { + context = (context | 131072) ^ 131072; + switch (parser.getToken()) { + case 67108877: { + nextToken(parser, (context | 262144 | 8) ^ 8); + if (context & 16 && parser.getToken() === 130 && parser.tokenValue === "super") { + parser.report(173); + } + parser.assignable = 1; + const property = parsePropertyOrPrivatePropertyName(parser, context | 64, privateScope); + expr = parser.finishNode({ + type: "MemberExpression", + object: expr, + computed: false, + property, + optional: false + }, start); + break; + } + case 69271571: { + let restoreHasOptionalChaining = false; + if ((parser.flags & 2048) === 2048) { + restoreHasOptionalChaining = true; + parser.flags = (parser.flags | 2048) ^ 2048; + } + nextToken(parser, context | 32); + const { tokenStart } = parser; + const property = parseExpressions(parser, context, privateScope, inGroup, 1, tokenStart); + consume(parser, context, 20); + parser.assignable = 1; + expr = parser.finishNode({ + type: "MemberExpression", + object: expr, + computed: true, + property, + optional: false + }, start); + if (restoreHasOptionalChaining) { + parser.flags |= 2048; + } + break; + } + case 67174411: { + if ((parser.flags & 1024) === 1024) { + parser.flags = (parser.flags | 1024) ^ 1024; + return expr; + } + let restoreHasOptionalChaining = false; + if ((parser.flags & 2048) === 2048) { + restoreHasOptionalChaining = true; + parser.flags = (parser.flags | 2048) ^ 2048; + } + const args = parseArguments(parser, context, privateScope, inGroup); + parser.assignable = 2; + expr = parser.finishNode({ + type: "CallExpression", + callee: expr, + arguments: args, + optional: false + }, start); + if (restoreHasOptionalChaining) { + parser.flags |= 2048; + } + break; + } + case 67108990: { + nextToken(parser, (context | 262144 | 8) ^ 8); + parser.flags |= 2048; + parser.assignable = 2; + expr = parseOptionalChain(parser, context, privateScope, expr, start); + break; + } + default: + if ((parser.flags & 2048) === 2048) { + parser.report(166); + } + parser.assignable = 2; + expr = parser.finishNode({ + type: "TaggedTemplateExpression", + tag: expr, + quasi: parser.getToken() === 67174408 ? parseTemplate(parser, context | 64, privateScope) : parseTemplateLiteral(parser, context) + }, start); + } + expr = parseMemberOrUpdateExpression(parser, context, privateScope, expr, 0, 1, start); + } + if (inChain === 0 && (parser.flags & 2048) === 2048) { + parser.flags = (parser.flags | 2048) ^ 2048; + expr = parser.finishNode({ + type: "ChainExpression", + expression: expr + }, start); + } + return expr; +} +__name(parseMemberOrUpdateExpression, "parseMemberOrUpdateExpression"); +function parseOptionalChain(parser, context, privateScope, expr, start) { + let restoreHasOptionalChaining = false; + let node; + if (parser.getToken() === 69271571 || parser.getToken() === 67174411) { + if ((parser.flags & 2048) === 2048) { + restoreHasOptionalChaining = true; + parser.flags = (parser.flags | 2048) ^ 2048; + } + } + if (parser.getToken() === 69271571) { + nextToken(parser, context | 32); + const { tokenStart } = parser; + const property = parseExpressions(parser, context, privateScope, 0, 1, tokenStart); + consume(parser, context, 20); + parser.assignable = 2; + node = parser.finishNode({ + type: "MemberExpression", + object: expr, + computed: true, + optional: true, + property + }, start); + } else if (parser.getToken() === 67174411) { + const args = parseArguments(parser, context, privateScope, 0); + parser.assignable = 2; + node = parser.finishNode({ + type: "CallExpression", + callee: expr, + arguments: args, + optional: true + }, start); + } else { + const property = parsePropertyOrPrivatePropertyName(parser, context, privateScope); + parser.assignable = 2; + node = parser.finishNode({ + type: "MemberExpression", + object: expr, + computed: false, + optional: true, + property + }, start); + } + if (restoreHasOptionalChaining) { + parser.flags |= 2048; + } + return node; +} +__name(parseOptionalChain, "parseOptionalChain"); +function parsePropertyOrPrivatePropertyName(parser, context, privateScope) { + if ((parser.getToken() & 143360) === 0 && parser.getToken() !== -2147483528 && parser.getToken() !== -2147483527 && parser.getToken() !== 130) { + parser.report(160); + } + return parser.getToken() === 130 ? parsePrivateIdentifier(parser, context, privateScope, 0) : parseIdentifier(parser, context); +} +__name(parsePropertyOrPrivatePropertyName, "parsePropertyOrPrivatePropertyName"); +function parseUpdateExpressionPrefixed(parser, context, privateScope, inNew, isLHS, start) { + if (inNew) + parser.report(56); + if (!isLHS) + parser.report(0); + const token = parser.getToken(); + nextToken(parser, context | 32); + const arg = parseLeftHandSideExpression(parser, context, privateScope, 0, 0, 1); + if (parser.assignable & 2) { + parser.report(55); + } + parser.assignable = 2; + return parser.finishNode({ + type: "UpdateExpression", + argument: arg, + operator: KeywordDescTable[token & 255], + prefix: true + }, start); +} +__name(parseUpdateExpressionPrefixed, "parseUpdateExpressionPrefixed"); +function parsePrimaryExpression(parser, context, privateScope, kind, inNew, canAssign, inGroup, isLHS, start) { + if ((parser.getToken() & 143360) === 143360) { + switch (parser.getToken()) { + case 209006: + return parseAwaitExpressionOrIdentifier(parser, context, privateScope, inNew, inGroup, start); + case 241771: + return parseYieldExpressionOrIdentifier(parser, context, privateScope, inGroup, canAssign, start); + case 209005: + return parseAsyncExpression(parser, context, privateScope, inGroup, isLHS, canAssign, inNew, start); + } + const { tokenValue } = parser; + const token = parser.getToken(); + const expr = parseIdentifier(parser, context | 64); + if (parser.getToken() === 10) { + if (!isLHS) + parser.report(0); + classifyIdentifier(parser, context, token); + if ((token & 36864) === 36864) { + parser.flags |= 256; + } + return parseArrowFromIdentifier(parser, context, privateScope, tokenValue, expr, inNew, canAssign, 0, start); + } + if (context & 16 && !(context & 32768) && !(context & 8192) && parser.tokenValue === "arguments") + parser.report(130); + if ((token & 255) === (241737 & 255)) { + if (context & 1) + parser.report(113); + if (kind & (8 | 16)) + parser.report(100); + } + parser.assignable = context & 1 && (token & 537079808) === 537079808 ? 2 : 1; + return expr; + } + if ((parser.getToken() & 134217728) === 134217728) { + return parseLiteral(parser, context); + } + switch (parser.getToken()) { + case 33619993: + case 33619994: + return parseUpdateExpressionPrefixed(parser, context, privateScope, inNew, isLHS, start); + case 16863276: + case 16842798: + case 16842799: + case 25233968: + case 25233969: + case 16863275: + case 16863277: + return parseUnaryExpression(parser, context, privateScope, isLHS, inGroup); + case 86104: + return parseFunctionExpression(parser, context, privateScope, 0, inGroup, start); + case 2162700: + return parseObjectLiteral(parser, context, privateScope, canAssign ? 0 : 1, inGroup); + case 69271571: + return parseArrayLiteral(parser, context, privateScope, canAssign ? 0 : 1, inGroup); + case 67174411: + return parseParenthesizedExpression(parser, context | 64, privateScope, canAssign, 1, 0, start); + case 86021: + case 86022: + case 86023: + return parseNullOrTrueOrFalseLiteral(parser, context); + case 86111: + return parseThisExpression(parser, context); + case 65540: + return parseRegExpLiteral(parser, context); + case 132: + case 86094: + return parseClassExpression(parser, context, privateScope, inGroup, start); + case 86109: + return parseSuperExpression(parser, context); + case 67174409: + return parseTemplateLiteral(parser, context); + case 67174408: + return parseTemplate(parser, context, privateScope); + case 86107: + return parseNewExpression(parser, context, privateScope, inGroup); + case 134283388: + return parseBigIntLiteral(parser, context); + case 130: + return parsePrivateIdentifier(parser, context, privateScope, 0); + case 86106: + return parseImportCallOrMetaExpression(parser, context, privateScope, inNew, inGroup, start); + case 8456256: + if (parser.options.jsx) + return parseJSXRootElementOrFragment(parser, context, privateScope, 0, parser.tokenStart); + default: + if (isValidIdentifier(context, parser.getToken())) + return parseIdentifierOrArrow(parser, context, privateScope); + parser.report(30, KeywordDescTable[parser.getToken() & 255]); + } +} +__name(parsePrimaryExpression, "parsePrimaryExpression"); +function parseImportCallOrMetaExpression(parser, context, privateScope, inNew, inGroup, start) { + let expr = parseIdentifier(parser, context); + if (parser.getToken() === 67108877) { + return parseImportMetaExpression(parser, context, expr, start); + } + if (inNew) + parser.report(142); + expr = parseImportExpression(parser, context, privateScope, inGroup, start); + parser.assignable = 2; + return parseMemberOrUpdateExpression(parser, context, privateScope, expr, inGroup, 0, start); +} +__name(parseImportCallOrMetaExpression, "parseImportCallOrMetaExpression"); +function parseImportMetaExpression(parser, context, meta, start) { + if ((context & 2) === 0) + parser.report(169); + nextToken(parser, context); + const token = parser.getToken(); + if (token !== 209030 && parser.tokenValue !== "meta") { + parser.report(174); + } else if (token & -2147483648) { + parser.report(175); + } + parser.assignable = 2; + return parser.finishNode({ + type: "MetaProperty", + meta, + property: parseIdentifier(parser, context) + }, start); +} +__name(parseImportMetaExpression, "parseImportMetaExpression"); +function parseImportExpression(parser, context, privateScope, inGroup, start) { + consume(parser, context | 32, 67174411); + if (parser.getToken() === 14) + parser.report(143); + const source = parseExpression(parser, context, privateScope, 1, inGroup, parser.tokenStart); + let options = null; + if (parser.getToken() === 18) { + consume(parser, context, 18); + if (parser.getToken() !== 16) { + const expContext = (context | 131072) ^ 131072; + options = parseExpression(parser, expContext, privateScope, 1, inGroup, parser.tokenStart); + } + consumeOpt(parser, context, 18); + } + const node = { + type: "ImportExpression", + source, + options + }; + consume(parser, context, 16); + return parser.finishNode(node, start); +} +__name(parseImportExpression, "parseImportExpression"); +function parseImportAttributes(parser, context) { + if (!consumeOpt(parser, context, 20579)) + return []; + consume(parser, context, 2162700); + const attributes = []; + const keysContent = /* @__PURE__ */ new Set(); + while (parser.getToken() !== 1074790415) { + const start = parser.tokenStart; + const key = parseIdentifierOrStringLiteral(parser, context); + consume(parser, context, 21); + const value = parseStringLiteral(parser, context); + const keyContent = key.type === "Literal" ? key.value : key.name; + if (keysContent.has(keyContent)) { + parser.report(145, `${keyContent}`); + } + keysContent.add(keyContent); + attributes.push(parser.finishNode({ + type: "ImportAttribute", + key, + value + }, start)); + if (parser.getToken() !== 1074790415) { + consume(parser, context, 18); + } + } + consume(parser, context, 1074790415); + return attributes; +} +__name(parseImportAttributes, "parseImportAttributes"); +function parseStringLiteral(parser, context) { + if (parser.getToken() === 134283267) { + return parseLiteral(parser, context); + } else { + parser.report(30, KeywordDescTable[parser.getToken() & 255]); + } +} +__name(parseStringLiteral, "parseStringLiteral"); +function parseIdentifierOrStringLiteral(parser, context) { + if (parser.getToken() === 134283267) { + return parseLiteral(parser, context); + } else if (parser.getToken() & 143360) { + return parseIdentifier(parser, context); + } else { + parser.report(30, KeywordDescTable[parser.getToken() & 255]); + } +} +__name(parseIdentifierOrStringLiteral, "parseIdentifierOrStringLiteral"); +function validateStringWellFormed(parser, str) { + const len = str.length; + for (let i = 0; i < len; i++) { + const code = str.charCodeAt(i); + if ((code & 64512) !== 55296) + continue; + if (code > 56319 || ++i >= len || (str.charCodeAt(i) & 64512) !== 56320) { + parser.report(171, JSON.stringify(str.charAt(i--))); + } + } +} +__name(validateStringWellFormed, "validateStringWellFormed"); +function parseModuleExportName(parser, context) { + if (parser.getToken() === 134283267) { + validateStringWellFormed(parser, parser.tokenValue); + return parseLiteral(parser, context); + } else if (parser.getToken() & 143360) { + return parseIdentifier(parser, context); + } else { + parser.report(30, KeywordDescTable[parser.getToken() & 255]); + } +} +__name(parseModuleExportName, "parseModuleExportName"); +function parseBigIntLiteral(parser, context) { + const { tokenRaw, tokenValue, tokenStart } = parser; + nextToken(parser, context); + parser.assignable = 2; + const node = { + type: "Literal", + value: tokenValue, + bigint: String(tokenValue) + }; + if (parser.options.raw) { + node.raw = tokenRaw; + } + return parser.finishNode(node, tokenStart); +} +__name(parseBigIntLiteral, "parseBigIntLiteral"); +function parseTemplateLiteral(parser, context) { + parser.assignable = 2; + const { tokenValue, tokenRaw, tokenStart } = parser; + consume(parser, context, 67174409); + const quasis = [parseTemplateElement(parser, tokenValue, tokenRaw, tokenStart, true)]; + return parser.finishNode({ + type: "TemplateLiteral", + expressions: [], + quasis + }, tokenStart); +} +__name(parseTemplateLiteral, "parseTemplateLiteral"); +function parseTemplate(parser, context, privateScope) { + context = (context | 131072) ^ 131072; + const { tokenValue, tokenRaw, tokenStart } = parser; + consume(parser, context & -65 | 32, 67174408); + const quasis = [parseTemplateElement(parser, tokenValue, tokenRaw, tokenStart, false)]; + const expressions = [ + parseExpressions(parser, context & -65, privateScope, 0, 1, parser.tokenStart) + ]; + if (parser.getToken() !== 1074790415) + parser.report(83); + while (parser.setToken(scanTemplateTail(parser, context), true) !== 67174409) { + const { tokenValue: tokenValue2, tokenRaw: tokenRaw2, tokenStart: tokenStart2 } = parser; + consume(parser, context & -65 | 32, 67174408); + quasis.push(parseTemplateElement(parser, tokenValue2, tokenRaw2, tokenStart2, false)); + expressions.push(parseExpressions(parser, context, privateScope, 0, 1, parser.tokenStart)); + if (parser.getToken() !== 1074790415) + parser.report(83); + } + { + const { tokenValue: tokenValue2, tokenRaw: tokenRaw2, tokenStart: tokenStart2 } = parser; + consume(parser, context, 67174409); + quasis.push(parseTemplateElement(parser, tokenValue2, tokenRaw2, tokenStart2, true)); + } + return parser.finishNode({ + type: "TemplateLiteral", + expressions, + quasis + }, tokenStart); +} +__name(parseTemplate, "parseTemplate"); +function parseTemplateElement(parser, cooked, raw, start, tail) { + const node = parser.finishNode({ + type: "TemplateElement", + value: { + cooked, + raw + }, + tail + }, start); + const tailSize = tail ? 1 : 2; + if (parser.options.ranges) { + node.start += 1; + node.range[0] += 1; + node.end -= tailSize; + node.range[1] -= tailSize; + } + if (parser.options.loc) { + node.loc.start.column += 1; + node.loc.end.column -= tailSize; + } + return node; +} +__name(parseTemplateElement, "parseTemplateElement"); +function parseSpreadElement(parser, context, privateScope) { + const start = parser.tokenStart; + context = (context | 131072) ^ 131072; + consume(parser, context | 32, 14); + const argument = parseExpression(parser, context, privateScope, 1, 0, parser.tokenStart); + parser.assignable = 1; + return parser.finishNode({ + type: "SpreadElement", + argument + }, start); +} +__name(parseSpreadElement, "parseSpreadElement"); +function parseArguments(parser, context, privateScope, inGroup) { + nextToken(parser, context | 32); + const args = []; + if (parser.getToken() === 16) { + nextToken(parser, context | 64); + return args; + } + while (parser.getToken() !== 16) { + if (parser.getToken() === 14) { + args.push(parseSpreadElement(parser, context, privateScope)); + } else { + args.push(parseExpression(parser, context, privateScope, 1, inGroup, parser.tokenStart)); + } + if (parser.getToken() !== 18) + break; + nextToken(parser, context | 32); + if (parser.getToken() === 16) + break; + } + consume(parser, context | 64, 16); + return args; +} +__name(parseArguments, "parseArguments"); +function parseIdentifier(parser, context) { + const { tokenValue, tokenStart } = parser; + const allowRegex = tokenValue === "await" && (parser.getToken() & -2147483648) === 0; + nextToken(parser, context | (allowRegex ? 32 : 0)); + return parser.finishNode({ + type: "Identifier", + name: tokenValue + }, tokenStart); +} +__name(parseIdentifier, "parseIdentifier"); +function parseLiteral(parser, context) { + const { tokenValue, tokenRaw, tokenStart } = parser; + if (parser.getToken() === 134283388) { + return parseBigIntLiteral(parser, context); + } + nextToken(parser, context); + parser.assignable = 2; + return parser.finishNode(parser.options.raw ? { + type: "Literal", + value: tokenValue, + raw: tokenRaw + } : { + type: "Literal", + value: tokenValue + }, tokenStart); +} +__name(parseLiteral, "parseLiteral"); +function parseNullOrTrueOrFalseLiteral(parser, context) { + const start = parser.tokenStart; + const raw = KeywordDescTable[parser.getToken() & 255]; + const value = parser.getToken() === 86023 ? null : raw === "true"; + nextToken(parser, context); + parser.assignable = 2; + return parser.finishNode(parser.options.raw ? { + type: "Literal", + value, + raw + } : { + type: "Literal", + value + }, start); +} +__name(parseNullOrTrueOrFalseLiteral, "parseNullOrTrueOrFalseLiteral"); +function parseThisExpression(parser, context) { + const { tokenStart } = parser; + nextToken(parser, context); + parser.assignable = 2; + return parser.finishNode({ + type: "ThisExpression" + }, tokenStart); +} +__name(parseThisExpression, "parseThisExpression"); +function parseFunctionDeclaration(parser, context, scope, privateScope, origin, allowGen, flags, isAsync, start) { + nextToken(parser, context | 32); + const isGenerator = allowGen ? optionalBit(parser, context, 8391476) : 0; + let id = null; + let funcNameToken; + let functionScope = scope ? parser.createScope() : void 0; + if (parser.getToken() === 67174411) { + if ((flags & 1) === 0) + parser.report(39, "Function"); + } else { + const kind = origin & 4 && ((context & 8) === 0 || (context & 2) === 0) ? 4 : 64 | (isAsync ? 1024 : 0) | (isGenerator ? 1024 : 0); + validateFunctionName(parser, context, parser.getToken()); + if (scope) { + if (kind & 4) { + scope.addVarName(context, parser.tokenValue, kind); + } else { + scope.addBlockName(context, parser.tokenValue, kind, origin); + } + functionScope = functionScope == null ? void 0 : functionScope.createChildScope(128); + if (flags) { + if (flags & 2) { + parser.declareUnboundVariable(parser.tokenValue); + } + } + } + funcNameToken = parser.getToken(); + if (parser.getToken() & 143360) { + id = parseIdentifier(parser, context); + } else { + parser.report(30, KeywordDescTable[parser.getToken() & 255]); + } + } + { + const modifierFlags2 = 256 | 512 | 1024 | 2048 | 8192 | 16384; + context = (context | modifierFlags2) ^ modifierFlags2 | 65536 | (isAsync ? 2048 : 0) | (isGenerator ? 1024 : 0) | (isGenerator ? 0 : 262144); + } + functionScope = functionScope == null ? void 0 : functionScope.createChildScope(256); + const params = parseFormalParametersOrFormalList(parser, (context | 8192) & -524289, functionScope, privateScope, 0, 1); + const modifierFlags = 8 | 4 | 128 | 524288; + const body = parseFunctionBody(parser, (context | modifierFlags) ^ modifierFlags | 32768 | 4096, functionScope == null ? void 0 : functionScope.createChildScope(64), privateScope, 8, funcNameToken, functionScope); + return parser.finishNode({ + type: "FunctionDeclaration", + id, + params, + body, + async: isAsync === 1, + generator: isGenerator === 1 + }, start); +} +__name(parseFunctionDeclaration, "parseFunctionDeclaration"); +function parseFunctionExpression(parser, context, privateScope, isAsync, inGroup, start) { + nextToken(parser, context | 32); + const isGenerator = optionalBit(parser, context, 8391476); + const generatorAndAsyncFlags = (isAsync ? 2048 : 0) | (isGenerator ? 1024 : 0); + let id = null; + let funcNameToken; + let scope = parser.createScopeIfLexical(); + const modifierFlags = 256 | 512 | 1024 | 2048 | 8192 | 16384 | 524288; + if (parser.getToken() & 143360) { + validateFunctionName(parser, (context | modifierFlags) ^ modifierFlags | generatorAndAsyncFlags, parser.getToken()); + scope = scope == null ? void 0 : scope.createChildScope(128); + funcNameToken = parser.getToken(); + id = parseIdentifier(parser, context); + } + context = (context | modifierFlags) ^ modifierFlags | 65536 | generatorAndAsyncFlags | (isGenerator ? 0 : 262144); + scope = scope == null ? void 0 : scope.createChildScope(256); + const params = parseFormalParametersOrFormalList(parser, (context | 8192) & -524289, scope, privateScope, inGroup, 1); + const body = parseFunctionBody(parser, context & -131229 | 32768 | 4096, scope == null ? void 0 : scope.createChildScope(64), privateScope, 0, funcNameToken, scope); + parser.assignable = 2; + return parser.finishNode({ + type: "FunctionExpression", + id, + params, + body, + async: isAsync === 1, + generator: isGenerator === 1 + }, start); +} +__name(parseFunctionExpression, "parseFunctionExpression"); +function parseArrayLiteral(parser, context, privateScope, skipInitializer, inGroup) { + const expr = parseArrayExpressionOrPattern(parser, context, void 0, privateScope, skipInitializer, inGroup, 0, 2, 0); + if (parser.destructible & 64) { + parser.report(63); + } + if (parser.destructible & 8) { + parser.report(62); + } + return expr; +} +__name(parseArrayLiteral, "parseArrayLiteral"); +function parseArrayExpressionOrPattern(parser, context, scope, privateScope, skipInitializer, inGroup, isPattern, kind, origin) { + const { tokenStart: start } = parser; + nextToken(parser, context | 32); + const elements = []; + let destructible = 0; + context = (context | 131072) ^ 131072; + while (parser.getToken() !== 20) { + if (consumeOpt(parser, context | 32, 18)) { + elements.push(null); + } else { + let left; + const { tokenStart, tokenValue } = parser; + const token = parser.getToken(); + if (token & 143360) { + left = parsePrimaryExpression(parser, context, privateScope, kind, 0, 1, inGroup, 1, tokenStart); + if (parser.getToken() === 1077936155) { + if (parser.assignable & 2) + parser.report(26); + nextToken(parser, context | 32); + scope == null ? void 0 : scope.addVarOrBlock(context, tokenValue, kind, origin); + const right = parseExpression(parser, context, privateScope, 1, inGroup, parser.tokenStart); + left = parser.finishNode(isPattern ? { + type: "AssignmentPattern", + left, + right + } : { + type: "AssignmentExpression", + operator: "=", + left, + right + }, tokenStart); + destructible |= parser.destructible & 256 ? 256 : 0 | parser.destructible & 128 ? 128 : 0; + } else if (parser.getToken() === 18 || parser.getToken() === 20) { + if (parser.assignable & 2) { + destructible |= 16; + } else { + scope == null ? void 0 : scope.addVarOrBlock(context, tokenValue, kind, origin); + } + destructible |= parser.destructible & 256 ? 256 : 0 | parser.destructible & 128 ? 128 : 0; + } else { + destructible |= kind & 1 ? 32 : (kind & 2) === 0 ? 16 : 0; + left = parseMemberOrUpdateExpression(parser, context, privateScope, left, inGroup, 0, tokenStart); + if (parser.getToken() !== 18 && parser.getToken() !== 20) { + if (parser.getToken() !== 1077936155) + destructible |= 16; + left = parseAssignmentExpression(parser, context, privateScope, inGroup, isPattern, tokenStart, left); + } else if (parser.getToken() !== 1077936155) { + destructible |= parser.assignable & 2 ? 16 : 32; + } + } + } else if (token & 2097152) { + left = parser.getToken() === 2162700 ? parseObjectLiteralOrPattern(parser, context, scope, privateScope, 0, inGroup, isPattern, kind, origin) : parseArrayExpressionOrPattern(parser, context, scope, privateScope, 0, inGroup, isPattern, kind, origin); + destructible |= parser.destructible; + parser.assignable = parser.destructible & 16 ? 2 : 1; + if (parser.getToken() === 18 || parser.getToken() === 20) { + if (parser.assignable & 2) { + destructible |= 16; + } + } else if (parser.destructible & 8) { + parser.report(71); + } else { + left = parseMemberOrUpdateExpression(parser, context, privateScope, left, inGroup, 0, tokenStart); + destructible = parser.assignable & 2 ? 16 : 0; + if (parser.getToken() !== 18 && parser.getToken() !== 20) { + left = parseAssignmentExpression(parser, context, privateScope, inGroup, isPattern, tokenStart, left); + } else if (parser.getToken() !== 1077936155) { + destructible |= parser.assignable & 2 ? 16 : 32; + } + } + } else if (token === 14) { + left = parseSpreadOrRestElement(parser, context, scope, privateScope, 20, kind, origin, 0, inGroup, isPattern); + destructible |= parser.destructible; + if (parser.getToken() !== 18 && parser.getToken() !== 20) + parser.report(30, KeywordDescTable[parser.getToken() & 255]); + } else { + left = parseLeftHandSideExpression(parser, context, privateScope, 1, 0, 1); + if (parser.getToken() !== 18 && parser.getToken() !== 20) { + left = parseAssignmentExpression(parser, context, privateScope, inGroup, isPattern, tokenStart, left); + if ((kind & (2 | 1)) === 0 && token === 67174411) + destructible |= 16; + } else if (parser.assignable & 2) { + destructible |= 16; + } else if (token === 67174411) { + destructible |= parser.assignable & 1 && kind & (2 | 1) ? 32 : 16; + } + } + elements.push(left); + if (consumeOpt(parser, context | 32, 18)) { + if (parser.getToken() === 20) + break; + } else + break; + } + } + consume(parser, context, 20); + const node = parser.finishNode({ + type: isPattern ? "ArrayPattern" : "ArrayExpression", + elements + }, start); + if (!skipInitializer && parser.getToken() & 4194304) { + return parseArrayOrObjectAssignmentPattern(parser, context, privateScope, destructible, inGroup, isPattern, start, node); + } + parser.destructible = destructible; + return node; +} +__name(parseArrayExpressionOrPattern, "parseArrayExpressionOrPattern"); +function parseArrayOrObjectAssignmentPattern(parser, context, privateScope, destructible, inGroup, isPattern, start, node) { + if (parser.getToken() !== 1077936155) + parser.report(26); + nextToken(parser, context | 32); + if (destructible & 16) + parser.report(26); + if (!isPattern) + reinterpretToPattern(parser, node); + const { tokenStart } = parser; + const right = parseExpression(parser, context, privateScope, 1, inGroup, tokenStart); + parser.destructible = (destructible | 64 | 8) ^ (8 | 64) | (parser.destructible & 128 ? 128 : 0) | (parser.destructible & 256 ? 256 : 0); + return parser.finishNode(isPattern ? { + type: "AssignmentPattern", + left: node, + right + } : { + type: "AssignmentExpression", + left: node, + operator: "=", + right + }, start); +} +__name(parseArrayOrObjectAssignmentPattern, "parseArrayOrObjectAssignmentPattern"); +function parseSpreadOrRestElement(parser, context, scope, privateScope, closingToken, kind, origin, isAsync, inGroup, isPattern) { + const { tokenStart: start } = parser; + nextToken(parser, context | 32); + let argument = null; + let destructible = 0; + const { tokenValue, tokenStart } = parser; + let token = parser.getToken(); + if (token & 143360) { + parser.assignable = 1; + argument = parsePrimaryExpression(parser, context, privateScope, kind, 0, 1, inGroup, 1, tokenStart); + token = parser.getToken(); + argument = parseMemberOrUpdateExpression(parser, context, privateScope, argument, inGroup, 0, tokenStart); + if (parser.getToken() !== 18 && parser.getToken() !== closingToken) { + if (parser.assignable & 2 && parser.getToken() === 1077936155) + parser.report(71); + destructible |= 16; + argument = parseAssignmentExpression(parser, context, privateScope, inGroup, isPattern, tokenStart, argument); + } + if (parser.assignable & 2) { + destructible |= 16; + } else if (token === closingToken || token === 18) { + scope == null ? void 0 : scope.addVarOrBlock(context, tokenValue, kind, origin); + } else { + destructible |= 32; + } + destructible |= parser.destructible & 128 ? 128 : 0; + } else if (token === closingToken) { + parser.report(41); + } else if (token & 2097152) { + argument = parser.getToken() === 2162700 ? parseObjectLiteralOrPattern(parser, context, scope, privateScope, 1, inGroup, isPattern, kind, origin) : parseArrayExpressionOrPattern(parser, context, scope, privateScope, 1, inGroup, isPattern, kind, origin); + token = parser.getToken(); + if (token !== 1077936155 && token !== closingToken && token !== 18) { + if (parser.destructible & 8) + parser.report(71); + argument = parseMemberOrUpdateExpression(parser, context, privateScope, argument, inGroup, 0, tokenStart); + destructible |= parser.assignable & 2 ? 16 : 0; + if ((parser.getToken() & 4194304) === 4194304) { + if (parser.getToken() !== 1077936155) + destructible |= 16; + argument = parseAssignmentExpression(parser, context, privateScope, inGroup, isPattern, tokenStart, argument); + } else { + if ((parser.getToken() & 8388608) === 8388608) { + argument = parseBinaryExpression(parser, context, privateScope, 1, tokenStart, 4, token, argument); + } + if (consumeOpt(parser, context | 32, 22)) { + argument = parseConditionalExpression(parser, context, privateScope, argument, tokenStart); + } + destructible |= parser.assignable & 2 ? 16 : 32; + } + } else { + destructible |= closingToken === 1074790415 && token !== 1077936155 ? 16 : parser.destructible; + } + } else { + destructible |= 32; + argument = parseLeftHandSideExpression(parser, context, privateScope, 1, inGroup, 1); + const { tokenStart: tokenStart2 } = parser; + const token2 = parser.getToken(); + if (token2 === 1077936155) { + if (parser.assignable & 2) + parser.report(26); + argument = parseAssignmentExpression(parser, context, privateScope, inGroup, isPattern, tokenStart2, argument); + destructible |= 16; + } else { + if (token2 === 18) { + destructible |= 16; + } else if (token2 !== closingToken) { + argument = parseAssignmentExpression(parser, context, privateScope, inGroup, isPattern, tokenStart2, argument); + } + destructible |= parser.assignable & 1 ? 32 : 16; + } + parser.destructible = destructible; + if (parser.getToken() !== closingToken && parser.getToken() !== 18) + parser.report(161); + return parser.finishNode({ + type: isPattern ? "RestElement" : "SpreadElement", + argument + }, start); + } + if (parser.getToken() !== closingToken) { + if (kind & 1) + destructible |= isAsync ? 16 : 32; + if (consumeOpt(parser, context | 32, 1077936155)) { + if (destructible & 16) + parser.report(26); + reinterpretToPattern(parser, argument); + const right = parseExpression(parser, context, privateScope, 1, inGroup, parser.tokenStart); + argument = parser.finishNode(isPattern ? { + type: "AssignmentPattern", + left: argument, + right + } : { + type: "AssignmentExpression", + left: argument, + operator: "=", + right + }, tokenStart); + destructible = 16; + } else { + destructible |= 16; + } + } + parser.destructible = destructible; + return parser.finishNode({ + type: isPattern ? "RestElement" : "SpreadElement", + argument + }, start); +} +__name(parseSpreadOrRestElement, "parseSpreadOrRestElement"); +function parseMethodDefinition(parser, context, privateScope, kind, inGroup, start) { + const modifierFlags = 1024 | 2048 | 8192 | ((kind & 64) === 0 ? 512 | 16384 : 0); + context = (context | modifierFlags) ^ modifierFlags | (kind & 8 ? 1024 : 0) | (kind & 16 ? 2048 : 0) | (kind & 64 ? 16384 : 0) | 256 | 32768 | 65536; + let scope = parser.createScopeIfLexical(256); + const params = parseMethodFormals(parser, (context | 8192) & -524289, scope, privateScope, kind, 1, inGroup); + scope = scope == null ? void 0 : scope.createChildScope(64); + const body = parseFunctionBody(parser, context & -655373 | 32768 | 4096, scope, privateScope, 0, void 0, scope == null ? void 0 : scope.parent); + return parser.finishNode({ + type: "FunctionExpression", + params, + body, + async: (kind & 16) > 0, + generator: (kind & 8) > 0, + id: null + }, start); +} +__name(parseMethodDefinition, "parseMethodDefinition"); +function parseObjectLiteral(parser, context, privateScope, skipInitializer, inGroup) { + const expr = parseObjectLiteralOrPattern(parser, context, void 0, privateScope, skipInitializer, inGroup, 0, 2, 0); + if (parser.destructible & 64) { + parser.report(63); + } + if (parser.destructible & 8) { + parser.report(62); + } + return expr; +} +__name(parseObjectLiteral, "parseObjectLiteral"); +function parseObjectLiteralOrPattern(parser, context, scope, privateScope, skipInitializer, inGroup, isPattern, kind, origin) { + const { tokenStart: start } = parser; + nextToken(parser, context); + const properties = []; + let destructible = 0; + let prototypeCount = 0; + context = (context | 131072) ^ 131072; + while (parser.getToken() !== 1074790415) { + const { tokenValue, tokenStart } = parser; + const token = parser.getToken(); + if (token === 14) { + properties.push(parseSpreadOrRestElement(parser, context, scope, privateScope, 1074790415, kind, origin, 0, inGroup, isPattern)); + } else { + let state = 0; + let key = null; + let value; + if (parser.getToken() & 143360 || parser.getToken() === -2147483528 || parser.getToken() === -2147483527) { + if (parser.getToken() === -2147483527) + destructible |= 16; + key = parseIdentifier(parser, context); + if (parser.getToken() === 18 || parser.getToken() === 1074790415 || parser.getToken() === 1077936155) { + state |= 4; + if (context & 1 && (token & 537079808) === 537079808) { + destructible |= 16; + } else { + validateBindingIdentifier(parser, context, kind, token, 0); + } + scope == null ? void 0 : scope.addVarOrBlock(context, tokenValue, kind, origin); + if (consumeOpt(parser, context | 32, 1077936155)) { + destructible |= 8; + const right = parseExpression(parser, context, privateScope, 1, inGroup, parser.tokenStart); + destructible |= parser.destructible & 256 ? 256 : 0 | parser.destructible & 128 ? 128 : 0; + value = parser.finishNode({ + type: "AssignmentPattern", + left: parser.options.uniqueKeyInPattern ? Object.assign({}, key) : key, + right + }, tokenStart); + } else { + destructible |= (token === 209006 ? 128 : 0) | (token === -2147483528 ? 16 : 0); + value = parser.options.uniqueKeyInPattern ? Object.assign({}, key) : key; + } + } else if (consumeOpt(parser, context | 32, 21)) { + const { tokenStart: tokenStart2 } = parser; + if (tokenValue === "__proto__") + prototypeCount++; + if (parser.getToken() & 143360) { + const tokenAfterColon = parser.getToken(); + const valueAfterColon = parser.tokenValue; + value = parsePrimaryExpression(parser, context, privateScope, kind, 0, 1, inGroup, 1, tokenStart2); + const token2 = parser.getToken(); + value = parseMemberOrUpdateExpression(parser, context, privateScope, value, inGroup, 0, tokenStart2); + if (parser.getToken() === 18 || parser.getToken() === 1074790415) { + if (token2 === 1077936155 || token2 === 1074790415 || token2 === 18) { + destructible |= parser.destructible & 128 ? 128 : 0; + if (parser.assignable & 2) { + destructible |= 16; + } else if ((tokenAfterColon & 143360) === 143360) { + scope == null ? void 0 : scope.addVarOrBlock(context, valueAfterColon, kind, origin); + } + } else { + destructible |= parser.assignable & 1 ? 32 : 16; + } + } else if ((parser.getToken() & 4194304) === 4194304) { + if (parser.assignable & 2) { + destructible |= 16; + } else if (token2 !== 1077936155) { + destructible |= 32; + } else { + scope == null ? void 0 : scope.addVarOrBlock(context, valueAfterColon, kind, origin); + } + value = parseAssignmentExpression(parser, context, privateScope, inGroup, isPattern, tokenStart2, value); + } else { + destructible |= 16; + if ((parser.getToken() & 8388608) === 8388608) { + value = parseBinaryExpression(parser, context, privateScope, 1, tokenStart2, 4, token2, value); + } + if (consumeOpt(parser, context | 32, 22)) { + value = parseConditionalExpression(parser, context, privateScope, value, tokenStart2); + } + } + } else if ((parser.getToken() & 2097152) === 2097152) { + value = parser.getToken() === 69271571 ? parseArrayExpressionOrPattern(parser, context, scope, privateScope, 0, inGroup, isPattern, kind, origin) : parseObjectLiteralOrPattern(parser, context, scope, privateScope, 0, inGroup, isPattern, kind, origin); + destructible = parser.destructible; + parser.assignable = destructible & 16 ? 2 : 1; + if (parser.getToken() === 18 || parser.getToken() === 1074790415) { + if (parser.assignable & 2) + destructible |= 16; + } else if (parser.destructible & 8) { + parser.report(71); + } else { + value = parseMemberOrUpdateExpression(parser, context, privateScope, value, inGroup, 0, tokenStart2); + destructible = parser.assignable & 2 ? 16 : 0; + if ((parser.getToken() & 4194304) === 4194304) { + value = parseAssignmentExpressionOrPattern(parser, context, privateScope, inGroup, isPattern, tokenStart2, value); + } else { + if ((parser.getToken() & 8388608) === 8388608) { + value = parseBinaryExpression(parser, context, privateScope, 1, tokenStart2, 4, token, value); + } + if (consumeOpt(parser, context | 32, 22)) { + value = parseConditionalExpression(parser, context, privateScope, value, tokenStart2); + } + destructible |= parser.assignable & 2 ? 16 : 32; + } + } + } else { + value = parseLeftHandSideExpression(parser, context, privateScope, 1, inGroup, 1); + destructible |= parser.assignable & 1 ? 32 : 16; + if (parser.getToken() === 18 || parser.getToken() === 1074790415) { + if (parser.assignable & 2) + destructible |= 16; + } else { + value = parseMemberOrUpdateExpression(parser, context, privateScope, value, inGroup, 0, tokenStart2); + destructible = parser.assignable & 2 ? 16 : 0; + if (parser.getToken() !== 18 && token !== 1074790415) { + if (parser.getToken() !== 1077936155) + destructible |= 16; + value = parseAssignmentExpression(parser, context, privateScope, inGroup, isPattern, tokenStart2, value); + } + } + } + } else if (parser.getToken() === 69271571) { + destructible |= 16; + if (token === 209005) + state |= 16; + state |= (token === 209008 ? 256 : token === 209009 ? 512 : 1) | 2; + key = parseComputedPropertyName(parser, context, privateScope, inGroup); + destructible |= parser.assignable; + value = parseMethodDefinition(parser, context, privateScope, state, inGroup, parser.tokenStart); + } else if (parser.getToken() & 143360) { + destructible |= 16; + if (token === -2147483528) + parser.report(95); + if (token === 209005) { + if (parser.flags & 1) + parser.report(132); + state |= 16 | 1; + } else if (token === 209008) { + state |= 256; + } else if (token === 209009) { + state |= 512; + } else { + parser.report(0); + } + key = parseIdentifier(parser, context); + value = parseMethodDefinition(parser, context, privateScope, state, inGroup, parser.tokenStart); + } else if (parser.getToken() === 67174411) { + destructible |= 16; + state |= 1; + value = parseMethodDefinition(parser, context, privateScope, state, inGroup, parser.tokenStart); + } else if (parser.getToken() === 8391476) { + destructible |= 16; + if (token === 209008) { + parser.report(42); + } else if (token === 209009) { + parser.report(43); + } else if (token !== 209005) { + parser.report(30, KeywordDescTable[8391476 & 255]); + } + nextToken(parser, context); + state |= 8 | 1 | (token === 209005 ? 16 : 0); + if (parser.getToken() & 143360) { + key = parseIdentifier(parser, context); + } else if ((parser.getToken() & 134217728) === 134217728) { + key = parseLiteral(parser, context); + } else if (parser.getToken() === 69271571) { + state |= 2; + key = parseComputedPropertyName(parser, context, privateScope, inGroup); + destructible |= parser.assignable; + } else { + parser.report(30, KeywordDescTable[parser.getToken() & 255]); + } + value = parseMethodDefinition(parser, context, privateScope, state, inGroup, parser.tokenStart); + } else if ((parser.getToken() & 134217728) === 134217728) { + if (token === 209005) + state |= 16; + state |= token === 209008 ? 256 : token === 209009 ? 512 : 1; + destructible |= 16; + key = parseLiteral(parser, context); + value = parseMethodDefinition(parser, context, privateScope, state, inGroup, parser.tokenStart); + } else { + parser.report(133); + } + } else if ((parser.getToken() & 134217728) === 134217728) { + key = parseLiteral(parser, context); + if (parser.getToken() === 21) { + consume(parser, context | 32, 21); + const { tokenStart: tokenStart2 } = parser; + if (tokenValue === "__proto__") + prototypeCount++; + if (parser.getToken() & 143360) { + value = parsePrimaryExpression(parser, context, privateScope, kind, 0, 1, inGroup, 1, tokenStart2); + const { tokenValue: valueAfterColon } = parser; + const token2 = parser.getToken(); + value = parseMemberOrUpdateExpression(parser, context, privateScope, value, inGroup, 0, tokenStart2); + if (parser.getToken() === 18 || parser.getToken() === 1074790415) { + if (token2 === 1077936155 || token2 === 1074790415 || token2 === 18) { + if (parser.assignable & 2) { + destructible |= 16; + } else { + scope == null ? void 0 : scope.addVarOrBlock(context, valueAfterColon, kind, origin); + } + } else { + destructible |= parser.assignable & 1 ? 32 : 16; + } + } else if (parser.getToken() === 1077936155) { + if (parser.assignable & 2) + destructible |= 16; + value = parseAssignmentExpression(parser, context, privateScope, inGroup, isPattern, tokenStart2, value); + } else { + destructible |= 16; + value = parseAssignmentExpression(parser, context, privateScope, inGroup, isPattern, tokenStart2, value); + } + } else if ((parser.getToken() & 2097152) === 2097152) { + value = parser.getToken() === 69271571 ? parseArrayExpressionOrPattern(parser, context, scope, privateScope, 0, inGroup, isPattern, kind, origin) : parseObjectLiteralOrPattern(parser, context, scope, privateScope, 0, inGroup, isPattern, kind, origin); + destructible = parser.destructible; + parser.assignable = destructible & 16 ? 2 : 1; + if (parser.getToken() === 18 || parser.getToken() === 1074790415) { + if (parser.assignable & 2) { + destructible |= 16; + } + } else if ((parser.destructible & 8) !== 8) { + value = parseMemberOrUpdateExpression(parser, context, privateScope, value, inGroup, 0, tokenStart2); + destructible = parser.assignable & 2 ? 16 : 0; + if ((parser.getToken() & 4194304) === 4194304) { + value = parseAssignmentExpressionOrPattern(parser, context, privateScope, inGroup, isPattern, tokenStart2, value); + } else { + if ((parser.getToken() & 8388608) === 8388608) { + value = parseBinaryExpression(parser, context, privateScope, 1, tokenStart2, 4, token, value); + } + if (consumeOpt(parser, context | 32, 22)) { + value = parseConditionalExpression(parser, context, privateScope, value, tokenStart2); + } + destructible |= parser.assignable & 2 ? 16 : 32; + } + } + } else { + value = parseLeftHandSideExpression(parser, context, privateScope, 1, 0, 1); + destructible |= parser.assignable & 1 ? 32 : 16; + if (parser.getToken() === 18 || parser.getToken() === 1074790415) { + if (parser.assignable & 2) { + destructible |= 16; + } + } else { + value = parseMemberOrUpdateExpression(parser, context, privateScope, value, inGroup, 0, tokenStart2); + destructible = parser.assignable & 1 ? 0 : 16; + if (parser.getToken() !== 18 && parser.getToken() !== 1074790415) { + if (parser.getToken() !== 1077936155) + destructible |= 16; + value = parseAssignmentExpression(parser, context, privateScope, inGroup, isPattern, tokenStart2, value); + } + } + } + } else if (parser.getToken() === 67174411) { + state |= 1; + value = parseMethodDefinition(parser, context, privateScope, state, inGroup, parser.tokenStart); + destructible = parser.assignable | 16; + } else { + parser.report(134); + } + } else if (parser.getToken() === 69271571) { + key = parseComputedPropertyName(parser, context, privateScope, inGroup); + destructible |= parser.destructible & 256 ? 256 : 0; + state |= 2; + if (parser.getToken() === 21) { + nextToken(parser, context | 32); + const { tokenStart: tokenStart2, tokenValue: tokenValue2 } = parser; + const tokenAfterColon = parser.getToken(); + if (parser.getToken() & 143360) { + value = parsePrimaryExpression(parser, context, privateScope, kind, 0, 1, inGroup, 1, tokenStart2); + const token2 = parser.getToken(); + value = parseMemberOrUpdateExpression(parser, context, privateScope, value, inGroup, 0, tokenStart2); + if ((parser.getToken() & 4194304) === 4194304) { + destructible |= parser.assignable & 2 ? 16 : token2 === 1077936155 ? 0 : 32; + value = parseAssignmentExpressionOrPattern(parser, context, privateScope, inGroup, isPattern, tokenStart2, value); + } else if (parser.getToken() === 18 || parser.getToken() === 1074790415) { + if (token2 === 1077936155 || token2 === 1074790415 || token2 === 18) { + if (parser.assignable & 2) { + destructible |= 16; + } else if ((tokenAfterColon & 143360) === 143360) { + scope == null ? void 0 : scope.addVarOrBlock(context, tokenValue2, kind, origin); + } + } else { + destructible |= parser.assignable & 1 ? 32 : 16; + } + } else { + destructible |= 16; + value = parseAssignmentExpression(parser, context, privateScope, inGroup, isPattern, tokenStart2, value); + } + } else if ((parser.getToken() & 2097152) === 2097152) { + value = parser.getToken() === 69271571 ? parseArrayExpressionOrPattern(parser, context, scope, privateScope, 0, inGroup, isPattern, kind, origin) : parseObjectLiteralOrPattern(parser, context, scope, privateScope, 0, inGroup, isPattern, kind, origin); + destructible = parser.destructible; + parser.assignable = destructible & 16 ? 2 : 1; + if (parser.getToken() === 18 || parser.getToken() === 1074790415) { + if (parser.assignable & 2) + destructible |= 16; + } else if (destructible & 8) { + parser.report(62); + } else { + value = parseMemberOrUpdateExpression(parser, context, privateScope, value, inGroup, 0, tokenStart2); + destructible = parser.assignable & 2 ? destructible | 16 : 0; + if ((parser.getToken() & 4194304) === 4194304) { + if (parser.getToken() !== 1077936155) + destructible |= 16; + value = parseAssignmentExpressionOrPattern(parser, context, privateScope, inGroup, isPattern, tokenStart2, value); + } else { + if ((parser.getToken() & 8388608) === 8388608) { + value = parseBinaryExpression(parser, context, privateScope, 1, tokenStart2, 4, token, value); + } + if (consumeOpt(parser, context | 32, 22)) { + value = parseConditionalExpression(parser, context, privateScope, value, tokenStart2); + } + destructible |= parser.assignable & 2 ? 16 : 32; + } + } + } else { + value = parseLeftHandSideExpression(parser, context, privateScope, 1, 0, 1); + destructible |= parser.assignable & 1 ? 32 : 16; + if (parser.getToken() === 18 || parser.getToken() === 1074790415) { + if (parser.assignable & 2) + destructible |= 16; + } else { + value = parseMemberOrUpdateExpression(parser, context, privateScope, value, inGroup, 0, tokenStart2); + destructible = parser.assignable & 1 ? 0 : 16; + if (parser.getToken() !== 18 && parser.getToken() !== 1074790415) { + if (parser.getToken() !== 1077936155) + destructible |= 16; + value = parseAssignmentExpression(parser, context, privateScope, inGroup, isPattern, tokenStart2, value); + } + } + } + } else if (parser.getToken() === 67174411) { + state |= 1; + value = parseMethodDefinition(parser, context, privateScope, state, inGroup, parser.tokenStart); + destructible = 16; + } else { + parser.report(44); + } + } else if (token === 8391476) { + consume(parser, context | 32, 8391476); + state |= 8; + if (parser.getToken() & 143360) { + const token2 = parser.getToken(); + key = parseIdentifier(parser, context); + state |= 1; + if (parser.getToken() === 67174411) { + destructible |= 16; + value = parseMethodDefinition(parser, context, privateScope, state, inGroup, parser.tokenStart); + } else { + throw new ParseError(parser.tokenStart, parser.currentLocation, token2 === 209005 ? 46 : token2 === 209008 || parser.getToken() === 209009 ? 45 : 47, KeywordDescTable[token2 & 255]); + } + } else if ((parser.getToken() & 134217728) === 134217728) { + destructible |= 16; + key = parseLiteral(parser, context); + state |= 1; + value = parseMethodDefinition(parser, context, privateScope, state, inGroup, parser.tokenStart); + } else if (parser.getToken() === 69271571) { + destructible |= 16; + state |= 2 | 1; + key = parseComputedPropertyName(parser, context, privateScope, inGroup); + value = parseMethodDefinition(parser, context, privateScope, state, inGroup, parser.tokenStart); + } else { + parser.report(126); + } + } else { + parser.report(30, KeywordDescTable[token & 255]); + } + destructible |= parser.destructible & 128 ? 128 : 0; + parser.destructible = destructible; + properties.push(parser.finishNode({ + type: "Property", + key, + value, + kind: !(state & 768) ? "init" : state & 512 ? "set" : "get", + computed: (state & 2) > 0, + method: (state & 1) > 0, + shorthand: (state & 4) > 0 + }, tokenStart)); + } + destructible |= parser.destructible; + if (parser.getToken() !== 18) + break; + nextToken(parser, context); + } + consume(parser, context, 1074790415); + if (prototypeCount > 1) + destructible |= 64; + const node = parser.finishNode({ + type: isPattern ? "ObjectPattern" : "ObjectExpression", + properties + }, start); + if (!skipInitializer && parser.getToken() & 4194304) { + return parseArrayOrObjectAssignmentPattern(parser, context, privateScope, destructible, inGroup, isPattern, start, node); + } + parser.destructible = destructible; + return node; +} +__name(parseObjectLiteralOrPattern, "parseObjectLiteralOrPattern"); +function parseMethodFormals(parser, context, scope, privateScope, kind, type, inGroup) { + consume(parser, context, 67174411); + const params = []; + parser.flags = (parser.flags | 128) ^ 128; + if (parser.getToken() === 16) { + if (kind & 512) { + parser.report(37, "Setter", "one", ""); + } + nextToken(parser, context); + return params; + } + if (kind & 256) { + parser.report(37, "Getter", "no", "s"); + } + if (kind & 512 && parser.getToken() === 14) { + parser.report(38); + } + context = (context | 131072) ^ 131072; + let setterArgs = 0; + let isNonSimpleParameterList = 0; + while (parser.getToken() !== 18) { + let left = null; + const { tokenStart } = parser; + if (parser.getToken() & 143360) { + if ((context & 1) === 0) { + if ((parser.getToken() & 36864) === 36864) { + parser.flags |= 256; + } + if ((parser.getToken() & 537079808) === 537079808) { + parser.flags |= 512; + } + } + left = parseAndClassifyIdentifier(parser, context, scope, kind | 1, 0); + } else { + if (parser.getToken() === 2162700) { + left = parseObjectLiteralOrPattern(parser, context, scope, privateScope, 1, inGroup, 1, type, 0); + } else if (parser.getToken() === 69271571) { + left = parseArrayExpressionOrPattern(parser, context, scope, privateScope, 1, inGroup, 1, type, 0); + } else if (parser.getToken() === 14) { + left = parseSpreadOrRestElement(parser, context, scope, privateScope, 16, type, 0, 0, inGroup, 1); + } + isNonSimpleParameterList = 1; + if (parser.destructible & (32 | 16)) + parser.report(50); + } + if (parser.getToken() === 1077936155) { + nextToken(parser, context | 32); + isNonSimpleParameterList = 1; + const right = parseExpression(parser, context, privateScope, 1, 0, parser.tokenStart); + left = parser.finishNode({ + type: "AssignmentPattern", + left, + right + }, tokenStart); + } + setterArgs++; + params.push(left); + if (!consumeOpt(parser, context, 18)) + break; + if (parser.getToken() === 16) { + break; + } + } + if (kind & 512 && setterArgs !== 1) { + parser.report(37, "Setter", "one", ""); + } + scope == null ? void 0 : scope.reportScopeError(); + if (isNonSimpleParameterList) + parser.flags |= 128; + consume(parser, context, 16); + return params; +} +__name(parseMethodFormals, "parseMethodFormals"); +function parseComputedPropertyName(parser, context, privateScope, inGroup) { + nextToken(parser, context | 32); + const key = parseExpression(parser, (context | 131072) ^ 131072, privateScope, 1, inGroup, parser.tokenStart); + consume(parser, context, 20); + return key; +} +__name(parseComputedPropertyName, "parseComputedPropertyName"); +function parseParenthesizedExpression(parser, context, privateScope, canAssign, kind, origin, start) { + var _a; + parser.flags = (parser.flags | 128) ^ 128; + const parenthesesStart = parser.tokenStart; + nextToken(parser, context | 32 | 262144); + const scope = (_a = parser.createScopeIfLexical()) == null ? void 0 : _a.createChildScope(512); + context = (context | 131072) ^ 131072; + if (consumeOpt(parser, context, 16)) { + return parseParenthesizedArrow(parser, context, scope, privateScope, [], canAssign, 0, start); + } + let destructible = 0; + parser.destructible &= -385; + let expr; + let expressions = []; + let isSequence = 0; + let isNonSimpleParameterList = 0; + let hasStrictReserved = 0; + const tokenAfterParenthesesStart = parser.tokenStart; + parser.assignable = 1; + while (parser.getToken() !== 16) { + const { tokenStart } = parser; + const token = parser.getToken(); + if (token & 143360) { + scope == null ? void 0 : scope.addBlockName(context, parser.tokenValue, 1, 0); + if ((token & 537079808) === 537079808) { + isNonSimpleParameterList = 1; + } else if ((token & 36864) === 36864) { + hasStrictReserved = 1; + } + expr = parsePrimaryExpression(parser, context, privateScope, kind, 0, 1, 1, 1, tokenStart); + if (parser.getToken() === 16 || parser.getToken() === 18) { + if (parser.assignable & 2) { + destructible |= 16; + isNonSimpleParameterList = 1; + } + } else { + if (parser.getToken() === 1077936155) { + isNonSimpleParameterList = 1; + } else { + destructible |= 16; + } + expr = parseMemberOrUpdateExpression(parser, context, privateScope, expr, 1, 0, tokenStart); + if (parser.getToken() !== 16 && parser.getToken() !== 18) { + expr = parseAssignmentExpression(parser, context, privateScope, 1, 0, tokenStart, expr); + } + } + } else if ((token & 2097152) === 2097152) { + expr = token === 2162700 ? parseObjectLiteralOrPattern(parser, context | 262144, scope, privateScope, 0, 1, 0, kind, origin) : parseArrayExpressionOrPattern(parser, context | 262144, scope, privateScope, 0, 1, 0, kind, origin); + destructible |= parser.destructible; + isNonSimpleParameterList = 1; + parser.assignable = 2; + if (parser.getToken() !== 16 && parser.getToken() !== 18) { + if (destructible & 8) + parser.report(122); + expr = parseMemberOrUpdateExpression(parser, context, privateScope, expr, 0, 0, tokenStart); + destructible |= 16; + if (parser.getToken() !== 16 && parser.getToken() !== 18) { + expr = parseAssignmentExpression(parser, context, privateScope, 0, 0, tokenStart, expr); + } + } + } else if (token === 14) { + expr = parseSpreadOrRestElement(parser, context, scope, privateScope, 16, kind, origin, 0, 1, 0); + if (parser.destructible & 16) + parser.report(74); + isNonSimpleParameterList = 1; + if (isSequence && (parser.getToken() === 16 || parser.getToken() === 18)) { + expressions.push(expr); + } + destructible |= 8; + break; + } else { + destructible |= 16; + expr = parseExpression(parser, context, privateScope, 1, 1, tokenStart); + if (isSequence && (parser.getToken() === 16 || parser.getToken() === 18)) { + expressions.push(expr); + } + if (parser.getToken() === 18) { + if (!isSequence) { + isSequence = 1; + expressions = [expr]; + } + } + if (isSequence) { + while (consumeOpt(parser, context | 32, 18)) { + expressions.push(parseExpression(parser, context, privateScope, 1, 1, parser.tokenStart)); + } + parser.assignable = 2; + expr = parser.finishNode({ + type: "SequenceExpression", + expressions + }, tokenAfterParenthesesStart); + } + consume(parser, context, 16); + parser.destructible = destructible; + return parser.options.preserveParens ? parser.finishNode({ + type: "ParenthesizedExpression", + expression: expr + }, parenthesesStart) : expr; + } + if (isSequence && (parser.getToken() === 16 || parser.getToken() === 18)) { + expressions.push(expr); + } + if (!consumeOpt(parser, context | 32, 18)) + break; + if (!isSequence) { + isSequence = 1; + expressions = [expr]; + } + if (parser.getToken() === 16) { + destructible |= 8; + break; + } + } + if (isSequence) { + parser.assignable = 2; + expr = parser.finishNode({ + type: "SequenceExpression", + expressions + }, tokenAfterParenthesesStart); + } + consume(parser, context, 16); + if (destructible & 16 && destructible & 8) + parser.report(151); + destructible |= parser.destructible & 256 ? 256 : 0 | parser.destructible & 128 ? 128 : 0; + if (parser.getToken() === 10) { + if (destructible & (32 | 16)) + parser.report(49); + if (context & (2048 | 2) && destructible & 128) + parser.report(31); + if (context & (1 | 1024) && destructible & 256) { + parser.report(32); + } + if (isNonSimpleParameterList) + parser.flags |= 128; + if (hasStrictReserved) + parser.flags |= 256; + return parseParenthesizedArrow(parser, context, scope, privateScope, isSequence ? expressions : [expr], canAssign, 0, start); + } + if (destructible & 64) { + parser.report(63); + } + if (destructible & 8) { + parser.report(144); + } + parser.destructible = (parser.destructible | 256) ^ 256 | destructible; + return parser.options.preserveParens ? parser.finishNode({ + type: "ParenthesizedExpression", + expression: expr + }, parenthesesStart) : expr; +} +__name(parseParenthesizedExpression, "parseParenthesizedExpression"); +function parseIdentifierOrArrow(parser, context, privateScope) { + const { tokenStart: start } = parser; + const { tokenValue } = parser; + let isNonSimpleParameterList = 0; + let hasStrictReserved = 0; + if ((parser.getToken() & 537079808) === 537079808) { + isNonSimpleParameterList = 1; + } else if ((parser.getToken() & 36864) === 36864) { + hasStrictReserved = 1; + } + const expr = parseIdentifier(parser, context); + parser.assignable = 1; + if (parser.getToken() === 10) { + const scope = parser.options.lexical ? createArrowHeadParsingScope(parser, context, tokenValue) : void 0; + if (isNonSimpleParameterList) + parser.flags |= 128; + if (hasStrictReserved) + parser.flags |= 256; + return parseArrowFunctionExpression(parser, context, scope, privateScope, [expr], 0, start); + } + return expr; +} +__name(parseIdentifierOrArrow, "parseIdentifierOrArrow"); +function parseArrowFromIdentifier(parser, context, privateScope, value, expr, inNew, canAssign, isAsync, start) { + if (!canAssign) + parser.report(57); + if (inNew) + parser.report(51); + parser.flags &= -129; + const scope = parser.options.lexical ? createArrowHeadParsingScope(parser, context, value) : void 0; + return parseArrowFunctionExpression(parser, context, scope, privateScope, [expr], isAsync, start); +} +__name(parseArrowFromIdentifier, "parseArrowFromIdentifier"); +function parseParenthesizedArrow(parser, context, scope, privateScope, params, canAssign, isAsync, start) { + if (!canAssign) + parser.report(57); + for (let i = 0; i < params.length; ++i) + reinterpretToPattern(parser, params[i]); + return parseArrowFunctionExpression(parser, context, scope, privateScope, params, isAsync, start); +} +__name(parseParenthesizedArrow, "parseParenthesizedArrow"); +function parseArrowFunctionExpression(parser, context, scope, privateScope, params, isAsync, start) { + if (parser.flags & 1) + parser.report(48); + consume(parser, context | 32, 10); + const modifierFlags = 1024 | 2048 | 8192 | 524288; + context = (context | modifierFlags) ^ modifierFlags | (isAsync ? 2048 : 0); + const expression = parser.getToken() !== 2162700; + let body; + scope == null ? void 0 : scope.reportScopeError(); + if (expression) { + parser.flags = (parser.flags | 512 | 256 | 64 | 4096) ^ (512 | 256 | 64 | 4096); + body = parseExpression(parser, context, privateScope, 1, 0, parser.tokenStart); + } else { + scope = scope == null ? void 0 : scope.createChildScope(64); + const modifierFlags2 = 4 | 131072 | 8; + body = parseFunctionBody(parser, (context | modifierFlags2) ^ modifierFlags2 | 4096, scope, privateScope, 16, void 0, void 0); + switch (parser.getToken()) { + case 69271571: + if ((parser.flags & 1) === 0) { + parser.report(116); + } + break; + case 67108877: + case 67174409: + case 22: + parser.report(117); + case 67174411: + if ((parser.flags & 1) === 0) { + parser.report(116); + } + parser.flags |= 1024; + break; + } + if ((parser.getToken() & 8388608) === 8388608 && (parser.flags & 1) === 0) + parser.report(30, KeywordDescTable[parser.getToken() & 255]); + if ((parser.getToken() & 33619968) === 33619968) + parser.report(125); + } + parser.assignable = 2; + return parser.finishNode({ + type: "ArrowFunctionExpression", + params, + body, + async: isAsync === 1, + expression, + generator: false + }, start); +} +__name(parseArrowFunctionExpression, "parseArrowFunctionExpression"); +function parseFormalParametersOrFormalList(parser, context, scope, privateScope, inGroup, kind) { + consume(parser, context, 67174411); + parser.flags = (parser.flags | 128) ^ 128; + const params = []; + if (consumeOpt(parser, context, 16)) + return params; + context = (context | 131072) ^ 131072; + let isNonSimpleParameterList = 0; + while (parser.getToken() !== 18) { + let left; + const { tokenStart } = parser; + const token = parser.getToken(); + if (token & 143360) { + if ((context & 1) === 0) { + if ((token & 36864) === 36864) { + parser.flags |= 256; + } + if ((token & 537079808) === 537079808) { + parser.flags |= 512; + } + } + left = parseAndClassifyIdentifier(parser, context, scope, kind | 1, 0); + } else { + if (token === 2162700) { + left = parseObjectLiteralOrPattern(parser, context, scope, privateScope, 1, inGroup, 1, kind, 0); + } else if (token === 69271571) { + left = parseArrayExpressionOrPattern(parser, context, scope, privateScope, 1, inGroup, 1, kind, 0); + } else if (token === 14) { + left = parseSpreadOrRestElement(parser, context, scope, privateScope, 16, kind, 0, 0, inGroup, 1); + } else { + parser.report(30, KeywordDescTable[token & 255]); + } + isNonSimpleParameterList = 1; + if (parser.destructible & (32 | 16)) { + parser.report(50); + } + } + if (parser.getToken() === 1077936155) { + nextToken(parser, context | 32); + isNonSimpleParameterList = 1; + const right = parseExpression(parser, context, privateScope, 1, inGroup, parser.tokenStart); + left = parser.finishNode({ + type: "AssignmentPattern", + left, + right + }, tokenStart); + } + params.push(left); + if (!consumeOpt(parser, context, 18)) + break; + if (parser.getToken() === 16) { + break; + } + } + if (isNonSimpleParameterList) + parser.flags |= 128; + if (isNonSimpleParameterList || context & 1) { + scope == null ? void 0 : scope.reportScopeError(); + } + consume(parser, context, 16); + return params; +} +__name(parseFormalParametersOrFormalList, "parseFormalParametersOrFormalList"); +function parseMemberExpressionNoCall(parser, context, privateScope, expr, inGroup, start) { + const token = parser.getToken(); + if (token & 67108864) { + if (token === 67108877) { + nextToken(parser, context | 262144); + parser.assignable = 1; + const property = parsePropertyOrPrivatePropertyName(parser, context, privateScope); + return parseMemberExpressionNoCall(parser, context, privateScope, parser.finishNode({ + type: "MemberExpression", + object: expr, + computed: false, + property, + optional: false + }, start), 0, start); + } else if (token === 69271571) { + nextToken(parser, context | 32); + const { tokenStart } = parser; + const property = parseExpressions(parser, context, privateScope, inGroup, 1, tokenStart); + consume(parser, context, 20); + parser.assignable = 1; + return parseMemberExpressionNoCall(parser, context, privateScope, parser.finishNode({ + type: "MemberExpression", + object: expr, + computed: true, + property, + optional: false + }, start), 0, start); + } else if (token === 67174408 || token === 67174409) { + parser.assignable = 2; + return parseMemberExpressionNoCall(parser, context, privateScope, parser.finishNode({ + type: "TaggedTemplateExpression", + tag: expr, + quasi: parser.getToken() === 67174408 ? parseTemplate(parser, context | 64, privateScope) : parseTemplateLiteral(parser, context | 64) + }, start), 0, start); + } + } + return expr; +} +__name(parseMemberExpressionNoCall, "parseMemberExpressionNoCall"); +function parseNewExpression(parser, context, privateScope, inGroup) { + const { tokenStart: start } = parser; + const id = parseIdentifier(parser, context | 32); + const { tokenStart } = parser; + if (consumeOpt(parser, context, 67108877)) { + if (context & 65536 && parser.getToken() === 209029) { + parser.assignable = 2; + return parseMetaProperty(parser, context, id, start); + } + parser.report(94); + } + parser.assignable = 2; + if ((parser.getToken() & 16842752) === 16842752) { + parser.report(65, KeywordDescTable[parser.getToken() & 255]); + } + const expr = parsePrimaryExpression(parser, context, privateScope, 2, 1, 0, inGroup, 1, tokenStart); + context = (context | 131072) ^ 131072; + if (parser.getToken() === 67108990) + parser.report(168); + const callee = parseMemberExpressionNoCall(parser, context, privateScope, expr, inGroup, tokenStart); + parser.assignable = 2; + return parser.finishNode({ + type: "NewExpression", + callee, + arguments: parser.getToken() === 67174411 ? parseArguments(parser, context, privateScope, inGroup) : [] + }, start); +} +__name(parseNewExpression, "parseNewExpression"); +function parseMetaProperty(parser, context, meta, start) { + const property = parseIdentifier(parser, context); + return parser.finishNode({ + type: "MetaProperty", + meta, + property + }, start); +} +__name(parseMetaProperty, "parseMetaProperty"); +function parseAsyncArrowAfterIdent(parser, context, privateScope, canAssign, start) { + if (parser.getToken() === 209006) + parser.report(31); + if (context & (1 | 1024) && parser.getToken() === 241771) { + parser.report(32); + } + classifyIdentifier(parser, context, parser.getToken()); + if ((parser.getToken() & 36864) === 36864) { + parser.flags |= 256; + } + return parseArrowFromIdentifier(parser, context & -524289 | 2048, privateScope, parser.tokenValue, parseIdentifier(parser, context), 0, canAssign, 1, start); +} +__name(parseAsyncArrowAfterIdent, "parseAsyncArrowAfterIdent"); +function parseAsyncArrowOrCallExpression(parser, context, privateScope, callee, canAssign, kind, origin, flags, start) { + var _a; + nextToken(parser, context | 32); + const scope = (_a = parser.createScopeIfLexical()) == null ? void 0 : _a.createChildScope(512); + context = (context | 131072) ^ 131072; + if (consumeOpt(parser, context, 16)) { + if (parser.getToken() === 10) { + if (flags & 1) + parser.report(48); + return parseParenthesizedArrow(parser, context, scope, privateScope, [], canAssign, 1, start); + } + return parser.finishNode({ + type: "CallExpression", + callee, + arguments: [], + optional: false + }, start); + } + let destructible = 0; + let expr = null; + let isNonSimpleParameterList = 0; + parser.destructible = (parser.destructible | 256 | 128) ^ (256 | 128); + const params = []; + while (parser.getToken() !== 16) { + const { tokenStart } = parser; + const token = parser.getToken(); + if (token & 143360) { + scope == null ? void 0 : scope.addBlockName(context, parser.tokenValue, kind, 0); + if ((token & 537079808) === 537079808) { + parser.flags |= 512; + } else if ((token & 36864) === 36864) { + parser.flags |= 256; + } + expr = parsePrimaryExpression(parser, context, privateScope, kind, 0, 1, 1, 1, tokenStart); + if (parser.getToken() === 16 || parser.getToken() === 18) { + if (parser.assignable & 2) { + destructible |= 16; + isNonSimpleParameterList = 1; + } + } else { + if (parser.getToken() === 1077936155) { + isNonSimpleParameterList = 1; + } else { + destructible |= 16; + } + expr = parseMemberOrUpdateExpression(parser, context, privateScope, expr, 1, 0, tokenStart); + if (parser.getToken() !== 16 && parser.getToken() !== 18) { + expr = parseAssignmentExpression(parser, context, privateScope, 1, 0, tokenStart, expr); + } + } + } else if (token & 2097152) { + expr = token === 2162700 ? parseObjectLiteralOrPattern(parser, context, scope, privateScope, 0, 1, 0, kind, origin) : parseArrayExpressionOrPattern(parser, context, scope, privateScope, 0, 1, 0, kind, origin); + destructible |= parser.destructible; + isNonSimpleParameterList = 1; + if (parser.getToken() !== 16 && parser.getToken() !== 18) { + if (destructible & 8) + parser.report(122); + expr = parseMemberOrUpdateExpression(parser, context, privateScope, expr, 0, 0, tokenStart); + destructible |= 16; + if ((parser.getToken() & 8388608) === 8388608) { + expr = parseBinaryExpression(parser, context, privateScope, 1, start, 4, token, expr); + } + if (consumeOpt(parser, context | 32, 22)) { + expr = parseConditionalExpression(parser, context, privateScope, expr, start); + } + } + } else if (token === 14) { + expr = parseSpreadOrRestElement(parser, context, scope, privateScope, 16, kind, origin, 1, 1, 0); + destructible |= (parser.getToken() === 16 ? 0 : 16) | parser.destructible; + isNonSimpleParameterList = 1; + } else { + expr = parseExpression(parser, context, privateScope, 1, 0, tokenStart); + destructible = parser.assignable; + params.push(expr); + while (consumeOpt(parser, context | 32, 18)) { + params.push(parseExpression(parser, context, privateScope, 1, 0, tokenStart)); + } + destructible |= parser.assignable; + consume(parser, context, 16); + parser.destructible = destructible | 16; + parser.assignable = 2; + return parser.finishNode({ + type: "CallExpression", + callee, + arguments: params, + optional: false + }, start); + } + params.push(expr); + if (!consumeOpt(parser, context | 32, 18)) + break; + } + consume(parser, context, 16); + destructible |= parser.destructible & 256 ? 256 : 0 | parser.destructible & 128 ? 128 : 0; + if (parser.getToken() === 10) { + if (destructible & (32 | 16)) + parser.report(27); + if (parser.flags & 1 || flags & 1) + parser.report(48); + if (destructible & 128) + parser.report(31); + if (context & (1 | 1024) && destructible & 256) + parser.report(32); + if (isNonSimpleParameterList) + parser.flags |= 128; + return parseParenthesizedArrow(parser, context | 2048, scope, privateScope, params, canAssign, 1, start); + } + if (destructible & 64) { + parser.report(63); + } + if (destructible & 8) { + parser.report(62); + } + parser.assignable = 2; + return parser.finishNode({ + type: "CallExpression", + callee, + arguments: params, + optional: false + }, start); +} +__name(parseAsyncArrowOrCallExpression, "parseAsyncArrowOrCallExpression"); +function parseRegExpLiteral(parser, context) { + const { tokenRaw, tokenRegExp, tokenValue, tokenStart } = parser; + nextToken(parser, context); + parser.assignable = 2; + const node = { + type: "Literal", + value: tokenValue, + regex: tokenRegExp + }; + if (parser.options.raw) { + node.raw = tokenRaw; + } + return parser.finishNode(node, tokenStart); +} +__name(parseRegExpLiteral, "parseRegExpLiteral"); +function parseClassDeclaration(parser, context, scope, privateScope, flags) { + let start; + let decorators; + if (parser.leadingDecorators.decorators.length) { + if (parser.getToken() === 132) { + parser.report(30, "@"); + } + start = parser.leadingDecorators.start; + decorators = [...parser.leadingDecorators.decorators]; + parser.leadingDecorators.decorators.length = 0; + } else { + start = parser.tokenStart; + decorators = parseDecorators(parser, context, privateScope); + } + context = (context | 16384 | 1) ^ 16384; + nextToken(parser, context); + let id = null; + let superClass = null; + const { tokenValue } = parser; + if (parser.getToken() & 4096 && parser.getToken() !== 20565) { + if (isStrictReservedWord(parser, context, parser.getToken())) { + parser.report(118); + } + if ((parser.getToken() & 537079808) === 537079808) { + parser.report(119); + } + if (scope) { + scope.addBlockName(context, tokenValue, 32, 0); + if (flags) { + if (flags & 2) { + parser.declareUnboundVariable(tokenValue); + } + } + } + id = parseIdentifier(parser, context); + } else { + if ((flags & 1) === 0) + parser.report(39, "Class"); + } + let inheritedContext = context; + if (consumeOpt(parser, context | 32, 20565)) { + superClass = parseLeftHandSideExpression(parser, context, privateScope, 0, 0, 0); + inheritedContext |= 512; + } else { + inheritedContext = (inheritedContext | 512) ^ 512; + } + const body = parseClassBody(parser, inheritedContext, context, scope, privateScope, 2, 8, 0); + return parser.finishNode({ + type: "ClassDeclaration", + id, + superClass, + body, + ...parser.options.next ? { decorators } : null + }, start); +} +__name(parseClassDeclaration, "parseClassDeclaration"); +function parseClassExpression(parser, context, privateScope, inGroup, start) { + let id = null; + let superClass = null; + const decorators = parseDecorators(parser, context, privateScope); + context = (context | 1 | 16384) ^ 16384; + nextToken(parser, context); + if (parser.getToken() & 4096 && parser.getToken() !== 20565) { + if (isStrictReservedWord(parser, context, parser.getToken())) + parser.report(118); + if ((parser.getToken() & 537079808) === 537079808) { + parser.report(119); + } + id = parseIdentifier(parser, context); + } + let inheritedContext = context; + if (consumeOpt(parser, context | 32, 20565)) { + superClass = parseLeftHandSideExpression(parser, context, privateScope, 0, inGroup, 0); + inheritedContext |= 512; + } else { + inheritedContext = (inheritedContext | 512) ^ 512; + } + const body = parseClassBody(parser, inheritedContext, context, void 0, privateScope, 2, 0, inGroup); + parser.assignable = 2; + return parser.finishNode({ + type: "ClassExpression", + id, + superClass, + body, + ...parser.options.next ? { decorators } : null + }, start); +} +__name(parseClassExpression, "parseClassExpression"); +function parseDecorators(parser, context, privateScope) { + const list = []; + if (parser.options.next) { + while (parser.getToken() === 132) { + list.push(parseDecoratorList(parser, context, privateScope)); + } + } + return list; +} +__name(parseDecorators, "parseDecorators"); +function parseDecoratorList(parser, context, privateScope) { + const start = parser.tokenStart; + nextToken(parser, context | 32); + let expression = parsePrimaryExpression(parser, context, privateScope, 2, 0, 1, 0, 1, start); + expression = parseMemberOrUpdateExpression(parser, context, privateScope, expression, 0, 0, parser.tokenStart); + return parser.finishNode({ + type: "Decorator", + expression + }, start); +} +__name(parseDecoratorList, "parseDecoratorList"); +function parseClassBody(parser, context, inheritedContext, scope, parentScope, kind, origin, inGroup) { + const { tokenStart } = parser; + const privateScope = parser.createPrivateScopeIfLexical(parentScope); + consume(parser, context | 32, 2162700); + const modifierFlags = 131072 | 524288; + context = (context | modifierFlags) ^ modifierFlags; + const hasConstr = parser.flags & 32; + parser.flags = (parser.flags | 32) ^ 32; + const body = []; + while (parser.getToken() !== 1074790415) { + const decoratorStart = parser.tokenStart; + const decorators = parseDecorators(parser, context, privateScope); + if (decorators.length > 0 && parser.tokenValue === "constructor") { + parser.report(109); + } + if (parser.getToken() === 1074790415) + parser.report(108); + if (consumeOpt(parser, context, 1074790417)) { + if (decorators.length > 0) + parser.report(120); + continue; + } + body.push(parseClassElementList(parser, context, scope, privateScope, inheritedContext, kind, decorators, 0, inGroup, decorators.length > 0 ? decoratorStart : parser.tokenStart)); + } + consume(parser, origin & 8 ? context | 32 : context, 1074790415); + privateScope == null ? void 0 : privateScope.validatePrivateIdentifierRefs(); + parser.flags = parser.flags & -33 | hasConstr; + return parser.finishNode({ + type: "ClassBody", + body + }, tokenStart); +} +__name(parseClassBody, "parseClassBody"); +function parseClassElementList(parser, context, scope, privateScope, inheritedContext, type, decorators, isStatic, inGroup, start) { + let kind = isStatic ? 32 : 0; + let key = null; + const token = parser.getToken(); + if (token & (143360 | 36864) || token === -2147483528) { + key = parseIdentifier(parser, context); + switch (token) { + case 36970: + if (!isStatic && parser.getToken() !== 67174411 && (parser.getToken() & 1048576) !== 1048576 && parser.getToken() !== 1077936155) { + return parseClassElementList(parser, context, scope, privateScope, inheritedContext, type, decorators, 1, inGroup, start); + } + break; + case 209005: + if (parser.getToken() !== 67174411 && (parser.flags & 1) === 0) { + if ((parser.getToken() & 1073741824) === 1073741824) { + return parsePropertyDefinition(parser, context, privateScope, key, kind, decorators, start); + } + kind |= 16 | (optionalBit(parser, context, 8391476) ? 8 : 0); + } + break; + case 209008: + if (parser.getToken() !== 67174411) { + if ((parser.getToken() & 1073741824) === 1073741824) { + return parsePropertyDefinition(parser, context, privateScope, key, kind, decorators, start); + } + kind |= 256; + } + break; + case 209009: + if (parser.getToken() !== 67174411) { + if ((parser.getToken() & 1073741824) === 1073741824) { + return parsePropertyDefinition(parser, context, privateScope, key, kind, decorators, start); + } + kind |= 512; + } + break; + case 12402: + if (parser.getToken() !== 67174411 && (parser.flags & 1) === 0) { + if ((parser.getToken() & 1073741824) === 1073741824) { + return parsePropertyDefinition(parser, context, privateScope, key, kind, decorators, start); + } + if (parser.options.next) + kind |= 1024; + } + break; + } + } else if (token === 69271571) { + kind |= 2; + key = parseComputedPropertyName(parser, inheritedContext, privateScope, inGroup); + } else if ((token & 134217728) === 134217728) { + key = parseLiteral(parser, context); + } else if (token === 8391476) { + kind |= 8; + nextToken(parser, context); + } else if (parser.getToken() === 130) { + kind |= 8192; + key = parsePrivateIdentifier(parser, context | 16, privateScope, 768); + } else if ((parser.getToken() & 1073741824) === 1073741824) { + kind |= 128; + } else if (isStatic && token === 2162700) { + return parseStaticBlock(parser, context | 16, scope, privateScope, start); + } else if (token === -2147483527) { + key = parseIdentifier(parser, context); + if (parser.getToken() !== 67174411) + parser.report(30, KeywordDescTable[parser.getToken() & 255]); + } else { + parser.report(30, KeywordDescTable[parser.getToken() & 255]); + } + if (kind & (8 | 16 | 768 | 1024)) { + if (parser.getToken() & 143360 || parser.getToken() === -2147483528 || parser.getToken() === -2147483527) { + key = parseIdentifier(parser, context); + } else if ((parser.getToken() & 134217728) === 134217728) { + key = parseLiteral(parser, context); + } else if (parser.getToken() === 69271571) { + kind |= 2; + key = parseComputedPropertyName(parser, context, privateScope, 0); + } else if (parser.getToken() === 130) { + kind |= 8192; + key = parsePrivateIdentifier(parser, context, privateScope, kind); + } else + parser.report(135); + } + if ((kind & 2) === 0) { + if (parser.tokenValue === "constructor") { + if ((parser.getToken() & 1073741824) === 1073741824) { + parser.report(129); + } else if ((kind & 32) === 0 && parser.getToken() === 67174411) { + if (kind & (768 | 16 | 128 | 8)) { + parser.report(53, "accessor"); + } else if ((context & 512) === 0) { + if (parser.flags & 32) + parser.report(54); + else + parser.flags |= 32; + } + } + kind |= 64; + } else if ((kind & 8192) === 0 && kind & 32 && parser.tokenValue === "prototype") { + parser.report(52); + } + } + if (kind & 1024 || parser.getToken() !== 67174411 && (kind & 768) === 0) { + return parsePropertyDefinition(parser, context, privateScope, key, kind, decorators, start); + } + const value = parseMethodDefinition(parser, context | 16, privateScope, kind, inGroup, parser.tokenStart); + return parser.finishNode({ + type: "MethodDefinition", + kind: (kind & 32) === 0 && kind & 64 ? "constructor" : kind & 256 ? "get" : kind & 512 ? "set" : "method", + static: (kind & 32) > 0, + computed: (kind & 2) > 0, + key, + value, + ...parser.options.next ? { decorators } : null + }, start); +} +__name(parseClassElementList, "parseClassElementList"); +function parsePrivateIdentifier(parser, context, privateScope, kind) { + const { tokenStart } = parser; + nextToken(parser, context); + const { tokenValue } = parser; + if (tokenValue === "constructor") + parser.report(128); + if (parser.options.lexical) { + if (!privateScope) + parser.report(4, tokenValue); + if (kind) { + privateScope.addPrivateIdentifier(tokenValue, kind); + } else { + privateScope.addPrivateIdentifierRef(tokenValue); + } + } + nextToken(parser, context); + return parser.finishNode({ + type: "PrivateIdentifier", + name: tokenValue + }, tokenStart); +} +__name(parsePrivateIdentifier, "parsePrivateIdentifier"); +function parsePropertyDefinition(parser, context, privateScope, key, state, decorators, start) { + let value = null; + if (state & 8) + parser.report(0); + if (parser.getToken() === 1077936155) { + nextToken(parser, context | 32); + const { tokenStart } = parser; + if (parser.getToken() === 537079927) + parser.report(119); + const modifierFlags = 1024 | 2048 | 8192 | ((state & 64) === 0 ? 512 | 16384 : 0); + context = (context | modifierFlags) ^ modifierFlags | (state & 8 ? 1024 : 0) | (state & 16 ? 2048 : 0) | (state & 64 ? 16384 : 0) | 256 | 65536; + value = parsePrimaryExpression(parser, context | 16, privateScope, 2, 0, 1, 0, 1, tokenStart); + if ((parser.getToken() & 1073741824) !== 1073741824 || (parser.getToken() & 4194304) === 4194304) { + value = parseMemberOrUpdateExpression(parser, context | 16, privateScope, value, 0, 0, tokenStart); + value = parseAssignmentExpression(parser, context | 16, privateScope, 0, 0, tokenStart, value); + } + } + matchOrInsertSemicolon(parser, context); + return parser.finishNode({ + type: state & 1024 ? "AccessorProperty" : "PropertyDefinition", + key, + value, + static: (state & 32) > 0, + computed: (state & 2) > 0, + ...parser.options.next ? { decorators } : null + }, start); +} +__name(parsePropertyDefinition, "parsePropertyDefinition"); +function parseBindingPattern(parser, context, scope, privateScope, type, origin) { + if (parser.getToken() & 143360 || (context & 1) === 0 && parser.getToken() === -2147483527) + return parseAndClassifyIdentifier(parser, context, scope, type, origin); + if ((parser.getToken() & 2097152) !== 2097152) + parser.report(30, KeywordDescTable[parser.getToken() & 255]); + const left = parser.getToken() === 69271571 ? parseArrayExpressionOrPattern(parser, context, scope, privateScope, 1, 0, 1, type, origin) : parseObjectLiteralOrPattern(parser, context, scope, privateScope, 1, 0, 1, type, origin); + if (parser.destructible & 16) + parser.report(50); + if (parser.destructible & 32) + parser.report(50); + return left; +} +__name(parseBindingPattern, "parseBindingPattern"); +function parseAndClassifyIdentifier(parser, context, scope, kind, origin) { + const token = parser.getToken(); + if (context & 1) { + if ((token & 537079808) === 537079808) { + parser.report(119); + } else if ((token & 36864) === 36864 || token === -2147483527) { + parser.report(118); + } + } + if ((token & 20480) === 20480) { + parser.report(102); + } + if (token === 241771) { + if (context & 1024) + parser.report(32); + if (context & 2) + parser.report(111); + } + if ((token & 255) === (241737 & 255)) { + if (kind & (8 | 16)) + parser.report(100); + } + if (token === 209006) { + if (context & 2048) + parser.report(176); + if (context & 2) + parser.report(110); + } + const { tokenValue, tokenStart: start } = parser; + nextToken(parser, context); + scope == null ? void 0 : scope.addVarOrBlock(context, tokenValue, kind, origin); + return parser.finishNode({ + type: "Identifier", + name: tokenValue + }, start); +} +__name(parseAndClassifyIdentifier, "parseAndClassifyIdentifier"); +function parseJSXRootElementOrFragment(parser, context, privateScope, inJSXChild, start) { + if (!inJSXChild) + consume(parser, context, 8456256); + if (parser.getToken() === 8390721) { + const openingFragment = parseJSXOpeningFragment(parser, start); + const [children2, closingFragment] = parseJSXChildrenAndClosingFragment(parser, context, privateScope, inJSXChild); + return parser.finishNode({ + type: "JSXFragment", + openingFragment, + children: children2, + closingFragment + }, start); + } + if (parser.getToken() === 8457014) + parser.report(30, KeywordDescTable[parser.getToken() & 255]); + let closingElement = null; + let children = []; + const openingElement = parseJSXOpeningElementOrSelfCloseElement(parser, context, privateScope, inJSXChild, start); + if (!openingElement.selfClosing) { + [children, closingElement] = parseJSXChildrenAndClosingElement(parser, context, privateScope, inJSXChild); + const close = isEqualTagName(closingElement.name); + if (isEqualTagName(openingElement.name) !== close) + parser.report(155, close); + } + return parser.finishNode({ + type: "JSXElement", + children, + openingElement, + closingElement + }, start); +} +__name(parseJSXRootElementOrFragment, "parseJSXRootElementOrFragment"); +function parseJSXOpeningFragment(parser, start) { + nextJSXToken(parser); + return parser.finishNode({ + type: "JSXOpeningFragment" + }, start); +} +__name(parseJSXOpeningFragment, "parseJSXOpeningFragment"); +function parseJSXClosingElement(parser, context, inJSXChild, start) { + consume(parser, context, 8457014); + const name = parseJSXElementName(parser, context); + if (parser.getToken() !== 8390721) { + parser.report(25, KeywordDescTable[8390721 & 255]); + } + if (inJSXChild) { + nextJSXToken(parser); + } else { + nextToken(parser, context); + } + return parser.finishNode({ + type: "JSXClosingElement", + name + }, start); +} +__name(parseJSXClosingElement, "parseJSXClosingElement"); +function parseJSXClosingFragment(parser, context, inJSXChild, start) { + consume(parser, context, 8457014); + if (parser.getToken() !== 8390721) { + parser.report(25, KeywordDescTable[8390721 & 255]); + } + if (inJSXChild) { + nextJSXToken(parser); + } else { + nextToken(parser, context); + } + return parser.finishNode({ + type: "JSXClosingFragment" + }, start); +} +__name(parseJSXClosingFragment, "parseJSXClosingFragment"); +function parseJSXChildrenAndClosingElement(parser, context, privateScope, inJSXChild) { + const children = []; + while (true) { + const child = parseJSXChildOrClosingElement(parser, context, privateScope, inJSXChild); + if (child.type === "JSXClosingElement") { + return [children, child]; + } + children.push(child); + } +} +__name(parseJSXChildrenAndClosingElement, "parseJSXChildrenAndClosingElement"); +function parseJSXChildrenAndClosingFragment(parser, context, privateScope, inJSXChild) { + const children = []; + while (true) { + const child = parseJSXChildOrClosingFragment(parser, context, privateScope, inJSXChild); + if (child.type === "JSXClosingFragment") { + return [children, child]; + } + children.push(child); + } +} +__name(parseJSXChildrenAndClosingFragment, "parseJSXChildrenAndClosingFragment"); +function parseJSXChildOrClosingElement(parser, context, privateScope, inJSXChild) { + if (parser.getToken() === 137) + return parseJSXText(parser, context); + if (parser.getToken() === 2162700) + return parseJSXExpressionContainer(parser, context, privateScope, 1, 0); + if (parser.getToken() === 8456256) { + const { tokenStart } = parser; + nextToken(parser, context); + if (parser.getToken() === 8457014) + return parseJSXClosingElement(parser, context, inJSXChild, tokenStart); + return parseJSXRootElementOrFragment(parser, context, privateScope, 1, tokenStart); + } + parser.report(0); +} +__name(parseJSXChildOrClosingElement, "parseJSXChildOrClosingElement"); +function parseJSXChildOrClosingFragment(parser, context, privateScope, inJSXChild) { + if (parser.getToken() === 137) + return parseJSXText(parser, context); + if (parser.getToken() === 2162700) + return parseJSXExpressionContainer(parser, context, privateScope, 1, 0); + if (parser.getToken() === 8456256) { + const { tokenStart } = parser; + nextToken(parser, context); + if (parser.getToken() === 8457014) + return parseJSXClosingFragment(parser, context, inJSXChild, tokenStart); + return parseJSXRootElementOrFragment(parser, context, privateScope, 1, tokenStart); + } + parser.report(0); +} +__name(parseJSXChildOrClosingFragment, "parseJSXChildOrClosingFragment"); +function parseJSXText(parser, context) { + const start = parser.tokenStart; + nextToken(parser, context); + const node = { + type: "JSXText", + value: parser.tokenValue + }; + if (parser.options.raw) { + node.raw = parser.tokenRaw; + } + return parser.finishNode(node, start); +} +__name(parseJSXText, "parseJSXText"); +function parseJSXOpeningElementOrSelfCloseElement(parser, context, privateScope, inJSXChild, start) { + if ((parser.getToken() & 143360) !== 143360 && (parser.getToken() & 4096) !== 4096) + parser.report(0); + const tagName = parseJSXElementName(parser, context); + const attributes = parseJSXAttributes(parser, context, privateScope); + const selfClosing = parser.getToken() === 8457014; + if (selfClosing) + consume(parser, context, 8457014); + if (parser.getToken() !== 8390721) { + parser.report(25, KeywordDescTable[8390721 & 255]); + } + if (inJSXChild || !selfClosing) { + nextJSXToken(parser); + } else { + nextToken(parser, context); + } + return parser.finishNode({ + type: "JSXOpeningElement", + name: tagName, + attributes, + selfClosing + }, start); +} +__name(parseJSXOpeningElementOrSelfCloseElement, "parseJSXOpeningElementOrSelfCloseElement"); +function parseJSXElementName(parser, context) { + const { tokenStart } = parser; + rescanJSXIdentifier(parser); + let key = parseJSXIdentifier(parser, context); + if (parser.getToken() === 21) + return parseJSXNamespacedName(parser, context, key, tokenStart); + while (consumeOpt(parser, context, 67108877)) { + rescanJSXIdentifier(parser); + key = parseJSXMemberExpression(parser, context, key, tokenStart); + } + return key; +} +__name(parseJSXElementName, "parseJSXElementName"); +function parseJSXMemberExpression(parser, context, object, start) { + const property = parseJSXIdentifier(parser, context); + return parser.finishNode({ + type: "JSXMemberExpression", + object, + property + }, start); +} +__name(parseJSXMemberExpression, "parseJSXMemberExpression"); +function parseJSXAttributes(parser, context, privateScope) { + const attributes = []; + while (parser.getToken() !== 8457014 && parser.getToken() !== 8390721 && parser.getToken() !== 1048576) { + attributes.push(parseJsxAttribute(parser, context, privateScope)); + } + return attributes; +} +__name(parseJSXAttributes, "parseJSXAttributes"); +function parseJSXSpreadAttribute(parser, context, privateScope) { + const start = parser.tokenStart; + nextToken(parser, context); + consume(parser, context, 14); + const expression = parseExpression(parser, context, privateScope, 1, 0, parser.tokenStart); + consume(parser, context, 1074790415); + return parser.finishNode({ + type: "JSXSpreadAttribute", + argument: expression + }, start); +} +__name(parseJSXSpreadAttribute, "parseJSXSpreadAttribute"); +function parseJsxAttribute(parser, context, privateScope) { + const { tokenStart } = parser; + if (parser.getToken() === 2162700) + return parseJSXSpreadAttribute(parser, context, privateScope); + rescanJSXIdentifier(parser); + let value = null; + let name = parseJSXIdentifier(parser, context); + if (parser.getToken() === 21) { + name = parseJSXNamespacedName(parser, context, name, tokenStart); + } + if (parser.getToken() === 1077936155) { + const token = scanJSXAttributeValue(parser, context); + switch (token) { + case 134283267: + value = parseLiteral(parser, context); + break; + case 8456256: + value = parseJSXRootElementOrFragment(parser, context, privateScope, 0, parser.tokenStart); + break; + case 2162700: + value = parseJSXExpressionContainer(parser, context, privateScope, 0, 1); + break; + default: + parser.report(154); + } + } + return parser.finishNode({ + type: "JSXAttribute", + value, + name + }, tokenStart); +} +__name(parseJsxAttribute, "parseJsxAttribute"); +function parseJSXNamespacedName(parser, context, namespace, start) { + consume(parser, context, 21); + const name = parseJSXIdentifier(parser, context); + return parser.finishNode({ + type: "JSXNamespacedName", + namespace, + name + }, start); +} +__name(parseJSXNamespacedName, "parseJSXNamespacedName"); +function parseJSXExpressionContainer(parser, context, privateScope, inJSXChild, isAttr) { + const { tokenStart: start } = parser; + nextToken(parser, context | 32); + const { tokenStart } = parser; + if (parser.getToken() === 14) + return parseJSXSpreadChild(parser, context, privateScope, start); + let expression = null; + if (parser.getToken() === 1074790415) { + if (isAttr) + parser.report(157); + expression = parseJSXEmptyExpression(parser, { + index: parser.startIndex, + line: parser.startLine, + column: parser.startColumn + }); + } else { + expression = parseExpression(parser, context, privateScope, 1, 0, tokenStart); + } + if (parser.getToken() !== 1074790415) { + parser.report(25, KeywordDescTable[1074790415 & 255]); + } + if (inJSXChild) { + nextJSXToken(parser); + } else { + nextToken(parser, context); + } + return parser.finishNode({ + type: "JSXExpressionContainer", + expression + }, start); +} +__name(parseJSXExpressionContainer, "parseJSXExpressionContainer"); +function parseJSXSpreadChild(parser, context, privateScope, start) { + consume(parser, context, 14); + const expression = parseExpression(parser, context, privateScope, 1, 0, parser.tokenStart); + consume(parser, context, 1074790415); + return parser.finishNode({ + type: "JSXSpreadChild", + expression + }, start); +} +__name(parseJSXSpreadChild, "parseJSXSpreadChild"); +function parseJSXEmptyExpression(parser, start) { + return parser.finishNode({ + type: "JSXEmptyExpression" + }, start, parser.tokenStart); +} +__name(parseJSXEmptyExpression, "parseJSXEmptyExpression"); +function parseJSXIdentifier(parser, context) { + const start = parser.tokenStart; + if (!(parser.getToken() & 143360)) { + parser.report(30, KeywordDescTable[parser.getToken() & 255]); + } + const { tokenValue } = parser; + nextToken(parser, context); + return parser.finishNode({ + type: "JSXIdentifier", + name: tokenValue + }, start); +} +__name(parseJSXIdentifier, "parseJSXIdentifier"); +function parseScript(source, options) { + return parseSource(source, options); +} +__name(parseScript, "parseScript"); + +// dist/src/utils/javascript/JsAnalyzer.js +var _JsAnalyzer = class _JsAnalyzer { + /** + * Creates a new instance over the provided source. + * @param code JavaScript source to parse and inspect. + * @param options Optional traversal settings. + */ + constructor(code, options = {}) { + __publicField(this, "source"); + __publicField(this, "programAst"); + __publicField(this, "hasExtractions"); + __publicField(this, "extractionStates"); + __publicField(this, "dependentsTracker", /* @__PURE__ */ new Map()); + __publicField(this, "pendingPrototypeAliasBinding", null); + __publicField(this, "iifeParamName", null); + __publicField(this, "declaredVariables", /* @__PURE__ */ new Map()); + this.source = code; + const extractionConfigs = options.extractions ? Array.isArray(options.extractions) ? options.extractions : [options.extractions] : []; + this.extractionStates = extractionConfigs.map((config) => ({ + config: { collectDependencies: true, stopWhenReady: true, ...config }, + dependencies: /* @__PURE__ */ new Set(), + dependents: /* @__PURE__ */ new Set(), + ready: false + })); + this.hasExtractions = this.extractionStates.length > 0; + this.programAst = parseScript(code, { + ranges: true, + loc: false, + module: false + }); + this.analyzeAst(); + } + /** + * Walks the AST to collect declarations and resolve initial targets. + */ + analyzeAst() { + var _a, _b, _c; + let iifeBody; + for (const statement of this.programAst.body) { + if (statement.type === "ExpressionStatement" && statement.expression.type === "CallExpression") { + const callExpr = statement.expression; + if (callExpr.callee.type === "FunctionExpression") { + const funcExpr = callExpr.callee; + const firstParam = funcExpr.params.length > 0 ? funcExpr.params[0] : null; + if (!this.iifeParamName && (firstParam == null ? void 0 : firstParam.type) === "Identifier") { + this.iifeParamName = firstParam.name; + } + if (((_a = funcExpr.body) == null ? void 0 : _a.type) === "BlockStatement") { + iifeBody = funcExpr.body; + break; + } + } + } + } + if (!iifeBody) + return; + for (const currentNode of iifeBody.body) { + switch (currentNode.type) { + case "ExpressionStatement": { + const assignment = currentNode.expression; + if (assignment.type !== "AssignmentExpression") + continue; + const left = assignment.left; + const right = assignment.right; + if (right.type === "MemberExpression" && !right.computed && right.property.type === "Identifier" && right.property.name === "prototype") { + const prototypeSourceExpr = memberToString(right, this.source); + const aliasTargetExpr = left.type === "Identifier" ? left.name : memberToString(left, this.source); + if (prototypeSourceExpr) { + const prototypeOwnerMeta = this.declaredVariables.get(prototypeSourceExpr.replace(".prototype", "")); + if (aliasTargetExpr && prototypeOwnerMeta) { + const aliasedPrototypeMembers = /* @__PURE__ */ new Set(); + const aliasExpr = `${aliasTargetExpr}.`; + this.pendingPrototypeAliasBinding = [aliasExpr, prototypeOwnerMeta]; + prototypeOwnerMeta.prototypeAliases.set(aliasExpr, aliasedPrototypeMembers); + } + } + } + if (left.type === "Identifier") { + const existingVariable = this.declaredVariables.get(left.name); + if (!existingVariable) + continue; + existingVariable.node.init = right; + if (this.needsDependencyAnalysis(right)) { + existingVariable.dependencies = this.findDependencies(assignment.right, left.name); + } + if (this.onMatch(existingVariable.node, existingVariable)) + return; + } else if (assignment.left.type === "MemberExpression") { + const memberName = memberToString(assignment.left, this.source); + const activeAliasExpr = (_b = this.pendingPrototypeAliasBinding) == null ? void 0 : _b[0]; + if (activeAliasExpr && ((memberName == null ? void 0 : memberName.includes(activeAliasExpr)) || memberName === activeAliasExpr.slice(0, -1))) { + const aliasOwnerMeta = this.declaredVariables.get(((_c = this.pendingPrototypeAliasBinding) == null ? void 0 : _c[1].name) || ""); + if (aliasOwnerMeta) { + const existingAliasedMembers = aliasOwnerMeta.prototypeAliases.get(activeAliasExpr); + const aliasedMemberMeta = { + name: memberName, + node: currentNode, + dependents: this.dependentsTracker.get(memberName) || /* @__PURE__ */ new Set(), + predeclared: false, + prototypeAliases: /* @__PURE__ */ new Map(), + dependencies: this.findDependencies(right, memberName) + }; + if (existingAliasedMembers) { + existingAliasedMembers.add(aliasedMemberMeta); + } else { + aliasOwnerMeta.prototypeAliases.set(activeAliasExpr, /* @__PURE__ */ new Set([aliasedMemberMeta])); + } + } + } else { + this.pendingPrototypeAliasBinding = null; + } + if (!memberName || this.declaredVariables.has(memberName)) + continue; + const metadata = { + name: memberName, + node: currentNode, + dependents: this.dependentsTracker.get(memberName) || /* @__PURE__ */ new Set(), + predeclared: false, + prototypeAliases: /* @__PURE__ */ new Map(), + dependencies: this.findDependencies(right, memberName) + }; + const baseName = memberBaseName(assignment.left, this.source); + if (baseName && baseName !== memberName && !baseName.startsWith("this.")) { + metadata.dependencies.add(baseName.replace(".prototype", "")); + } + if (this.dependentsTracker.has(memberName)) { + this.dependentsTracker.delete(memberName); + } + this.declaredVariables.set(memberName, metadata); + if (this.onMatch(currentNode, metadata)) + return; + } + break; + } + case "VariableDeclaration": { + this.pendingPrototypeAliasBinding = null; + for (const declaration of currentNode.declarations) { + if (declaration.id.type !== "Identifier") + continue; + const metadata = { + name: declaration.id.name, + node: declaration, + dependents: this.dependentsTracker.get(declaration.id.name) || /* @__PURE__ */ new Set(), + prototypeAliases: /* @__PURE__ */ new Map(), + dependencies: /* @__PURE__ */ new Set(), + predeclared: false + }; + const init = declaration.init; + if (!init && currentNode.kind === "var") { + metadata.predeclared = true; + } else if (init && this.needsDependencyAnalysis(init)) { + metadata.dependencies = this.findDependencies(init, metadata.name); + } + if (this.dependentsTracker.has(metadata.name)) { + this.dependentsTracker.delete(metadata.name); + } + this.declaredVariables.set(metadata.name, metadata); + if (this.onMatch(declaration, metadata)) + return; + } + break; + } + } + } + } + /** + * Quick check if node type requires dependency analysis + */ + needsDependencyAnalysis(node) { + if (!node) + return false; + switch (node.type) { + case "FunctionExpression": + case "ArrowFunctionExpression": + case "ArrayExpression": + case "LogicalExpression": + case "CallExpression": + case "NewExpression": + case "MemberExpression": + case "BinaryExpression": + case "ConditionalExpression": + case "ObjectExpression": + case "SequenceExpression": + case "ClassExpression": + case "Identifier": + return true; + default: + return false; + } + } + /** + * Records a match, attaches metadata, and updates readiness state. + * @returns True when traversal can stop as a result of the match. + */ + onMatch(node, metadata) { + if (!this.hasExtractions) + return false; + let matched = false; + let result = false; + for (const state of this.extractionStates) { + if (!state.node) { + if (node.type === "VariableDeclarator" && !node.init) + continue; + result = state.config.match(node); + if (!result) + continue; + state.node = node; + matched = true; + if (metadata) { + state.metadata = metadata; + state.dependents = metadata.dependents; + state.dependencies = metadata.dependencies; + if (typeof result !== "boolean") + state.matchContext = result; + } + this.refreshExtractionState(state); + } else if (state.node !== node) { + this.refreshExtractionState(state); + if (this.shouldStopTraversal()) { + return true; + } + } + } + if (!matched) + return false; + return this.shouldStopTraversal(); + } + /** + * Refreshes the readiness state of an extraction target based on its dependencies + * and/or configuration. + * @param state - State to refresh. + */ + refreshExtractionState(state) { + if (!state.node) { + state.ready = false; + return; + } + if (state.config.collectDependencies === false) { + state.ready = true; + return; + } + if (!state.metadata) { + state.ready = false; + return; + } + state.ready = this.areDependenciesResolved(state.dependencies); + } + /** + * Determines whether traversal should stop based on extraction states and configuration. + */ + shouldStopTraversal() { + if (!this.hasExtractions) + return false; + let hasStoppingTarget = false; + for (const state of this.extractionStates) { + if (state.config.stopWhenReady === false) + continue; + hasStoppingTarget = true; + if (!state.node) + return false; + if (!state.ready) + return false; + } + return hasStoppingTarget; + } + /** + * Checks if every dependency resolves to a declaration or built-in symbol. + * @param dependencies - Dependencies to validate. + * @param seen - Tracks recursively visited identifiers. + */ + areDependenciesResolved(dependencies, seen = /* @__PURE__ */ new Set()) { + if (!dependencies || dependencies.size === 0) + return true; + for (const dependency of dependencies) { + if (!dependency) + continue; + if (jsBuiltIns.has(dependency)) + continue; + if (dependency === this.iifeParamName) + continue; + if (seen.has(dependency)) + continue; + const depMeta = this.declaredVariables.get(dependency); + if (!depMeta) + return false; + seen.add(dependency); + if (!this.areDependenciesResolved(depMeta.dependencies, seen)) { + return false; + } + } + return true; + } + /** + * Collects free identifier dependencies reachable from the provided AST node. + * @param rootNode - AST node to search for dependencies. + * @param identifierName - Name of the identifier represented by `rootNode`, used for tracking dependents. + */ + findDependencies(rootNode, identifierName) { + var _a; + const dependencies = /* @__PURE__ */ new Set(); + if (!rootNode) + return dependencies; + const scopeStack = [ + { + names: /* @__PURE__ */ new Set(), + type: "block" + } + ]; + const currentScope = /* @__PURE__ */ __name(() => scopeStack[scopeStack.length - 1], "currentScope"); + const isInScope = /* @__PURE__ */ __name((name) => { + for (let i = scopeStack.length - 1; i >= 0; i--) { + if (scopeStack[i].names.has(name)) + return true; + } + return false; + }, "isInScope"); + const rootIdentifierName = "id" in rootNode && ((_a = rootNode == null ? void 0 : rootNode.id) == null ? void 0 : _a.type) === "Identifier" ? rootNode.id.name : void 0; + const collectBindingIdentifiers = /* @__PURE__ */ __name((pattern, target) => { + if (!pattern) + return; + switch (pattern.type) { + case "Identifier": + target.add(pattern.name); + break; + case "ObjectPattern": + for (const prop of pattern.properties) { + if (prop.type === "RestElement") { + collectBindingIdentifiers(prop.argument, target); + } else if (prop.type === "Property") { + collectBindingIdentifiers(prop.value, target); + } + } + break; + case "ArrayPattern": + for (const el of pattern.elements) { + if (el) + collectBindingIdentifiers(el, target); + } + break; + case "RestElement": + collectBindingIdentifiers(pattern.argument, target); + break; + case "AssignmentPattern": + collectBindingIdentifiers(pattern.left, target); + break; + } + }, "collectBindingIdentifiers"); + const collectParams = /* @__PURE__ */ __name((fnNode, target) => { + if (!(fnNode == null ? void 0 : fnNode.params)) + return; + for (const p of fnNode.params) + collectBindingIdentifiers(p, target); + }, "collectParams"); + walkAst(rootNode, { + enter: /* @__PURE__ */ __name((n, parent) => { + var _a2, _b, _c, _d; + switch (n.type) { + // Note for anybody debugging this in the future: + // *DO NOT* add MethodDefinition here. + // MethodDefinition.value is a FunctionExpression, so it is already handled... + case "FunctionDeclaration": + case "FunctionExpression": + case "ArrowFunctionExpression": { + const isDecl = n.type === "FunctionDeclaration"; + const fnName = "id" in n ? (_a2 = n.id) == null ? void 0 : _a2.name : void 0; + if (isDecl && fnName) { + currentScope().names.add(fnName); + } + const fnScope = { names: /* @__PURE__ */ new Set(), type: "function" }; + if (n.type === "FunctionExpression" && fnName) { + fnScope.names.add(fnName); + } + collectParams(n, fnScope.names); + scopeStack.push(fnScope); + break; + } + case "BlockStatement": { + scopeStack.push({ names: /* @__PURE__ */ new Set(), type: "block" }); + break; + } + case "CatchClause": { + const s = /* @__PURE__ */ new Set(); + if (n.param) + collectBindingIdentifiers(n.param, s); + scopeStack.push({ names: s, type: "block" }); + break; + } + case "VariableDeclaration": { + const targetScope = n.kind === "var" ? (_b = scopeStack.findLast((s) => s.type === "function")) != null ? _b : currentScope() : currentScope(); + for (const d of n.declarations) { + collectBindingIdentifiers(d.id, targetScope.names); + } + break; + } + case "ClassDeclaration": { + if ((_c = n.id) == null ? void 0 : _c.name) { + currentScope().names.add(n.id.name); + } + break; + } + case "LabeledStatement": { + if (((_d = n.label) == null ? void 0 : _d.type) === "Identifier") + currentScope().names.add(n.label.name); + break; + } + case "Identifier": { + if (n.name === rootIdentifierName) + return; + if ((parent == null ? void 0 : parent.type) === "Property" && parent.key === n && !parent.computed) + return; + if ((parent == null ? void 0 : parent.type) === "MethodDefinition" && parent.key === n && !parent.computed) + return; + if ((parent == null ? void 0 : parent.type) === "MemberExpression" && parent.property === n && !parent.computed) { + if (parent.object.type === "ThisExpression") + return; + const full = memberToString(parent, this.source); + if (!full) + return; + const declaredVariable2 = this.declaredVariables.get(full); + if (declaredVariable2) { + declaredVariable2.dependents.add(identifierName); + dependencies.add(full); + } else if (parent.object.type === "Identifier") { + const baseName = parent.object.name; + const declaredBaseVariable = this.declaredVariables.get(baseName); + if ((declaredBaseVariable || baseName === this.iifeParamName) && !isInScope(baseName) && !jsBuiltIns.has(baseName)) { + declaredBaseVariable == null ? void 0 : declaredBaseVariable.dependents.add(identifierName); + dependencies.add(full); + const existingTracker = this.dependentsTracker.get(full); + if (existingTracker) { + existingTracker.add(identifierName); + } else { + this.dependentsTracker.set(full, /* @__PURE__ */ new Set([identifierName])); + } + } + } + return; + } + if ((parent == null ? void 0 : parent.type) === "MetaProperty") { + return; + } + if (isInScope(n.name) || jsBuiltIns.has(n.name)) + return; + dependencies.add(n.name); + const declaredVariable = this.declaredVariables.get(n.name); + if (declaredVariable) { + declaredVariable.dependents.add(identifierName); + } else { + const existing = this.dependentsTracker.get(n.name); + if (existing) { + existing.add(identifierName); + } else { + this.dependentsTracker.set(n.name, /* @__PURE__ */ new Set([identifierName])); + } + } + break; + } + case "ForStatement": + case "ForInStatement": + case "ForOfStatement": { + scopeStack.push({ names: /* @__PURE__ */ new Set(), type: "block" }); + break; + } + } + }, "enter"), + leave: /* @__PURE__ */ __name((n) => { + switch (n.type) { + case "FunctionDeclaration": + case "FunctionExpression": + case "ArrowFunctionExpression": + case "BlockStatement": + case "CatchClause": + case "ForStatement": + case "ForInStatement": + case "ForOfStatement": + if (scopeStack.length > 1) + scopeStack.pop(); + break; + } + }, "leave") + }); + return dependencies; + } + /** + * Returns the current set of matched extractions. + */ + getExtractedMatches() { + return this.extractionStates.filter((state) => !!state.node); + } + /** + * Returns the raw, original source. + */ + getSource() { + return this.source; + } +}; +__name(_JsAnalyzer, "JsAnalyzer"); +var JsAnalyzer = _JsAnalyzer; + +// dist/src/utils/javascript/JsExtractor.js +var _JsExtractor = class _JsExtractor { + constructor(analyzer) { + __publicField(this, "analyzer"); + this.analyzer = analyzer; + } + /** + * Checks if all provided arguments are safe initializers. + * @param args - The arguments to check. + * @param mode - The side effect mode to use ('strict' or 'loose'). + */ + areSafeArgs(args, mode = "strict") { + return (args != null ? args : []).every((arg) => { + if (!arg) + return false; + if (arg.type === "SpreadElement") + return false; + return this.isSafeInitializer(arg, mode); + }); + } + /** + * Determines if a given AST node is a safe initializer without side effects. + * @param node - The AST node to evaluate. + * @param mode - The side effect mode to use ('strict' or 'loose'). + */ + isSafeInitializer(node, mode = "strict") { + var _a; + if (!node) + return true; + switch (node.type) { + case "ClassExpression": + return true; + case "Literal": { + const literal = node; + return typeof literal.value === "string" || typeof literal.value === "number" || typeof literal.value === "boolean" || literal.value === null || Boolean(literal.regex); + } + case "TemplateLiteral": { + return node.expressions.every((expr) => this.isSafeInitializer(expr, mode)); + } + case "ArrayExpression": { + return node.elements.every((elem) => { + if (!elem) + return true; + if (elem.type === "SpreadElement") + return false; + return this.isSafeInitializer(elem, mode); + }); + } + case "ObjectExpression": { + return node.properties.every((prop) => { + if (prop.type !== "Property") + return false; + if (prop.computed) + return false; + if (prop.kind !== "init") + return false; + const value = prop.value; + if (!value) + return false; + return value.type === "FunctionExpression" || value.type === "ArrowFunctionExpression" || value.type === "Literal"; + }); + } + case "CallExpression": { + if (node.callee.type === "Identifier" && jsBuiltIns.has(node.callee.name)) { + return this.areSafeArgs(node.arguments, mode); + } else if (node.callee.type === "MemberExpression") { + if (!this.isSafeInitializer(node.callee.object, mode)) + return false; + if (mode === "strict") { + const propertyName = node.callee.property.type === "Identifier" ? node.callee.property.name : ""; + if (node.callee.computed || !jsBuiltIns.has(propertyName)) { + return false; + } + } + return this.areSafeArgs(node.arguments, mode); + } + return false; + } + case "NewExpression": { + if (node.callee.type === "Identifier") { + if (jsBuiltIns.has(node.callee.name)) { + return this.areSafeArgs(node.arguments, mode); + } + if (mode === "loose") { + return this.areSafeArgs(node.arguments, mode); + } + } + return false; + } + case "UnaryExpression": { + return this.isSafeInitializer(node.argument, mode); + } + case "FunctionExpression": + case "ArrowFunctionExpression": + case "Identifier": { + return true; + } + case "MemberExpression": { + if (mode === "loose") { + if (node.computed && !this.isSafeInitializer(node.property, mode)) { + return false; + } + return this.isSafeInitializer(node.object, mode); + } + if (!node.computed && node.property.type === "Identifier" && node.property.name === "prototype") { + return true; + } + return false; + } + case "LogicalExpression": + case "BinaryExpression": { + return this.isSafeInitializer(node.left, mode) && this.isSafeInitializer(node.right, mode); + } + case "ConditionalExpression": { + if (mode === "loose") { + return this.isSafeInitializer(node.test, mode) && this.isSafeInitializer(node.consequent, mode) && this.isSafeInitializer(node.alternate, mode); + } + return false; + } + case "SequenceExpression": { + if (mode === "loose") { + return node.expressions.every((expr) => this.isSafeInitializer(expr, mode)); + } + return false; + } + case "AssignmentExpression": { + if (node.left.type === "MemberExpression" && !node.left.computed) { + const object = node.left.object; + if (object.type === "Identifier" && ((_a = this.analyzer.declaredVariables.get(object.name)) == null ? void 0 : _a.node.init) !== void 0) { + return this.isSafeInitializer(node.right, mode); + } + } else if (node.left.type === "Identifier") { + if (this.analyzer.declaredVariables.has(node.left.name)) { + return this.isSafeInitializer(node.right, mode); + } + } + return false; + } + // @todo: check for more? + default: + return false; + } + } + /** + * Provides a fallback initializer string based on the type of the initializer node. + * @TODO: Check more cases. + * @param init - The initializer expression to evaluate. + */ + getInitializerFallback(init) { + switch (init == null ? void 0 : init.type) { + case "ObjectExpression": + case "NewExpression": + case "MemberExpression": + case "LogicalExpression": + return "{}"; + case "ArrayExpression": + return "[]"; + default: + return "undefined"; + } + } + /** + * Renders an AST node to JavaScript source code, with special handling for variable declarators. + * @param node - The ESTree node to render. + * @param preDeclared - Whether the variable has been previously declared. + * @param options - Configuration options for the emitter. + */ + renderNode(node, preDeclared, options = {}) { + var _a, _b, _c; + const source = this.analyzer.getSource(); + const declaredVariables = this.analyzer.declaredVariables; + const sideEffectPolicy = options.disallowSideEffectInitializers; + const sideEffectMode = typeof sideEffectPolicy === "object" && sideEffectPolicy !== null ? (_a = sideEffectPolicy.mode) != null ? _a : "strict" : "strict"; + const canDisallow = Boolean(sideEffectPolicy); + const assignmentTarget = node.type === "AssignmentExpression" ? node : node.type === "ExpressionStatement" && node.expression.type === "AssignmentExpression" ? node.expression : null; + const init = assignmentTarget && assignmentTarget.operator === "=" ? assignmentTarget.right : node.type === "VariableDeclarator" ? node.init : null; + const forceRemove = canDisallow && init && !this.isSafeInitializer(init, sideEffectMode); + const initializerFallback = this.getInitializerFallback(init); + let initSource = initializerFallback; + if (!forceRemove && init) { + if (!preDeclared && init.type === "Identifier" && !declaredVariables.has(init.name)) { + initSource = initializerFallback; + } else { + const left = assignmentTarget == null ? void 0 : assignmentTarget.left; + const isPrototypeAlias = (init == null ? void 0 : init.type) === "MemberExpression" && !init.computed && init.property.type === "Identifier" && init.property.name === "prototype"; + if (!isPrototypeAlias && (left == null ? void 0 : left.type) === "MemberExpression" && init) { + if (canDisallow && left.object.type === "Identifier" && init.type !== "FunctionExpression" && init.type !== "ArrowFunctionExpression" && init.type !== "LogicalExpression" && init.type !== "ClassExpression") { + return `${indent}// Skipped ${memberToString(left, source)} assignment.`; + } + } + initSource = ((_b = extractNodeSource(init, source)) == null ? void 0 : _b.trim().replace(/;\s*$/, "")) || "undefined // [JsExtractor] Failed to extract initializer source."; + } + } + if (!forceRemove && init && init.type === "SequenceExpression" && !initSource.startsWith("(")) { + initSource = `(${initSource})`; + } + const idName = node.type === "VariableDeclarator" && node.id.type === "Identifier" ? node.id.name : assignmentTarget && assignmentTarget.left.type === "Identifier" ? assignmentTarget.left.name : (assignmentTarget == null ? void 0 : assignmentTarget.type) === "AssignmentExpression" ? (_c = memberToString(assignmentTarget.left, source)) == null ? void 0 : _c.trim() : "unknown"; + const assignmentExpression = `${idName} = ${initSource};`; + if (node.type === "VariableDeclarator" && node.init && !preDeclared) { + return `${indent}var ${assignmentExpression}`; + } + return `${indent}${assignmentExpression}`; + } + /** + * Processes extracted matches from the analyzer, handles dependencies, predeclares + * variables as needed, and generates an IIFE-wrapped output string containing the + * code snippets and exported variables. + * @param config - Configuration options for the emitter. + */ + buildScript(config) { + var _a, _b; + const { maxDepth = Infinity, forceVarPredeclaration = false, exportRawValues = false, rawValueOnly: skipEmitFor = [] } = config; + const extractions = this.analyzer.getExtractedMatches(); + const seen = new Set(extractions.map((e) => { + var _a2; + return ((_a2 = e.metadata) == null ? void 0 : _a2.name) || ""; + })); + const snippets = []; + const predeclaredVarSet = /* @__PURE__ */ new Set(); + const exported = /* @__PURE__ */ new Map(); + const exportedRawValues = {}; + function registerPredeclaredVar(name) { + if (!name || name.includes(".")) + return; + predeclaredVarSet.add(name); + } + __name(registerPredeclaredVar, "registerPredeclaredVar"); + const visit = /* @__PURE__ */ __name((metadata, depth = 0, whitelistedDep) => { + if (!metadata || depth > maxDepth) + return; + for (const dependency of metadata.dependencies) { + if (whitelistedDep && whitelistedDep !== dependency) { + if (!seen.has(whitelistedDep)) + continue; + whitelistedDep = void 0; + } + if (seen.has(dependency)) + continue; + seen.add(dependency); + const dependencyMetadata = this.analyzer.declaredVariables.get(dependency); + if (!dependencyMetadata) + continue; + const shouldPredeclare = forceVarPredeclaration || dependencyMetadata.predeclared; + if (shouldPredeclare) { + registerPredeclaredVar(dependency); + } + visit(dependencyMetadata, depth + 1, whitelistedDep); + snippets.push(this.renderNode(dependencyMetadata.node, shouldPredeclare, config)); + if (dependencyMetadata.prototypeAliases.size > 0) { + for (const [, aliasMembers] of dependencyMetadata.prototypeAliases) { + for (const member of aliasMembers) { + visit(member, depth); + snippets.push(this.renderNode(member.node, shouldPredeclare, config)); + } + } + } + } + }, "visit"); + for (const extraction of extractions) { + const fname = extraction.config.friendlyName; + const shouldSkip = fname && skipEmitFor.includes(fname); + if (extraction.metadata) { + if (!shouldSkip) + snippets.push(`${indent}//#region --- start [${fname || "Unknown"}] ---`); + const shouldPredeclare = (forceVarPredeclaration || extraction.metadata.predeclared) && !shouldSkip; + const onlyProcessMatchContext = extraction.config.onlyProcessMatchContext; + if (shouldPredeclare) { + registerPredeclaredVar(extraction.metadata.name); + } + if (extraction.config.collectDependencies && !shouldSkip) { + let whitelistedDep; + const matchContextNode = extraction.matchContext; + if ((matchContextNode == null ? void 0 : matchContextNode.type) === "NewExpression" && onlyProcessMatchContext) { + if (matchContextNode.callee.type === "Identifier") { + whitelistedDep = matchContextNode.callee.name; + } else if (matchContextNode.callee.type === "MemberExpression") { + whitelistedDep = memberToString(matchContextNode.callee, this.analyzer.getSource()) || void 0; + } + } + visit(extraction.metadata, void 0, whitelistedDep); + } + if (extraction.matchContext && fname) { + exported.set(fname, extraction.matchContext); + if (exportRawValues) { + const ctx = extraction.matchContext; + const src = this.analyzer.getSource(); + let rawValue = null; + if (ctx.type === "Property") { + rawValue = extractNodeSource(ctx.value, src); + } else if (ctx.type === "Identifier") { + rawValue = ctx.name; + } else { + rawValue = extractNodeSource(ctx, src); + } + exportedRawValues[fname] = rawValue; + } + } + if (!shouldSkip) { + if (!onlyProcessMatchContext) { + snippets.push(this.renderNode(extraction.metadata.node, shouldPredeclare, config)); + } + snippets.push(`${indent}//#endregion --- end [${fname || "Unknown"}] --- +`); + } + } + } + const output = []; + output.push("const __jsExtractorGlobal = typeof globalThis !== 'undefined' ? globalThis :"); + output.push(`${indent}typeof self !== 'undefined' ? self :`); + output.push(`${indent}typeof window !== 'undefined' ? window :`); + output.push(`${indent}typeof global !== 'undefined' ? global : {}; +`); + output.push(`const exportedVars = (function(${this.analyzer.iifeParamName}) {`); + output.push(`${indent}const window = typeof __jsExtractorGlobal.window !== 'undefined' ? __jsExtractorGlobal.window : Object.create(null);`); + output.push(`${indent}const document = typeof __jsExtractorGlobal.document !== 'undefined' ? __jsExtractorGlobal.document : {};`); + output.push(`${indent}const self = typeof __jsExtractorGlobal.self !== 'undefined' ? __jsExtractorGlobal.self : window; +`); + if (predeclaredVarSet.size > 0) { + output.push(`${indent}var ${Array.from(predeclaredVarSet).join(", ")}; +`); + } + output.push(snippets.join("\n")); + const exportedVars = []; + for (const [friendlyName, node] of exported) { + let currentFunctionNode = null; + if (node.type === "Identifier") { + const decl = this.analyzer.declaredVariables.get(node.name); + if (((_a = decl == null ? void 0 : decl.node) == null ? void 0 : _a.type) === "VariableDeclarator" && ((_b = decl.node.init) == null ? void 0 : _b.type) === "FunctionExpression") { + currentFunctionNode = decl.node; + } + } else if (node.type === "CallExpression" || node.type === "NewExpression" || node.type === "VariableDeclarator") { + currentFunctionNode = node; + } + if (currentFunctionNode) { + const wrapper = createWrapperFunction(this.analyzer, friendlyName, currentFunctionNode); + if (wrapper) { + output.push(`${wrapper} +`); + exportedVars.push(friendlyName); + } + } + } + if (exportRawValues) { + const rawJson = JSON.stringify(exportedRawValues, null, indent.length); + const rawJsonLines = rawJson.split("\n"); + const formattedRawJson = `${rawJsonLines[0]} +${rawJsonLines.slice(1).map((line) => indent + line).join("\n")}`; + output.push(`${indent}const rawValues = ${formattedRawJson}; +`); + exportedVars.push("rawValues"); + } + output.push(`${indent}return { ${exportedVars.join(", ")} };`); + output.push("})({});\n"); + return { + output: output.join("\n"), + exported: exportedVars, + exportedRawValues: exportRawValues ? exportedRawValues : void 0 + }; + } +}; +__name(_JsExtractor, "JsExtractor"); +var JsExtractor = _JsExtractor; + +// dist/src/parser/classes/actions/OpenPopupAction.js +var _OpenPopupAction = class _OpenPopupAction extends YTNode { + constructor(data) { + super(); + __publicField(this, "popup"); + __publicField(this, "popup_type"); + this.popup = parser_exports.parseItem(data.popup); + this.popup_type = data.popupType; + } +}; +__name(_OpenPopupAction, "OpenPopupAction"); +__publicField(_OpenPopupAction, "type", "OpenPopupAction"); +var OpenPopupAction = _OpenPopupAction; + +// dist/src/parser/classes/Button.js +var _Button = class _Button extends YTNode { + constructor(data) { + super(); + __publicField(this, "text"); + __publicField(this, "label"); + __publicField(this, "tooltip"); + __publicField(this, "style"); + __publicField(this, "size"); + __publicField(this, "icon_type"); + __publicField(this, "is_disabled"); + __publicField(this, "target_id"); + __publicField(this, "endpoint"); + __publicField(this, "accessibility"); + if (Reflect.has(data, "text")) + this.text = new Text2(data.text).toString(); + if (Reflect.has(data, "accessibility") && Reflect.has(data.accessibility, "label")) { + this.label = data.accessibility.label; + } + if ("accessibilityData" in data && "accessibilityData" in data.accessibilityData) { + this.accessibility = { + accessibility_data: new AccessibilityData(data.accessibilityData.accessibilityData) + }; + } + if (Reflect.has(data, "tooltip")) + this.tooltip = data.tooltip; + if (Reflect.has(data, "style")) + this.style = data.style; + if (Reflect.has(data, "size")) + this.size = data.size; + if (Reflect.has(data, "icon") && Reflect.has(data.icon, "iconType")) + this.icon_type = data.icon.iconType; + if (Reflect.has(data, "isDisabled")) + this.is_disabled = data.isDisabled; + if (Reflect.has(data, "targetId")) + this.target_id = data.targetId; + this.endpoint = new NavigationEndpoint(data.navigationEndpoint || data.serviceEndpoint || data.command); + } +}; +__name(_Button, "Button"); +__publicField(_Button, "type", "Button"); +var Button = _Button; + +// dist/src/parser/classes/DropdownItem.js +var _DropdownItem = class _DropdownItem extends YTNode { + constructor(data) { + var _a; + super(); + __publicField(this, "label"); + __publicField(this, "selected"); + __publicField(this, "value"); + __publicField(this, "icon_type"); + __publicField(this, "description"); + __publicField(this, "endpoint"); + this.label = new Text2(data.label).toString(); + this.selected = !!data.isSelected; + if (Reflect.has(data, "int32Value")) { + this.value = data.int32Value; + } else if (data.stringValue) { + this.value = data.stringValue; + } + if (Reflect.has(data, "onSelectCommand")) { + this.endpoint = new NavigationEndpoint(data.onSelectCommand); + } + if (Reflect.has(data, "icon")) { + this.icon_type = (_a = data.icon) == null ? void 0 : _a.iconType; + } + if (Reflect.has(data, "descriptionText")) { + this.description = new Text2(data.descriptionText); + } + } +}; +__name(_DropdownItem, "DropdownItem"); +__publicField(_DropdownItem, "type", "DropdownItem"); +var DropdownItem = _DropdownItem; + +// dist/src/parser/classes/Dropdown.js +var _Dropdown = class _Dropdown extends YTNode { + constructor(data) { + super(); + __publicField(this, "label"); + __publicField(this, "entries"); + this.label = data.label || ""; + this.entries = parser_exports.parseArray(data.entries, DropdownItem); + } +}; +__name(_Dropdown, "Dropdown"); +__publicField(_Dropdown, "type", "Dropdown"); +var Dropdown = _Dropdown; + +// dist/src/parser/classes/CreatePlaylistDialog.js +var _CreatePlaylistDialog = class _CreatePlaylistDialog extends YTNode { + constructor(data) { + super(); + __publicField(this, "title"); + __publicField(this, "title_placeholder"); + __publicField(this, "privacy_option"); + __publicField(this, "cancel_button"); + __publicField(this, "create_button"); + this.title = new Text2(data.dialogTitle).toString(); + this.title_placeholder = data.titlePlaceholder || ""; + this.privacy_option = parser_exports.parseItem(data.privacyOption, Dropdown); + this.create_button = parser_exports.parseItem(data.cancelButton, Button); + this.cancel_button = parser_exports.parseItem(data.cancelButton, Button); + } +}; +__name(_CreatePlaylistDialog, "CreatePlaylistDialog"); +__publicField(_CreatePlaylistDialog, "type", "CreatePlaylistDialog"); +var CreatePlaylistDialog = _CreatePlaylistDialog; + +// dist/src/parser/classes/commands/CommandExecutorCommand.js +var _CommandExecutorCommand = class _CommandExecutorCommand extends YTNode { + constructor(data) { + super(); + __publicField(this, "commands"); + this.commands = parser_exports.parseCommands(data.commands); + } +}; +__name(_CommandExecutorCommand, "CommandExecutorCommand"); +__publicField(_CommandExecutorCommand, "type", "CommandExecutorCommand"); +var CommandExecutorCommand = _CommandExecutorCommand; + +// dist/src/parser/classes/NavigationEndpoint.js +var _NavigationEndpoint = class _NavigationEndpoint extends YTNode { + constructor(data) { + var _a, _b, _c, _d, _e, _f, _g, _h; + super(); + __publicField(this, "name"); + __publicField(this, "payload"); + __publicField(this, "dialog"); + __publicField(this, "modal"); + __publicField(this, "open_popup"); + __publicField(this, "next_endpoint"); + __publicField(this, "metadata"); + __publicField(this, "command"); + __publicField(this, "commands"); + if (data) { + if (data.serialCommand || data.parallelCommand) { + const raw_command = data.serialCommand || data.parallelCommand; + this.commands = raw_command.commands.map((command) => new _NavigationEndpoint(command)); + } + if (data.innertubeCommand || data.command || data.performOnceCommand) { + data = data.innertubeCommand || data.command || data.performOnceCommand; + } + } + this.command = parser_exports.parseCommand(data); + if (Reflect.has(data || {}, "openPopupAction")) + this.open_popup = new OpenPopupAction(data.openPopupAction); + this.name = Object.keys(data || {}).find((item) => item.endsWith("Endpoint") || item.endsWith("Command")); + this.payload = this.name ? Reflect.get(data, this.name) : {}; + if (Reflect.has(this.payload, "dialog") || Reflect.has(this.payload, "content")) { + this.dialog = parser_exports.parseItem(this.payload.dialog || this.payload.content); + } + if (Reflect.has(this.payload, "modal")) { + this.modal = parser_exports.parseItem(this.payload.modal); + } + if (Reflect.has(this.payload, "nextEndpoint")) { + this.next_endpoint = new _NavigationEndpoint(this.payload.nextEndpoint); + } + if (data == null ? void 0 : data.serviceEndpoint) { + data = data.serviceEndpoint; + } + this.metadata = {}; + if ((_b = (_a = data == null ? void 0 : data.commandMetadata) == null ? void 0 : _a.webCommandMetadata) == null ? void 0 : _b.url) { + this.metadata.url = data.commandMetadata.webCommandMetadata.url; + } + if ((_d = (_c = data == null ? void 0 : data.commandMetadata) == null ? void 0 : _c.webCommandMetadata) == null ? void 0 : _d.webPageType) { + this.metadata.page_type = data.commandMetadata.webCommandMetadata.webPageType; + } + if ((_f = (_e = data == null ? void 0 : data.commandMetadata) == null ? void 0 : _e.webCommandMetadata) == null ? void 0 : _f.apiUrl) { + this.metadata.api_url = data.commandMetadata.webCommandMetadata.apiUrl.replace("/youtubei/v1/", ""); + } else if (this.name) { + this.metadata.api_url = this.getPath(this.name); + } + if ((_h = (_g = data == null ? void 0 : data.commandMetadata) == null ? void 0 : _g.webCommandMetadata) == null ? void 0 : _h.sendPost) { + this.metadata.send_post = data.commandMetadata.webCommandMetadata.sendPost; + } + if (data == null ? void 0 : data.createPlaylistEndpoint) { + if (data == null ? void 0 : data.createPlaylistEndpoint.createPlaylistDialog) { + this.dialog = parser_exports.parseItem(data == null ? void 0 : data.createPlaylistEndpoint.createPlaylistDialog, CreatePlaylistDialog); + } + } + } + /** + * Sometimes InnerTube does not return an API url, in that case the library should set it based on the name of the payload object. + * @deprecated This should be removed in the future. + */ + getPath(name) { + switch (name) { + case "browseEndpoint": + return "/browse"; + case "watchEndpoint": + case "reelWatchEndpoint": + return "/player"; + case "searchEndpoint": + return "/search"; + case "watchPlaylistEndpoint": + return "/next"; + case "liveChatItemContextMenuEndpoint": + return "/live_chat/get_item_context_menu"; + } + } + call(actions, args) { + if (!actions) + throw new Error("An API caller must be provided"); + if (this.command) { + let command = this.command; + if (command.is(CommandExecutorCommand)) { + command = command.commands.at(-1); + } + return actions.execute(command.getApiPath(), { ...command.buildRequest(), ...args }); + } + if (!this.metadata.api_url) + throw new Error("Expected an api_url, but none was found."); + return actions.execute(this.metadata.api_url, { ...this.payload, ...args }); + } + toURL() { + if (!this.metadata.url) + return void 0; + if (!this.metadata.page_type) + return void 0; + return this.metadata.page_type === "WEB_PAGE_TYPE_UNKNOWN" ? this.metadata.url : `https://www.youtube.com${this.metadata.url}`; + } +}; +__name(_NavigationEndpoint, "NavigationEndpoint"); +__publicField(_NavigationEndpoint, "type", "NavigationEndpoint"); +var NavigationEndpoint = _NavigationEndpoint; + +// dist/src/parser/classes/misc/Thumbnail.js +var _Thumbnail = class _Thumbnail { + constructor(data) { + __publicField(this, "url"); + __publicField(this, "width"); + __publicField(this, "height"); + this.url = data.url; + this.width = data.width; + this.height = data.height; + } + /** + * Get thumbnails from response object. + */ + static fromResponse(data) { + if (!data) + return []; + let thumbnail_data; + if (data.thumbnails) { + thumbnail_data = data.thumbnails; + } else if (data.sources) { + thumbnail_data = data.sources; + } + if (thumbnail_data) { + return thumbnail_data.map((x) => new _Thumbnail(x)).sort((a, b) => b.width - a.width); + } + return []; + } +}; +__name(_Thumbnail, "Thumbnail"); +var Thumbnail = _Thumbnail; + +// dist/src/parser/classes/misc/EmojiRun.js +var _EmojiRun = class _EmojiRun { + constructor(data) { + __publicField(this, "text"); + __publicField(this, "emoji"); + var _a, _b, _c, _d, _e, _f; + this.text = ((_a = data.emoji) == null ? void 0 : _a.emojiId) || ((_c = (_b = data.emoji) == null ? void 0 : _b.shortcuts) == null ? void 0 : _c[0]) || data.text || ""; + this.emoji = { + emoji_id: data.emoji.emojiId, + shortcuts: ((_d = data.emoji) == null ? void 0 : _d.shortcuts) || [], + search_terms: ((_e = data.emoji) == null ? void 0 : _e.searchTerms) || [], + image: Thumbnail.fromResponse(data.emoji.image), + is_custom: !!((_f = data.emoji) == null ? void 0 : _f.isCustomEmoji) + }; + } + toString() { + return this.text; + } + toHTML() { + const escaped_text = escape(this.text); + return `${escaped_text}`; + } +}; +__name(_EmojiRun, "EmojiRun"); +var EmojiRun = _EmojiRun; + +// dist/src/parser/classes/misc/TextRun.js +var _TextRun = class _TextRun { + constructor(data) { + __publicField(this, "text"); + __publicField(this, "text_color"); + __publicField(this, "endpoint"); + __publicField(this, "bold"); + __publicField(this, "bracket"); + __publicField(this, "dark_mode_text_color"); + __publicField(this, "deemphasize"); + __publicField(this, "italics"); + __publicField(this, "strikethrough"); + __publicField(this, "error_underline"); + __publicField(this, "underline"); + __publicField(this, "font_face"); + __publicField(this, "attachment"); + this.text = data.text; + this.bold = Boolean(data.bold); + this.bracket = Boolean(data.bracket); + this.italics = Boolean(data.italics); + this.strikethrough = Boolean(data.strikethrough); + this.error_underline = Boolean(data.error_underline); + this.underline = Boolean(data.underline); + this.deemphasize = Boolean(data.deemphasize); + if ("textColor" in data) { + this.text_color = data.textColor; + } + if ("navigationEndpoint" in data) { + this.endpoint = new NavigationEndpoint(data.navigationEndpoint); + } + if ("darkModeTextColor" in data) { + this.dark_mode_text_color = data.darkModeTextColor; + } + if ("fontFace" in data) { + this.font_face = data.fontFace; + } + this.attachment = data.attachment; + } + toString() { + return this.text; + } + toHTML() { + var _a; + const tags = []; + if (this.bold) + tags.push("b"); + if (this.italics) + tags.push("i"); + if (this.strikethrough) + tags.push("s"); + if (this.deemphasize) + tags.push("small"); + if (this.underline) + tags.push("u"); + if (this.error_underline) + tags.push("u"); + if (!((_a = this.text) == null ? void 0 : _a.length)) + return ""; + const escaped_text = escape(this.text); + const styled_text = tags.map((tag) => `<${tag}>`).join("") + escaped_text + tags.map((tag) => ``).join(""); + const wrapped_text = `${styled_text}`; + if (this.attachment) { + if (this.attachment.element.type.imageType.image.sources.length) { + if (this.endpoint) { + const { url } = this.attachment.element.type.imageType.image.sources[0]; + let image_el = ""; + if (url) { + image_el = ``; + } + const nav_url = this.endpoint.toURL(); + if (nav_url) + return `${image_el}${wrapped_text}`; + } + } + } + if (this.endpoint) { + const url = this.endpoint.toURL(); + if (url) + return `${wrapped_text}`; + } + return wrapped_text; + } +}; +__name(_TextRun, "TextRun"); +var TextRun = _TextRun; + +// dist/src/parser/classes/misc/Text.js +function escape(text) { + return text.replace(/&/g, "&").replace(//g, ">").replace(/"/g, """).replace(/'/g, "'"); +} +__name(escape, "escape"); +var TAG = "Text"; +var _Text = class _Text { + constructor(data) { + /** + * The plain text content. + */ + __publicField(this, "text"); + /** + * Individual text segments with their formatting. + */ + __publicField(this, "runs"); + /** + * Navigation endpoint associated with this text. + */ + __publicField(this, "endpoint"); + /** + * Accessibility data associated with this text. + */ + __publicField(this, "accessibility"); + /** + * Indicates if the text is right-to-left. + */ + __publicField(this, "rtl"); + if (this.isRunsData(data)) { + this.runs = data.runs.map((run) => run.emoji ? new EmojiRun(run) : new TextRun(run)); + this.text = this.runs.map((run) => run.text).join(""); + } else { + this.text = data == null ? void 0 : data.simpleText; + } + if (this.isObject(data) && "accessibility" in data && "accessibilityData" in data.accessibility) { + this.accessibility = { + accessibility_data: new AccessibilityData(data.accessibility.accessibilityData) + }; + } + this.rtl = !!(data == null ? void 0 : data.rtl); + this.parseEndpoint(data); + } + isRunsData(data) { + return this.isObject(data) && Reflect.has(data, "runs") && Array.isArray(data.runs); + } + parseEndpoint(data) { + var _a, _b, _c; + if (!this.isObject(data)) + return; + if ("navigationEndpoint" in data) { + this.endpoint = new NavigationEndpoint(data.navigationEndpoint); + } else if ("titleNavigationEndpoint" in data) { + this.endpoint = new NavigationEndpoint(data.titleNavigationEndpoint); + } else if ((_b = (_a = this.runs) == null ? void 0 : _a[0]) == null ? void 0 : _b.endpoint) { + this.endpoint = ((_c = this.runs) == null ? void 0 : _c[0]).endpoint; + } + } + isObject(data) { + return typeof data === "object" && data !== null; + } + static fromAttributed(data) { + var _a; + const { content, commandRuns: command_runs, attachmentRuns: attachment_runs } = data; + const runs = [ + { + text: content, + startIndex: 0 + } + ]; + const style_runs = (_a = data.styleRuns) == null ? void 0 : _a.map((run) => { + var _a2, _b; + return { + ...run, + startIndex: (_a2 = run.startIndex) != null ? _a2 : 0, + length: (_b = run.length) != null ? _b : content.length + }; + }); + if (style_runs == null ? void 0 : style_runs.length) + this.processStyleRuns(runs, style_runs, data); + if (command_runs == null ? void 0 : command_runs.length) + this.processCommandRuns(runs, command_runs, data); + if (attachment_runs == null ? void 0 : attachment_runs.length) + this.processAttachmentRuns(runs, attachment_runs, data); + return new _Text({ runs }); + } + static processStyleRuns(runs, style_runs, data) { + for (const style_run of style_runs) { + if (style_run.italic || style_run.strikethrough === "LINE_STYLE_SINGLE" || style_run.weightLabel === "FONT_WEIGHT_MEDIUM" || style_run.weightLabel === "FONT_WEIGHT_BOLD") { + const matching_run = findMatchingRun(runs, style_run); + if (!matching_run) { + Log_exports.warn(TAG, "Unable to find matching run for style run. Skipping...", { + style_run, + input_data: data, + // For performance reasons, web browser consoles only expand an object, when the user clicks on it, + // So if we log the original runs object, it might have changed by the time the user looks at it. + // Deep clone, so that we log the exact state of the runs at this point. + parsed_runs: JSON.parse(JSON.stringify(runs)) + }); + continue; + } + insertSubRun(runs, matching_run, style_run, { + bold: style_run.weightLabel === "FONT_WEIGHT_MEDIUM" || style_run.weightLabel === "FONT_WEIGHT_BOLD", + italics: style_run.italic, + strikethrough: style_run.strikethrough === "LINE_STYLE_SINGLE" + }); + } else { + Log_exports.debug(TAG, "Skipping style run as it is doesn't have any information that we parse.", { + style_run, + input_data: data + }); + } + } + } + static processCommandRuns(runs, command_runs, data) { + for (const command_run of command_runs) { + if (command_run.onTap) { + const matching_run = findMatchingRun(runs, command_run); + if (!matching_run) { + Log_exports.warn(TAG, "Unable to find matching run for command run. Skipping...", { + command_run, + input_data: data, + // For performance reasons, web browser consoles only expand an object, when the user clicks on it, + // So if we log the original runs object, it might have changed by the time the user looks at it. + // Deep clone, so that we log the exact state of the runs at this point. + parsed_runs: JSON.parse(JSON.stringify(runs)) + }); + continue; + } + insertSubRun(runs, matching_run, command_run, { + navigationEndpoint: command_run.onTap + }); + } else { + Log_exports.debug(TAG, 'Skipping command run as it is missing the "doTap" property.', { + command_run, + input_data: data + }); + } + } + } + static processAttachmentRuns(runs, attachment_runs, data) { + var _a, _b, _c; + for (const attachment_run of attachment_runs) { + const matching_run = findMatchingRun(runs, attachment_run); + if (!matching_run) { + Log_exports.warn(TAG, "Unable to find matching run for attachment run. Skipping...", { + attachment_run, + input_data: data, + // For performance reasons, web browser consoles only expand an object, when the user clicks on it, + // So if we log the original runs object, it might have changed by the time the user looks at it. + // Deep clone, so that we log the exact state of the runs at this point. + parsed_runs: JSON.parse(JSON.stringify(runs)) + }); + continue; + } + if (attachment_run.length === 0) { + matching_run.attachment = attachment_run; + } else { + const offset_start_index = attachment_run.startIndex - matching_run.startIndex; + const text = matching_run.text.substring(offset_start_index, offset_start_index + attachment_run.length); + const is_custom_emoji = /^:[^:]+:$/.test(text); + if (((_c = (_b = (_a = attachment_run.element) == null ? void 0 : _a.type) == null ? void 0 : _b.imageType) == null ? void 0 : _c.image) && (is_custom_emoji || new RegExp("^(?:\\p{Emoji}|\\u200d)+$", "u").test(text))) { + const emoji = { + image: attachment_run.element.type.imageType.image, + isCustomEmoji: is_custom_emoji, + shortcuts: is_custom_emoji ? [text] : void 0 + }; + insertSubRun(runs, matching_run, attachment_run, { emoji }); + } else { + insertSubRun(runs, matching_run, attachment_run, { + attachment: attachment_run + }); + } + } + } + } + /** + * Converts the text to HTML. + * @returns The HTML. + */ + toHTML() { + return this.runs ? this.runs.map((run) => run.toHTML()).join("") : this.text; + } + /** + * Checks if the text is empty. + * @returns Whether the text is empty. + */ + isEmpty() { + return this.text === void 0; + } + /** + * Converts the text to a string. + * @returns The text. + */ + toString() { + return this.text || "N/A"; + } +}; +__name(_Text, "Text"); +var Text2 = _Text; +function findMatchingRun(runs, response_run) { + return runs.find((run) => { + return run.startIndex <= response_run.startIndex && response_run.startIndex + response_run.length <= run.startIndex + run.text.length; + }); +} +__name(findMatchingRun, "findMatchingRun"); +function insertSubRun(runs, original_run, response_run, properties_to_add) { + const replace_index = runs.indexOf(original_run); + const replacement_runs = []; + const offset_start_index = response_run.startIndex - original_run.startIndex; + if (response_run.startIndex > original_run.startIndex) { + replacement_runs.push({ + ...original_run, + text: original_run.text.substring(0, offset_start_index) + }); + } + replacement_runs.push({ + ...original_run, + text: original_run.text.substring(offset_start_index, offset_start_index + response_run.length), + startIndex: response_run.startIndex, + ...properties_to_add + }); + if (response_run.startIndex + response_run.length < original_run.startIndex + original_run.text.length) { + replacement_runs.push({ + ...original_run, + text: original_run.text.substring(offset_start_index + response_run.length), + startIndex: response_run.startIndex + response_run.length + }); + } + runs.splice(replace_index, 1, ...replacement_runs); +} +__name(insertSubRun, "insertSubRun"); + +// dist/src/parser/classes/ChannelExternalLinkView.js +var _ChannelExternalLinkView = class _ChannelExternalLinkView extends YTNode { + constructor(data) { + super(); + __publicField(this, "title"); + __publicField(this, "link"); + __publicField(this, "favicon"); + this.title = Text2.fromAttributed(data.title); + this.link = Text2.fromAttributed(data.link); + this.favicon = Thumbnail.fromResponse(data.favicon); + } +}; +__name(_ChannelExternalLinkView, "ChannelExternalLinkView"); +__publicField(_ChannelExternalLinkView, "type", "ChannelExternalLinkView"); +var ChannelExternalLinkView = _ChannelExternalLinkView; + +// dist/src/parser/classes/AboutChannelView.js +var _AboutChannelView = class _AboutChannelView extends YTNode { + constructor(data) { + super(); + __publicField(this, "description"); + __publicField(this, "description_label"); + __publicField(this, "country"); + __publicField(this, "custom_links_label"); + __publicField(this, "subscriber_count"); + __publicField(this, "view_count"); + __publicField(this, "joined_date"); + __publicField(this, "canonical_channel_url"); + __publicField(this, "channel_id"); + __publicField(this, "additional_info_label"); + __publicField(this, "custom_url_on_tap"); + __publicField(this, "video_count"); + __publicField(this, "sign_in_for_business_email"); + __publicField(this, "links"); + if (Reflect.has(data, "description")) { + this.description = data.description; + } + if (Reflect.has(data, "descriptionLabel")) { + this.description_label = Text2.fromAttributed(data.descriptionLabel); + } + if (Reflect.has(data, "country")) { + this.country = data.country; + } + if (Reflect.has(data, "customLinksLabel")) { + this.custom_links_label = Text2.fromAttributed(data.customLinksLabel); + } + if (Reflect.has(data, "subscriberCountText")) { + this.subscriber_count = data.subscriberCountText; + } + if (Reflect.has(data, "viewCountText")) { + this.view_count = data.viewCountText; + } + if (Reflect.has(data, "joinedDateText")) { + this.joined_date = Text2.fromAttributed(data.joinedDateText); + } + if (Reflect.has(data, "canonicalChannelUrl")) { + this.canonical_channel_url = data.canonicalChannelUrl; + } + if (Reflect.has(data, "channelId")) { + this.channel_id = data.channelId; + } + if (Reflect.has(data, "additionalInfoLabel")) { + this.additional_info_label = Text2.fromAttributed(data.additionalInfoLabel); + } + if (Reflect.has(data, "customUrlOnTap")) { + this.custom_url_on_tap = new NavigationEndpoint(data.customUrlOnTap); + } + if (Reflect.has(data, "videoCountText")) { + this.video_count = data.videoCountText; + } + if (Reflect.has(data, "signInForBusinessEmail")) { + this.sign_in_for_business_email = Text2.fromAttributed(data.signInForBusinessEmail); + } + if (Reflect.has(data, "links")) { + this.links = parser_exports.parseArray(data.links, ChannelExternalLinkView); + } else { + this.links = []; + } + } +}; +__name(_AboutChannelView, "AboutChannelView"); +__publicField(_AboutChannelView, "type", "AboutChannelView"); +var AboutChannelView = _AboutChannelView; + +// dist/src/parser/classes/AboutChannel.js +var _AboutChannel = class _AboutChannel extends YTNode { + constructor(data) { + super(); + __publicField(this, "metadata"); + __publicField(this, "share_channel"); + this.metadata = parser_exports.parseItem(data.metadata, AboutChannelView); + this.share_channel = parser_exports.parseItem(data.shareChannel, Button); + } +}; +__name(_AboutChannel, "AboutChannel"); +__publicField(_AboutChannel, "type", "AboutChannel"); +var AboutChannel = _AboutChannel; + +// dist/src/parser/classes/AccountChannel.js +var _AccountChannel = class _AccountChannel extends YTNode { + constructor(data) { + super(); + __publicField(this, "title"); + __publicField(this, "endpoint"); + this.title = new Text2(data.title); + this.endpoint = new NavigationEndpoint(data.navigationEndpoint); + } +}; +__name(_AccountChannel, "AccountChannel"); +__publicField(_AccountChannel, "type", "AccountChannel"); +var AccountChannel = _AccountChannel; + +// dist/src/parser/classes/AccountItem.js +var _AccountItem = class _AccountItem extends YTNode { + constructor(data) { + super(); + __publicField(this, "account_name"); + __publicField(this, "account_photo"); + __publicField(this, "is_selected"); + __publicField(this, "is_disabled"); + __publicField(this, "has_channel"); + __publicField(this, "endpoint"); + __publicField(this, "account_byline"); + __publicField(this, "channel_handle"); + this.account_name = new Text2(data.accountName); + this.account_photo = Thumbnail.fromResponse(data.accountPhoto); + this.is_selected = !!data.isSelected; + this.is_disabled = !!data.isDisabled; + this.has_channel = !!data.hasChannel; + this.endpoint = new NavigationEndpoint(data.serviceEndpoint); + this.account_byline = new Text2(data.accountByline); + this.channel_handle = new Text2(data.channelHandle); + } +}; +__name(_AccountItem, "AccountItem"); +__publicField(_AccountItem, "type", "AccountItem"); +var AccountItem = _AccountItem; + +// dist/src/parser/classes/AccountItemSectionHeader.js +var _AccountItemSectionHeader = class _AccountItemSectionHeader extends YTNode { + constructor(data) { + super(); + __publicField(this, "title"); + this.title = new Text2(data.title); + } +}; +__name(_AccountItemSectionHeader, "AccountItemSectionHeader"); +__publicField(_AccountItemSectionHeader, "type", "AccountItemSectionHeader"); +var AccountItemSectionHeader = _AccountItemSectionHeader; + +// dist/src/parser/classes/CompactLink.js +var _CompactLink = class _CompactLink extends YTNode { + constructor(data) { + super(); + __publicField(this, "title"); + __publicField(this, "subtitle"); + __publicField(this, "endpoint"); + __publicField(this, "style"); + __publicField(this, "icon_type"); + __publicField(this, "secondary_icon_type"); + this.title = new Text2(data.title).toString(); + if ("subtitle" in data) + this.subtitle = new Text2(data.subtitle); + if ("icon" in data && "iconType" in data.icon) + this.icon_type = data.icon.iconType; + if ("secondaryIcon" in data && "iconType" in data.secondaryIcon) + this.secondary_icon_type = data.secondaryIcon.iconType; + this.endpoint = new NavigationEndpoint(data.navigationEndpoint || data.serviceEndpoint); + this.style = data.style; + } +}; +__name(_CompactLink, "CompactLink"); +__publicField(_CompactLink, "type", "CompactLink"); +var CompactLink = _CompactLink; + +// dist/src/parser/classes/AccountItemSection.js +var _AccountItemSection = class _AccountItemSection extends YTNode { + constructor(data) { + super(); + __publicField(this, "contents"); + __publicField(this, "header"); + this.contents = parser_exports.parseArray(data.contents, [AccountItem, CompactLink]); + this.header = parser_exports.parseItem(data.header, AccountItemSectionHeader); + } +}; +__name(_AccountItemSection, "AccountItemSection"); +__publicField(_AccountItemSection, "type", "AccountItemSection"); +var AccountItemSection = _AccountItemSection; + +// dist/src/parser/classes/AccountSectionList.js +var _AccountSectionList = class _AccountSectionList extends YTNode { + constructor(data) { + super(); + __publicField(this, "contents"); + __publicField(this, "footers"); + this.contents = parser_exports.parseArray(data.contents, AccountItemSection); + this.footers = parser_exports.parseArray(data.footers, AccountChannel); + } +}; +__name(_AccountSectionList, "AccountSectionList"); +__publicField(_AccountSectionList, "type", "AccountSectionList"); +var AccountSectionList = _AccountSectionList; + +// dist/src/parser/classes/actions/AppendContinuationItemsAction.js +var _AppendContinuationItemsAction = class _AppendContinuationItemsAction extends YTNode { + constructor(data) { + super(); + __publicField(this, "contents"); + __publicField(this, "target"); + this.contents = parser_exports.parseArray(data.continuationItems); + this.target = data.target; + } +}; +__name(_AppendContinuationItemsAction, "AppendContinuationItemsAction"); +__publicField(_AppendContinuationItemsAction, "type", "AppendContinuationItemsAction"); +var AppendContinuationItemsAction = _AppendContinuationItemsAction; + +// dist/src/parser/classes/actions/ChangeEngagementPanelVisibilityAction.js +var _ChangeEngagementPanelVisibilityAction = class _ChangeEngagementPanelVisibilityAction extends YTNode { + constructor(data) { + super(); + __publicField(this, "target_id"); + __publicField(this, "visibility"); + this.target_id = data.targetId; + this.visibility = data.visibility; + } +}; +__name(_ChangeEngagementPanelVisibilityAction, "ChangeEngagementPanelVisibilityAction"); +__publicField(_ChangeEngagementPanelVisibilityAction, "type", "ChangeEngagementPanelVisibilityAction"); +var ChangeEngagementPanelVisibilityAction = _ChangeEngagementPanelVisibilityAction; + +// dist/src/parser/classes/menus/MultiPageMenu.js +var _MultiPageMenu = class _MultiPageMenu extends YTNode { + constructor(data) { + super(); + __publicField(this, "header"); + __publicField(this, "sections"); + __publicField(this, "style"); + this.header = parser_exports.parseItem(data.header); + this.sections = parser_exports.parseArray(data.sections); + this.style = data.style; + } +}; +__name(_MultiPageMenu, "MultiPageMenu"); +__publicField(_MultiPageMenu, "type", "MultiPageMenu"); +var MultiPageMenu = _MultiPageMenu; + +// dist/src/parser/classes/actions/GetMultiPageMenuAction.js +var _GetMultiPageMenuAction = class _GetMultiPageMenuAction extends YTNode { + constructor(data) { + super(); + __publicField(this, "menu"); + this.menu = parser_exports.parseItem(data.menu, MultiPageMenu); + } +}; +__name(_GetMultiPageMenuAction, "GetMultiPageMenuAction"); +__publicField(_GetMultiPageMenuAction, "type", "GetMultiPageMenuAction"); +var GetMultiPageMenuAction = _GetMultiPageMenuAction; + +// dist/src/parser/classes/actions/SendFeedbackAction.js +var _SendFeedbackAction = class _SendFeedbackAction extends YTNode { + constructor(data) { + super(); + __publicField(this, "bucket"); + this.bucket = data.bucket; + } +}; +__name(_SendFeedbackAction, "SendFeedbackAction"); +__publicField(_SendFeedbackAction, "type", "SendFeedbackAction"); +var SendFeedbackAction = _SendFeedbackAction; + +// dist/src/parser/classes/actions/SignalAction.js +var _SignalAction = class _SignalAction extends YTNode { + constructor(data) { + super(); + __publicField(this, "signal"); + this.signal = data.signal; + } +}; +__name(_SignalAction, "SignalAction"); +__publicField(_SignalAction, "type", "SignalAction"); +var SignalAction = _SignalAction; + +// dist/src/parser/classes/ChannelSwitcherPage.js +var _ChannelSwitcherPage = class _ChannelSwitcherPage extends YTNode { + constructor(data) { + super(); + __publicField(this, "header"); + __publicField(this, "contents"); + this.header = parser_exports.parseItem(data.header); + this.contents = parser_exports.parse(data.contents, true); + } +}; +__name(_ChannelSwitcherPage, "ChannelSwitcherPage"); +__publicField(_ChannelSwitcherPage, "type", "ChannelSwitcherPage"); +var ChannelSwitcherPage = _ChannelSwitcherPage; + +// dist/src/parser/classes/actions/UpdateChannelSwitcherPageAction.js +var _UpdateChannelSwitcherPageAction = class _UpdateChannelSwitcherPageAction extends YTNode { + constructor(data) { + super(); + __publicField(this, "header"); + __publicField(this, "contents"); + const page = parser_exports.parseItem(data.page, ChannelSwitcherPage); + if (page) { + this.header = page.header; + this.contents = page.contents; + } + } +}; +__name(_UpdateChannelSwitcherPageAction, "UpdateChannelSwitcherPageAction"); +__publicField(_UpdateChannelSwitcherPageAction, "type", "UpdateChannelSwitcherPageAction"); +var UpdateChannelSwitcherPageAction = _UpdateChannelSwitcherPageAction; + +// dist/src/parser/classes/SortFilterSubMenu.js +var _SortFilterSubMenu = class _SortFilterSubMenu extends YTNode { + constructor(data) { + super(); + __publicField(this, "title"); + __publicField(this, "icon_type"); + __publicField(this, "tooltip"); + __publicField(this, "sub_menu_items"); + __publicField(this, "accessibility"); + if ("title" in data) { + this.title = data.title; + } + if ("icon" in data) { + this.icon_type = data.icon.iconType; + } + if ("tooltip" in data) { + this.tooltip = data.tooltip; + } + if ("subMenuItems" in data) { + this.sub_menu_items = data.subMenuItems.map((item) => { + var _a, _b; + return { + title: item.title, + selected: item.selected, + continuation: (_b = (_a = item.continuation) == null ? void 0 : _a.reloadContinuationData) == null ? void 0 : _b.continuation, + endpoint: new NavigationEndpoint(item.serviceEndpoint || item.navigationEndpoint), + subtitle: item.subtitle || null + }; + }); + } + if ("accessibility" in data && "accessibilityData" in data.accessibility) { + this.accessibility = { + accessibility_data: new AccessibilityData(data.accessibility.accessibilityData) + }; + } + } + get label() { + var _a, _b; + return (_b = (_a = this.accessibility) == null ? void 0 : _a.accessibility_data) == null ? void 0 : _b.label; + } +}; +__name(_SortFilterSubMenu, "SortFilterSubMenu"); +__publicField(_SortFilterSubMenu, "type", "SortFilterSubMenu"); +var SortFilterSubMenu = _SortFilterSubMenu; + +// dist/src/parser/classes/TranscriptFooter.js +var _TranscriptFooter = class _TranscriptFooter extends YTNode { + constructor(data) { + super(); + __publicField(this, "language_menu"); + this.language_menu = parser_exports.parseItem(data.languageMenu, SortFilterSubMenu); + } +}; +__name(_TranscriptFooter, "TranscriptFooter"); +__publicField(_TranscriptFooter, "type", "TranscriptFooter"); +var TranscriptFooter = _TranscriptFooter; + +// dist/src/parser/classes/TranscriptSearchBox.js +var _TranscriptSearchBox = class _TranscriptSearchBox extends YTNode { + constructor(data) { + super(); + __publicField(this, "formatted_placeholder"); + __publicField(this, "clear_button"); + __publicField(this, "endpoint"); + __publicField(this, "search_button"); + this.formatted_placeholder = new Text2(data.formattedPlaceholder); + this.clear_button = parser_exports.parseItem(data.clearButton, Button); + this.endpoint = new NavigationEndpoint(data.onTextChangeCommand); + this.search_button = parser_exports.parseItem(data.searchButton, Button); + } +}; +__name(_TranscriptSearchBox, "TranscriptSearchBox"); +__publicField(_TranscriptSearchBox, "type", "TranscriptSearchBox"); +var TranscriptSearchBox = _TranscriptSearchBox; + +// dist/src/parser/classes/TranscriptSectionHeader.js +var _TranscriptSectionHeader = class _TranscriptSectionHeader extends YTNode { + constructor(data) { + super(); + __publicField(this, "start_ms"); + __publicField(this, "end_ms"); + __publicField(this, "snippet"); + this.start_ms = data.startMs; + this.end_ms = data.endMs; + this.snippet = new Text2(data.snippet); + } +}; +__name(_TranscriptSectionHeader, "TranscriptSectionHeader"); +__publicField(_TranscriptSectionHeader, "type", "TranscriptSectionHeader"); +var TranscriptSectionHeader = _TranscriptSectionHeader; + +// dist/src/parser/classes/TranscriptSegment.js +var _TranscriptSegment = class _TranscriptSegment extends YTNode { + constructor(data) { + super(); + __publicField(this, "start_ms"); + __publicField(this, "end_ms"); + __publicField(this, "snippet"); + __publicField(this, "start_time_text"); + __publicField(this, "target_id"); + this.start_ms = data.startMs; + this.end_ms = data.endMs; + this.snippet = new Text2(data.snippet); + this.start_time_text = new Text2(data.startTimeText); + this.target_id = data.targetId; + } +}; +__name(_TranscriptSegment, "TranscriptSegment"); +__publicField(_TranscriptSegment, "type", "TranscriptSegment"); +var TranscriptSegment = _TranscriptSegment; + +// dist/src/parser/classes/TranscriptSegmentList.js +var _TranscriptSegmentList = class _TranscriptSegmentList extends YTNode { + constructor(data) { + super(); + __publicField(this, "initial_segments"); + __publicField(this, "no_result_label"); + __publicField(this, "retry_label"); + __publicField(this, "touch_captions_enabled"); + this.initial_segments = parser_exports.parseArray(data.initialSegments, [TranscriptSegment, TranscriptSectionHeader]); + this.no_result_label = new Text2(data.noResultLabel); + this.retry_label = new Text2(data.retryLabel); + this.touch_captions_enabled = data.touchCaptionsEnabled; + } +}; +__name(_TranscriptSegmentList, "TranscriptSegmentList"); +__publicField(_TranscriptSegmentList, "type", "TranscriptSegmentList"); +var TranscriptSegmentList = _TranscriptSegmentList; + +// dist/src/parser/classes/TranscriptSearchPanel.js +var _TranscriptSearchPanel = class _TranscriptSearchPanel extends YTNode { + constructor(data) { + super(); + __publicField(this, "header"); + __publicField(this, "body"); + __publicField(this, "footer"); + __publicField(this, "target_id"); + this.header = parser_exports.parseItem(data.header, TranscriptSearchBox); + this.body = parser_exports.parseItem(data.body, TranscriptSegmentList); + this.footer = parser_exports.parseItem(data.footer, TranscriptFooter); + this.target_id = data.targetId; + } +}; +__name(_TranscriptSearchPanel, "TranscriptSearchPanel"); +__publicField(_TranscriptSearchPanel, "type", "TranscriptSearchPanel"); +var TranscriptSearchPanel = _TranscriptSearchPanel; + +// dist/src/parser/classes/Transcript.js +var _Transcript = class _Transcript extends YTNode { + constructor(data) { + super(); + __publicField(this, "content"); + this.content = parser_exports.parseItem(data.content, TranscriptSearchPanel); + } +}; +__name(_Transcript, "Transcript"); +__publicField(_Transcript, "type", "Transcript"); +var Transcript = _Transcript; + +// dist/src/parser/classes/actions/UpdateEngagementPanelAction.js +var _UpdateEngagementPanelAction = class _UpdateEngagementPanelAction extends YTNode { + constructor(data) { + super(); + __publicField(this, "target_id"); + __publicField(this, "content"); + this.target_id = data.targetId; + this.content = parser_exports.parseItem(data.content, Transcript); + } +}; +__name(_UpdateEngagementPanelAction, "UpdateEngagementPanelAction"); +__publicField(_UpdateEngagementPanelAction, "type", "UpdateEngagementPanelAction"); +var UpdateEngagementPanelAction = _UpdateEngagementPanelAction; + +// dist/src/parser/classes/actions/UpdateSubscribeButtonAction.js +var _UpdateSubscribeButtonAction = class _UpdateSubscribeButtonAction extends YTNode { + constructor(data) { + super(); + __publicField(this, "channel_id"); + __publicField(this, "subscribed"); + this.channel_id = data.channelId; + this.subscribed = data.subscribed; + } +}; +__name(_UpdateSubscribeButtonAction, "UpdateSubscribeButtonAction"); +__publicField(_UpdateSubscribeButtonAction, "type", "UpdateSubscribeButtonAction"); +var UpdateSubscribeButtonAction = _UpdateSubscribeButtonAction; + +// dist/src/parser/classes/ActiveAccountHeader.js +var _ActiveAccountHeader = class _ActiveAccountHeader extends YTNode { + constructor(data) { + super(); + __publicField(this, "account_name"); + __publicField(this, "account_photo"); + __publicField(this, "endpoint"); + __publicField(this, "manage_account_title"); + __publicField(this, "channel_handle"); + this.account_name = new Text2(data.accountName); + this.account_photo = Thumbnail.fromResponse(data.accountPhoto); + this.endpoint = new NavigationEndpoint(data.serviceEndpoint); + this.manage_account_title = new Text2(data.manageAccountTitle); + this.channel_handle = new Text2(data.channelHandle); + } +}; +__name(_ActiveAccountHeader, "ActiveAccountHeader"); +__publicField(_ActiveAccountHeader, "type", "ActiveAccountHeader"); +var ActiveAccountHeader = _ActiveAccountHeader; + +// dist/src/parser/classes/MenuTitle.js +var _MenuTitle = class _MenuTitle extends YTNode { + constructor(data) { + super(); + __publicField(this, "title"); + this.title = new Text2(data.title); + } +}; +__name(_MenuTitle, "MenuTitle"); +__publicField(_MenuTitle, "type", "MenuTitle"); +var MenuTitle = _MenuTitle; + +// dist/src/parser/classes/PlaylistAddToOption.js +var _PlaylistAddToOption = class _PlaylistAddToOption extends YTNode { + constructor(data) { + var _a; + super(); + __publicField(this, "add_to_playlist_service_endpoint"); + __publicField(this, "contains_selected_videos"); + __publicField(this, "playlist_id"); + __publicField(this, "privacy"); + __publicField(this, "privacy_icon"); + __publicField(this, "remove_from_playlist_service_endpoint"); + __publicField(this, "title"); + this.add_to_playlist_service_endpoint = new NavigationEndpoint(data.addToPlaylistServiceEndpoint); + this.contains_selected_videos = data.containsSelectedVideos; + this.playlist_id = data.playlistId; + this.privacy = data.privacy; + this.privacy_icon = { icon_type: ((_a = data.privacyIcon) == null ? void 0 : _a.iconType) || null }; + this.remove_from_playlist_service_endpoint = new NavigationEndpoint(data.removeFromPlaylistServiceEndpoint); + this.title = new Text2(data.title); + } +}; +__name(_PlaylistAddToOption, "PlaylistAddToOption"); +__publicField(_PlaylistAddToOption, "type", "PlaylistAddToOption"); +var PlaylistAddToOption = _PlaylistAddToOption; + +// dist/src/parser/classes/AddToPlaylist.js +var _AddToPlaylist = class _AddToPlaylist extends YTNode { + constructor(data) { + super(); + __publicField(this, "actions"); + __publicField(this, "playlists"); + this.actions = parser_exports.parseArray(data.actions, [MenuTitle, Button]); + this.playlists = parser_exports.parseArray(data.playlists, PlaylistAddToOption); + } +}; +__name(_AddToPlaylist, "AddToPlaylist"); +__publicField(_AddToPlaylist, "type", "AddToPlaylist"); +var AddToPlaylist = _AddToPlaylist; + +// dist/src/parser/classes/Alert.js +var _Alert = class _Alert extends YTNode { + constructor(data) { + super(); + __publicField(this, "text"); + __publicField(this, "alert_type"); + this.text = new Text2(data.text); + this.alert_type = data.type; + } +}; +__name(_Alert, "Alert"); +__publicField(_Alert, "type", "Alert"); +var Alert = _Alert; + +// dist/src/parser/classes/AlertWithButton.js +var _AlertWithButton = class _AlertWithButton extends YTNode { + constructor(data) { + super(); + __publicField(this, "text"); + __publicField(this, "alert_type"); + __publicField(this, "dismiss_button"); + this.text = new Text2(data.text); + this.alert_type = data.type; + this.dismiss_button = parser_exports.parseItem(data.dismissButton, Button); + } +}; +__name(_AlertWithButton, "AlertWithButton"); +__publicField(_AlertWithButton, "type", "AlertWithButton"); +var AlertWithButton = _AlertWithButton; + +// dist/src/parser/classes/AnimatedThumbnailOverlayView.js +var _AnimatedThumbnailOverlayView = class _AnimatedThumbnailOverlayView extends YTNode { + constructor(data) { + super(); + __publicField(this, "thumbnail"); + this.thumbnail = Thumbnail.fromResponse(data.thumbnail); + } +}; +__name(_AnimatedThumbnailOverlayView, "AnimatedThumbnailOverlayView"); +__publicField(_AnimatedThumbnailOverlayView, "type", "AnimatedThumbnailOverlayView"); +var AnimatedThumbnailOverlayView = _AnimatedThumbnailOverlayView; + +// dist/src/parser/classes/AttributionView.js +var _AttributionView = class _AttributionView extends YTNode { + constructor(data) { + super(); + __publicField(this, "text"); + __publicField(this, "suffix"); + this.text = Text2.fromAttributed(data.text); + this.suffix = Text2.fromAttributed(data.suffix); + } +}; +__name(_AttributionView, "AttributionView"); +__publicField(_AttributionView, "type", "AttributionView"); +var AttributionView = _AttributionView; + +// dist/src/parser/classes/AudioOnlyPlayability.js +var _AudioOnlyPlayability = class _AudioOnlyPlayability extends YTNode { + constructor(data) { + super(); + __publicField(this, "audio_only_availability"); + this.audio_only_availability = data.audioOnlyAvailability; + } +}; +__name(_AudioOnlyPlayability, "AudioOnlyPlayability"); +__publicField(_AudioOnlyPlayability, "type", "AudioOnlyPlayability"); +var AudioOnlyPlayability = _AudioOnlyPlayability; + +// dist/src/parser/classes/AutomixPreviewVideo.js +var _AutomixPreviewVideo = class _AutomixPreviewVideo extends YTNode { + constructor(data) { + var _a, _b; + super(); + __publicField(this, "playlist_video"); + if ((_b = (_a = data == null ? void 0 : data.content) == null ? void 0 : _a.automixPlaylistVideoRenderer) == null ? void 0 : _b.navigationEndpoint) { + this.playlist_video = { + endpoint: new NavigationEndpoint(data.content.automixPlaylistVideoRenderer.navigationEndpoint) + }; + } + } +}; +__name(_AutomixPreviewVideo, "AutomixPreviewVideo"); +__publicField(_AutomixPreviewVideo, "type", "AutomixPreviewVideo"); +var AutomixPreviewVideo = _AutomixPreviewVideo; + +// dist/src/parser/classes/AvatarView.js +var _AvatarView = class _AvatarView extends YTNode { + constructor(data) { + super(); + __publicField(this, "image"); + __publicField(this, "image_processor"); + __publicField(this, "avatar_image_size"); + this.image = Thumbnail.fromResponse(data.image); + this.avatar_image_size = data.avatarImageSize; + if (data.image.processor) { + this.image_processor = { + border_image_processor: { + circular: data.image.processor.borderImageProcessor.circular + } + }; + } + } +}; +__name(_AvatarView, "AvatarView"); +__publicField(_AvatarView, "type", "AvatarView"); +var AvatarView = _AvatarView; + +// dist/src/parser/classes/misc/CommandContext.js +var _CommandContext = class _CommandContext { + constructor(data) { + __publicField(this, "on_focus"); + __publicField(this, "on_hidden"); + __publicField(this, "on_touch_end"); + __publicField(this, "on_touch_move"); + __publicField(this, "on_long_press"); + __publicField(this, "on_tap"); + __publicField(this, "on_touch_start"); + __publicField(this, "on_visible"); + __publicField(this, "on_first_visible"); + __publicField(this, "on_hover"); + if ("onFocus" in data) + this.on_focus = new NavigationEndpoint(data.onFocus); + if ("onHidden" in data) + this.on_hidden = new NavigationEndpoint(data.onHidden); + if ("onTouchEnd" in data) + this.on_touch_end = new NavigationEndpoint(data.onTouchEnd); + if ("onTouchMove" in data) + this.on_touch_move = new NavigationEndpoint(data.onTouchMove); + if ("onLongPress" in data) + this.on_long_press = new NavigationEndpoint(data.onLongPress); + if ("onTap" in data) + this.on_tap = new NavigationEndpoint(data.onTap); + if ("onTouchStart" in data) + this.on_touch_start = new NavigationEndpoint(data.onTouchStart); + if ("onVisible" in data) + this.on_visible = new NavigationEndpoint(data.onVisible); + if ("onFirstVisible" in data) + this.on_first_visible = new NavigationEndpoint(data.onFirstVisible); + if ("onHover" in data) + this.on_hover = new NavigationEndpoint(data.onHover); + } +}; +__name(_CommandContext, "CommandContext"); +var CommandContext = _CommandContext; + +// dist/src/parser/classes/misc/RendererContext.js +var _RendererContext = class _RendererContext { + constructor(data) { + __publicField(this, "command_context"); + __publicField(this, "accessibility_context"); + if (!data) + return; + if ("commandContext" in data) { + this.command_context = new CommandContext(data.commandContext); + } + if ("accessibilityContext" in data) { + this.accessibility_context = new AccessibilityContext(data.accessibilityContext); + } + } +}; +__name(_RendererContext, "RendererContext"); +var RendererContext = _RendererContext; + +// dist/src/parser/classes/AvatarStackView.js +var _AvatarStackView = class _AvatarStackView extends YTNode { + constructor(data) { + super(); + __publicField(this, "avatars"); + __publicField(this, "text"); + __publicField(this, "renderer_context"); + this.avatars = parser_exports.parseArray(data.avatars, AvatarView); + if (Reflect.has(data, "text")) + this.text = Text2.fromAttributed(data.text); + this.renderer_context = new RendererContext(data.rendererContext); + } +}; +__name(_AvatarStackView, "AvatarStackView"); +__publicField(_AvatarStackView, "type", "AvatarStackView"); +var AvatarStackView = _AvatarStackView; + +// dist/src/parser/classes/ButtonView.js +var _ButtonView = class _ButtonView extends YTNode { + constructor(data) { + super(); + __publicField(this, "secondary_icon_image"); + __publicField(this, "icon_name"); + __publicField(this, "enable_icon_button"); + __publicField(this, "tooltip"); + __publicField(this, "icon_image_flip_for_rtl"); + __publicField(this, "button_size"); + __publicField(this, "icon_position"); + __publicField(this, "is_full_width"); + __publicField(this, "state"); + __publicField(this, "on_disabled_tap"); + __publicField(this, "custom_border_color"); + __publicField(this, "on_tap"); + __publicField(this, "style"); + __publicField(this, "icon_image"); + __publicField(this, "custom_dark_theme_border_color"); + __publicField(this, "title"); + __publicField(this, "target_id"); + __publicField(this, "enable_full_width_margins"); + __publicField(this, "custom_font_color"); + __publicField(this, "button_type"); + __publicField(this, "enabled"); + __publicField(this, "accessibility_id"); + __publicField(this, "custom_background_color"); + __publicField(this, "on_long_press"); + __publicField(this, "title_formatted"); + __publicField(this, "on_visible"); + __publicField(this, "icon_trailing"); + __publicField(this, "accessibility_text"); + if ("secondaryIconImage" in data) + this.secondary_icon_image = Thumbnail.fromResponse(data.secondaryIconImage); + if ("iconName" in data) + this.icon_name = data.iconName; + if ("enableIconButton" in data) + this.enable_icon_button = data.enableIconButton; + if ("tooltip" in data) + this.tooltip = data.tooltip; + if ("iconImageFlipForRtl" in data) + this.icon_image_flip_for_rtl = data.iconImageFlipForRtl; + if ("buttonSize" in data) + this.button_size = data.buttonSize; + if ("iconPosition" in data) + this.icon_position = data.iconPosition; + if ("isFullWidth" in data) + this.is_full_width = data.isFullWidth; + if ("state" in data) + this.state = data.state; + if ("onDisabledTap" in data) + this.on_disabled_tap = new NavigationEndpoint(data.onDisabledTap); + if ("customBorderColor" in data) + this.custom_border_color = data.customBorderColor; + if ("onTap" in data) + this.on_tap = new NavigationEndpoint(data.onTap); + if ("style" in data) + this.style = data.style; + if ("iconImage" in data) + this.icon_image = data.iconImage; + if ("customDarkThemeBorderColor" in data) + this.custom_dark_theme_border_color = data.customDarkThemeBorderColor; + if ("title" in data) + this.title = data.title; + if ("targetId" in data) + this.target_id = data.targetId; + if ("enableFullWidthMargins" in data) + this.enable_full_width_margins = data.enableFullWidthMargins; + if ("customFontColor" in data) + this.custom_font_color = data.customFontColor; + if ("type" in data) + this.button_type = data.type; + if ("enabled" in data) + this.enabled = data.enabled; + if ("accessibilityId" in data) + this.accessibility_id = data.accessibilityId; + if ("customBackgroundColor" in data) + this.custom_background_color = data.customBackgroundColor; + if ("onLongPress" in data) + this.on_long_press = new NavigationEndpoint(data.onLongPress); + if ("titleFormatted" in data) + this.title_formatted = data.titleFormatted; + if ("onVisible" in data) + this.on_visible = data.onVisible; + if ("iconTrailing" in data) + this.icon_trailing = data.iconTrailing; + if ("accessibilityText" in data) + this.accessibility_text = data.accessibilityText; + } +}; +__name(_ButtonView, "ButtonView"); +__publicField(_ButtonView, "type", "ButtonView"); +var ButtonView = _ButtonView; + +// dist/src/parser/classes/BackgroundPromo.js +var _BackgroundPromo = class _BackgroundPromo extends YTNode { + constructor(data) { + super(); + __publicField(this, "body_text"); + __publicField(this, "cta_button"); + __publicField(this, "icon_type"); + __publicField(this, "title"); + this.body_text = new Text2(data.bodyText); + this.cta_button = parser_exports.parseItem(data.ctaButton, [Button, ButtonView]); + if (Reflect.has(data, "icon")) + this.icon_type = data.icon.iconType; + this.title = new Text2(data.title); + } +}; +__name(_BackgroundPromo, "BackgroundPromo"); +__publicField(_BackgroundPromo, "type", "BackgroundPromo"); +var BackgroundPromo = _BackgroundPromo; + +// dist/src/parser/classes/BackstageImage.js +var _BackstageImage = class _BackstageImage extends YTNode { + constructor(data) { + super(); + __publicField(this, "image"); + __publicField(this, "endpoint"); + this.image = Thumbnail.fromResponse(data.image); + this.endpoint = new NavigationEndpoint(data.command); + } +}; +__name(_BackstageImage, "BackstageImage"); +__publicField(_BackstageImage, "type", "BackstageImage"); +var BackstageImage = _BackstageImage; + +// dist/src/parser/classes/ToggleButton.js +var _ToggleButton = class _ToggleButton extends YTNode { + constructor(data) { + var _a, _b, _c, _d, _e, _f, _g, _h, _i; + super(); + __publicField(this, "text"); + __publicField(this, "toggled_text"); + __publicField(this, "tooltip"); + __publicField(this, "toggled_tooltip"); + __publicField(this, "is_toggled"); + __publicField(this, "is_disabled"); + __publicField(this, "icon_type"); + __publicField(this, "like_count"); + __publicField(this, "short_like_count"); + __publicField(this, "endpoint"); + __publicField(this, "toggled_endpoint"); + __publicField(this, "button_id"); + __publicField(this, "target_id"); + this.text = new Text2(data.defaultText); + this.toggled_text = new Text2(data.toggledText); + this.tooltip = data.defaultTooltip; + this.toggled_tooltip = data.toggledTooltip; + this.is_toggled = data.isToggled; + this.is_disabled = data.isDisabled; + this.icon_type = (_a = data.defaultIcon) == null ? void 0 : _a.iconType; + const acc_label = ((_d = (_c = (_b = data == null ? void 0 : data.defaultText) == null ? void 0 : _b.accessibility) == null ? void 0 : _c.accessibilityData) == null ? void 0 : _d.label) || ((_f = (_e = data == null ? void 0 : data.accessibilityData) == null ? void 0 : _e.accessibilityData) == null ? void 0 : _f.label) || ((_g = data == null ? void 0 : data.accessibility) == null ? void 0 : _g.label); + if (this.icon_type == "LIKE") { + this.like_count = parseInt(acc_label.replace(/\D/g, "")); + this.short_like_count = new Text2(data.defaultText).toString(); + } + this.endpoint = ((_i = (_h = data.defaultServiceEndpoint) == null ? void 0 : _h.commandExecutorCommand) == null ? void 0 : _i.commands) ? new NavigationEndpoint(data.defaultServiceEndpoint.commandExecutorCommand.commands.pop()) : new NavigationEndpoint(data.defaultServiceEndpoint); + this.toggled_endpoint = new NavigationEndpoint(data.toggledServiceEndpoint); + if (Reflect.has(data, "toggleButtonSupportedData") && Reflect.has(data.toggleButtonSupportedData, "toggleButtonIdData")) { + this.button_id = data.toggleButtonSupportedData.toggleButtonIdData.id; + } + if (Reflect.has(data, "targetId")) { + this.target_id = data.targetId; + } + } +}; +__name(_ToggleButton, "ToggleButton"); +__publicField(_ToggleButton, "type", "ToggleButton"); +var ToggleButton = _ToggleButton; + +// dist/src/parser/classes/comments/CreatorHeart.js +var _CreatorHeart = class _CreatorHeart extends YTNode { + constructor(data) { + var _a, _b; + super(); + __publicField(this, "creator_thumbnail"); + __publicField(this, "heart_icon_type"); + __publicField(this, "heart_color"); + __publicField(this, "hearted_tooltip"); + __publicField(this, "is_hearted"); + __publicField(this, "is_enabled"); + __publicField(this, "kennedy_heart_color_string"); + this.creator_thumbnail = Thumbnail.fromResponse(data.creatorThumbnail); + if (Reflect.has(data, "heartIcon") && Reflect.has(data.heartIcon, "iconType")) { + this.heart_icon_type = data.heartIcon.iconType; + } + this.heart_color = { + basic_color_palette_data: { + foreground_title_color: (_b = (_a = data.heartColor) == null ? void 0 : _a.basicColorPaletteData) == null ? void 0 : _b.foregroundTitleColor + } + }; + this.hearted_tooltip = data.heartedTooltip; + this.is_hearted = data.isHearted; + this.is_enabled = data.isEnabled; + this.kennedy_heart_color_string = data.kennedyHeartColorString; + } +}; +__name(_CreatorHeart, "CreatorHeart"); +__publicField(_CreatorHeart, "type", "CreatorHeart"); +var CreatorHeart = _CreatorHeart; + +// dist/src/parser/classes/comments/CommentActionButtons.js +var _CommentActionButtons = class _CommentActionButtons extends YTNode { + constructor(data) { + super(); + __publicField(this, "like_button"); + __publicField(this, "dislike_button"); + __publicField(this, "reply_button"); + __publicField(this, "creator_heart"); + this.like_button = parser_exports.parseItem(data.likeButton, ToggleButton); + this.dislike_button = parser_exports.parseItem(data.dislikeButton, ToggleButton); + this.reply_button = parser_exports.parseItem(data.replyButton, Button); + this.creator_heart = parser_exports.parseItem(data.creatorHeart, CreatorHeart); + } +}; +__name(_CommentActionButtons, "CommentActionButtons"); +__publicField(_CommentActionButtons, "type", "CommentActionButtons"); +var CommentActionButtons = _CommentActionButtons; + +// dist/src/parser/classes/ToggleButtonView.js +var _ToggleButtonView = class _ToggleButtonView extends YTNode { + constructor(data) { + super(); + __publicField(this, "default_button"); + __publicField(this, "toggled_button"); + __publicField(this, "is_toggling_disabled"); + __publicField(this, "identifier"); + __publicField(this, "is_toggled"); + this.default_button = parser_exports.parseItem(data.defaultButtonViewModel, ButtonView); + this.toggled_button = parser_exports.parseItem(data.toggledButtonViewModel, ButtonView); + this.is_toggling_disabled = data.isTogglingDisabled; + this.identifier = data.identifier; + if (Reflect.has(data, "isToggled")) { + this.is_toggled = data.isToggled; + } + } +}; +__name(_ToggleButtonView, "ToggleButtonView"); +__publicField(_ToggleButtonView, "type", "ToggleButtonView"); +var ToggleButtonView = _ToggleButtonView; + +// dist/src/parser/classes/LikeButtonView.js +var _LikeButtonView = class _LikeButtonView extends YTNode { + constructor(data) { + super(); + __publicField(this, "toggle_button"); + __publicField(this, "like_status_entity_key"); + __publicField(this, "like_status_entity"); + this.toggle_button = parser_exports.parseItem(data.toggleButtonViewModel, ToggleButtonView); + this.like_status_entity_key = data.likeStatusEntityKey; + this.like_status_entity = { + key: data.likeStatusEntity.key, + like_status: data.likeStatusEntity.likeStatus + }; + } +}; +__name(_LikeButtonView, "LikeButtonView"); +__publicField(_LikeButtonView, "type", "LikeButtonView"); +var LikeButtonView = _LikeButtonView; + +// dist/src/parser/classes/DislikeButtonView.js +var _DislikeButtonView = class _DislikeButtonView extends YTNode { + constructor(data) { + super(); + __publicField(this, "toggle_button"); + __publicField(this, "dislike_entity_key"); + this.toggle_button = parser_exports.parseItem(data.toggleButtonViewModel, ToggleButtonView); + this.dislike_entity_key = data.dislikeEntityKey; + } +}; +__name(_DislikeButtonView, "DislikeButtonView"); +__publicField(_DislikeButtonView, "type", "DislikeButtonView"); +var DislikeButtonView = _DislikeButtonView; + +// dist/src/parser/classes/SegmentedLikeDislikeButtonView.js +var _SegmentedLikeDislikeButtonView = class _SegmentedLikeDislikeButtonView extends YTNode { + constructor(data) { + super(); + __publicField(this, "like_button"); + __publicField(this, "dislike_button"); + __publicField(this, "icon_type"); + __publicField(this, "like_count_entity"); + __publicField(this, "dynamic_like_count_update_data"); + __publicField(this, "like_count"); + __publicField(this, "short_like_count"); + this.like_button = parser_exports.parseItem(data.likeButtonViewModel, LikeButtonView); + this.dislike_button = parser_exports.parseItem(data.dislikeButtonViewModel, DislikeButtonView); + this.icon_type = data.iconType; + if (this.like_button && this.like_button.toggle_button) { + const toggle_button = this.like_button.toggle_button; + if (toggle_button.default_button) { + this.short_like_count = toggle_button.default_button.title; + if (toggle_button.default_button.accessibility_text) + this.like_count = parseInt(toggle_button.default_button.accessibility_text.replace(/\D/g, "")); + } else if (toggle_button.toggled_button) { + this.short_like_count = toggle_button.toggled_button.title; + if (toggle_button.toggled_button.accessibility_text) + this.like_count = parseInt(toggle_button.toggled_button.accessibility_text.replace(/\D/g, "")); + } + } + this.like_count_entity = { + key: data.likeCountEntity.key + }; + this.dynamic_like_count_update_data = { + update_status_key: data.dynamicLikeCountUpdateData.updateStatusKey, + placeholder_like_count_values_key: data.dynamicLikeCountUpdateData.placeholderLikeCountValuesKey, + update_delay_loop_id: data.dynamicLikeCountUpdateData.updateDelayLoopId, + update_delay_sec: data.dynamicLikeCountUpdateData.updateDelaySec + }; + } +}; +__name(_SegmentedLikeDislikeButtonView, "SegmentedLikeDislikeButtonView"); +__publicField(_SegmentedLikeDislikeButtonView, "type", "SegmentedLikeDislikeButtonView"); +var SegmentedLikeDislikeButtonView = _SegmentedLikeDislikeButtonView; + +// dist/src/parser/classes/menus/MenuServiceItem.js +var _MenuServiceItem = class _MenuServiceItem extends Button { + constructor(data) { + super(data); + } +}; +__name(_MenuServiceItem, "MenuServiceItem"); +__publicField(_MenuServiceItem, "type", "MenuServiceItem"); +var MenuServiceItem = _MenuServiceItem; + +// dist/src/parser/classes/DownloadButton.js +var _DownloadButton = class _DownloadButton extends YTNode { + constructor(data) { + super(); + __publicField(this, "style"); + __publicField(this, "size"); + // TODO: check this + __publicField(this, "endpoint"); + __publicField(this, "target_id"); + this.style = data.style; + this.size = data.size; + this.endpoint = new NavigationEndpoint(data.command); + this.target_id = data.targetId; + } +}; +__name(_DownloadButton, "DownloadButton"); +__publicField(_DownloadButton, "type", "DownloadButton"); +var DownloadButton = _DownloadButton; + +// dist/src/parser/classes/menus/MenuServiceItemDownload.js +var _MenuServiceItemDownload = class _MenuServiceItemDownload extends YTNode { + constructor(data) { + super(); + __publicField(this, "has_separator"); + __publicField(this, "endpoint"); + this.has_separator = !!data.hasSeparator; + this.endpoint = new NavigationEndpoint(data.navigationEndpoint || data.serviceEndpoint); + } +}; +__name(_MenuServiceItemDownload, "MenuServiceItemDownload"); +__publicField(_MenuServiceItemDownload, "type", "MenuServiceItemDownload"); +var MenuServiceItemDownload = _MenuServiceItemDownload; + +// dist/src/parser/classes/SubscribeButtonView.js +var _SubscribeButtonView_instances, parseButtonContent_fn; +var _SubscribeButtonView = class _SubscribeButtonView extends YTNode { + constructor(data) { + var _a, _b, _c, _d, _e, _f; + super(); + __privateAdd(this, _SubscribeButtonView_instances); + __publicField(this, "subscribe_button_content"); + __publicField(this, "unsubscribe_button_content"); + __publicField(this, "disable_notification_bell"); + __publicField(this, "button_style"); + __publicField(this, "is_signed_out"); + __publicField(this, "background_style"); + __publicField(this, "disable_subscribe_button"); + __publicField(this, "on_show_subscription_options"); + __publicField(this, "channel_id"); + __publicField(this, "enable_subscribe_button_post_click_animation"); + __publicField(this, "bell_accessibility_data"); + this.subscribe_button_content = __privateMethod(this, _SubscribeButtonView_instances, parseButtonContent_fn).call(this, data.subscribeButtonContent); + this.unsubscribe_button_content = __privateMethod(this, _SubscribeButtonView_instances, parseButtonContent_fn).call(this, data.unsubscribeButtonContent); + this.disable_notification_bell = data.disableNotificationBell; + if ("buttonStyle" in data) { + this.button_style = { + unsubscribed_state_style: (_a = data.buttonStyle) == null ? void 0 : _a.unsubscribedStateStyle, + subscribed_state_style: (_b = data.buttonStyle) == null ? void 0 : _b.subscribedStateStyle + }; + } + this.is_signed_out = data.isSignedOut; + this.background_style = data.backgroundStyle; + this.disable_subscribe_button = data.disableSubscribeButton; + if ("onShowSubscriptionOptions" in data) { + this.on_show_subscription_options = new NavigationEndpoint(data.onShowSubscriptionOptions); + } + this.channel_id = data.channelId; + this.enable_subscribe_button_post_click_animation = data.enableSubscribeButtonPostClickAnimation; + if ("bellAccessibilityData" in data) { + this.bell_accessibility_data = { + off_label: (_c = data.bellAccessibilityData) == null ? void 0 : _c.offLabel, + all_label: (_d = data.bellAccessibilityData) == null ? void 0 : _d.allLabel, + occasional_label: (_e = data.bellAccessibilityData) == null ? void 0 : _e.occasionalLabel, + disabled_label: (_f = data.bellAccessibilityData) == null ? void 0 : _f.disabledLabel + }; + } + } +}; +_SubscribeButtonView_instances = new WeakSet(); +parseButtonContent_fn = /* @__PURE__ */ __name(function(data) { + return { + button_text: data.buttonText, + accessibility_text: data.accessibilityText, + image_name: data.imageName, + subscribe_state_subscribed: data.subscribeState.subscribed, + endpoint: new NavigationEndpoint(data.onTapCommand) + }; +}, "#parseButtonContent"); +__name(_SubscribeButtonView, "SubscribeButtonView"); +__publicField(_SubscribeButtonView, "type", "SubscribeButtonView"); +var SubscribeButtonView = _SubscribeButtonView; + +// dist/src/parser/classes/ListItemView.js +var _ListItemView = class _ListItemView extends YTNode { + constructor(data) { + var _a; + super(); + __publicField(this, "title"); + __publicField(this, "subtitle"); + __publicField(this, "leading_accessory"); + __publicField(this, "renderer_context"); + __publicField(this, "trailing_buttons"); + if ("title" in data) { + this.title = Text2.fromAttributed(data.title); + } + if ("subtitle" in data) { + this.subtitle = Text2.fromAttributed(data.subtitle); + } + this.leading_accessory = parser_exports.parseItem(data.leadingAccessory, AvatarView); + if ("rendererContext" in data) { + this.renderer_context = new RendererContext(data.rendererContext); + } + this.trailing_buttons = parser_exports.parseArray((_a = data.trailingButtons) == null ? void 0 : _a.buttons, SubscribeButtonView); + } +}; +__name(_ListItemView, "ListItemView"); +__publicField(_ListItemView, "type", "ListItemView"); +var ListItemView = _ListItemView; + +// dist/src/parser/classes/menus/MenuFlexibleItem.js +var _MenuFlexibleItem = class _MenuFlexibleItem extends YTNode { + constructor(data) { + super(); + __publicField(this, "menu_item"); + __publicField(this, "top_level_button"); + this.menu_item = parser_exports.parseItem(data.menuItem, [ListItemView, MenuServiceItem, MenuServiceItemDownload]); + this.top_level_button = parser_exports.parseItem(data.topLevelButton, [DownloadButton, ButtonView, Button]); + } +}; +__name(_MenuFlexibleItem, "MenuFlexibleItem"); +__publicField(_MenuFlexibleItem, "type", "MenuFlexibleItem"); +var MenuFlexibleItem = _MenuFlexibleItem; + +// dist/src/parser/classes/LikeButton.js +var _LikeButton = class _LikeButton extends YTNode { + constructor(data) { + super(); + __publicField(this, "target"); + __publicField(this, "like_status"); + __publicField(this, "likes_allowed"); + __publicField(this, "endpoints"); + this.target = { + video_id: data.target.videoId + }; + this.like_status = data.likeStatus; + this.likes_allowed = data.likesAllowed; + if (Reflect.has(data, "serviceEndpoints")) { + this.endpoints = data.serviceEndpoints.map((endpoint) => new NavigationEndpoint(endpoint)); + } + } +}; +__name(_LikeButton, "LikeButton"); +__publicField(_LikeButton, "type", "LikeButton"); +var LikeButton = _LikeButton; + +// dist/src/parser/classes/FlexibleActionsView.js +var _FlexibleActionsView = class _FlexibleActionsView extends YTNode { + constructor(data) { + super(); + __publicField(this, "actions_rows"); + __publicField(this, "style"); + this.actions_rows = data.actionsRows.map((row) => ({ + actions: parser_exports.parseArray(row.actions, [ButtonView, ToggleButtonView, SubscribeButtonView]) + })); + this.style = data.style; + } +}; +__name(_FlexibleActionsView, "FlexibleActionsView"); +__publicField(_FlexibleActionsView, "type", "FlexibleActionsView"); +var FlexibleActionsView = _FlexibleActionsView; + +// dist/src/parser/classes/menus/Menu.js +var _Menu = class _Menu extends YTNode { + constructor(data) { + super(); + __publicField(this, "items"); + __publicField(this, "flexible_items"); + __publicField(this, "top_level_buttons"); + __publicField(this, "accessibility"); + this.items = parser_exports.parseArray(data.items); + this.flexible_items = parser_exports.parseArray(data.flexibleItems, MenuFlexibleItem); + this.top_level_buttons = parser_exports.parseArray(data.topLevelButtons, [ToggleButton, LikeButton, Button, ButtonView, SegmentedLikeDislikeButtonView, FlexibleActionsView]); + if ("accessibility" in data && "accessibilityData" in data.accessibility) { + this.accessibility = { + accessibility_data: new AccessibilityData(data.accessibility.accessibilityData) + }; + } + } + get label() { + var _a, _b; + return (_b = (_a = this.accessibility) == null ? void 0 : _a.accessibility_data) == null ? void 0 : _b.label; + } + // XXX: alias for consistency + get contents() { + return this.items; + } +}; +__name(_Menu, "Menu"); +__publicField(_Menu, "type", "Menu"); +var Menu = _Menu; + +// dist/src/parser/classes/BackstagePost.js +var _BackstagePost = class _BackstagePost extends YTNode { + constructor(data) { + super(); + __publicField(this, "id"); + __publicField(this, "author"); + __publicField(this, "content"); + __publicField(this, "published"); + __publicField(this, "poll_status"); + __publicField(this, "vote_status"); + __publicField(this, "vote_count"); + __publicField(this, "menu"); + __publicField(this, "action_buttons"); + __publicField(this, "vote_button"); + __publicField(this, "surface"); + __publicField(this, "endpoint"); + __publicField(this, "attachment"); + this.id = data.postId; + this.author = new Author({ + ...data.authorText, + navigationEndpoint: data.authorEndpoint + }, null, data.authorThumbnail); + this.content = new Text2(data.contentText); + this.published = new Text2(data.publishedTimeText); + if (Reflect.has(data, "pollStatus")) { + this.poll_status = data.pollStatus; + } + if (Reflect.has(data, "voteStatus")) { + this.vote_status = data.voteStatus; + } + if (Reflect.has(data, "voteCount")) { + this.vote_count = new Text2(data.voteCount); + } + if (Reflect.has(data, "actionMenu")) { + this.menu = parser_exports.parseItem(data.actionMenu, Menu); + } + if (Reflect.has(data, "actionButtons")) { + this.action_buttons = parser_exports.parseItem(data.actionButtons, CommentActionButtons); + } + if (Reflect.has(data, "voteButton")) { + this.vote_button = parser_exports.parseItem(data.voteButton, Button); + } + if (Reflect.has(data, "navigationEndpoint")) { + this.endpoint = new NavigationEndpoint(data.navigationEndpoint); + } + if (Reflect.has(data, "backstageAttachment")) { + this.attachment = parser_exports.parseItem(data.backstageAttachment); + } + this.surface = data.surface; + } +}; +__name(_BackstagePost, "BackstagePost"); +__publicField(_BackstagePost, "type", "BackstagePost"); +var BackstagePost = _BackstagePost; + +// dist/src/parser/classes/BackstagePostThread.js +var _BackstagePostThread = class _BackstagePostThread extends YTNode { + constructor(data) { + super(); + __publicField(this, "post"); + this.post = parser_exports.parseItem(data.post); + } +}; +__name(_BackstagePostThread, "BackstagePostThread"); +__publicField(_BackstagePostThread, "type", "BackstagePostThread"); +var BackstagePostThread = _BackstagePostThread; + +// dist/src/parser/classes/BadgeView.js +var _BadgeView = class _BadgeView extends YTNode { + constructor(data) { + super(); + __publicField(this, "text"); + __publicField(this, "style"); + __publicField(this, "accessibility_label"); + this.text = data.badgeText; + this.style = data.badgeStyle; + this.accessibility_label = data.accessibilityLabel; + } +}; +__name(_BadgeView, "BadgeView"); +var BadgeView = _BadgeView; + +// dist/src/parser/classes/SubFeedOption.js +var _SubFeedOption = class _SubFeedOption extends YTNode { + constructor(data) { + super(); + __publicField(this, "name"); + __publicField(this, "is_selected"); + __publicField(this, "endpoint"); + this.name = new Text2(data.name); + this.is_selected = data.isSelected; + this.endpoint = new NavigationEndpoint(data.navigationEndpoint); + } +}; +__name(_SubFeedOption, "SubFeedOption"); +__publicField(_SubFeedOption, "type", "SubFeedOption"); +var SubFeedOption = _SubFeedOption; + +// dist/src/parser/classes/SubFeedSelector.js +var _SubFeedSelector = class _SubFeedSelector extends YTNode { + constructor(data) { + super(); + __publicField(this, "title"); + __publicField(this, "options"); + this.title = new Text2(data.title); + this.options = parser_exports.parseArray(data.options, SubFeedOption); + } +}; +__name(_SubFeedSelector, "SubFeedSelector"); +__publicField(_SubFeedSelector, "type", "SubFeedSelector"); +var SubFeedSelector = _SubFeedSelector; + +// dist/src/parser/classes/EomSettingsDisclaimer.js +var _EomSettingsDisclaimer = class _EomSettingsDisclaimer extends YTNode { + constructor(data) { + super(); + __publicField(this, "disclaimer"); + __publicField(this, "info_icon"); + __publicField(this, "usage_scenario"); + this.disclaimer = new Text2(data.disclaimer); + this.info_icon = { + icon_type: data.infoIcon.iconType + }; + this.usage_scenario = data.usageScenario; + } +}; +__name(_EomSettingsDisclaimer, "EomSettingsDisclaimer"); +__publicField(_EomSettingsDisclaimer, "type", "EomSettingsDisclaimer"); +var EomSettingsDisclaimer = _EomSettingsDisclaimer; + +// dist/src/parser/classes/SearchBox.js +var _SearchBox = class _SearchBox extends YTNode { + constructor(data) { + super(); + __publicField(this, "endpoint"); + __publicField(this, "search_button"); + __publicField(this, "clear_button"); + __publicField(this, "placeholder_text"); + this.endpoint = new NavigationEndpoint(data.endpoint); + this.search_button = parser_exports.parseItem(data.searchButton, Button); + this.clear_button = parser_exports.parseItem(data.clearButton, Button); + this.placeholder_text = new Text2(data.placeholderText); + } +}; +__name(_SearchBox, "SearchBox"); +__publicField(_SearchBox, "type", "SearchBox"); +var SearchBox = _SearchBox; + +// dist/src/parser/classes/BrowseFeedActions.js +var _BrowseFeedActions = class _BrowseFeedActions extends YTNode { + constructor(data) { + super(); + __publicField(this, "contents"); + this.contents = parser_exports.parseArray(data.contents, [SubFeedSelector, EomSettingsDisclaimer, ToggleButton, CompactLink, SearchBox, Button]); + } +}; +__name(_BrowseFeedActions, "BrowseFeedActions"); +__publicField(_BrowseFeedActions, "type", "BrowseFeedActions"); +var BrowseFeedActions = _BrowseFeedActions; + +// dist/src/parser/classes/BrowserMediaSession.js +var _BrowserMediaSession = class _BrowserMediaSession extends YTNode { + constructor(data) { + super(); + __publicField(this, "album"); + __publicField(this, "thumbnails"); + this.album = new Text2(data.album); + this.thumbnails = Thumbnail.fromResponse(data.thumbnailDetails); + } +}; +__name(_BrowserMediaSession, "BrowserMediaSession"); +__publicField(_BrowserMediaSession, "type", "BrowserMediaSession"); +var BrowserMediaSession = _BrowserMediaSession; + +// dist/src/parser/classes/ButtonCardView.js +var _ButtonCardView = class _ButtonCardView extends YTNode { + constructor(data) { + super(); + __publicField(this, "title"); + __publicField(this, "icon_name"); + __publicField(this, "renderer_context"); + this.title = data.title; + this.icon_name = data.image.sources[0].clientResource.imageName; + this.renderer_context = new RendererContext(data.rendererContext); + } +}; +__name(_ButtonCardView, "ButtonCardView"); +__publicField(_ButtonCardView, "type", "ButtonCardView"); +var ButtonCardView = _ButtonCardView; + +// dist/src/parser/classes/ChannelHeaderLinks.js +var _HeaderLink = class _HeaderLink extends YTNode { + constructor(data) { + super(); + __publicField(this, "endpoint"); + __publicField(this, "icon"); + __publicField(this, "title"); + this.endpoint = new NavigationEndpoint(data.navigationEndpoint); + this.icon = Thumbnail.fromResponse(data.icon); + this.title = new Text2(data.title); + } +}; +__name(_HeaderLink, "HeaderLink"); +__publicField(_HeaderLink, "type", "HeaderLink"); +var HeaderLink = _HeaderLink; +var _ChannelHeaderLinks = class _ChannelHeaderLinks extends YTNode { + constructor(data) { + var _a, _b; + super(); + __publicField(this, "primary"); + __publicField(this, "secondary"); + this.primary = observe(((_a = data.primaryLinks) == null ? void 0 : _a.map((link) => new HeaderLink(link))) || []); + this.secondary = observe(((_b = data.secondaryLinks) == null ? void 0 : _b.map((link) => new HeaderLink(link))) || []); + } +}; +__name(_ChannelHeaderLinks, "ChannelHeaderLinks"); +__publicField(_ChannelHeaderLinks, "type", "ChannelHeaderLinks"); +var ChannelHeaderLinks = _ChannelHeaderLinks; + +// dist/src/parser/classes/ChannelHeaderLinksView.js +var _ChannelHeaderLinksView = class _ChannelHeaderLinksView extends YTNode { + constructor(data) { + super(); + __publicField(this, "first_link"); + __publicField(this, "more"); + if (Reflect.has(data, "firstLink")) { + this.first_link = Text2.fromAttributed(data.firstLink); + } + if (Reflect.has(data, "more")) { + this.more = Text2.fromAttributed(data.more); + } + } +}; +__name(_ChannelHeaderLinksView, "ChannelHeaderLinksView"); +__publicField(_ChannelHeaderLinksView, "type", "ChannelHeaderLinksView"); +var ChannelHeaderLinksView = _ChannelHeaderLinksView; + +// dist/src/parser/classes/ClipCreationTextInput.js +var _ClipCreationTextInput = class _ClipCreationTextInput extends YTNode { + constructor(data) { + super(); + __publicField(this, "placeholder_text"); + __publicField(this, "max_character_limit"); + this.placeholder_text = new Text2(data.placeholderText); + this.max_character_limit = data.maxCharacterLimit; + } +}; +__name(_ClipCreationTextInput, "ClipCreationTextInput"); +__publicField(_ClipCreationTextInput, "type", "ClipCreationTextInput"); +var ClipCreationTextInput = _ClipCreationTextInput; + +// dist/src/parser/classes/ClipCreationScrubber.js +var _ClipCreationScrubber = class _ClipCreationScrubber extends YTNode { + constructor(data) { + var _a, _b, _c, _d, _e, _f; + super(); + __publicField(this, "length_template"); + __publicField(this, "max_length_ms"); + __publicField(this, "min_length_ms"); + __publicField(this, "default_length_ms"); + __publicField(this, "window_size_ms"); + __publicField(this, "start_label"); + __publicField(this, "end_label"); + __publicField(this, "duration_label"); + this.length_template = data.lengthTemplate; + this.max_length_ms = data.maxLengthMs; + this.min_length_ms = data.minLengthMs; + this.default_length_ms = data.defaultLengthMs; + this.window_size_ms = data.windowSizeMs; + this.start_label = (_b = (_a = data.startAccessibility) == null ? void 0 : _a.accessibilityData) == null ? void 0 : _b.label; + this.end_label = (_d = (_c = data.endAccessibility) == null ? void 0 : _c.accessibilityData) == null ? void 0 : _d.label; + this.duration_label = (_f = (_e = data.durationAccessibility) == null ? void 0 : _e.accessibilityData) == null ? void 0 : _f.label; + } +}; +__name(_ClipCreationScrubber, "ClipCreationScrubber"); +__publicField(_ClipCreationScrubber, "type", "ClipCreationScrubber"); +var ClipCreationScrubber = _ClipCreationScrubber; + +// dist/src/parser/classes/ClipAdState.js +var _ClipAdState = class _ClipAdState extends YTNode { + constructor(data) { + super(); + __publicField(this, "title"); + __publicField(this, "body"); + this.title = new Text2(data.title); + this.body = new Text2(data.body); + } +}; +__name(_ClipAdState, "ClipAdState"); +__publicField(_ClipAdState, "type", "ClipAdState"); +var ClipAdState = _ClipAdState; + +// dist/src/parser/classes/ClipCreation.js +var _ClipCreation = class _ClipCreation extends YTNode { + constructor(data) { + super(); + __publicField(this, "user_avatar"); + __publicField(this, "title_input"); + __publicField(this, "scrubber"); + __publicField(this, "save_button"); + __publicField(this, "display_name"); + __publicField(this, "publicity_label"); + __publicField(this, "cancel_button"); + __publicField(this, "ad_state_overlay"); + __publicField(this, "external_video_id"); + __publicField(this, "publicity_label_icon"); + this.user_avatar = Thumbnail.fromResponse(data.userAvatar); + this.title_input = parser_exports.parseItem(data.titleInput, [ClipCreationTextInput]); + this.scrubber = parser_exports.parseItem(data.scrubber, [ClipCreationScrubber]); + this.save_button = parser_exports.parseItem(data.saveButton, [Button]); + this.display_name = new Text2(data.displayName); + this.publicity_label = data.publicityLabel; + this.cancel_button = parser_exports.parseItem(data.cancelButton, [Button]); + this.ad_state_overlay = parser_exports.parseItem(data.adStateOverlay, [ClipAdState]); + this.external_video_id = data.externalVideoId; + this.publicity_label_icon = data.publicityLabelIcon; + } +}; +__name(_ClipCreation, "ClipCreation"); +__publicField(_ClipCreation, "type", "ClipCreation"); +var ClipCreation = _ClipCreation; + +// dist/src/parser/classes/ClipSection.js +var _ClipSection = class _ClipSection extends YTNode { + constructor(data) { + super(); + __publicField(this, "contents"); + this.contents = parser_exports.parse(data.contents, true, [ClipCreation]); + } +}; +__name(_ClipSection, "ClipSection"); +__publicField(_ClipSection, "type", "ClipSection"); +var ClipSection = _ClipSection; + +// dist/src/parser/classes/ContinuationItem.js +var _ContinuationItem = class _ContinuationItem extends YTNode { + constructor(data) { + super(); + __publicField(this, "trigger"); + __publicField(this, "button"); + __publicField(this, "endpoint"); + this.trigger = data.trigger; + if (Reflect.has(data, "button")) { + this.button = parser_exports.parseItem(data.button, Button); + } + this.endpoint = new NavigationEndpoint(data.continuationEndpoint); + } +}; +__name(_ContinuationItem, "ContinuationItem"); +__publicField(_ContinuationItem, "type", "ContinuationItem"); +var ContinuationItem = _ContinuationItem; + +// dist/src/parser/classes/EngagementPanelTitleHeader.js +var _EngagementPanelTitleHeader = class _EngagementPanelTitleHeader extends YTNode { + constructor(data) { + super(); + __publicField(this, "title"); + __publicField(this, "visibility_button"); + __publicField(this, "contextual_info"); + __publicField(this, "menu"); + this.title = new Text2(data.title); + this.contextual_info = data.contextualInfo ? new Text2(data.contextualInfo) : void 0; + this.visibility_button = parser_exports.parseItem(data.visibilityButton, Button); + this.menu = parser_exports.parseItem(data.menu); + } +}; +__name(_EngagementPanelTitleHeader, "EngagementPanelTitleHeader"); +__publicField(_EngagementPanelTitleHeader, "type", "EngagementPanelTitleHeader"); +var EngagementPanelTitleHeader = _EngagementPanelTitleHeader; + +// dist/src/parser/classes/MacroMarkersInfoItem.js +var _MacroMarkersInfoItem = class _MacroMarkersInfoItem extends YTNode { + constructor(data) { + super(); + __publicField(this, "info_text"); + __publicField(this, "menu"); + this.info_text = new Text2(data.infoText); + this.menu = parser_exports.parseItem(data.menu, Menu); + } +}; +__name(_MacroMarkersInfoItem, "MacroMarkersInfoItem"); +__publicField(_MacroMarkersInfoItem, "type", "MacroMarkersInfoItem"); +var MacroMarkersInfoItem = _MacroMarkersInfoItem; + +// dist/src/parser/classes/MacroMarkersListItem.js +var _MacroMarkersListItem = class _MacroMarkersListItem extends YTNode { + constructor(data) { + super(); + __publicField(this, "title"); + __publicField(this, "time_description"); + __publicField(this, "thumbnail"); + __publicField(this, "on_tap_endpoint"); + __publicField(this, "layout"); + __publicField(this, "is_highlighted"); + this.title = new Text2(data.title); + this.time_description = new Text2(data.timeDescription); + this.thumbnail = Thumbnail.fromResponse(data.thumbnail); + this.on_tap_endpoint = new NavigationEndpoint(data.onTap); + this.layout = data.layout; + this.is_highlighted = !!data.isHighlighted; + } +}; +__name(_MacroMarkersListItem, "MacroMarkersListItem"); +__publicField(_MacroMarkersListItem, "type", "MacroMarkersListItem"); +var MacroMarkersListItem = _MacroMarkersListItem; + +// dist/src/parser/classes/MacroMarkersList.js +var _MacroMarkersList = class _MacroMarkersList extends YTNode { + constructor(data) { + super(); + __publicField(this, "contents"); + __publicField(this, "sync_button_label"); + this.contents = parser_exports.parseArray(data.contents, [MacroMarkersInfoItem, MacroMarkersListItem]); + this.sync_button_label = new Text2(data.syncButtonLabel); + } +}; +__name(_MacroMarkersList, "MacroMarkersList"); +__publicField(_MacroMarkersList, "type", "MacroMarkersList"); +var MacroMarkersList = _MacroMarkersList; + +// dist/src/parser/classes/ProductList.js +var _ProductList = class _ProductList extends YTNode { + constructor(data) { + super(); + __publicField(this, "contents"); + this.contents = parser_exports.parseArray(data.contents); + } +}; +__name(_ProductList, "ProductList"); +__publicField(_ProductList, "type", "ProductList"); +var ProductList = _ProductList; + +// dist/src/parser/classes/SectionList.js +var _SectionList = class _SectionList extends YTNode { + constructor(data) { + super(); + __publicField(this, "contents"); + __publicField(this, "target_id"); + __publicField(this, "continuation"); + __publicField(this, "header"); + __publicField(this, "sub_menu"); + this.contents = parser_exports.parseArray(data.contents); + if (Reflect.has(data, "targetId")) { + this.target_id = data.targetId; + } + if (Reflect.has(data, "continuations")) { + if (Reflect.has(data.continuations[0], "nextContinuationData")) { + this.continuation = data.continuations[0].nextContinuationData.continuation; + } else if (Reflect.has(data.continuations[0], "reloadContinuationData")) { + this.continuation = data.continuations[0].reloadContinuationData.continuation; + } + } + if (Reflect.has(data, "header")) { + this.header = parser_exports.parseItem(data.header); + } + if (Reflect.has(data, "subMenu")) { + this.sub_menu = parser_exports.parseItem(data.subMenu); + } + } +}; +__name(_SectionList, "SectionList"); +__publicField(_SectionList, "type", "SectionList"); +var SectionList = _SectionList; + +// dist/src/parser/classes/ExpandableVideoDescriptionBody.js +var _ExpandableVideoDescriptionBody = class _ExpandableVideoDescriptionBody extends YTNode { + constructor(data) { + super(); + __publicField(this, "show_more_text"); + __publicField(this, "show_less_text"); + __publicField(this, "attributed_description_body_text"); + this.show_more_text = new Text2(data.showMoreText); + this.show_less_text = new Text2(data.showLessText); + if (Reflect.has(data, "attributedDescriptionBodyText")) { + this.attributed_description_body_text = Text2.fromAttributed(data.attributedDescriptionBodyText); + } + } +}; +__name(_ExpandableVideoDescriptionBody, "ExpandableVideoDescriptionBody"); +__publicField(_ExpandableVideoDescriptionBody, "type", "ExpandableVideoDescriptionBody"); +var ExpandableVideoDescriptionBody = _ExpandableVideoDescriptionBody; + +// dist/src/parser/classes/SearchRefinementCard.js +var _SearchRefinementCard = class _SearchRefinementCard extends YTNode { + constructor(data) { + super(); + __publicField(this, "thumbnails"); + __publicField(this, "endpoint"); + __publicField(this, "query"); + this.thumbnails = Thumbnail.fromResponse(data.thumbnail); + this.endpoint = new NavigationEndpoint(data.searchEndpoint); + this.query = new Text2(data.query).toString(); + } +}; +__name(_SearchRefinementCard, "SearchRefinementCard"); +__publicField(_SearchRefinementCard, "type", "SearchRefinementCard"); +var SearchRefinementCard = _SearchRefinementCard; + +// dist/src/parser/classes/GameCard.js +var _GameCard = class _GameCard extends YTNode { + constructor(data) { + super(); + __publicField(this, "game"); + this.game = parser_exports.parseItem(data.game); + } +}; +__name(_GameCard, "GameCard"); +__publicField(_GameCard, "type", "GameCard"); +var GameCard = _GameCard; + +// dist/src/parser/classes/HorizontalList.js +var _HorizontalList = class _HorizontalList extends YTNode { + constructor(data) { + super(); + __publicField(this, "visible_item_count"); + __publicField(this, "items"); + this.visible_item_count = data.visibleItemCount; + this.items = parser_exports.parseArray(data.items); + } + // XXX: Alias for consistency. + get contents() { + return this.items; + } +}; +__name(_HorizontalList, "HorizontalList"); +__publicField(_HorizontalList, "type", "HorizontalList"); +var HorizontalList = _HorizontalList; + +// dist/src/parser/classes/VideoSummaryParagraphView.js +var _VideoSummaryParagraphView = class _VideoSummaryParagraphView extends YTNode { + constructor(data) { + super(); + __publicField(this, "text"); + this.text = Text2.fromAttributed(data.text); + } +}; +__name(_VideoSummaryParagraphView, "VideoSummaryParagraphView"); +__publicField(_VideoSummaryParagraphView, "type", "VideoSummaryParagraphView"); +var VideoSummaryParagraphView = _VideoSummaryParagraphView; + +// dist/src/parser/classes/VideoSummaryContentView.js +var _VideoSummaryContentView = class _VideoSummaryContentView extends YTNode { + constructor(data) { + super(); + __publicField(this, "dislike_button_view"); + __publicField(this, "like_button_view"); + __publicField(this, "paragraphs"); + if ("dislikeButtonViewModel" in data) { + this.dislike_button_view = parser_exports.parseItem(data.dislikeButtonViewModel, DislikeButtonView); + } + if ("likeButtonViewModel" in data) { + this.like_button_view = parser_exports.parseItem(data.likeButtonViewModel, LikeButtonView); + } + this.paragraphs = parser_exports.parseArray(data.paragraphs, VideoSummaryParagraphView); + } +}; +__name(_VideoSummaryContentView, "VideoSummaryContentView"); +__publicField(_VideoSummaryContentView, "type", "VideoSummaryContentView"); +var VideoSummaryContentView = _VideoSummaryContentView; + +// dist/src/parser/classes/ExpandableMetadata.js +var _ExpandableMetadata = class _ExpandableMetadata extends YTNode { + constructor(data) { + super(); + __publicField(this, "header"); + __publicField(this, "expanded_content"); + __publicField(this, "expand_button"); + __publicField(this, "collapse_button"); + if (Reflect.has(data, "header")) { + this.header = { + collapsed_title: new Text2(data.header.collapsedTitle), + collapsed_thumbnail: Thumbnail.fromResponse(data.header.collapsedThumbnail), + collapsed_label: new Text2(data.header.collapsedLabel), + expanded_title: new Text2(data.header.expandedTitle) + }; + } + this.expanded_content = parser_exports.parseItem(data.expandedContent, [VideoSummaryContentView, HorizontalCardList, HorizontalList]); + this.expand_button = parser_exports.parseItem(data.expandButton, Button); + this.collapse_button = parser_exports.parseItem(data.collapseButton, Button); + } +}; +__name(_ExpandableMetadata, "ExpandableMetadata"); +__publicField(_ExpandableMetadata, "type", "ExpandableMetadata"); +var ExpandableMetadata = _ExpandableMetadata; + +// dist/src/parser/classes/MetadataBadge.js +var _MetadataBadge = class _MetadataBadge extends YTNode { + constructor(data) { + super(); + __publicField(this, "icon_type"); + __publicField(this, "style"); + __publicField(this, "label"); + __publicField(this, "tooltip"); + if (Reflect.has(data, "icon")) { + this.icon_type = data.icon.iconType; + } + if (Reflect.has(data, "style")) { + this.style = data.style; + } + if (Reflect.has(data, "label")) { + this.label = data.label; + } + if (Reflect.has(data, "tooltip") || Reflect.has(data, "iconTooltip")) { + this.tooltip = data.tooltip || data.iconTooltip; + } + } +}; +__name(_MetadataBadge, "MetadataBadge"); +__publicField(_MetadataBadge, "type", "MetadataBadge"); +var MetadataBadge = _MetadataBadge; + +// dist/src/parser/classes/ThumbnailOverlayTimeStatus.js +var _ThumbnailOverlayTimeStatus = class _ThumbnailOverlayTimeStatus extends YTNode { + constructor(data) { + super(); + __publicField(this, "text"); + __publicField(this, "style"); + this.text = new Text2(data.text).toString(); + this.style = data.style; + } +}; +__name(_ThumbnailOverlayTimeStatus, "ThumbnailOverlayTimeStatus"); +__publicField(_ThumbnailOverlayTimeStatus, "type", "ThumbnailOverlayTimeStatus"); +var ThumbnailOverlayTimeStatus = _ThumbnailOverlayTimeStatus; + +// dist/src/parser/classes/Video.js +var _Video = class _Video extends YTNode { + constructor(data) { + var _a, _b; + super(); + __publicField(this, "video_id"); + __publicField(this, "title"); + __publicField(this, "untranslated_title"); + __publicField(this, "description_snippet"); + __publicField(this, "snippets"); + __publicField(this, "expandable_metadata"); + __publicField(this, "additional_metadatas"); + __publicField(this, "thumbnails"); + __publicField(this, "thumbnail_overlays"); + __publicField(this, "rich_thumbnail"); + __publicField(this, "author"); + __publicField(this, "badges"); + __publicField(this, "endpoint"); + __publicField(this, "published"); + __publicField(this, "view_count"); + __publicField(this, "short_view_count"); + __publicField(this, "upcoming"); + __publicField(this, "length_text"); + __publicField(this, "show_action_menu"); + __publicField(this, "is_watched"); + __publicField(this, "menu"); + __publicField(this, "byline_text"); + __publicField(this, "search_video_result_entity_key"); + __publicField(this, "service_endpoints"); + __publicField(this, "service_endpoint"); + __publicField(this, "style"); + this.title = new Text2(data.title); + this.video_id = data.videoId; + this.expandable_metadata = parser_exports.parseItem(data.expandableMetadata, ExpandableMetadata); + if ("untranslatedTitle" in data) + this.untranslated_title = new Text2(data.untranslatedTitle); + if ("descriptionSnippet" in data) + this.description_snippet = new Text2(data.descriptionSnippet); + if ("detailedMetadataSnippets" in data) { + this.snippets = data.detailedMetadataSnippets.map((snippet) => ({ + text: new Text2(snippet.snippetText), + hover_text: new Text2(snippet.snippetHoverText) + })); + } + if ("additionalMetadatas" in data) + this.additional_metadatas = data.additionalMetadatas.map((meta) => new Text2(meta)); + this.thumbnails = Thumbnail.fromResponse(data.thumbnail); + this.thumbnail_overlays = parser_exports.parseArray(data.thumbnailOverlays); + if ("richThumbnail" in data) + this.rich_thumbnail = parser_exports.parseItem(data.richThumbnail); + this.author = new Author(data.ownerText, data.ownerBadges, (_b = (_a = data.channelThumbnailSupportedRenderers) == null ? void 0 : _a.channelThumbnailWithLinkRenderer) == null ? void 0 : _b.thumbnail); + this.badges = parser_exports.parseArray(data.badges, MetadataBadge); + if ("navigationEndpoint" in data) + this.endpoint = new NavigationEndpoint(data.navigationEndpoint); + if ("publishedTimeText" in data) + this.published = new Text2(data.publishedTimeText); + if ("viewCountText" in data) + this.view_count = new Text2(data.viewCountText); + if ("shortViewCountText" in data) + this.short_view_count = new Text2(data.shortViewCountText); + if ("upcomingEventData" in data) + this.upcoming = new Date(Number(`${data.upcomingEventData.startTime}000`)); + this.show_action_menu = !!data.showActionMenu; + this.is_watched = !!data.isWatched; + this.menu = parser_exports.parseItem(data.menu, Menu); + if ("searchVideoResultEntityKey" in data) + this.search_video_result_entity_key = data.searchVideoResultEntityKey; + if ("bylineText" in data) + this.byline_text = new Text2(data.bylineText); + if ("lengthText" in data) + this.length_text = new Text2(data.lengthText); + if ("serviceEndpoints" in data) + this.service_endpoints = data.serviceEndpoints.map((endpoint) => new NavigationEndpoint(endpoint)); + if ("serviceEndpoint" in data) + this.service_endpoint = new NavigationEndpoint(data.serviceEndpoint); + if ("style" in data) + this.style = data.style; + } + /** + * @deprecated Use {@linkcode video_id} instead. + */ + get id() { + return this.video_id; + } + get description() { + var _a; + if (this.snippets) + return this.snippets.map((snip) => snip.text.toString()).join(""); + return ((_a = this.description_snippet) == null ? void 0 : _a.toString()) || ""; + } + get is_live() { + var _a; + return this.badges.some((badge) => { + if (badge.style === "BADGE_STYLE_TYPE_LIVE_NOW" || badge.label === "LIVE") + return true; + }) || ((_a = this.thumbnail_overlays.firstOfType(ThumbnailOverlayTimeStatus)) == null ? void 0 : _a.style) === "LIVE"; + } + get is_upcoming() { + return this.upcoming && this.upcoming > /* @__PURE__ */ new Date(); + } + get is_premiere() { + return this.badges.some((badge) => badge.label === "PREMIERE"); + } + get is_4k() { + return this.badges.some((badge) => badge.label === "4K"); + } + get has_captions() { + return this.badges.some((badge) => badge.label === "CC"); + } + get best_thumbnail() { + return this.thumbnails[0]; + } + get duration() { + var _a; + const overlay_time_status = this.thumbnail_overlays.firstOfType(ThumbnailOverlayTimeStatus); + const length_text = ((_a = this.length_text) == null ? void 0 : _a.toString()) || (overlay_time_status == null ? void 0 : overlay_time_status.text.toString()); + return { + text: length_text, + seconds: length_text ? timeToSeconds(length_text) : 0 + }; + } +}; +__name(_Video, "Video"); +__publicField(_Video, "type", "Video"); +var Video = _Video; + +// dist/src/parser/classes/VideoCard.js +var _VideoCard = class _VideoCard extends Video { + constructor(data) { + var _a, _b, _c, _d; + super(data); + __publicField(this, "metadata_text"); + if (Reflect.has(data, "metadataText")) { + this.metadata_text = new Text2(data.metadataText); + if (this.metadata_text.text) { + this.short_view_count = new Text2({ simpleText: (_a = this.metadata_text.text.split("\xB7")[0]) == null ? void 0 : _a.trim() }); + this.published = new Text2({ simpleText: (_b = this.metadata_text.text.split("\xB7")[1]) == null ? void 0 : _b.trim() }); + } + } + if (Reflect.has(data, "bylineText")) { + this.author = new Author(data.bylineText, data.ownerBadges, (_d = (_c = data.channelThumbnailSupportedRenderers) == null ? void 0 : _c.channelThumbnailWithLinkRenderer) == null ? void 0 : _d.thumbnail); + } + } +}; +__name(_VideoCard, "VideoCard"); +__publicField(_VideoCard, "type", "VideoCard"); +var VideoCard = _VideoCard; + +// dist/src/parser/classes/ContentPreviewImageView.js +var _ContentPreviewImageView = class _ContentPreviewImageView extends YTNode { + constructor(data) { + super(); + __publicField(this, "image"); + __publicField(this, "style"); + this.image = Thumbnail.fromResponse(data.image); + this.style = data.style; + } +}; +__name(_ContentPreviewImageView, "ContentPreviewImageView"); +__publicField(_ContentPreviewImageView, "type", "ContentPreviewImageView"); +var ContentPreviewImageView = _ContentPreviewImageView; + +// dist/src/parser/classes/VideoAttributeView.js +var _VideoAttributeView = class _VideoAttributeView extends YTNode { + constructor(data) { + var _a; + super(); + __publicField(this, "image"); + __publicField(this, "image_style"); + __publicField(this, "title"); + __publicField(this, "subtitle"); + __publicField(this, "secondary_subtitle"); + __publicField(this, "orientation"); + __publicField(this, "sizing_rule"); + __publicField(this, "overflow_menu_on_tap"); + __publicField(this, "overflow_menu_a11y_label"); + if ((_a = data.image) == null ? void 0 : _a.sources) { + this.image = Thumbnail.fromResponse(data.image); + } else { + this.image = parser_exports.parseItem(data.image, ContentPreviewImageView); + } + this.image_style = data.imageStyle; + this.title = data.title; + this.subtitle = data.subtitle; + if (Reflect.has(data, "secondarySubtitle")) { + this.secondary_subtitle = { + content: data.secondarySubtitle.content + }; + } + this.orientation = data.orientation; + this.sizing_rule = data.sizingRule; + this.overflow_menu_on_tap = new NavigationEndpoint(data.overflowMenuOnTap); + this.overflow_menu_a11y_label = data.overflowMenuA11yLabel; + } +}; +__name(_VideoAttributeView, "VideoAttributeView"); +__publicField(_VideoAttributeView, "type", "VideoAttributeView"); +var VideoAttributeView = _VideoAttributeView; + +// dist/src/parser/classes/HorizontalCardList.js +var _HorizontalCardList = class _HorizontalCardList extends YTNode { + constructor(data) { + super(); + __publicField(this, "cards"); + __publicField(this, "header"); + __publicField(this, "previous_button"); + __publicField(this, "next_button"); + this.cards = parser_exports.parseArray(data.cards, [VideoAttributeView, SearchRefinementCard, MacroMarkersListItem, GameCard, VideoCard]); + this.header = parser_exports.parseItem(data.header); + this.previous_button = parser_exports.parseItem(data.previousButton, Button); + this.next_button = parser_exports.parseItem(data.nextButton, Button); + } +}; +__name(_HorizontalCardList, "HorizontalCardList"); +__publicField(_HorizontalCardList, "type", "HorizontalCardList"); +var HorizontalCardList = _HorizontalCardList; + +// dist/src/parser/classes/Factoid.js +var _Factoid = class _Factoid extends YTNode { + constructor(data) { + super(); + __publicField(this, "label"); + __publicField(this, "value"); + __publicField(this, "accessibility_text"); + this.label = new Text2(data.label); + this.value = new Text2(data.value); + this.accessibility_text = data.accessibilityText; + } +}; +__name(_Factoid, "Factoid"); +__publicField(_Factoid, "type", "Factoid"); +var Factoid = _Factoid; + +// dist/src/parser/classes/UploadTimeFactoid.js +var _UploadTimeFactoid = class _UploadTimeFactoid extends YTNode { + constructor(data) { + super(); + __publicField(this, "factoid"); + this.factoid = parser_exports.parseItem(data.factoid, Factoid); + } +}; +__name(_UploadTimeFactoid, "UploadTimeFactoid"); +__publicField(_UploadTimeFactoid, "type", "UploadTimeFactoid"); +var UploadTimeFactoid = _UploadTimeFactoid; + +// dist/src/parser/classes/ViewCountFactoid.js +var _ViewCountFactoid = class _ViewCountFactoid extends YTNode { + constructor(data) { + super(); + __publicField(this, "view_count_entity_key"); + __publicField(this, "factoid"); + __publicField(this, "view_count_type"); + this.view_count_entity_key = data.viewCountEntityKey; + this.factoid = parser_exports.parseItem(data.factoid, [Factoid]); + this.view_count_type = data.viewCountType; + } +}; +__name(_ViewCountFactoid, "ViewCountFactoid"); +__publicField(_ViewCountFactoid, "type", "ViewCountFactoid"); +var ViewCountFactoid = _ViewCountFactoid; + +// dist/src/parser/classes/HypePointsFactoid.js +var _HypePointsFactoid = class _HypePointsFactoid extends YTNode { + constructor(data) { + super(); + __publicField(this, "factoid"); + this.factoid = parser_exports.parseItem(data.factoid, Factoid); + } +}; +__name(_HypePointsFactoid, "HypePointsFactoid"); +__publicField(_HypePointsFactoid, "type", "HypePointsFactoid"); +var HypePointsFactoid = _HypePointsFactoid; + +// dist/src/parser/classes/VideoDescriptionHeader.js +var _VideoDescriptionHeader = class _VideoDescriptionHeader extends YTNode { + constructor(data) { + super(); + __publicField(this, "channel"); + __publicField(this, "channel_navigation_endpoint"); + __publicField(this, "channel_thumbnail"); + __publicField(this, "factoids"); + __publicField(this, "publish_date"); + __publicField(this, "title"); + __publicField(this, "views"); + this.title = new Text2(data.title); + this.channel = new Text2(data.channel); + this.channel_navigation_endpoint = new NavigationEndpoint(data.channelNavigationEndpoint); + this.channel_thumbnail = Thumbnail.fromResponse(data.channelThumbnail); + this.publish_date = new Text2(data.publishDate); + this.views = new Text2(data.views); + this.factoids = parser_exports.parseArray(data.factoid, [Factoid, HypePointsFactoid, ViewCountFactoid, UploadTimeFactoid]); + } +}; +__name(_VideoDescriptionHeader, "VideoDescriptionHeader"); +__publicField(_VideoDescriptionHeader, "type", "VideoDescriptionHeader"); +var VideoDescriptionHeader = _VideoDescriptionHeader; + +// dist/src/parser/classes/VideoDescriptionInfocardsSection.js +var _VideoDescriptionInfocardsSection = class _VideoDescriptionInfocardsSection extends YTNode { + constructor(data) { + super(); + __publicField(this, "section_title"); + __publicField(this, "creator_videos_button"); + __publicField(this, "creator_about_button"); + __publicField(this, "section_subtitle"); + __publicField(this, "channel_avatar"); + __publicField(this, "channel_endpoint"); + this.section_title = new Text2(data.sectionTitle); + this.creator_videos_button = parser_exports.parseItem(data.creatorVideosButton, Button); + this.creator_about_button = parser_exports.parseItem(data.creatorAboutButton, Button); + this.section_subtitle = new Text2(data.sectionSubtitle); + this.channel_avatar = Thumbnail.fromResponse(data.channelAvatar); + this.channel_endpoint = new NavigationEndpoint(data.channelEndpoint); + } +}; +__name(_VideoDescriptionInfocardsSection, "VideoDescriptionInfocardsSection"); +__publicField(_VideoDescriptionInfocardsSection, "type", "VideoDescriptionInfocardsSection"); +var VideoDescriptionInfocardsSection = _VideoDescriptionInfocardsSection; + +// dist/src/parser/classes/InfoRow.js +var _InfoRow = class _InfoRow extends YTNode { + constructor(data) { + super(); + __publicField(this, "title"); + __publicField(this, "default_metadata"); + __publicField(this, "expanded_metadata"); + __publicField(this, "info_row_expand_status_key"); + this.title = new Text2(data.title); + if (Reflect.has(data, "defaultMetadata")) { + this.default_metadata = new Text2(data.defaultMetadata); + } + if (Reflect.has(data, "expandedMetadata")) { + this.expanded_metadata = new Text2(data.expandedMetadata); + } + if (Reflect.has(data, "infoRowExpandStatusKey")) { + this.info_row_expand_status_key = data.infoRowExpandStatusKey; + } + } +}; +__name(_InfoRow, "InfoRow"); +__publicField(_InfoRow, "type", "InfoRow"); +var InfoRow = _InfoRow; + +// dist/src/parser/classes/CompactVideo.js +var _CompactVideo = class _CompactVideo extends YTNode { + constructor(data) { + super(); + __publicField(this, "video_id"); + __publicField(this, "thumbnails"); + __publicField(this, "rich_thumbnail"); + __publicField(this, "title"); + __publicField(this, "author"); + __publicField(this, "view_count"); + __publicField(this, "short_view_count"); + __publicField(this, "short_byline_text"); + __publicField(this, "long_byline_text"); + __publicField(this, "published"); + __publicField(this, "badges"); + __publicField(this, "thumbnail_overlays"); + __publicField(this, "endpoint"); + __publicField(this, "menu"); + __publicField(this, "length_text"); + __publicField(this, "is_watched"); + __publicField(this, "service_endpoints"); + __publicField(this, "service_endpoint"); + __publicField(this, "style"); + this.video_id = data.videoId; + this.thumbnails = Thumbnail.fromResponse(data.thumbnail); + this.title = new Text2(data.title); + this.author = new Author(data.longBylineText, data.ownerBadges, data.channelThumbnail); + this.is_watched = !!data.isWatched; + this.thumbnail_overlays = parser_exports.parseArray(data.thumbnailOverlays); + this.menu = parser_exports.parseItem(data.menu, Menu); + this.badges = parser_exports.parseArray(data.badges, MetadataBadge); + if ("publishedTimeText" in data) + this.published = new Text2(data.publishedTimeText); + if ("shortBylineText" in data) + this.view_count = new Text2(data.viewCountText); + if ("shortViewCountText" in data) + this.short_view_count = new Text2(data.shortViewCountText); + if ("richThumbnail" in data) + this.rich_thumbnail = parser_exports.parseItem(data.richThumbnail); + if ("shortBylineText" in data) + this.short_byline_text = new Text2(data.shortBylineText); + if ("longBylineText" in data) + this.long_byline_text = new Text2(data.longBylineText); + if ("lengthText" in data) + this.length_text = new Text2(data.lengthText); + if ("serviceEndpoints" in data) + this.service_endpoints = data.serviceEndpoints.map((endpoint) => new NavigationEndpoint(endpoint)); + if ("serviceEndpoint" in data) + this.service_endpoint = new NavigationEndpoint(data.serviceEndpoint); + if ("navigationEndpoint" in data) + this.endpoint = new NavigationEndpoint(data.navigationEndpoint); + if ("style" in data) + this.style = data.style; + } + /** + * @deprecated Use {@linkcode video_id} instead. + */ + get id() { + return this.video_id; + } + get duration() { + var _a; + const overlay_time_status = this.thumbnail_overlays.firstOfType(ThumbnailOverlayTimeStatus); + const length_text = ((_a = this.length_text) == null ? void 0 : _a.toString()) || (overlay_time_status == null ? void 0 : overlay_time_status.text.toString()); + return { + text: length_text, + seconds: length_text ? timeToSeconds(length_text) : 0 + }; + } + get best_thumbnail() { + return this.thumbnails[0]; + } + get is_fundraiser() { + return this.badges.some((badge) => badge.label === "Fundraiser"); + } + get is_live() { + return this.badges.some((badge) => { + if (badge.style === "BADGE_STYLE_TYPE_LIVE_NOW" || badge.label === "LIVE") + return true; + }); + } + get is_new() { + return this.badges.some((badge) => badge.label === "New"); + } + get is_premiere() { + return this.badges.some((badge) => badge.style === "PREMIERE"); + } +}; +__name(_CompactVideo, "CompactVideo"); +__publicField(_CompactVideo, "type", "CompactVideo"); +var CompactVideo = _CompactVideo; + +// dist/src/parser/classes/CarouselLockup.js +var _CarouselLockup = class _CarouselLockup extends YTNode { + constructor(data) { + super(); + __publicField(this, "info_rows"); + __publicField(this, "video_lockup"); + this.info_rows = parser_exports.parseArray(data.infoRows, InfoRow); + this.video_lockup = parser_exports.parseItem(data.videoLockup, CompactVideo); + } +}; +__name(_CarouselLockup, "CarouselLockup"); +__publicField(_CarouselLockup, "type", "CarouselLockup"); +var CarouselLockup = _CarouselLockup; + +// dist/src/parser/classes/VideoDescriptionMusicSection.js +var _VideoDescriptionMusicSection = class _VideoDescriptionMusicSection extends YTNode { + constructor(data) { + super(); + __publicField(this, "carousel_lockups"); + __publicField(this, "section_title"); + this.carousel_lockups = parser_exports.parseArray(data.carouselLockups, CarouselLockup); + this.section_title = new Text2(data.sectionTitle); + } +}; +__name(_VideoDescriptionMusicSection, "VideoDescriptionMusicSection"); +__publicField(_VideoDescriptionMusicSection, "type", "VideoDescriptionMusicSection"); +var VideoDescriptionMusicSection = _VideoDescriptionMusicSection; + +// dist/src/parser/classes/VideoDescriptionTranscriptSection.js +var _VideoDescriptionTranscriptSection = class _VideoDescriptionTranscriptSection extends YTNode { + constructor(data) { + super(); + __publicField(this, "section_title"); + __publicField(this, "sub_header_text"); + __publicField(this, "primary_button"); + this.section_title = new Text2(data.sectionTitle); + this.sub_header_text = new Text2(data.subHeaderText); + this.primary_button = parser_exports.parseItem(data.primaryButton, Button); + } +}; +__name(_VideoDescriptionTranscriptSection, "VideoDescriptionTranscriptSection"); +__publicField(_VideoDescriptionTranscriptSection, "type", "VideoDescriptionTranscriptSection"); +var VideoDescriptionTranscriptSection = _VideoDescriptionTranscriptSection; + +// dist/src/parser/classes/StructuredDescriptionPlaylistLockup.js +var _StructuredDescriptionPlaylistLockup = class _StructuredDescriptionPlaylistLockup extends YTNode { + constructor(data) { + super(); + __publicField(this, "thumbnail"); + __publicField(this, "title"); + __publicField(this, "short_byline_text"); + __publicField(this, "video_count_short_text"); + __publicField(this, "endpoint"); + __publicField(this, "thumbnail_width"); + __publicField(this, "aspect_ratio"); + __publicField(this, "max_lines_title"); + __publicField(this, "max_lines_short_byline_text"); + __publicField(this, "overlay_position"); + this.thumbnail = Thumbnail.fromResponse(data.thumbnail); + this.title = new Text2(data.title); + this.short_byline_text = new Text2(data.shortBylineText); + this.video_count_short_text = new Text2(data.videoCountShortText); + this.endpoint = new NavigationEndpoint(data.navigationEndpoint); + this.thumbnail_width = data.thumbnailWidth; + this.aspect_ratio = data.aspectRatio; + this.max_lines_title = data.maxLinesTitle; + this.max_lines_short_byline_text = data.maxLinesShortBylineText; + this.overlay_position = data.overlayPosition; + } +}; +__name(_StructuredDescriptionPlaylistLockup, "StructuredDescriptionPlaylistLockup"); +__publicField(_StructuredDescriptionPlaylistLockup, "type", "StructuredDescriptionPlaylistLockup"); +var StructuredDescriptionPlaylistLockup = _StructuredDescriptionPlaylistLockup; + +// dist/src/parser/classes/VideoDescriptionCourseSection.js +var _VideoDescriptionCourseSection = class _VideoDescriptionCourseSection extends YTNode { + constructor(data) { + super(); + __publicField(this, "section_title"); + __publicField(this, "media_lockups"); + this.section_title = new Text2(data.sectionTitle); + this.media_lockups = parser_exports.parseArray(data.mediaLockups, [StructuredDescriptionPlaylistLockup]); + } +}; +__name(_VideoDescriptionCourseSection, "VideoDescriptionCourseSection"); +__publicField(_VideoDescriptionCourseSection, "type", "VideoDescriptionCourseSection"); +var VideoDescriptionCourseSection = _VideoDescriptionCourseSection; + +// dist/src/parser/classes/VideoAttributesSectionView.js +var _VideoAttributesSectionView = class _VideoAttributesSectionView extends YTNode { + constructor(data) { + super(); + __publicField(this, "header_title"); + __publicField(this, "header_subtitle"); + __publicField(this, "video_attributes"); + __publicField(this, "previous_button"); + __publicField(this, "next_button"); + this.header_title = data.headerTitle; + this.header_subtitle = data.headerSubtitle; + this.video_attributes = parser_exports.parseArray(data.videoAttributeViewModels, VideoAttributeView); + this.previous_button = parser_exports.parseItem(data.previousButton, ButtonView); + this.next_button = parser_exports.parseItem(data.nextButton, ButtonView); + } +}; +__name(_VideoAttributesSectionView, "VideoAttributesSectionView"); +__publicField(_VideoAttributesSectionView, "type", "VideoAttributesSectionView"); +var VideoAttributesSectionView = _VideoAttributesSectionView; + +// dist/src/parser/classes/HowThisWasMadeSectionView.js +var _HowThisWasMadeSectionView = class _HowThisWasMadeSectionView extends YTNode { + constructor(data) { + super(); + __publicField(this, "section_title"); + __publicField(this, "body_text"); + __publicField(this, "body_header"); + if (Reflect.has(data, "sectionText")) + this.section_title = Text2.fromAttributed(data.sectionText); + if (Reflect.has(data, "bodyText")) + this.body_text = Text2.fromAttributed(data.bodyText); + if (Reflect.has(data, "bodyHeader")) + this.body_header = Text2.fromAttributed(data.bodyHeader); + } +}; +__name(_HowThisWasMadeSectionView, "HowThisWasMadeSectionView"); +__publicField(_HowThisWasMadeSectionView, "type", "HowThisWasMadeSectionView"); +var HowThisWasMadeSectionView = _HowThisWasMadeSectionView; + +// dist/src/parser/classes/ReelShelf.js +var _ReelShelf = class _ReelShelf extends YTNode { + constructor(data) { + super(); + __publicField(this, "title"); + __publicField(this, "items"); + __publicField(this, "endpoint"); + this.title = new Text2(data.title); + this.items = parser_exports.parseArray(data.items); + if (Reflect.has(data, "endpoint")) { + this.endpoint = new NavigationEndpoint(data.endpoint); + } + } + // XXX: Alias for consistency. + get contents() { + return this.items; + } +}; +__name(_ReelShelf, "ReelShelf"); +__publicField(_ReelShelf, "type", "ReelShelf"); +var ReelShelf = _ReelShelf; + +// dist/src/parser/classes/MerchandiseShelf.js +var _MerchandiseShelf = class _MerchandiseShelf extends YTNode { + constructor(data) { + super(); + __publicField(this, "title"); + __publicField(this, "menu"); + __publicField(this, "items"); + this.title = data.title; + this.menu = parser_exports.parseItem(data.actionButton); + this.items = parser_exports.parseArray(data.items); + } + // XXX: Alias for consistency. + get contents() { + return this.items; + } +}; +__name(_MerchandiseShelf, "MerchandiseShelf"); +__publicField(_MerchandiseShelf, "type", "MerchandiseShelf"); +var MerchandiseShelf = _MerchandiseShelf; + +// dist/src/parser/classes/StructuredDescriptionContent.js +var _StructuredDescriptionContent = class _StructuredDescriptionContent extends YTNode { + constructor(data) { + super(); + __publicField(this, "items"); + this.items = parser_exports.parseArray(data.items, [ + VideoDescriptionHeader, + ExpandableVideoDescriptionBody, + VideoDescriptionMusicSection, + VideoDescriptionInfocardsSection, + VideoDescriptionCourseSection, + VideoDescriptionTranscriptSection, + VideoDescriptionTranscriptSection, + HorizontalCardList, + ReelShelf, + VideoAttributesSectionView, + HowThisWasMadeSectionView, + ExpandableMetadata, + MerchandiseShelf + ]); + } +}; +__name(_StructuredDescriptionContent, "StructuredDescriptionContent"); +__publicField(_StructuredDescriptionContent, "type", "StructuredDescriptionContent"); +var StructuredDescriptionContent = _StructuredDescriptionContent; + +// dist/src/parser/classes/EngagementPanelSectionList.js +var _EngagementPanelSectionList = class _EngagementPanelSectionList extends YTNode { + constructor(data) { + super(); + __publicField(this, "header"); + __publicField(this, "content"); + __publicField(this, "target_id"); + __publicField(this, "panel_identifier"); + __publicField(this, "identifier"); + __publicField(this, "visibility"); + this.header = parser_exports.parseItem(data.header, EngagementPanelTitleHeader); + this.content = parser_exports.parseItem(data.content, [VideoAttributeView, SectionList, ContinuationItem, ClipSection, StructuredDescriptionContent, MacroMarkersList, ProductList]); + this.panel_identifier = data.panelIdentifier; + this.identifier = data.identifier ? { + surface: data.identifier.surface, + tag: data.identifier.tag + } : void 0; + this.target_id = data.targetId; + this.visibility = data.visibility; + } +}; +__name(_EngagementPanelSectionList, "EngagementPanelSectionList"); +__publicField(_EngagementPanelSectionList, "type", "EngagementPanelSectionList"); +var EngagementPanelSectionList = _EngagementPanelSectionList; + +// dist/src/parser/classes/ChannelTagline.js +var _ChannelTagline = class _ChannelTagline extends YTNode { + constructor(data) { + super(); + __publicField(this, "content"); + __publicField(this, "max_lines"); + __publicField(this, "more_endpoint"); + __publicField(this, "more_icon_type"); + __publicField(this, "more_label"); + __publicField(this, "target_id"); + this.content = data.content; + this.max_lines = data.maxLines; + this.more_endpoint = data.moreEndpoint.showEngagementPanelEndpoint ? { + show_engagement_panel_endpoint: { + engagement_panel: parser_exports.parseItem(data.moreEndpoint.showEngagementPanelEndpoint.engagementPanel, EngagementPanelSectionList), + engagement_panel_popup_type: data.moreEndpoint.showEngagementPanelEndpoint.engagementPanelPresentationConfigs.engagementPanelPopupPresentationConfig.popupType, + identifier: { + surface: data.moreEndpoint.showEngagementPanelEndpoint.identifier.surface, + tag: data.moreEndpoint.showEngagementPanelEndpoint.identifier.tag + } + } + } : new NavigationEndpoint(data.moreEndpoint); + this.more_icon_type = data.moreIcon.iconType; + this.more_label = data.moreLabel; + this.target_id = data.targetId; + } +}; +__name(_ChannelTagline, "ChannelTagline"); +__publicField(_ChannelTagline, "type", "ChannelTagline"); +var ChannelTagline = _ChannelTagline; + +// dist/src/parser/classes/SubscriptionNotificationToggleButton.js +var _SubscriptionNotificationToggleButton = class _SubscriptionNotificationToggleButton extends YTNode { + constructor(data) { + super(); + __publicField(this, "states"); + __publicField(this, "current_state_id"); + __publicField(this, "target_id"); + this.states = data.states.map((data2) => ({ + id: data2.stateId, + next_id: data2.nextStateId, + state: parser_exports.parse(data2.state) + })); + this.current_state_id = data.currentStateId; + this.target_id = data.targetId; + } +}; +__name(_SubscriptionNotificationToggleButton, "SubscriptionNotificationToggleButton"); +__publicField(_SubscriptionNotificationToggleButton, "type", "SubscriptionNotificationToggleButton"); +var SubscriptionNotificationToggleButton = _SubscriptionNotificationToggleButton; + +// dist/src/parser/classes/SubscribeButton.js +var _SubscribeButton = class _SubscribeButton extends YTNode { + constructor(data) { + var _a, _b; + super(); + __publicField(this, "button_text"); + __publicField(this, "subscribed"); + __publicField(this, "enabled"); + __publicField(this, "item_type"); + __publicField(this, "channel_id"); + __publicField(this, "show_preferences"); + __publicField(this, "subscribed_text"); + __publicField(this, "unsubscribed_text"); + __publicField(this, "unsubscribe_text"); + __publicField(this, "notification_preference_button"); + __publicField(this, "service_endpoints"); + __publicField(this, "on_subscribe_endpoints"); + __publicField(this, "on_unsubscribe_endpoints"); + __publicField(this, "subscribed_entity_key"); + __publicField(this, "target_id"); + __publicField(this, "subscribe_accessibility_label"); + __publicField(this, "unsubscribe_accessibility_label"); + this.button_text = new Text2(data.buttonText); + this.subscribed = data.subscribed; + this.enabled = data.enabled; + this.item_type = data.type; + this.channel_id = data.channelId; + this.show_preferences = data.showPreferences; + if (Reflect.has(data, "subscribedButtonText")) + this.subscribed_text = new Text2(data.subscribedButtonText); + if (Reflect.has(data, "unsubscribedButtonText")) + this.unsubscribed_text = new Text2(data.unsubscribedButtonText); + if (Reflect.has(data, "unsubscribeButtonText")) + this.unsubscribe_text = new Text2(data.unsubscribeButtonText); + this.notification_preference_button = parser_exports.parseItem(data.notificationPreferenceButton, SubscriptionNotificationToggleButton); + if (Reflect.has(data, "serviceEndpoints")) + this.service_endpoints = data.serviceEndpoints.map((endpoint) => new NavigationEndpoint(endpoint)); + if (Reflect.has(data, "onSubscribeEndpoints")) + this.on_subscribe_endpoints = data.onSubscribeEndpoints.map((endpoint) => new NavigationEndpoint(endpoint)); + if (Reflect.has(data, "onUnsubscribeEndpoints")) + this.on_unsubscribe_endpoints = data.onUnsubscribeEndpoints.map((endpoint) => new NavigationEndpoint(endpoint)); + if (Reflect.has(data, "subscribedEntityKey")) + this.subscribed_entity_key = data.subscribedEntityKey; + if (Reflect.has(data, "targetId")) + this.target_id = data.targetId; + if (Reflect.has(data, "subscribeAccessibility")) + this.subscribe_accessibility_label = (_a = data.subscribeAccessibility.accessibilityData) == null ? void 0 : _a.label; + if (Reflect.has(data, "unsubscribeAccessibility")) + this.unsubscribe_accessibility_label = (_b = data.unsubscribeAccessibility.accessibilityData) == null ? void 0 : _b.label; + } +}; +__name(_SubscribeButton, "SubscribeButton"); +__publicField(_SubscribeButton, "type", "SubscribeButton"); +var SubscribeButton = _SubscribeButton; + +// dist/src/parser/classes/C4TabbedHeader.js +var _C4TabbedHeader = class _C4TabbedHeader extends YTNode { + constructor(data) { + super(); + __publicField(this, "author"); + __publicField(this, "banner"); + __publicField(this, "tv_banner"); + __publicField(this, "mobile_banner"); + __publicField(this, "subscribers"); + __publicField(this, "videos_count"); + __publicField(this, "sponsor_button"); + __publicField(this, "subscribe_button"); + __publicField(this, "header_links"); + __publicField(this, "channel_handle"); + __publicField(this, "channel_id"); + __publicField(this, "tagline"); + this.author = new Author({ + simpleText: data.title, + navigationEndpoint: data.navigationEndpoint + }, data.badges, data.avatar); + if (Reflect.has(data, "banner")) { + this.banner = Thumbnail.fromResponse(data.banner); + } + if (Reflect.has(data, "tv_banner")) { + this.tv_banner = Thumbnail.fromResponse(data.tvBanner); + } + if (Reflect.has(data, "mobile_banner")) { + this.mobile_banner = Thumbnail.fromResponse(data.mobileBanner); + } + if (Reflect.has(data, "subscriberCountText")) { + this.subscribers = new Text2(data.subscriberCountText); + } + if (Reflect.has(data, "videosCountText")) { + this.videos_count = new Text2(data.videosCountText); + } + if (Reflect.has(data, "sponsorButton")) { + this.sponsor_button = parser_exports.parseItem(data.sponsorButton, Button); + } + if (Reflect.has(data, "subscribeButton")) { + this.subscribe_button = parser_exports.parseItem(data.subscribeButton, [SubscribeButton, Button]); + } + if (Reflect.has(data, "headerLinks")) { + this.header_links = parser_exports.parseItem(data.headerLinks, [ChannelHeaderLinks, ChannelHeaderLinksView]); + } + if (Reflect.has(data, "channelHandleText")) { + this.channel_handle = new Text2(data.channelHandleText); + } + if (Reflect.has(data, "channelId")) { + this.channel_id = data.channelId; + } + if (Reflect.has(data, "tagline")) { + this.tagline = parser_exports.parseItem(data.tagline, ChannelTagline); + } + } +}; +__name(_C4TabbedHeader, "C4TabbedHeader"); +__publicField(_C4TabbedHeader, "type", "C4TabbedHeader"); +var C4TabbedHeader = _C4TabbedHeader; + +// dist/src/parser/classes/CallToActionButton.js +var _CallToActionButton = class _CallToActionButton extends YTNode { + constructor(data) { + super(); + __publicField(this, "label"); + __publicField(this, "icon_type"); + __publicField(this, "style"); + this.label = new Text2(data.label); + this.icon_type = data.icon.iconType; + this.style = data.style; + } +}; +__name(_CallToActionButton, "CallToActionButton"); +__publicField(_CallToActionButton, "type", "CallToActionButton"); +var CallToActionButton = _CallToActionButton; + +// dist/src/parser/classes/Card.js +var _Card = class _Card extends YTNode { + constructor(data) { + super(); + __publicField(this, "teaser"); + __publicField(this, "content"); + __publicField(this, "card_id"); + __publicField(this, "feature"); + __publicField(this, "cue_ranges"); + this.teaser = parser_exports.parseItem(data.teaser); + this.content = parser_exports.parseItem(data.content); + if (Reflect.has(data, "cardId")) { + this.card_id = data.cardId; + } + if (Reflect.has(data, "feature")) { + this.feature = data.feature; + } + this.cue_ranges = data.cueRanges.map((cr) => ({ + start_card_active_ms: cr.startCardActiveMs, + end_card_active_ms: cr.endCardActiveMs, + teaser_duration_ms: cr.teaserDurationMs, + icon_after_teaser_ms: cr.iconAfterTeaserMs + })); + } +}; +__name(_Card, "Card"); +__publicField(_Card, "type", "Card"); +var Card = _Card; + +// dist/src/parser/classes/CardCollection.js +var _CardCollection = class _CardCollection extends YTNode { + constructor(data) { + super(); + __publicField(this, "cards"); + __publicField(this, "header"); + __publicField(this, "allow_teaser_dismiss"); + this.cards = parser_exports.parseArray(data.cards); + this.header = new Text2(data.headerText); + this.allow_teaser_dismiss = data.allowTeaserDismiss; + } +}; +__name(_CardCollection, "CardCollection"); +__publicField(_CardCollection, "type", "CardCollection"); +var CardCollection = _CardCollection; + +// dist/src/parser/classes/CarouselHeader.js +var _CarouselHeader = class _CarouselHeader extends YTNode { + constructor(data) { + super(); + __publicField(this, "contents"); + this.contents = parser_exports.parseArray(data.contents); + } +}; +__name(_CarouselHeader, "CarouselHeader"); +__publicField(_CarouselHeader, "type", "CarouselHeader"); +var CarouselHeader = _CarouselHeader; + +// dist/src/parser/classes/CarouselItem.js +var _CarouselItem = class _CarouselItem extends YTNode { + constructor(data) { + super(); + __publicField(this, "items"); + __publicField(this, "background_color"); + __publicField(this, "layout_style"); + __publicField(this, "pagination_thumbnails"); + __publicField(this, "paginator_alignment"); + this.items = parser_exports.parseArray(data.carouselItems); + this.background_color = data.backgroundColor; + this.layout_style = data.layoutStyle; + this.pagination_thumbnails = Thumbnail.fromResponse(data.paginationThumbnails); + this.paginator_alignment = data.paginatorAlignment; + } + // XXX: For consistency. + get contents() { + return this.items; + } +}; +__name(_CarouselItem, "CarouselItem"); +__publicField(_CarouselItem, "type", "CarouselItem"); +var CarouselItem = _CarouselItem; + +// dist/src/parser/classes/TextCarouselItemView.js +var _TextCarouselItemView = class _TextCarouselItemView extends YTNode { + constructor(data) { + super(); + __publicField(this, "icon_name"); + __publicField(this, "text"); + __publicField(this, "on_tap_endpoint"); + __publicField(this, "button"); + this.icon_name = data.iconName; + this.text = Text2.fromAttributed(data.text); + this.on_tap_endpoint = new NavigationEndpoint(data.onTap); + this.button = parser_exports.parseItem(data.button, ButtonView); + } +}; +__name(_TextCarouselItemView, "TextCarouselItemView"); +__publicField(_TextCarouselItemView, "type", "TextCarouselItemView"); +var TextCarouselItemView = _TextCarouselItemView; + +// dist/src/parser/classes/CarouselItemView.js +var _CarouselItemView = class _CarouselItemView extends YTNode { + constructor(data) { + super(); + __publicField(this, "item_type"); + __publicField(this, "carousel_item"); + this.item_type = data.itemType; + this.carousel_item = parser_exports.parseItem(data.carouselItem, TextCarouselItemView); + } +}; +__name(_CarouselItemView, "CarouselItemView"); +__publicField(_CarouselItemView, "type", "CarouselItemView"); +var CarouselItemView = _CarouselItemView; + +// dist/src/parser/classes/CarouselTitleView.js +var _CarouselTitleView = class _CarouselTitleView extends YTNode { + constructor(data) { + super(); + __publicField(this, "title"); + __publicField(this, "previous_button"); + __publicField(this, "next_button"); + this.title = data.title; + this.previous_button = parser_exports.parseItem(data.previousButton, ButtonView); + this.next_button = parser_exports.parseItem(data.nextButton, ButtonView); + } +}; +__name(_CarouselTitleView, "CarouselTitleView"); +__publicField(_CarouselTitleView, "type", "CarouselTitleView"); +var CarouselTitleView = _CarouselTitleView; + +// dist/src/parser/classes/Channel.js +var _Channel = class _Channel extends YTNode { + constructor(data) { + super(); + __publicField(this, "id"); + __publicField(this, "author"); + __publicField(this, "subscriber_count"); + __publicField(this, "video_count"); + __publicField(this, "long_byline"); + __publicField(this, "short_byline"); + __publicField(this, "endpoint"); + __publicField(this, "subscribe_button"); + __publicField(this, "description_snippet"); + this.id = data.channelId; + this.author = new Author({ + ...data.title, + navigationEndpoint: data.navigationEndpoint + }, data.ownerBadges, data.thumbnail); + this.subscriber_count = new Text2(data.subscriberCountText); + this.video_count = new Text2(data.videoCountText); + this.long_byline = new Text2(data.longBylineText); + this.short_byline = new Text2(data.shortBylineText); + this.endpoint = new NavigationEndpoint(data.navigationEndpoint); + this.subscribe_button = parser_exports.parseItem(data.subscribeButton, [SubscribeButton, Button]); + this.description_snippet = new Text2(data.descriptionSnippet); + } +}; +__name(_Channel, "Channel"); +__publicField(_Channel, "type", "Channel"); +var Channel = _Channel; + +// dist/src/parser/classes/ChannelAboutFullMetadata.js +var _ChannelAboutFullMetadata = class _ChannelAboutFullMetadata extends YTNode { + constructor(data) { + var _a, _b; + super(); + __publicField(this, "id"); + __publicField(this, "name"); + __publicField(this, "avatar"); + __publicField(this, "canonical_channel_url"); + __publicField(this, "primary_links"); + __publicField(this, "view_count"); + __publicField(this, "joined_date"); + __publicField(this, "description"); + __publicField(this, "email_reveal"); + __publicField(this, "can_reveal_email"); + __publicField(this, "country"); + __publicField(this, "buttons"); + this.id = data.channelId; + this.name = new Text2(data.title); + this.avatar = Thumbnail.fromResponse(data.avatar); + this.canonical_channel_url = data.canonicalChannelUrl; + this.primary_links = (_b = (_a = data.primaryLinks) == null ? void 0 : _a.map((link) => ({ + endpoint: new NavigationEndpoint(link.navigationEndpoint), + icon: Thumbnail.fromResponse(link.icon), + title: new Text2(link.title) + }))) != null ? _b : []; + this.view_count = new Text2(data.viewCountText); + this.joined_date = new Text2(data.joinedDateText); + this.description = new Text2(data.description); + this.email_reveal = new NavigationEndpoint(data.onBusinessEmailRevealClickCommand); + this.can_reveal_email = !data.signInForBusinessEmail; + this.country = new Text2(data.country); + this.buttons = parser_exports.parseArray(data.actionButtons, Button); + } +}; +__name(_ChannelAboutFullMetadata, "ChannelAboutFullMetadata"); +__publicField(_ChannelAboutFullMetadata, "type", "ChannelAboutFullMetadata"); +var ChannelAboutFullMetadata = _ChannelAboutFullMetadata; + +// dist/src/parser/classes/ChannelAgeGate.js +var _ChannelAgeGate = class _ChannelAgeGate extends YTNode { + constructor(data) { + super(); + __publicField(this, "channel_title"); + __publicField(this, "avatar"); + __publicField(this, "header"); + __publicField(this, "main_text"); + __publicField(this, "sign_in_button"); + __publicField(this, "secondary_text"); + this.channel_title = data.channelTitle; + this.avatar = Thumbnail.fromResponse(data.avatar); + this.header = new Text2(data.header); + this.main_text = new Text2(data.mainText); + this.sign_in_button = parser_exports.parseItem(data.signInButton, Button); + this.secondary_text = new Text2(data.secondaryText); + } +}; +__name(_ChannelAgeGate, "ChannelAgeGate"); +__publicField(_ChannelAgeGate, "type", "ChannelAgeGate"); +var ChannelAgeGate = _ChannelAgeGate; + +// dist/src/parser/classes/ChannelFeaturedContent.js +var _ChannelFeaturedContent = class _ChannelFeaturedContent extends YTNode { + constructor(data) { + super(); + __publicField(this, "title"); + __publicField(this, "items"); + this.title = new Text2(data.title); + this.items = parser_exports.parseArray(data.items); + } +}; +__name(_ChannelFeaturedContent, "ChannelFeaturedContent"); +__publicField(_ChannelFeaturedContent, "type", "ChannelFeaturedContent"); +var ChannelFeaturedContent = _ChannelFeaturedContent; + +// dist/src/parser/classes/ChannelMetadata.js +var _ChannelMetadata = class _ChannelMetadata extends YTNode { + constructor(data) { + super(); + __publicField(this, "title"); + __publicField(this, "description"); + __publicField(this, "url"); + __publicField(this, "rss_url"); + __publicField(this, "vanity_channel_url"); + __publicField(this, "external_id"); + __publicField(this, "is_family_safe"); + __publicField(this, "keywords"); + __publicField(this, "avatar"); + __publicField(this, "music_artist_name"); + __publicField(this, "available_countries"); + __publicField(this, "android_deep_link"); + __publicField(this, "android_appindexing_link"); + __publicField(this, "ios_appindexing_link"); + this.title = data.title; + this.description = data.description; + this.url = data.channelUrl; + this.rss_url = data.rssUrl; + this.vanity_channel_url = data.vanityChannelUrl; + this.external_id = data.externalId; + this.is_family_safe = data.isFamilySafe; + this.keywords = data.keywords; + this.avatar = Thumbnail.fromResponse(data.avatar); + this.music_artist_name = typeof data.musicArtistName === "string" && data.musicArtistName.length > 0 ? data.musicArtistName : void 0; + this.available_countries = data.availableCountryCodes; + this.android_deep_link = data.androidDeepLink; + this.android_appindexing_link = data.androidAppindexingLink; + this.ios_appindexing_link = data.iosAppindexingLink; + } +}; +__name(_ChannelMetadata, "ChannelMetadata"); +__publicField(_ChannelMetadata, "type", "ChannelMetadata"); +var ChannelMetadata = _ChannelMetadata; + +// dist/src/parser/classes/ChannelMobileHeader.js +var _ChannelMobileHeader = class _ChannelMobileHeader extends YTNode { + constructor(data) { + super(); + __publicField(this, "title"); + this.title = new Text2(data.title); + } +}; +__name(_ChannelMobileHeader, "ChannelMobileHeader"); +__publicField(_ChannelMobileHeader, "type", "ChannelMobileHeader"); +var ChannelMobileHeader = _ChannelMobileHeader; + +// dist/src/parser/classes/ChannelOptions.js +var _ChannelOptions = class _ChannelOptions extends YTNode { + constructor(data) { + super(); + __publicField(this, "avatar"); + __publicField(this, "endpoint"); + __publicField(this, "name"); + __publicField(this, "links"); + this.avatar = Thumbnail.fromResponse(data.avatar); + this.endpoint = new NavigationEndpoint(data.avatarEndpoint); + this.name = data.name; + this.links = data.links.map((link) => new Text2(link)); + } +}; +__name(_ChannelOptions, "ChannelOptions"); +__publicField(_ChannelOptions, "type", "ChannelOptions"); +var ChannelOptions = _ChannelOptions; + +// dist/src/parser/classes/ChannelOwnerEmptyState.js +var _ChannelOwnerEmptyState = class _ChannelOwnerEmptyState extends YTNode { + constructor(data) { + super(); + __publicField(this, "illustration"); + __publicField(this, "description"); + this.illustration = Thumbnail.fromResponse(data.illustration); + this.description = new Text2(data.description); + } +}; +__name(_ChannelOwnerEmptyState, "ChannelOwnerEmptyState"); +__publicField(_ChannelOwnerEmptyState, "type", "ChannelOwnerEmptyState"); +var ChannelOwnerEmptyState = _ChannelOwnerEmptyState; + +// dist/src/parser/classes/ChannelSubMenu.js +var _ChannelSubMenu = class _ChannelSubMenu extends YTNode { + constructor(data) { + var _a, _b, _c; + super(); + __publicField(this, "content_type_sub_menu_items"); + __publicField(this, "sort_setting"); + this.content_type_sub_menu_items = ((_c = (_b = (_a = data.sortSetting) == null ? void 0 : _a.sortFilterSubMenuRenderer) == null ? void 0 : _b.subMenuItems) == null ? void 0 : _c.map((item) => ({ + endpoint: new NavigationEndpoint(item.navigationEndpoint || item.endpoint), + selected: item.selected, + title: item.title + }))) || []; + this.sort_setting = parser_exports.parseItem(data.sortSetting); + } +}; +__name(_ChannelSubMenu, "ChannelSubMenu"); +__publicField(_ChannelSubMenu, "type", "ChannelSubMenu"); +var ChannelSubMenu = _ChannelSubMenu; + +// dist/src/parser/classes/ChannelSwitcherHeader.js +var _ChannelSwitcherHeader = class _ChannelSwitcherHeader extends YTNode { + constructor(data) { + super(); + __publicField(this, "title"); + __publicField(this, "button"); + this.title = new Text2(data.title).toString(); + if (Reflect.has(data, "button")) { + this.button = parser_exports.parseItem(data.button, Button); + } + } +}; +__name(_ChannelSwitcherHeader, "ChannelSwitcherHeader"); +__publicField(_ChannelSwitcherHeader, "type", "ChannelSwitcherHeader"); +var ChannelSwitcherHeader = _ChannelSwitcherHeader; + +// dist/src/parser/classes/ChannelThumbnailWithLink.js +var _ChannelThumbnailWithLink = class _ChannelThumbnailWithLink extends YTNode { + constructor(data) { + super(); + __publicField(this, "thumbnails"); + __publicField(this, "endpoint"); + __publicField(this, "accessibility"); + this.thumbnails = Thumbnail.fromResponse(data.thumbnail); + this.endpoint = new NavigationEndpoint(data.navigationEndpoint); + if ("accessibility" in data && "accessibilityData" in data.accessibility) { + this.accessibility = { + accessibility_data: new AccessibilityData(data.accessibility.accessibilityData) + }; + } + } + get label() { + var _a, _b; + return (_b = (_a = this.accessibility) == null ? void 0 : _a.accessibility_data) == null ? void 0 : _b.label; + } +}; +__name(_ChannelThumbnailWithLink, "ChannelThumbnailWithLink"); +__publicField(_ChannelThumbnailWithLink, "type", "ChannelThumbnailWithLink"); +var ChannelThumbnailWithLink = _ChannelThumbnailWithLink; + +// dist/src/parser/classes/ChannelVideoPlayer.js +var _ChannelVideoPlayer = class _ChannelVideoPlayer extends YTNode { + constructor(data) { + super(); + __publicField(this, "id"); + __publicField(this, "title"); + __publicField(this, "description"); + __publicField(this, "view_count"); + __publicField(this, "published_time"); + this.id = data.videoId; + this.title = new Text2(data.title); + this.description = new Text2(data.description); + this.view_count = new Text2(data.viewCountText); + this.published_time = new Text2(data.publishedTimeText); + } +}; +__name(_ChannelVideoPlayer, "ChannelVideoPlayer"); +__publicField(_ChannelVideoPlayer, "type", "ChannelVideoPlayer"); +var ChannelVideoPlayer = _ChannelVideoPlayer; + +// dist/src/parser/classes/Chapter.js +var _Chapter = class _Chapter extends YTNode { + constructor(data) { + super(); + __publicField(this, "title"); + __publicField(this, "time_range_start_millis"); + __publicField(this, "thumbnail"); + this.title = new Text2(data.title); + this.time_range_start_millis = data.timeRangeStartMillis; + this.thumbnail = Thumbnail.fromResponse(data.thumbnail); + } +}; +__name(_Chapter, "Chapter"); +__publicField(_Chapter, "type", "Chapter"); +var Chapter = _Chapter; + +// dist/src/parser/classes/ChildVideo.js +var _ChildVideo = class _ChildVideo extends YTNode { + constructor(data) { + super(); + __publicField(this, "id"); + __publicField(this, "title"); + __publicField(this, "duration"); + __publicField(this, "endpoint"); + this.id = data.videoId; + this.title = new Text2(data.title); + this.duration = { + text: data.lengthText.simpleText, + seconds: timeToSeconds(data.lengthText.simpleText) + }; + this.endpoint = new NavigationEndpoint(data.navigationEndpoint); + } +}; +__name(_ChildVideo, "ChildVideo"); +__publicField(_ChildVideo, "type", "ChildVideo"); +var ChildVideo = _ChildVideo; + +// dist/src/parser/classes/ChipView.js +var _ChipView = class _ChipView extends YTNode { + constructor(data) { + super(); + __publicField(this, "text"); + __publicField(this, "display_type"); + __publicField(this, "endpoint"); + __publicField(this, "chip_entity_key"); + this.text = data.text; + this.display_type = data.displayType; + this.endpoint = new NavigationEndpoint(data.tapCommand); + this.chip_entity_key = data.chipEntityKey; + } +}; +__name(_ChipView, "ChipView"); +__publicField(_ChipView, "type", "ChipView"); +var ChipView = _ChipView; + +// dist/src/parser/classes/ChipBarView.js +var _ChipBarView = class _ChipBarView extends YTNode { + constructor(data) { + super(); + __publicField(this, "chips"); + this.chips = parser_exports.parseArray(data.chips, ChipView); + } +}; +__name(_ChipBarView, "ChipBarView"); +__publicField(_ChipBarView, "type", "ChipBarView"); +var ChipBarView = _ChipBarView; + +// dist/src/parser/classes/ChipCloudChip.js +var _ChipCloudChip = class _ChipCloudChip extends YTNode { + constructor(data) { + super(); + __publicField(this, "is_selected"); + __publicField(this, "endpoint"); + __publicField(this, "text"); + this.is_selected = data.isSelected; + if (Reflect.has(data, "navigationEndpoint")) { + this.endpoint = new NavigationEndpoint(data.navigationEndpoint); + } + this.text = new Text2(data.text).toString(); + } +}; +__name(_ChipCloudChip, "ChipCloudChip"); +__publicField(_ChipCloudChip, "type", "ChipCloudChip"); +var ChipCloudChip = _ChipCloudChip; + +// dist/src/parser/classes/ChipCloud.js +var _ChipCloud = class _ChipCloud extends YTNode { + constructor(data) { + super(); + __publicField(this, "chips"); + __publicField(this, "next_button"); + __publicField(this, "previous_button"); + __publicField(this, "horizontal_scrollable"); + this.chips = parser_exports.parseArray(data.chips, ChipCloudChip); + this.next_button = parser_exports.parseItem(data.nextButton, Button); + this.previous_button = parser_exports.parseItem(data.previousButton, Button); + this.horizontal_scrollable = data.horizontalScrollable; + } +}; +__name(_ChipCloud, "ChipCloud"); +__publicField(_ChipCloud, "type", "ChipCloud"); +var ChipCloud = _ChipCloud; + +// dist/src/parser/classes/ClientSideToggleMenuItem.js +var _ClientSideToggleMenuItem = class _ClientSideToggleMenuItem extends YTNode { + constructor(data) { + super(); + __publicField(this, "text"); + __publicField(this, "icon_type"); + __publicField(this, "toggled_text"); + __publicField(this, "toggled_icon_type"); + __publicField(this, "is_toggled"); + __publicField(this, "menu_item_identifier"); + __publicField(this, "endpoint"); + __publicField(this, "logging_directives"); + this.text = new Text2(data.defaultText); + this.icon_type = data.defaultIcon.iconType; + this.toggled_text = new Text2(data.toggledText); + this.toggled_icon_type = data.toggledIcon.iconType; + if (Reflect.has(data, "isToggled")) { + this.is_toggled = data.isToggled; + } + this.menu_item_identifier = data.menuItemIdentifier; + this.endpoint = new NavigationEndpoint(data.command); + if (Reflect.has(data, "loggingDirectives")) { + this.logging_directives = { + visibility: { + types: data.loggingDirectives.visibility.types + }, + enable_displaylogger_experiment: data.loggingDirectives.enableDisplayloggerExperiment + }; + } + } +}; +__name(_ClientSideToggleMenuItem, "ClientSideToggleMenuItem"); +__publicField(_ClientSideToggleMenuItem, "type", "ClientSideToggleMenuItem"); +var ClientSideToggleMenuItem = _ClientSideToggleMenuItem; + +// dist/src/parser/classes/CollaboratorInfoCardContent.js +var _CollaboratorInfoCardContent = class _CollaboratorInfoCardContent extends YTNode { + constructor(data) { + super(); + __publicField(this, "channel_avatar"); + __publicField(this, "custom_text"); + __publicField(this, "channel_name"); + __publicField(this, "subscriber_count"); + __publicField(this, "endpoint"); + this.channel_avatar = Thumbnail.fromResponse(data.channelAvatar); + this.custom_text = new Text2(data.customText); + this.channel_name = new Text2(data.channelName); + this.subscriber_count = new Text2(data.subscriberCountText); + this.endpoint = new NavigationEndpoint(data.endpoint); + } +}; +__name(_CollaboratorInfoCardContent, "CollaboratorInfoCardContent"); +__publicField(_CollaboratorInfoCardContent, "type", "CollaboratorInfoCardContent"); +var CollaboratorInfoCardContent = _CollaboratorInfoCardContent; + +// dist/src/parser/classes/CollageHeroImage.js +var _CollageHeroImage = class _CollageHeroImage extends YTNode { + constructor(data) { + super(); + __publicField(this, "left"); + __publicField(this, "top_right"); + __publicField(this, "bottom_right"); + __publicField(this, "endpoint"); + this.left = Thumbnail.fromResponse(data.leftThumbnail); + this.top_right = Thumbnail.fromResponse(data.topRightThumbnail); + this.bottom_right = Thumbnail.fromResponse(data.bottomRightThumbnail); + this.endpoint = new NavigationEndpoint(data.navigationEndpoint); + } +}; +__name(_CollageHeroImage, "CollageHeroImage"); +__publicField(_CollageHeroImage, "type", "CollageHeroImage"); +var CollageHeroImage = _CollageHeroImage; + +// dist/src/parser/classes/ThumbnailHoverOverlayView.js +var _ThumbnailHoverOverlayView = class _ThumbnailHoverOverlayView extends YTNode { + constructor(data) { + super(); + __publicField(this, "icon_name"); + __publicField(this, "text"); + __publicField(this, "style"); + this.icon_name = data.icon.sources[0].clientResource.imageName; + this.text = Text2.fromAttributed(data.text); + this.style = data.style; + } +}; +__name(_ThumbnailHoverOverlayView, "ThumbnailHoverOverlayView"); +__publicField(_ThumbnailHoverOverlayView, "type", "ThumbnailHoverOverlayView"); +var ThumbnailHoverOverlayView = _ThumbnailHoverOverlayView; + +// dist/src/parser/classes/ThumbnailBadgeView.js +var _ThumbnailBadgeView = class _ThumbnailBadgeView extends YTNode { + constructor(data) { + super(); + __publicField(this, "icon_name"); + __publicField(this, "text"); + __publicField(this, "badge_style"); + __publicField(this, "background_color"); + this.text = data.text; + this.badge_style = data.badgeStyle; + if (data.backgroundColor) { + this.background_color = { + light_theme: data.backgroundColor.lightTheme, + dark_theme: data.backgroundColor.darkTheme + }; + } + if (data.iconName) { + this.icon_name = data.icon.sources[0].clientResource.imageName; + } + } +}; +__name(_ThumbnailBadgeView, "ThumbnailBadgeView"); +__publicField(_ThumbnailBadgeView, "type", "ThumbnailBadgeView"); +var ThumbnailBadgeView = _ThumbnailBadgeView; + +// dist/src/parser/classes/ThumbnailOverlayBadgeView.js +var _ThumbnailOverlayBadgeView = class _ThumbnailOverlayBadgeView extends YTNode { + constructor(data) { + super(); + __publicField(this, "badges"); + __publicField(this, "position"); + this.badges = parser_exports.parseArray(data.thumbnailBadges, ThumbnailBadgeView); + this.position = data.position; + } +}; +__name(_ThumbnailOverlayBadgeView, "ThumbnailOverlayBadgeView"); +__publicField(_ThumbnailOverlayBadgeView, "type", "ThumbnailOverlayBadgeView"); +var ThumbnailOverlayBadgeView = _ThumbnailOverlayBadgeView; + +// dist/src/parser/classes/ThumbnailHoverOverlayToggleActionsView.js +var _ThumbnailHoverOverlayToggleActionsView = class _ThumbnailHoverOverlayToggleActionsView extends YTNode { + constructor(data) { + super(); + __publicField(this, "buttons"); + this.buttons = parser_exports.parseArray(data.buttons, ToggleButtonView); + } +}; +__name(_ThumbnailHoverOverlayToggleActionsView, "ThumbnailHoverOverlayToggleActionsView"); +__publicField(_ThumbnailHoverOverlayToggleActionsView, "type", "ThumbnailHoverOverlayToggleActionsView"); +var ThumbnailHoverOverlayToggleActionsView = _ThumbnailHoverOverlayToggleActionsView; + +// dist/src/parser/classes/ThumbnailOverlayProgressBarView.js +var _ThumbnailOverlayProgressBarView = class _ThumbnailOverlayProgressBarView extends YTNode { + constructor(data) { + super(); + __publicField(this, "start_percent"); + this.start_percent = data.startPercent; + } +}; +__name(_ThumbnailOverlayProgressBarView, "ThumbnailOverlayProgressBarView"); +__publicField(_ThumbnailOverlayProgressBarView, "type", "ThumbnailOverlayProgressBarView"); +var ThumbnailOverlayProgressBarView = _ThumbnailOverlayProgressBarView; + +// dist/src/parser/classes/ThumbnailBottomOverlayView.js +var _ThumbnailBottomOverlayView = class _ThumbnailBottomOverlayView extends YTNode { + constructor(data) { + super(); + __publicField(this, "progress_bar"); + __publicField(this, "badges"); + this.progress_bar = parser_exports.parseItem(data.progressBar, ThumbnailOverlayProgressBarView); + this.badges = parser_exports.parseArray(data.badges, ThumbnailBadgeView); + } +}; +__name(_ThumbnailBottomOverlayView, "ThumbnailBottomOverlayView"); +__publicField(_ThumbnailBottomOverlayView, "type", "ThumbnailBottomOverlayView"); +var ThumbnailBottomOverlayView = _ThumbnailBottomOverlayView; + +// dist/src/parser/classes/ThumbnailView.js +var _ThumbnailView = class _ThumbnailView extends YTNode { + constructor(data) { + super(); + __publicField(this, "image"); + __publicField(this, "overlays"); + __publicField(this, "background_color"); + this.image = Thumbnail.fromResponse(data.image); + this.overlays = parser_exports.parseArray(data.overlays, [ + ThumbnailHoverOverlayToggleActionsView, + ThumbnailBottomOverlayView, + ThumbnailOverlayBadgeView, + ThumbnailHoverOverlayView, + AnimatedThumbnailOverlayView + ]); + if ("backgroundColor" in data) { + this.background_color = { + light_theme: data.backgroundColor.lightTheme, + dark_theme: data.backgroundColor.darkTheme + }; + } + } +}; +__name(_ThumbnailView, "ThumbnailView"); +__publicField(_ThumbnailView, "type", "ThumbnailView"); +var ThumbnailView = _ThumbnailView; + +// dist/src/parser/classes/CollectionThumbnailView.js +var _CollectionThumbnailView = class _CollectionThumbnailView extends YTNode { + constructor(data) { + var _a, _b; + super(); + __publicField(this, "primary_thumbnail"); + __publicField(this, "stack_color"); + this.primary_thumbnail = parser_exports.parseItem(data.primaryThumbnail, ThumbnailView); + if ("stackColor" in data) { + this.stack_color = { + light_theme: (_a = data.stackColor) == null ? void 0 : _a.lightTheme, + dark_theme: (_b = data.stackColor) == null ? void 0 : _b.darkTheme + }; + } + } +}; +__name(_CollectionThumbnailView, "CollectionThumbnailView"); +__publicField(_CollectionThumbnailView, "type", "CollectionThumbnailView"); +var CollectionThumbnailView = _CollectionThumbnailView; + +// dist/src/parser/classes/commands/AddToPlaylistCommand.js +var _AddToPlaylistCommand = class _AddToPlaylistCommand extends YTNode { + constructor(data) { + super(); + __publicField(this, "open_miniplayer"); + __publicField(this, "video_id"); + __publicField(this, "list_type"); + __publicField(this, "endpoint"); + __publicField(this, "video_ids"); + this.open_miniplayer = data.openMiniplayer; + this.video_id = data.videoId; + this.list_type = data.listType; + this.endpoint = new NavigationEndpoint(data.onCreateListCommand); + this.video_ids = data.videoIds; + } +}; +__name(_AddToPlaylistCommand, "AddToPlaylistCommand"); +__publicField(_AddToPlaylistCommand, "type", "AddToPlaylistCommand"); +var AddToPlaylistCommand = _AddToPlaylistCommand; + +// dist/src/parser/classes/commands/ContinuationCommand.js +var _data; +var _ContinuationCommand = class _ContinuationCommand extends YTNode { + constructor(data) { + super(); + __privateAdd(this, _data); + __privateSet(this, _data, data); + } + getApiPath() { + switch (__privateGet(this, _data).request) { + case "CONTINUATION_REQUEST_TYPE_WATCH_NEXT": + return "next"; + case "CONTINUATION_REQUEST_TYPE_BROWSE": + return "browse"; + case "CONTINUATION_REQUEST_TYPE_SEARCH": + return "search"; + case "CONTINUATION_REQUEST_TYPE_ACCOUNTS_LIST": + return "account/accounts_list"; + case "CONTINUATION_REQUEST_TYPE_COMMENTS_NOTIFICATION_MENU": + return "notification/get_notification_menu"; + case "CONTINUATION_REQUEST_TYPE_COMMENT_REPLIES": + return "comment/get_comment_replies"; + case "CONTINUATION_REQUEST_TYPE_REEL_WATCH_SEQUENCE": + return "reel/reel_watch_sequence"; + case "CONTINUATION_REQUEST_TYPE_GET_PANEL": + return "get_panel"; + default: + return ""; + } + } + buildRequest() { + const request = {}; + if (__privateGet(this, _data).formData) + request.formData = __privateGet(this, _data).formData; + if (__privateGet(this, _data).token) + request.continuation = __privateGet(this, _data).token; + if (__privateGet(this, _data).request === "CONTINUATION_REQUEST_TYPE_COMMENTS_NOTIFICATION_MENU") { + request.notificationsMenuRequestType = "NOTIFICATIONS_MENU_REQUEST_TYPE_COMMENTS"; + if (__privateGet(this, _data).token) { + request.fetchCommentsParams = { + continuation: __privateGet(this, _data).token + }; + delete request.continuation; + } + } + return request; + } +}; +_data = new WeakMap(); +__name(_ContinuationCommand, "ContinuationCommand"); +__publicField(_ContinuationCommand, "type", "ContinuationCommand"); +var ContinuationCommand = _ContinuationCommand; + +// dist/src/parser/classes/commands/GetKidsBlocklistPickerCommand.js +var API_PATH = "kids/get_kids_blocklist_picker"; +var _data2; +var _GetKidsBlocklistPickerCommand = class _GetKidsBlocklistPickerCommand extends YTNode { + constructor(data) { + super(); + __privateAdd(this, _data2); + __privateSet(this, _data2, data); + } + getApiPath() { + return API_PATH; + } + buildRequest() { + const request = {}; + if (__privateGet(this, _data2).blockedForKidsContent) + request.blockedForKidsContent = __privateGet(this, _data2).blockedForKidsContent; + return request; + } +}; +_data2 = new WeakMap(); +__name(_GetKidsBlocklistPickerCommand, "GetKidsBlocklistPickerCommand"); +__publicField(_GetKidsBlocklistPickerCommand, "type", "GetKidsBlocklistPickerCommand"); +var GetKidsBlocklistPickerCommand = _GetKidsBlocklistPickerCommand; + +// dist/src/parser/classes/commands/RunAttestationCommand.js +var _RunAttestationCommand = class _RunAttestationCommand extends YTNode { + constructor(data) { + super(); + __publicField(this, "engagement_type"); + __publicField(this, "ids"); + this.engagement_type = data.engagementType; + if (Reflect.has(data, "ids")) { + this.ids = data.ids.map((id) => ({ + encrypted_video_id: id.encryptedVideoId, + external_channel_id: id.externalChannelId, + comment_id: id.commentId, + external_owner_id: id.externalOwnerId, + artist_id: id.artistId, + playlist_id: id.playlistId, + external_post_id: id.externalPostId, + share_id: id.shareId + })); + } + } +}; +__name(_RunAttestationCommand, "RunAttestationCommand"); +__publicField(_RunAttestationCommand, "type", "RunAttestationCommand"); +var RunAttestationCommand = _RunAttestationCommand; + +// dist/src/parser/classes/commands/ShowDialogCommand.js +var _ShowDialogCommand = class _ShowDialogCommand extends YTNode { + constructor(data) { + var _a; + super(); + __publicField(this, "inline_content"); + __publicField(this, "remove_default_padding"); + this.inline_content = parser_exports.parseItem((_a = data.panelLoadingStrategy) == null ? void 0 : _a.inlineContent); + this.remove_default_padding = !!data.removeDefaultPadding; + } +}; +__name(_ShowDialogCommand, "ShowDialogCommand"); +__publicField(_ShowDialogCommand, "type", "ShowDialogCommand"); +var ShowDialogCommand = _ShowDialogCommand; + +// dist/src/parser/classes/commands/UpdateEngagementPanelContentCommand.js +var _UpdateEngagementPanelContentCommand = class _UpdateEngagementPanelContentCommand extends YTNode { + constructor(data) { + super(); + __publicField(this, "content_source_panel_identifier"); + __publicField(this, "target_panel_identifier"); + this.content_source_panel_identifier = data.contentSourcePanelIdentifier; + this.target_panel_identifier = data.targetPanelIdentifier; + } +}; +__name(_UpdateEngagementPanelContentCommand, "UpdateEngagementPanelContentCommand"); +__publicField(_UpdateEngagementPanelContentCommand, "type", "UpdateEngagementPanelContentCommand"); +var UpdateEngagementPanelContentCommand = _UpdateEngagementPanelContentCommand; + +// dist/src/parser/classes/comments/AuthorCommentBadge.js +var _data3; +var _AuthorCommentBadge = class _AuthorCommentBadge extends YTNode { + constructor(data) { + super(); + __privateAdd(this, _data3); + __publicField(this, "icon_type"); + __publicField(this, "tooltip"); + __publicField(this, "style"); + if (Reflect.has(data, "icon") && Reflect.has(data.icon, "iconType")) { + this.icon_type = data.icon.iconType; + } + this.tooltip = data.iconTooltip; + if (this.tooltip === "Verified") { + this.style = "BADGE_STYLE_TYPE_VERIFIED"; + data.style = "BADGE_STYLE_TYPE_VERIFIED"; + } + __privateSet(this, _data3, data); + } + get orig_badge() { + return __privateGet(this, _data3); + } +}; +_data3 = new WeakMap(); +__name(_AuthorCommentBadge, "AuthorCommentBadge"); +__publicField(_AuthorCommentBadge, "type", "AuthorCommentBadge"); +var AuthorCommentBadge = _AuthorCommentBadge; + +// dist/src/parser/classes/comments/EmojiPicker.js +var _EmojiPicker = class _EmojiPicker extends YTNode { + constructor(data) { + super(); + __publicField(this, "id"); + __publicField(this, "categories"); + __publicField(this, "category_buttons"); + __publicField(this, "search_placeholder"); + __publicField(this, "search_no_results"); + __publicField(this, "pick_skin_tone"); + __publicField(this, "clear_search_label"); + __publicField(this, "skin_tone_generic_label"); + __publicField(this, "skin_tone_light_label"); + __publicField(this, "skin_tone_medium_light_label"); + __publicField(this, "skin_tone_medium_label"); + __publicField(this, "skin_tone_medium_dark_label"); + __publicField(this, "skin_tone_dark_label"); + this.id = data.id; + this.categories = parser_exports.parseArray(data.categories); + this.category_buttons = parser_exports.parseArray(data.categoryButtons); + this.search_placeholder = new Text2(data.searchPlaceholderText); + this.search_no_results = new Text2(data.searchNoResultsText); + this.pick_skin_tone = new Text2(data.pickSkinToneText); + this.clear_search_label = data.clearSearchLabel; + this.skin_tone_generic_label = data.skinToneGenericLabel; + this.skin_tone_light_label = data.skinToneLightLabel; + this.skin_tone_medium_light_label = data.skinToneMediumLightLabel; + this.skin_tone_medium_label = data.skinToneMediumLabel; + this.skin_tone_medium_dark_label = data.skinToneMediumDarkLabel; + this.skin_tone_dark_label = data.skinToneDarkLabel; + } +}; +__name(_EmojiPicker, "EmojiPicker"); +__publicField(_EmojiPicker, "type", "EmojiPicker"); +var EmojiPicker = _EmojiPicker; + +// dist/src/parser/classes/comments/CommentDialog.js +var _CommentDialog = class _CommentDialog extends YTNode { + constructor(data) { + super(); + __publicField(this, "editable_text"); + __publicField(this, "author_thumbnail"); + __publicField(this, "submit_button"); + __publicField(this, "cancel_button"); + __publicField(this, "placeholder"); + __publicField(this, "emoji_button"); + __publicField(this, "emoji_picker"); + this.editable_text = new Text2(data.editableText); + this.author_thumbnail = Thumbnail.fromResponse(data.authorThumbnail); + this.submit_button = parser_exports.parseItem(data.submitButton, Button); + this.cancel_button = parser_exports.parseItem(data.cancelButton, Button); + this.placeholder = new Text2(data.placeholderText); + this.emoji_button = parser_exports.parseItem(data.emojiButton, Button); + this.emoji_picker = parser_exports.parseItem(data.emojiPicker, EmojiPicker); + } +}; +__name(_CommentDialog, "CommentDialog"); +__publicField(_CommentDialog, "type", "CommentDialog"); +var CommentDialog = _CommentDialog; + +// dist/src/parser/classes/comments/CommentReplies.js +var _CommentReplies = class _CommentReplies extends YTNode { + constructor(data) { + super(); + __publicField(this, "contents"); + __publicField(this, "view_replies"); + __publicField(this, "hide_replies"); + __publicField(this, "view_replies_creator_thumbnail"); + __publicField(this, "has_channel_owner_replied"); + this.contents = parser_exports.parseArray(data.contents); + this.view_replies = parser_exports.parseItem(data.viewReplies, Button); + this.hide_replies = parser_exports.parseItem(data.hideReplies, Button); + this.view_replies_creator_thumbnail = Thumbnail.fromResponse(data.viewRepliesCreatorThumbnail); + this.has_channel_owner_replied = !!data.viewRepliesCreatorThumbnail; + } +}; +__name(_CommentReplies, "CommentReplies"); +__publicField(_CommentReplies, "type", "CommentReplies"); +var CommentReplies = _CommentReplies; + +// dist/src/parser/classes/comments/CommentReplyDialog.js +var _CommentReplyDialog = class _CommentReplyDialog extends YTNode { + constructor(data) { + super(); + __publicField(this, "reply_button"); + __publicField(this, "cancel_button"); + __publicField(this, "author_thumbnail"); + __publicField(this, "placeholder"); + __publicField(this, "error_message"); + this.reply_button = parser_exports.parseItem(data.replyButton, Button); + this.cancel_button = parser_exports.parseItem(data.cancelButton, Button); + this.author_thumbnail = Thumbnail.fromResponse(data.authorThumbnail); + this.placeholder = new Text2(data.placeholderText); + this.error_message = new Text2(data.errorMessage); + } +}; +__name(_CommentReplyDialog, "CommentReplyDialog"); +__publicField(_CommentReplyDialog, "type", "CommentReplyDialog"); +var CommentReplyDialog = _CommentReplyDialog; + +// dist/src/parser/classes/comments/CommentsSimplebox.js +var _CommentsSimplebox = class _CommentsSimplebox extends YTNode { + constructor(data) { + super(); + __publicField(this, "simplebox_avatar"); + __publicField(this, "simplebox_placeholder"); + this.simplebox_avatar = Thumbnail.fromResponse(data.simpleboxAvatar); + this.simplebox_placeholder = new Text2(data.simpleboxPlaceholder); + } +}; +__name(_CommentsSimplebox, "CommentsSimplebox"); +__publicField(_CommentsSimplebox, "type", "CommentsSimplebox"); +var CommentsSimplebox = _CommentsSimplebox; + +// dist/src/parser/classes/comments/CommentsEntryPointTeaser.js +var _CommentsEntryPointTeaser = class _CommentsEntryPointTeaser extends YTNode { + constructor(data) { + super(); + __publicField(this, "teaser_avatar"); + __publicField(this, "teaser_content"); + if (Reflect.has(data, "teaserAvatar")) { + this.teaser_avatar = Thumbnail.fromResponse(data.teaserAvatar); + } + if (Reflect.has(data, "teaserContent")) { + this.teaser_content = new Text2(data.teaserContent); + } + } +}; +__name(_CommentsEntryPointTeaser, "CommentsEntryPointTeaser"); +__publicField(_CommentsEntryPointTeaser, "type", "CommentsEntryPointTeaser"); +var CommentsEntryPointTeaser = _CommentsEntryPointTeaser; + +// dist/src/parser/classes/comments/CommentsEntryPointHeader.js +var _CommentsEntryPointHeader = class _CommentsEntryPointHeader extends YTNode { + constructor(data) { + super(); + __publicField(this, "header"); + __publicField(this, "comment_count"); + __publicField(this, "teaser_avatar"); + __publicField(this, "teaser_content"); + __publicField(this, "content_renderer"); + __publicField(this, "simplebox_placeholder"); + if (Reflect.has(data, "headerText")) { + this.header = new Text2(data.headerText); + } + if (Reflect.has(data, "commentCount")) { + this.comment_count = new Text2(data.commentCount); + } + if (Reflect.has(data, "teaserAvatar") || Reflect.has(data, "simpleboxAvatar")) { + this.teaser_avatar = Thumbnail.fromResponse(data.teaserAvatar || data.simpleboxAvatar); + } + if (Reflect.has(data, "teaserContent")) { + this.teaser_content = new Text2(data.teaserContent); + } + if (Reflect.has(data, "contentRenderer")) { + this.content_renderer = parser_exports.parseItem(data.contentRenderer, [CommentsEntryPointTeaser, CommentsSimplebox]); + } + if (Reflect.has(data, "simpleboxPlaceholder")) { + this.simplebox_placeholder = new Text2(data.simpleboxPlaceholder); + } + } +}; +__name(_CommentsEntryPointHeader, "CommentsEntryPointHeader"); +__publicField(_CommentsEntryPointHeader, "type", "CommentsEntryPointHeader"); +var CommentsEntryPointHeader = _CommentsEntryPointHeader; + +// dist/src/parser/classes/comments/CommentsHeader.js +var _CommentsHeader = class _CommentsHeader extends YTNode { + constructor(data) { + super(); + __publicField(this, "title"); + __publicField(this, "count"); + __publicField(this, "comments_count"); + __publicField(this, "create_renderer"); + __publicField(this, "sort_menu"); + __publicField(this, "custom_emojis"); + this.title = new Text2(data.titleText); + this.count = new Text2(data.countText); + this.comments_count = new Text2(data.commentsCount); + this.create_renderer = parser_exports.parseItem(data.createRenderer); + this.sort_menu = parser_exports.parseItem(data.sortMenu, SortFilterSubMenu); + if (Reflect.has(data, "customEmojis")) { + this.custom_emojis = data.customEmojis.map((emoji) => ({ + emoji_id: emoji.emojiId, + shortcuts: emoji.shortcuts, + search_terms: emoji.searchTerms, + image: Thumbnail.fromResponse(emoji.image), + is_custom_emoji: emoji.isCustomEmoji + })); + } + } +}; +__name(_CommentsHeader, "CommentsHeader"); +__publicField(_CommentsHeader, "type", "CommentsHeader"); +var CommentsHeader = _CommentsHeader; + +// dist/src/parser/classes/comments/CommentSimplebox.js +var _CommentSimplebox = class _CommentSimplebox extends YTNode { + constructor(data) { + super(); + __publicField(this, "submit_button"); + __publicField(this, "cancel_button"); + __publicField(this, "author_thumbnail"); + __publicField(this, "placeholder"); + __publicField(this, "avatar_size"); + this.submit_button = parser_exports.parseItem(data.submitButton, Button); + this.cancel_button = parser_exports.parseItem(data.cancelButton, Button); + this.author_thumbnail = Thumbnail.fromResponse(data.authorThumbnail); + this.placeholder = new Text2(data.placeholderText); + this.avatar_size = data.avatarSize; + } +}; +__name(_CommentSimplebox, "CommentSimplebox"); +__publicField(_CommentSimplebox, "type", "CommentSimplebox"); +var CommentSimplebox = _CommentSimplebox; + +// dist/src/parser/classes/comments/VoiceReplyContainerView.js +var _VoiceReplyContainerView = class _VoiceReplyContainerView extends YTNode { + constructor(data) { + super(); + __publicField(this, "voice_reply_unavailable_text"); + __publicField(this, "transcript_text"); + this.voice_reply_unavailable_text = Text2.fromAttributed(data.voiceReplyUnavailableText); + this.transcript_text = Text2.fromAttributed(data.transcriptText); + } +}; +__name(_VoiceReplyContainerView, "VoiceReplyContainerView"); +__publicField(_VoiceReplyContainerView, "type", "VoiceReplyContainerView"); +var VoiceReplyContainerView = _VoiceReplyContainerView; + +// dist/src/parser/classes/comments/CommentView.js +var _actions; +var _CommentView = class _CommentView extends YTNode { + constructor(data) { + super(); + __privateAdd(this, _actions); + __publicField(this, "like_command"); + __publicField(this, "dislike_command"); + __publicField(this, "unlike_command"); + __publicField(this, "undislike_command"); + __publicField(this, "reply_command"); + __publicField(this, "prepare_account_command"); + __publicField(this, "comment_id"); + __publicField(this, "is_pinned"); + __publicField(this, "keys"); + __publicField(this, "content"); + __publicField(this, "published_time"); + __publicField(this, "author_is_channel_owner"); + __publicField(this, "creator_thumbnail_url"); + __publicField(this, "like_button_a11y"); + __publicField(this, "like_count"); + __publicField(this, "like_count_liked"); + __publicField(this, "like_count_a11y"); + __publicField(this, "like_active_tooltip"); + __publicField(this, "like_inactive_tooltip"); + __publicField(this, "dislike_active_tooltip"); + __publicField(this, "dislike_inactive_tooltip"); + __publicField(this, "heart_active_tooltip"); + __publicField(this, "reply_count"); + __publicField(this, "reply_count_a11y"); + __publicField(this, "is_member"); + __publicField(this, "member_badge"); + __publicField(this, "author"); + __publicField(this, "is_liked"); + __publicField(this, "is_disliked"); + __publicField(this, "is_hearted"); + __publicField(this, "voice_reply_container"); + this.comment_id = data.commentId; + this.is_pinned = !!data.pinnedText; + this.keys = { + comment: data.commentKey, + comment_surface: data.commentSurfaceKey, + toolbar_state: data.toolbarStateKey, + toolbar_surface: data.toolbarSurfaceKey, + shared: data.sharedKey + }; + } + applyMutations(comment, toolbar_state, toolbar_surface, comment_surface) { + if (comment) { + this.content = Text2.fromAttributed(comment.properties.content); + this.published_time = comment.properties.publishedTime; + this.author_is_channel_owner = !!comment.author.isCreator; + this.creator_thumbnail_url = comment.toolbar.creatorThumbnailUrl; + this.like_count = comment.toolbar.likeCountNotliked ? comment.toolbar.likeCountNotliked : "0"; + this.like_count_liked = comment.toolbar.likeCountLiked ? comment.toolbar.likeCountLiked : "0"; + this.like_count_a11y = comment.toolbar.likeCountA11y; + this.like_active_tooltip = comment.toolbar.likeActiveTooltip; + this.like_inactive_tooltip = comment.toolbar.likeInactiveTooltip; + this.dislike_active_tooltip = comment.toolbar.dislikeActiveTooltip; + this.dislike_inactive_tooltip = comment.toolbar.dislikeInactiveTooltip; + this.like_button_a11y = comment.toolbar.likeButtonA11y; + this.heart_active_tooltip = comment.toolbar.heartActiveTooltip; + this.reply_count_a11y = comment.toolbar.replyCountA11y; + this.reply_count = comment.toolbar.replyCount ? comment.toolbar.replyCount : "0"; + this.is_member = !!comment.author.sponsorBadgeUrl; + if (Reflect.has(comment.author, "sponsorBadgeUrl")) { + this.member_badge = { + url: comment.author.sponsorBadgeUrl, + a11y: comment.author.A11y + }; + } + this.author = new Author({ + simpleText: comment.author.displayName, + navigationEndpoint: comment.avatar.endpoint + }, comment.author, comment.avatar.image, comment.author.channelId); + } + if (toolbar_state) { + this.is_hearted = toolbar_state.heartState === "TOOLBAR_HEART_STATE_HEARTED"; + this.is_liked = toolbar_state.likeState === "TOOLBAR_LIKE_STATE_LIKED"; + this.is_disliked = toolbar_state.likeState === "TOOLBAR_LIKE_STATE_DISLIKED"; + } + if (toolbar_surface) { + if ("prepareAccountCommand" in toolbar_surface) { + this.prepare_account_command = new NavigationEndpoint(toolbar_surface.prepareAccountCommand); + } else { + this.like_command = new NavigationEndpoint(toolbar_surface.likeCommand); + this.dislike_command = new NavigationEndpoint(toolbar_surface.dislikeCommand); + this.unlike_command = new NavigationEndpoint(toolbar_surface.unlikeCommand); + this.undislike_command = new NavigationEndpoint(toolbar_surface.undislikeCommand); + this.reply_command = new NavigationEndpoint(toolbar_surface.replyCommand); + } + } + if (comment_surface) { + if ("voiceReplyContainerViewModel" in comment_surface) { + this.voice_reply_container = parser_exports.parseItem(comment_surface.voiceReplyContainerViewModel, VoiceReplyContainerView); + } + } + } + /** + * Likes the comment. + * @returns A promise that resolves to the API response. + * @throws If the Actions instance is not set for this comment or if the like command is not found. + */ + async like() { + if (!__privateGet(this, _actions)) + throw new InnertubeError("Actions instance not set for this comment."); + if (!this.like_command) + throw new InnertubeError("Like command not found."); + if (this.is_liked) + throw new InnertubeError("This comment is already liked.", { comment_id: this.comment_id }); + return this.like_command.call(__privateGet(this, _actions)); + } + /** + * Dislikes the comment. + * @returns A promise that resolves to the API response. + * @throws If the Actions instance is not set for this comment or if the dislike command is not found. + */ + async dislike() { + if (!__privateGet(this, _actions)) + throw new InnertubeError("Actions instance not set for this comment."); + if (!this.dislike_command) + throw new InnertubeError("Dislike command not found."); + if (this.is_disliked) + throw new InnertubeError("This comment is already disliked.", { comment_id: this.comment_id }); + return this.dislike_command.call(__privateGet(this, _actions)); + } + /** + * Unlikes the comment. + * @returns A promise that resolves to the API response. + * @throws If the Actions instance is not set for this comment or if the unlike command is not found. + */ + async unlike() { + if (!__privateGet(this, _actions)) + throw new InnertubeError("Actions instance not set for this comment."); + if (!this.unlike_command) + throw new InnertubeError("Unlike command not found."); + if (!this.is_liked) + throw new InnertubeError("This comment is not liked.", { comment_id: this.comment_id }); + return this.unlike_command.call(__privateGet(this, _actions)); + } + /** + * Undislikes the comment. + * @returns A promise that resolves to the API response. + * @throws If the Actions instance is not set for this comment or if the undislike command is not found. + */ + async undislike() { + if (!__privateGet(this, _actions)) + throw new InnertubeError("Actions instance not set for this comment."); + if (!this.undislike_command) + throw new InnertubeError("Undislike command not found."); + if (!this.is_disliked) + throw new InnertubeError("This comment is not disliked.", { comment_id: this.comment_id }); + return this.undislike_command.call(__privateGet(this, _actions)); + } + /** + * Replies to the comment. + * @param comment_text - The text of the reply. + * @returns A promise that resolves to the API response. + * @throws If the Actions instance is not set for this comment or if the reply command is not found. + */ + async reply(comment_text) { + var _a; + if (!__privateGet(this, _actions)) + throw new InnertubeError("Actions instance not set for this comment."); + if (!this.reply_command) + throw new InnertubeError("Reply command not found."); + const dialog = (_a = this.reply_command.dialog) == null ? void 0 : _a.as(CommentReplyDialog); + if (!dialog) + throw new InnertubeError("Reply dialog not found."); + const reply_button = dialog.reply_button; + if (!reply_button) + throw new InnertubeError("Reply button not found in the dialog."); + if (!reply_button.endpoint) + throw new InnertubeError("Reply button endpoint not found."); + return reply_button.endpoint.call(__privateGet(this, _actions), { commentText: comment_text }); + } + /** + * Translates the comment to the specified target language. + * @param target_language - The target language to translate the comment to, e.g. 'en', 'ja'. + * @returns Resolves to an ApiResponse object with the translated content, if available. + * @throws if the Actions instance is not set for this comment or if the comment content is not found. + */ + async translate(target_language) { + var _a, _b, _c, _d, _e, _f; + if (!__privateGet(this, _actions)) + throw new InnertubeError("Actions instance not set for this comment."); + if (!this.content) + throw new InnertubeError("Comment content not found.", { comment_id: this.comment_id }); + const text = this.content.toString().replace(/[^\p{L}\p{N}\p{P}\p{Z}]/gu, ""); + const payload = { text, target_language }; + const action = encodeCommentActionParams(22, payload); + const response = await __privateGet(this, _actions).execute("comment/perform_comment_action", { action }); + const mutations = (_b = (_a = response.data.frameworkUpdates) == null ? void 0 : _a.entityBatchUpdate) == null ? void 0 : _b.mutations; + const content = (_f = (_e = (_d = (_c = mutations == null ? void 0 : mutations[0]) == null ? void 0 : _c.payload) == null ? void 0 : _d.commentEntityPayload) == null ? void 0 : _e.translatedContent) == null ? void 0 : _f.content; + return { ...response, content }; + } + setActions(actions) { + __privateSet(this, _actions, actions); + } +}; +_actions = new WeakMap(); +__name(_CommentView, "CommentView"); +__publicField(_CommentView, "type", "CommentView"); +var CommentView = _CommentView; + +// dist/src/parser/classes/comments/CommentThread.js +var _actions2, _continuation, _CommentThread_instances, getPatchedReplies_fn; +var _CommentThread = class _CommentThread extends YTNode { + constructor(data) { + super(); + __privateAdd(this, _CommentThread_instances); + __publicField(this, "comment"); + __publicField(this, "replies"); + __publicField(this, "comment_replies_data"); + __publicField(this, "is_moderated_elq_comment"); + __publicField(this, "has_replies"); + __privateAdd(this, _actions2); + __privateAdd(this, _continuation); + this.comment = parser_exports.parseItem(data.commentViewModel, CommentView); + this.comment_replies_data = parser_exports.parseItem(data.replies, CommentReplies); + this.is_moderated_elq_comment = data.isModeratedElqComment; + this.has_replies = !!this.comment_replies_data; + } + get has_continuation() { + if (!this.replies) + throw new InnertubeError("Cannot determine if there is a continuation because this thread's replies have not been loaded."); + return !!__privateGet(this, _continuation); + } + /** + * Retrieves replies to this comment thread. + */ + async getReplies() { + var _a; + if (!__privateGet(this, _actions2)) + throw new InnertubeError("Actions instance not set for this thread."); + if (!this.comment_replies_data) + throw new InnertubeError("This comment has no replies.", this); + const continuation = (_a = this.comment_replies_data.contents) == null ? void 0 : _a.firstOfType(ContinuationItem); + if (!continuation) + throw new InnertubeError("Replies continuation not found."); + const response = await continuation.endpoint.call(__privateGet(this, _actions2), { parse: true }); + if (!response.on_response_received_endpoints_memo) + throw new InnertubeError("Unexpected response.", response); + this.replies = __privateMethod(this, _CommentThread_instances, getPatchedReplies_fn).call(this, response.on_response_received_endpoints_memo); + __privateSet(this, _continuation, response.on_response_received_endpoints_memo.getType(ContinuationItem)[0]); + return this; + } + /** + * Retrieves next batch of replies. + */ + async getContinuation() { + var _a; + if (!this.replies) + throw new InnertubeError("Cannot retrieve continuation because this thread's replies have not been loaded."); + if (!__privateGet(this, _continuation)) + throw new InnertubeError("Continuation not found."); + if (!__privateGet(this, _actions2)) + throw new InnertubeError("Actions instance not set for this thread."); + const load_more_button = (_a = __privateGet(this, _continuation).button) == null ? void 0 : _a.as(Button); + if (!load_more_button) + throw new InnertubeError('"Load more" button not found.'); + const response = await load_more_button.endpoint.call(__privateGet(this, _actions2), { parse: true }); + if (!response.on_response_received_endpoints_memo) + throw new InnertubeError("Unexpected response.", response); + this.replies = __privateMethod(this, _CommentThread_instances, getPatchedReplies_fn).call(this, response.on_response_received_endpoints_memo); + __privateSet(this, _continuation, response.on_response_received_endpoints_memo.getType(ContinuationItem)[0]); + return this; + } + setActions(actions) { + __privateSet(this, _actions2, actions); + } +}; +_actions2 = new WeakMap(); +_continuation = new WeakMap(); +_CommentThread_instances = new WeakSet(); +getPatchedReplies_fn = /* @__PURE__ */ __name(function(data) { + return observe(data.getType(CommentView).map((comment) => { + comment.setActions(__privateGet(this, _actions2)); + return comment; + })); +}, "#getPatchedReplies"); +__name(_CommentThread, "CommentThread"); +__publicField(_CommentThread, "type", "CommentThread"); +var CommentThread = _CommentThread; + +// dist/src/parser/classes/comments/PdgCommentChip.js +var _PdgCommentChip = class _PdgCommentChip extends YTNode { + constructor(data) { + var _a, _b; + super(); + __publicField(this, "text"); + __publicField(this, "color_pallette"); + __publicField(this, "icon_type"); + this.text = new Text2(data.chipText); + this.color_pallette = { + background_color: (_a = data.chipColorPalette) == null ? void 0 : _a.backgroundColor, + foreground_title_color: (_b = data.chipColorPalette) == null ? void 0 : _b.foregroundTitleColor + }; + if (Reflect.has(data, "chipIcon") && Reflect.has(data.chipIcon, "iconType")) { + this.icon_type = data.chipIcon.iconType; + } + } +}; +__name(_PdgCommentChip, "PdgCommentChip"); +__publicField(_PdgCommentChip, "type", "PdgCommentChip"); +var PdgCommentChip = _PdgCommentChip; + +// dist/src/parser/classes/comments/SponsorCommentBadge.js +var _SponsorCommentBadge = class _SponsorCommentBadge extends YTNode { + constructor(data) { + super(); + __publicField(this, "custom_badge"); + __publicField(this, "tooltip"); + this.custom_badge = Thumbnail.fromResponse(data.customBadge); + this.tooltip = data.tooltip; + } +}; +__name(_SponsorCommentBadge, "SponsorCommentBadge"); +__publicField(_SponsorCommentBadge, "type", "SponsorCommentBadge"); +var SponsorCommentBadge = _SponsorCommentBadge; + +// dist/src/parser/classes/CompactChannel.js +var _CompactChannel = class _CompactChannel extends YTNode { + constructor(data) { + super(); + __publicField(this, "title"); + __publicField(this, "channel_id"); + __publicField(this, "thumbnail"); + __publicField(this, "display_name"); + __publicField(this, "video_count"); + __publicField(this, "subscriber_count"); + __publicField(this, "endpoint"); + __publicField(this, "tv_banner"); + __publicField(this, "menu"); + this.title = new Text2(data.title); + this.channel_id = data.channelId; + this.thumbnail = Thumbnail.fromResponse(data.thumbnail); + this.display_name = new Text2(data.displayName); + this.video_count = new Text2(data.videoCountText); + this.subscriber_count = new Text2(data.subscriberCountText); + this.endpoint = new NavigationEndpoint(data.navigationEndpoint); + this.tv_banner = Thumbnail.fromResponse(data.tvBanner); + this.menu = parser_exports.parseItem(data.menu, Menu); + } +}; +__name(_CompactChannel, "CompactChannel"); +__publicField(_CompactChannel, "type", "CompactChannel"); +var CompactChannel = _CompactChannel; + +// dist/src/parser/classes/PlaylistCustomThumbnail.js +var _PlaylistCustomThumbnail = class _PlaylistCustomThumbnail extends YTNode { + constructor(data) { + super(); + __publicField(this, "thumbnail"); + this.thumbnail = Thumbnail.fromResponse(data.thumbnail); + } +}; +__name(_PlaylistCustomThumbnail, "PlaylistCustomThumbnail"); +__publicField(_PlaylistCustomThumbnail, "type", "PlaylistCustomThumbnail"); +var PlaylistCustomThumbnail = _PlaylistCustomThumbnail; + +// dist/src/parser/classes/PlaylistVideoThumbnail.js +var _PlaylistVideoThumbnail = class _PlaylistVideoThumbnail extends YTNode { + constructor(data) { + super(); + __publicField(this, "thumbnail"); + this.thumbnail = Thumbnail.fromResponse(data.thumbnail); + } +}; +__name(_PlaylistVideoThumbnail, "PlaylistVideoThumbnail"); +__publicField(_PlaylistVideoThumbnail, "type", "PlaylistVideoThumbnail"); +var PlaylistVideoThumbnail = _PlaylistVideoThumbnail; + +// dist/src/parser/classes/Playlist.js +var _Playlist = class _Playlist extends YTNode { + constructor(data) { + var _a; + super(); + __publicField(this, "id"); + __publicField(this, "title"); + __publicField(this, "author"); + __publicField(this, "thumbnails"); + __publicField(this, "thumbnail_renderer"); + __publicField(this, "video_count"); + __publicField(this, "video_count_short"); + __publicField(this, "first_videos"); + __publicField(this, "share_url"); + __publicField(this, "menu"); + __publicField(this, "badges"); + __publicField(this, "endpoint"); + __publicField(this, "thumbnail_overlays"); + __publicField(this, "view_playlist"); + this.id = data.playlistId; + this.title = new Text2(data.title); + this.author = ((_a = data.shortBylineText) == null ? void 0 : _a.simpleText) ? new Text2(data.shortBylineText) : new Author(data.longBylineText, data.ownerBadges, null); + this.thumbnails = Thumbnail.fromResponse(data.thumbnail || { thumbnails: data.thumbnails.map((th) => th.thumbnails).flat(1) }); + this.video_count = new Text2(data.thumbnailText); + this.video_count_short = new Text2(data.videoCountShortText); + this.first_videos = parser_exports.parseArray(data.videos); + this.share_url = data.shareUrl || null; + this.menu = parser_exports.parseItem(data.menu); + this.badges = parser_exports.parseArray(data.ownerBadges); + this.endpoint = new NavigationEndpoint(data.navigationEndpoint); + this.thumbnail_overlays = parser_exports.parseArray(data.thumbnailOverlays); + if (Reflect.has(data, "thumbnailRenderer")) { + this.thumbnail_renderer = parser_exports.parseItem(data.thumbnailRenderer, [PlaylistVideoThumbnail, PlaylistCustomThumbnail]) || void 0; + } + if (Reflect.has(data, "viewPlaylistText")) { + this.view_playlist = new Text2(data.viewPlaylistText); + } + } +}; +__name(_Playlist, "Playlist"); +__publicField(_Playlist, "type", "Playlist"); +var Playlist = _Playlist; + +// dist/src/parser/classes/CompactMix.js +var _CompactMix = class _CompactMix extends Playlist { + constructor(data) { + super(data); + } +}; +__name(_CompactMix, "CompactMix"); +__publicField(_CompactMix, "type", "CompactMix"); +var CompactMix = _CompactMix; + +// dist/src/parser/classes/CompactMovie.js +var _CompactMovie = class _CompactMovie extends YTNode { + constructor(data) { + var _a; + super(); + __publicField(this, "id"); + __publicField(this, "title"); + __publicField(this, "top_metadata_items"); + __publicField(this, "thumbnails"); + __publicField(this, "thumbnail_overlays"); + __publicField(this, "author"); + __publicField(this, "duration"); + __publicField(this, "endpoint"); + __publicField(this, "badges"); + __publicField(this, "use_vertical_poster"); + __publicField(this, "menu"); + const overlay_time_status = ((_a = data.thumbnailOverlays.find((overlay) => overlay.thumbnailOverlayTimeStatusRenderer)) == null ? void 0 : _a.thumbnailOverlayTimeStatusRenderer.text) || "N/A"; + this.id = data.videoId; + this.title = new Text2(data.title); + this.top_metadata_items = new Text2(data.topMetadataItems); + this.thumbnails = Thumbnail.fromResponse(data.thumbnail); + this.thumbnail_overlays = parser_exports.parseArray(data.thumbnailOverlays); + this.author = new Author(data.shortBylineText); + const durationText = data.lengthText ? new Text2(data.lengthText).toString() : new Text2(overlay_time_status).toString(); + this.duration = { + text: durationText, + seconds: timeToSeconds(durationText) + }; + this.endpoint = new NavigationEndpoint(data.navigationEndpoint); + this.badges = parser_exports.parseArray(data.badges); + this.use_vertical_poster = data.useVerticalPoster; + this.menu = parser_exports.parseItem(data.menu, Menu); + } +}; +__name(_CompactMovie, "CompactMovie"); +__publicField(_CompactMovie, "type", "CompactMovie"); +var CompactMovie = _CompactMovie; + +// dist/src/parser/classes/CompactPlaylist.js +var _CompactPlaylist = class _CompactPlaylist extends Playlist { + constructor(data) { + super(data); + } +}; +__name(_CompactPlaylist, "CompactPlaylist"); +__publicField(_CompactPlaylist, "type", "CompactPlaylist"); +var CompactPlaylist = _CompactPlaylist; +var CompactPlaylist_default = CompactPlaylist; + +// dist/src/parser/classes/CompactStation.js +var _CompactStation = class _CompactStation extends YTNode { + constructor(data) { + super(); + __publicField(this, "title"); + __publicField(this, "description"); + __publicField(this, "video_count"); + __publicField(this, "endpoint"); + __publicField(this, "thumbnail"); + this.title = new Text2(data.title); + this.description = new Text2(data.description); + this.video_count = new Text2(data.videoCountText); + this.endpoint = new NavigationEndpoint(data.navigationEndpoint); + this.thumbnail = Thumbnail.fromResponse(data.thumbnail); + } +}; +__name(_CompactStation, "CompactStation"); +__publicField(_CompactStation, "type", "CompactStation"); +var CompactStation = _CompactStation; + +// dist/src/parser/classes/CompositeVideoPrimaryInfo.js +var _CompositeVideoPrimaryInfo = class _CompositeVideoPrimaryInfo extends YTNode { + constructor(_data23) { + super(); + } +}; +__name(_CompositeVideoPrimaryInfo, "CompositeVideoPrimaryInfo"); +__publicField(_CompositeVideoPrimaryInfo, "type", "CompositeVideoPrimaryInfo"); +var CompositeVideoPrimaryInfo = _CompositeVideoPrimaryInfo; + +// dist/src/parser/classes/ConfirmDialog.js +var _ConfirmDialog = class _ConfirmDialog extends YTNode { + constructor(data) { + super(); + __publicField(this, "title"); + __publicField(this, "confirm_button"); + __publicField(this, "cancel_button"); + __publicField(this, "dialog_messages"); + this.title = new Text2(data.title); + this.confirm_button = parser_exports.parseItem(data.confirmButton, Button); + this.cancel_button = parser_exports.parseItem(data.cancelButton, Button); + this.dialog_messages = data.dialogMessages.map((txt) => new Text2(txt)); + } +}; +__name(_ConfirmDialog, "ConfirmDialog"); +__publicField(_ConfirmDialog, "type", "ConfirmDialog"); +var ConfirmDialog = _ConfirmDialog; + +// dist/src/parser/classes/ContentMetadataView.js +var _ContentMetadataView = class _ContentMetadataView extends YTNode { + constructor(data) { + var _a; + super(); + __publicField(this, "metadata_rows"); + __publicField(this, "delimiter"); + this.metadata_rows = ((_a = data.metadataRows) == null ? void 0 : _a.map((row) => { + var _a2; + return { + metadata_parts: (_a2 = row.metadataParts) == null ? void 0 : _a2.map((part) => ({ + text: part.text ? Text2.fromAttributed(part.text) : null, + avatar_stack: parser_exports.parseItem(part.avatarStack, AvatarStackView), + enable_truncation: data.enableTruncation + })), + badges: parser_exports.parseArray(row.badges, BadgeView) + }; + })) || []; + this.delimiter = data.delimiter; + } +}; +__name(_ContentMetadataView, "ContentMetadataView"); +__publicField(_ContentMetadataView, "type", "ContentMetadataView"); +var ContentMetadataView = _ContentMetadataView; + +// dist/src/parser/classes/Message.js +var _Message = class _Message extends YTNode { + constructor(data) { + super(); + __publicField(this, "text"); + this.text = new Text2(data.text); + } +}; +__name(_Message, "Message"); +__publicField(_Message, "type", "Message"); +var Message = _Message; + +// dist/src/parser/classes/ConversationBar.js +var _ConversationBar = class _ConversationBar extends YTNode { + constructor(data) { + super(); + __publicField(this, "availability_message"); + this.availability_message = parser_exports.parseItem(data.availabilityMessage, Message); + } +}; +__name(_ConversationBar, "ConversationBar"); +__publicField(_ConversationBar, "type", "ConversationBar"); +var ConversationBar = _ConversationBar; + +// dist/src/parser/classes/CopyLink.js +var _CopyLink = class _CopyLink extends YTNode { + constructor(data) { + super(); + __publicField(this, "copy_button"); + __publicField(this, "short_url"); + __publicField(this, "style"); + this.copy_button = parser_exports.parseItem(data.copyButton, Button); + this.short_url = data.shortUrl; + this.style = data.style; + } +}; +__name(_CopyLink, "CopyLink"); +__publicField(_CopyLink, "type", "CopyLink"); +var CopyLink = _CopyLink; + +// dist/src/parser/classes/DropdownView.js +var _DropdownView = class _DropdownView extends YTNode { + constructor(data) { + super(); + __publicField(this, "label"); + __publicField(this, "placeholder_text"); + __publicField(this, "disabled"); + __publicField(this, "options"); + __publicField(this, "dropdown_type"); + __publicField(this, "id"); + this.label = new Text2(data.label); + this.placeholder_text = new Text2(data.placeholderText); + this.disabled = !!data.disabled; + this.dropdown_type = data.type; + this.id = data.id; + if (Reflect.has(data, "options")) { + this.options = data.options.map((option) => { + var _a; + return { + title: new Text2(option.title), + subtitle: new Text2(option.subtitle), + leading_image: Thumbnail.fromResponse(option.leadingImage), + value: { privacy_status_value: (_a = option.value) == null ? void 0 : _a.privacyStatusValue }, + on_tap: new NavigationEndpoint(option.onTap), + is_selected: !!option.isSelected + }; + }); + } + } +}; +__name(_DropdownView, "DropdownView"); +__publicField(_DropdownView, "type", "DropdownView"); +var DropdownView = _DropdownView; + +// dist/src/parser/classes/TextFieldView.js +var _TextFieldView = class _TextFieldView extends YTNode { + constructor(data) { + super(); + __publicField(this, "display_properties"); + __publicField(this, "content_properties"); + __publicField(this, "initial_state"); + __publicField(this, "form_field_metadata"); + if (Reflect.has(data, "displayProperties")) { + this.display_properties = { + isMultiline: !!data.displayProperties.isMultiline, + disableNewLines: !!data.displayProperties.disableNewLines + }; + } + if (Reflect.has(data, "contentProperties")) { + this.content_properties = { + labelText: data.contentProperties.labelText, + placeholderText: data.contentProperties.placeholderText, + maxCharacterCount: data.contentProperties.maxCharacterCount + }; + } + if (Reflect.has(data, "initialState")) { + this.initial_state = { + isFocused: !!data.initialState.isFocused + }; + } + if (Reflect.has(data, "formFieldMetadata")) { + this.form_field_metadata = { + formId: data.formFieldMetadata.formId, + fieldId: data.formFieldMetadata.fieldId + }; + } + } +}; +__name(_TextFieldView, "TextFieldView"); +__publicField(_TextFieldView, "type", "TextFieldView"); +var TextFieldView = _TextFieldView; + +// dist/src/parser/classes/CreatePlaylistDialogFormView.js +var _CreatePlaylistDialogFormView = class _CreatePlaylistDialogFormView extends YTNode { + constructor(data) { + super(); + __publicField(this, "playlist_title"); + __publicField(this, "playlist_visibility"); + __publicField(this, "disable_playlist_collaborate"); + __publicField(this, "create_playlist_params_collaboration_enabled"); + __publicField(this, "create_playlist_params_collaboration_disabled"); + __publicField(this, "video_ids"); + this.playlist_title = parser_exports.parseItem(data.playlistTitle, TextFieldView); + this.playlist_visibility = parser_exports.parseItem(data.playlistVisibility, DropdownView); + this.disable_playlist_collaborate = !!data.disablePlaylistCollaborate; + this.create_playlist_params_collaboration_enabled = data.createPlaylistParamsCollaborationEnabled; + this.create_playlist_params_collaboration_disabled = data.createPlaylistParamsCollaborationDisabled; + this.video_ids = data.videoIds; + } +}; +__name(_CreatePlaylistDialogFormView, "CreatePlaylistDialogFormView"); +__publicField(_CreatePlaylistDialogFormView, "type", "CreatePlaylistDialogFormView"); +var CreatePlaylistDialogFormView = _CreatePlaylistDialogFormView; + +// dist/src/parser/classes/DecoratedAvatarView.js +var _DecoratedAvatarView = class _DecoratedAvatarView extends YTNode { + constructor(data) { + super(); + __publicField(this, "avatar"); + __publicField(this, "a11y_label"); + __publicField(this, "renderer_context"); + this.avatar = parser_exports.parseItem(data.avatar, AvatarView); + this.a11y_label = data.a11yLabel; + this.renderer_context = new RendererContext(data.rendererContext); + } +}; +__name(_DecoratedAvatarView, "DecoratedAvatarView"); +__publicField(_DecoratedAvatarView, "type", "DecoratedAvatarView"); +var DecoratedAvatarView = _DecoratedAvatarView; + +// dist/src/parser/classes/HeatMarker.js +var _HeatMarker = class _HeatMarker extends YTNode { + constructor(data) { + super(); + __publicField(this, "time_range_start_millis"); + __publicField(this, "marker_duration_millis"); + __publicField(this, "heat_marker_intensity_score_normalized"); + this.time_range_start_millis = Number.parseInt(data.startMillis, 10); + this.marker_duration_millis = Number.parseInt(data.durationMillis, 10); + this.heat_marker_intensity_score_normalized = data.intensityScoreNormalized; + } +}; +__name(_HeatMarker, "HeatMarker"); +__publicField(_HeatMarker, "type", "HeatMarker"); +var HeatMarker = _HeatMarker; + +// dist/src/parser/classes/TimedMarkerDecoration.js +var _TimedMarkerDecoration = class _TimedMarkerDecoration extends YTNode { + constructor(data) { + super(); + __publicField(this, "visible_time_range_start_millis"); + __publicField(this, "visible_time_range_end_millis"); + __publicField(this, "decoration_time_millis"); + __publicField(this, "label"); + __publicField(this, "icon"); + this.visible_time_range_start_millis = data.visibleTimeRangeStartMillis; + this.visible_time_range_end_millis = data.visibleTimeRangeEndMillis; + this.decoration_time_millis = data.decorationTimeMillis; + this.label = new Text2(data.label); + this.icon = data.icon; + } +}; +__name(_TimedMarkerDecoration, "TimedMarkerDecoration"); +__publicField(_TimedMarkerDecoration, "type", "TimedMarkerDecoration"); +var TimedMarkerDecoration = _TimedMarkerDecoration; + +// dist/src/parser/classes/Heatmap.js +var _Heatmap = class _Heatmap extends YTNode { + constructor(data) { + super(); + __publicField(this, "max_height_dp"); + __publicField(this, "min_height_dp"); + __publicField(this, "show_hide_animation_duration_millis"); + __publicField(this, "heat_markers"); + __publicField(this, "heat_markers_decorations"); + this.max_height_dp = data.maxHeightDp; + this.min_height_dp = data.minHeightDp; + this.show_hide_animation_duration_millis = data.showHideAnimationDurationMillis; + this.heat_markers = parser_exports.parseArray(data.heatMarkers, HeatMarker); + this.heat_markers_decorations = parser_exports.parseArray(data.heatMarkersDecorations, TimedMarkerDecoration); + } +}; +__name(_Heatmap, "Heatmap"); +__publicField(_Heatmap, "type", "Heatmap"); +var Heatmap = _Heatmap; + +// dist/src/parser/classes/MultiMarkersPlayerBar.js +var _Marker = class _Marker extends YTNode { + constructor(data) { + super(); + __publicField(this, "marker_key"); + __publicField(this, "value"); + this.marker_key = data.key; + this.value = {}; + if (Reflect.has(data, "value")) { + if (Reflect.has(data.value, "heatmap")) { + this.value.heatmap = parser_exports.parseItem(data.value.heatmap, Heatmap); + } + if (Reflect.has(data.value, "chapters")) { + this.value.chapters = parser_exports.parseArray(data.value.chapters, Chapter); + } + } + } +}; +__name(_Marker, "Marker"); +__publicField(_Marker, "type", "Marker"); +var Marker = _Marker; +var _MultiMarkersPlayerBar = class _MultiMarkersPlayerBar extends YTNode { + constructor(data) { + var _a; + super(); + __publicField(this, "markers_map"); + this.markers_map = observe(((_a = data.markersMap) == null ? void 0 : _a.map((marker) => new Marker(marker))) || []); + } +}; +__name(_MultiMarkersPlayerBar, "MultiMarkersPlayerBar"); +__publicField(_MultiMarkersPlayerBar, "type", "MultiMarkersPlayerBar"); +var MultiMarkersPlayerBar = _MultiMarkersPlayerBar; + +// dist/src/parser/classes/DecoratedPlayerBar.js +var _DecoratedPlayerBar = class _DecoratedPlayerBar extends YTNode { + constructor(data) { + super(); + __publicField(this, "player_bar"); + __publicField(this, "player_bar_action_button"); + this.player_bar = parser_exports.parseItem(data.playerBar, MultiMarkersPlayerBar); + this.player_bar_action_button = parser_exports.parseItem(data.playerBarActionButton, Button); + } +}; +__name(_DecoratedPlayerBar, "DecoratedPlayerBar"); +__publicField(_DecoratedPlayerBar, "type", "DecoratedPlayerBar"); +var DecoratedPlayerBar = _DecoratedPlayerBar; + +// dist/src/parser/classes/DefaultPromoPanel.js +var _DefaultPromoPanel = class _DefaultPromoPanel extends YTNode { + constructor(data) { + super(); + __publicField(this, "title"); + __publicField(this, "description"); + __publicField(this, "endpoint"); + __publicField(this, "large_form_factor_background_thumbnail"); + __publicField(this, "small_form_factor_background_thumbnail"); + __publicField(this, "scrim_color_values"); + __publicField(this, "min_panel_display_duration_ms"); + __publicField(this, "min_video_play_duration_ms"); + __publicField(this, "scrim_duration"); + __publicField(this, "metadata_order"); + __publicField(this, "panel_layout"); + this.title = new Text2(data.title); + this.description = new Text2(data.description); + this.endpoint = new NavigationEndpoint(data.navigationEndpoint); + this.large_form_factor_background_thumbnail = parser_exports.parseItem(data.largeFormFactorBackgroundThumbnail); + this.small_form_factor_background_thumbnail = parser_exports.parseItem(data.smallFormFactorBackgroundThumbnail); + this.scrim_color_values = data.scrimColorValues; + this.min_panel_display_duration_ms = data.minPanelDisplayDurationMs; + this.min_video_play_duration_ms = data.minVideoPlayDurationMs; + this.scrim_duration = data.scrimDuration; + this.metadata_order = data.metadataOrder; + this.panel_layout = data.panelLayout; + } +}; +__name(_DefaultPromoPanel, "DefaultPromoPanel"); +__publicField(_DefaultPromoPanel, "type", "DefaultPromoPanel"); +var DefaultPromoPanel = _DefaultPromoPanel; + +// dist/src/parser/classes/DescriptionPreviewView.js +var _DescriptionPreviewView = class _DescriptionPreviewView extends YTNode { + constructor(data) { + var _a, _b, _c, _d, _e, _f; + super(); + __publicField(this, "description"); + __publicField(this, "max_lines"); + __publicField(this, "truncation_text"); + __publicField(this, "always_show_truncation_text"); + __publicField(this, "more_endpoint"); + __publicField(this, "renderer_context"); + if ("description" in data) + this.description = Text2.fromAttributed(data.description); + if ("maxLines" in data) + this.max_lines = parseInt(data.maxLines); + if ("truncationText" in data) + this.truncation_text = Text2.fromAttributed(data.truncationText); + this.always_show_truncation_text = !!data.alwaysShowTruncationText; + if ((_c = (_b = (_a = data.rendererContext.commandContext) == null ? void 0 : _a.onTap) == null ? void 0 : _b.innertubeCommand) == null ? void 0 : _c.showEngagementPanelEndpoint) { + const endpoint = (_f = (_e = (_d = data.rendererContext.commandContext) == null ? void 0 : _d.onTap) == null ? void 0 : _e.innertubeCommand) == null ? void 0 : _f.showEngagementPanelEndpoint; + this.more_endpoint = { + show_engagement_panel_endpoint: { + engagement_panel: parser_exports.parseItem(endpoint.engagementPanel, EngagementPanelSectionList), + engagement_panel_popup_type: endpoint.engagementPanelPresentationConfigs.engagementPanelPopupPresentationConfig.popupType, + identifier: { + surface: endpoint.identifier.surface, + tag: endpoint.identifier.tag + } + } + }; + } + this.renderer_context = new RendererContext(data.rendererContext); + } +}; +__name(_DescriptionPreviewView, "DescriptionPreviewView"); +__publicField(_DescriptionPreviewView, "type", "DescriptionPreviewView"); +var DescriptionPreviewView = _DescriptionPreviewView; + +// dist/src/parser/classes/DialogHeaderView.js +var _DialogHeaderView = class _DialogHeaderView extends YTNode { + constructor(data) { + super(); + __publicField(this, "headline"); + this.headline = Text2.fromAttributed(data.headline); + } +}; +__name(_DialogHeaderView, "DialogHeaderView"); +__publicField(_DialogHeaderView, "type", "DialogHeaderView"); +var DialogHeaderView = _DialogHeaderView; + +// dist/src/parser/classes/PanelFooterView.js +var _PanelFooterView = class _PanelFooterView extends YTNode { + constructor(data) { + super(); + __publicField(this, "primary_button"); + __publicField(this, "secondary_button"); + __publicField(this, "should_hide_divider"); + this.primary_button = parser_exports.parseItem(data.primaryButton, ButtonView); + this.secondary_button = parser_exports.parseItem(data.secondaryButton, ButtonView); + this.should_hide_divider = !!data.shouldHideDivider; + } +}; +__name(_PanelFooterView, "PanelFooterView"); +__publicField(_PanelFooterView, "type", "PanelFooterView"); +var PanelFooterView = _PanelFooterView; + +// dist/src/parser/classes/FormFooterView.js +var _FormFooterView = class _FormFooterView extends YTNode { + constructor(data) { + super(); + __publicField(this, "panel_footer"); + __publicField(this, "form_id"); + __publicField(this, "container_type"); + this.panel_footer = parser_exports.parseItem(data.panelFooter, PanelFooterView); + this.form_id = data.formId; + this.container_type = data.containerType; + } +}; +__name(_FormFooterView, "FormFooterView"); +__publicField(_FormFooterView, "type", "FormFooterView"); +var FormFooterView = _FormFooterView; + +// dist/src/parser/classes/ListView.js +var _ListView = class _ListView extends YTNode { + constructor(data) { + super(); + __publicField(this, "items"); + this.items = parser_exports.parseArray(data.listItems, ListItemView); + } +}; +__name(_ListView, "ListView"); +__publicField(_ListView, "type", "ListView"); +var ListView = _ListView; + +// dist/src/parser/classes/DialogView.js +var _DialogView = class _DialogView extends YTNode { + constructor(data) { + super(); + __publicField(this, "header"); + __publicField(this, "footer"); + __publicField(this, "custom_content"); + this.header = parser_exports.parseItem(data.header, DialogHeaderView); + this.footer = parser_exports.parseItem(data.footer, [FormFooterView, PanelFooterView]); + this.custom_content = parser_exports.parseItem(data.customContent, [CreatePlaylistDialogFormView, ListView]); + } +}; +__name(_DialogView, "DialogView"); +__publicField(_DialogView, "type", "DialogView"); +var DialogView = _DialogView; + +// dist/src/parser/classes/DidYouMean.js +var _DidYouMean = class _DidYouMean extends YTNode { + constructor(data) { + super(); + __publicField(this, "text"); + __publicField(this, "corrected_query"); + __publicField(this, "endpoint"); + this.text = new Text2(data.didYouMean).toString(); + this.corrected_query = new Text2(data.correctedQuery); + this.endpoint = new NavigationEndpoint(data.navigationEndpoint || data.correctedQueryEndpoint); + } +}; +__name(_DidYouMean, "DidYouMean"); +__publicField(_DidYouMean, "type", "DidYouMean"); +var DidYouMean = _DidYouMean; + +// dist/src/parser/classes/DismissableDialogContentSection.js +var _DismissableDialogContentSection = class _DismissableDialogContentSection extends YTNode { + constructor(data) { + super(); + __publicField(this, "title"); + __publicField(this, "subtitle"); + this.title = new Text2(data.title); + this.subtitle = new Text2(data.subtitle); + } +}; +__name(_DismissableDialogContentSection, "DismissableDialogContentSection"); +__publicField(_DismissableDialogContentSection, "type", "DismissableDialogContentSection"); +var DismissableDialogContentSection = _DismissableDialogContentSection; + +// dist/src/parser/classes/DismissableDialog.js +var _DismissableDialog = class _DismissableDialog extends YTNode { + constructor(data) { + super(); + __publicField(this, "title"); + __publicField(this, "sections"); + __publicField(this, "metadata"); + __publicField(this, "display_style"); + this.title = data.title; + this.sections = parser_exports.parseArray(data.sections, DismissableDialogContentSection); + this.metadata = parser_exports.parseItem(data.metadata); + this.display_style = data.displayStyle; + } +}; +__name(_DismissableDialog, "DismissableDialog"); +__publicField(_DismissableDialog, "type", "DismissableDialog"); +var DismissableDialog = _DismissableDialog; + +// dist/src/parser/classes/DynamicTextView.js +var _DynamicTextView = class _DynamicTextView extends YTNode { + constructor(data) { + super(); + __publicField(this, "text"); + __publicField(this, "max_lines"); + this.text = Text2.fromAttributed(data.text); + this.max_lines = parseInt(data.maxLines); + } +}; +__name(_DynamicTextView, "DynamicTextView"); +__publicField(_DynamicTextView, "type", "DynamicTextView"); +var DynamicTextView = _DynamicTextView; + +// dist/src/parser/classes/misc/ChildElement.js +var _ChildElement = class _ChildElement extends YTNode { + constructor(data) { + var _a; + super(); + __publicField(this, "text"); + __publicField(this, "properties"); + __publicField(this, "child_elements"); + if (Reflect.has(data, "type") && Reflect.has(data.type, "textType")) { + this.text = (_a = data.type.textType.text) == null ? void 0 : _a.content; + } + this.properties = data.properties; + if (Reflect.has(data, "childElements")) { + this.child_elements = data.childElements.map((el) => new _ChildElement(el)); + } + } +}; +__name(_ChildElement, "ChildElement"); +__publicField(_ChildElement, "type", "ChildElement"); +var ChildElement = _ChildElement; + +// dist/src/parser/classes/Element.js +var _Element = class _Element extends YTNode { + constructor(data) { + var _a; + super(); + __publicField(this, "model"); + __publicField(this, "child_elements"); + if (Reflect.has(data, "elementRenderer")) { + return parser_exports.parseItem(data, _Element); + } + const type = data.newElement.type.componentType; + this.model = parser_exports.parseItem(type == null ? void 0 : type.model); + if (Reflect.has(data, "newElement") && Reflect.has(data.newElement, "childElements")) { + this.child_elements = observe(((_a = data.newElement.childElements) == null ? void 0 : _a.map((el) => new ChildElement(el))) || []); + } + } +}; +__name(_Element, "Element"); +__publicField(_Element, "type", "Element"); +var Element = _Element; + +// dist/src/parser/classes/EmergencyOnebox.js +var _EmergencyOnebox = class _EmergencyOnebox extends YTNode { + constructor(data) { + super(); + __publicField(this, "title"); + __publicField(this, "first_option"); + __publicField(this, "menu"); + this.title = new Text2(data.title); + this.first_option = parser_exports.parseItem(data.firstOption); + this.menu = parser_exports.parseItem(data.menu, Menu); + } +}; +__name(_EmergencyOnebox, "EmergencyOnebox"); +__publicField(_EmergencyOnebox, "type", "EmergencyOnebox"); +var EmergencyOnebox = _EmergencyOnebox; + +// dist/src/parser/classes/EmojiPickerCategory.js +var _EmojiPickerCategory = class _EmojiPickerCategory extends YTNode { + constructor(data) { + super(); + __publicField(this, "category_id"); + __publicField(this, "title"); + __publicField(this, "emoji_ids"); + __publicField(this, "image_loading_lazy"); + __publicField(this, "category_type"); + this.category_id = data.categoryId; + this.title = new Text2(data.title); + this.emoji_ids = data.emojiIds; + this.image_loading_lazy = !!data.imageLoadingLazy; + this.category_type = data.categoryType; + } +}; +__name(_EmojiPickerCategory, "EmojiPickerCategory"); +__publicField(_EmojiPickerCategory, "type", "EmojiPickerCategory"); +var EmojiPickerCategory = _EmojiPickerCategory; + +// dist/src/parser/classes/EmojiPickerCategoryButton.js +var _EmojiPickerCategoryButton = class _EmojiPickerCategoryButton extends YTNode { + constructor(data) { + var _a; + super(); + __publicField(this, "category_id"); + __publicField(this, "icon_type"); + __publicField(this, "tooltip"); + this.category_id = data.categoryId; + if (Reflect.has(data, "icon")) { + this.icon_type = (_a = data.icon) == null ? void 0 : _a.iconType; + } + this.tooltip = data.tooltip; + } +}; +__name(_EmojiPickerCategoryButton, "EmojiPickerCategoryButton"); +__publicField(_EmojiPickerCategoryButton, "type", "EmojiPickerCategoryButton"); +var EmojiPickerCategoryButton = _EmojiPickerCategoryButton; + +// dist/src/parser/classes/EmojiPickerUpsellCategory.js +var _EmojiPickerUpsellCategory = class _EmojiPickerUpsellCategory extends YTNode { + constructor(data) { + super(); + __publicField(this, "category_id"); + __publicField(this, "title"); + __publicField(this, "upsell"); + __publicField(this, "emoji_tooltip"); + __publicField(this, "endpoint"); + __publicField(this, "emoji_ids"); + this.category_id = data.categoryId; + this.title = new Text2(data.title); + this.upsell = new Text2(data.upsell); + this.emoji_tooltip = data.emojiTooltip; + this.endpoint = new NavigationEndpoint(data.command); + this.emoji_ids = data.emojiIds; + } +}; +__name(_EmojiPickerUpsellCategory, "EmojiPickerUpsellCategory"); +__publicField(_EmojiPickerUpsellCategory, "type", "EmojiPickerUpsellCategory"); +var EmojiPickerUpsellCategory = _EmojiPickerUpsellCategory; + +// dist/src/parser/classes/endpoints/AddToPlaylistServiceEndpoint.js +var API_PATH2 = "playlist/get_add_to_playlist"; +var _data4; +var _AddToPlaylistServiceEndpoint = class _AddToPlaylistServiceEndpoint extends YTNode { + constructor(data) { + super(); + __privateAdd(this, _data4); + __privateSet(this, _data4, data); + } + getApiPath() { + return API_PATH2; + } + buildRequest() { + const request = {}; + request.videoIds = __privateGet(this, _data4).videoIds ? __privateGet(this, _data4).videoIds : [__privateGet(this, _data4).videoId]; + if (__privateGet(this, _data4).playlistId) + request.playlistId = __privateGet(this, _data4).playlistId; + if (__privateGet(this, _data4).params) + request.params = __privateGet(this, _data4).params; + request.excludeWatchLater = !!__privateGet(this, _data4).excludeWatchLater; + return request; + } +}; +_data4 = new WeakMap(); +__name(_AddToPlaylistServiceEndpoint, "AddToPlaylistServiceEndpoint"); +__publicField(_AddToPlaylistServiceEndpoint, "type", "AddToPlaylistServiceEndpoint"); +var AddToPlaylistServiceEndpoint = _AddToPlaylistServiceEndpoint; + +// dist/src/parser/classes/endpoints/AddToPlaylistEndpoint.js +var _AddToPlaylistEndpoint = class _AddToPlaylistEndpoint extends AddToPlaylistServiceEndpoint { + constructor(data) { + super(data); + } +}; +__name(_AddToPlaylistEndpoint, "AddToPlaylistEndpoint"); +__publicField(_AddToPlaylistEndpoint, "type", "AddToPlaylistEndpoint"); +var AddToPlaylistEndpoint = _AddToPlaylistEndpoint; + +// dist/src/parser/classes/endpoints/BrowseEndpoint.js +var API_PATH3 = "browse"; +var _data5; +var _BrowseEndpoint = class _BrowseEndpoint extends YTNode { + constructor(data) { + super(); + __privateAdd(this, _data5); + __privateSet(this, _data5, data); + } + getApiPath() { + return API_PATH3; + } + buildRequest() { + const request = {}; + if (__privateGet(this, _data5).browseId) + request.browseId = __privateGet(this, _data5).browseId; + if (__privateGet(this, _data5).params) + request.params = __privateGet(this, _data5).params; + if (__privateGet(this, _data5).query) + request.query = __privateGet(this, _data5).query; + if (__privateGet(this, _data5).browseId === "FEsubscriptions") { + request.subscriptionSettingsState = __privateGet(this, _data5).subscriptionSettingsState || "MY_SUBS_SETTINGS_STATE_LAYOUT_FORMAT_LIST"; + } + if (__privateGet(this, _data5).browseId === "SPaccount_playback") { + request.formData = __privateGet(this, _data5).formData || { + accountSettingsFormData: { + flagCaptionsDefaultOff: false, + flagAutoCaptionsDefaultOn: false, + flagDisableInlinePreview: false, + flagAudioDescriptionDefaultOn: false + } + }; + } + if (__privateGet(this, _data5).browseId === "FEwhat_to_watch") { + if (__privateGet(this, _data5).browseRequestSupportedMetadata) + request.browseRequestSupportedMetadata = __privateGet(this, _data5).browseRequestSupportedMetadata; + if (__privateGet(this, _data5).inlineSettingStatus) + request.inlineSettingStatus = __privateGet(this, _data5).inlineSettingStatus; + } + return request; + } +}; +_data5 = new WeakMap(); +__name(_BrowseEndpoint, "BrowseEndpoint"); +__publicField(_BrowseEndpoint, "type", "BrowseEndpoint"); +var BrowseEndpoint = _BrowseEndpoint; + +// dist/src/parser/classes/endpoints/CreateCommentEndpoint.js +var API_PATH4 = "comment/create_comment"; +var _data6; +var _CreateCommentEndpoint = class _CreateCommentEndpoint extends YTNode { + constructor(data) { + super(); + __privateAdd(this, _data6); + __privateSet(this, _data6, data); + } + getApiPath() { + return API_PATH4; + } + buildRequest() { + const request = {}; + if (__privateGet(this, _data6).createCommentParams) + request.createCommentParams = __privateGet(this, _data6).createCommentParams; + if (__privateGet(this, _data6).commentText) + request.commentText = __privateGet(this, _data6).commentText; + if (__privateGet(this, _data6).attachedVideoId) + request.videoAttachment = { videoId: __privateGet(this, _data6).attachedVideoId }; + else if (__privateGet(this, _data6).pollOptions) + request.pollAttachment = { choices: __privateGet(this, _data6).pollOptions }; + else if (__privateGet(this, _data6).imageBlobId) + request.imageAttachment = { encryptedBlobId: __privateGet(this, _data6).imageBlobId }; + else if (__privateGet(this, _data6).sharedPostId) + request.sharedPostAttachment = { postId: __privateGet(this, _data6).sharedPostId }; + if (__privateGet(this, _data6).accessRestrictions && typeof __privateGet(this, _data6).accessRestrictions === "number") { + const restriction = __privateGet(this, _data6).accessRestrictions === 1 ? "RESTRICTION_TYPE_EVERYONE" : "RESTRICTION_TYPE_SPONSORS_ONLY"; + request.accessRestrictions = { restriction }; + } + if (__privateGet(this, _data6).botguardResponse) + request.botguardResponse = __privateGet(this, _data6).botguardResponse; + return request; + } +}; +_data6 = new WeakMap(); +__name(_CreateCommentEndpoint, "CreateCommentEndpoint"); +__publicField(_CreateCommentEndpoint, "type", "CreateCommentEndpoint"); +var CreateCommentEndpoint = _CreateCommentEndpoint; + +// dist/src/parser/classes/endpoints/CreatePlaylistServiceEndpoint.js +var API_PATH5 = "playlist/create"; +var _data7; +var _CreatePlaylistServiceEndpoint = class _CreatePlaylistServiceEndpoint extends YTNode { + constructor(data) { + super(); + __privateAdd(this, _data7); + __privateSet(this, _data7, data); + } + getApiPath() { + return API_PATH5; + } + buildRequest() { + const request = {}; + if (__privateGet(this, _data7).title) + request.title = __privateGet(this, _data7).title; + if (__privateGet(this, _data7).privacyStatus) + request.privacyStatus = __privateGet(this, _data7).privacyStatus; + if (__privateGet(this, _data7).description) + request.description = __privateGet(this, _data7).description; + if (__privateGet(this, _data7).videoIds) + request.videoIds = __privateGet(this, _data7).videoIds; + if (__privateGet(this, _data7).params) + request.params = __privateGet(this, _data7).params; + if (__privateGet(this, _data7).sourcePlaylistId) + request.sourcePlaylistId = __privateGet(this, _data7).sourcePlaylistId; + return request; + } +}; +_data7 = new WeakMap(); +__name(_CreatePlaylistServiceEndpoint, "CreatePlaylistServiceEndpoint"); +__publicField(_CreatePlaylistServiceEndpoint, "type", "CreatePlaylistServiceEndpoint"); +var CreatePlaylistServiceEndpoint = _CreatePlaylistServiceEndpoint; + +// dist/src/parser/classes/endpoints/DeletePlaylistEndpoint.js +var API_PATH6 = "playlist/delete"; +var _data8; +var _DeletePlaylistEndpoint = class _DeletePlaylistEndpoint extends YTNode { + constructor(data) { + super(); + __privateAdd(this, _data8); + __privateSet(this, _data8, data); + } + getApiPath() { + return API_PATH6; + } + buildRequest() { + const request = {}; + if (__privateGet(this, _data8).playlistId) + request.playlistId = __privateGet(this, _data8).sourcePlaylistId; + return request; + } +}; +_data8 = new WeakMap(); +__name(_DeletePlaylistEndpoint, "DeletePlaylistEndpoint"); +__publicField(_DeletePlaylistEndpoint, "type", "DeletePlaylistEndpoint"); +var DeletePlaylistEndpoint = _DeletePlaylistEndpoint; + +// dist/src/parser/classes/endpoints/FeedbackEndpoint.js +var API_PATH7 = "feedback"; +var _data9; +var _FeedbackEndpoint = class _FeedbackEndpoint extends YTNode { + constructor(data) { + super(); + __privateAdd(this, _data9); + __privateSet(this, _data9, data); + } + getApiPath() { + return API_PATH7; + } + buildRequest() { + const request = {}; + if (__privateGet(this, _data9).feedbackToken) + request.feedbackTokens = [__privateGet(this, _data9).feedbackToken]; + if (__privateGet(this, _data9).cpn) + request.feedbackContext = { cpn: __privateGet(this, _data9).cpn }; + request.isFeedbackTokenUnencrypted = !!__privateGet(this, _data9).isFeedbackTokenUnencrypted; + request.shouldMerge = !!__privateGet(this, _data9).shouldMerge; + return request; + } +}; +_data9 = new WeakMap(); +__name(_FeedbackEndpoint, "FeedbackEndpoint"); +__publicField(_FeedbackEndpoint, "type", "FeedbackEndpoint"); +var FeedbackEndpoint = _FeedbackEndpoint; + +// dist/src/parser/classes/endpoints/GetAccountsListInnertubeEndpoint.js +var API_PATH8 = "account/accounts_list"; +var _data10; +var _GetAccountsListInnertubeEndpoint = class _GetAccountsListInnertubeEndpoint extends YTNode { + constructor(data) { + super(); + __privateAdd(this, _data10); + __privateSet(this, _data10, data); + } + getApiPath() { + return API_PATH8; + } + buildRequest() { + const request = {}; + if (__privateGet(this, _data10).requestType) { + request.requestType = __privateGet(this, _data10).requestType; + if (__privateGet(this, _data10).requestType === "ACCOUNTS_LIST_REQUEST_TYPE_CHANNEL_SWITCHER" || __privateGet(this, _data10).requestType === "ACCOUNTS_LIST_REQUEST_TYPE_IDENTITY_PROMPT") { + if (__privateGet(this, _data10).nextUrl) + request.nextNavendpoint = { + urlEndpoint: { + url: __privateGet(this, _data10).nextUrl + } + }; + } + } + if (__privateGet(this, _data10).channelSwitcherQuery) + request.channelSwitcherQuery = __privateGet(this, _data10).channelSwitcherQuery; + if (__privateGet(this, _data10).triggerChannelCreation) + request.triggerChannelCreation = __privateGet(this, _data10).triggerChannelCreation; + if (__privateGet(this, _data10).contentOwnerConfig && __privateGet(this, _data10).contentOwnerConfig.externalContentOwnerId) + request.contentOwnerConfig = __privateGet(this, _data10).contentOwnerConfig; + if (__privateGet(this, _data10).obfuscatedSelectedGaiaId) + request.obfuscatedSelectedGaiaId = __privateGet(this, _data10).obfuscatedSelectedGaiaId; + if (__privateGet(this, _data10).selectedSerializedDelegationContext) + request.selectedSerializedDelegationContext = __privateGet(this, _data10).selectedSerializedDelegationContext; + if (__privateGet(this, _data10).callCircumstance) + request.callCircumstance = __privateGet(this, _data10).callCircumstance; + return request; + } +}; +_data10 = new WeakMap(); +__name(_GetAccountsListInnertubeEndpoint, "GetAccountsListInnertubeEndpoint"); +__publicField(_GetAccountsListInnertubeEndpoint, "type", "GetAccountsListInnertubeEndpoint"); +var GetAccountsListInnertubeEndpoint = _GetAccountsListInnertubeEndpoint; + +// dist/src/parser/classes/endpoints/HideEngagementPanelEndpoint.js +var _HideEngagementPanelEndpoint = class _HideEngagementPanelEndpoint extends YTNode { + constructor(data) { + super(); + __publicField(this, "panel_identifier"); + this.panel_identifier = data.panelIdentifier; + } +}; +__name(_HideEngagementPanelEndpoint, "HideEngagementPanelEndpoint"); +__publicField(_HideEngagementPanelEndpoint, "type", "HideEngagementPanelEndpoint"); +var HideEngagementPanelEndpoint = _HideEngagementPanelEndpoint; + +// dist/src/parser/classes/endpoints/LikeEndpoint.js +var LIKE_API_PATH = "like/like"; +var DISLIKE_API_PATH = "like/dislike"; +var REMOVE_LIKE_API_PATH = "like/removelike"; +var _data11; +var _LikeEndpoint = class _LikeEndpoint extends YTNode { + constructor(data) { + super(); + __privateAdd(this, _data11); + __privateSet(this, _data11, data); + } + getApiPath() { + return __privateGet(this, _data11).status === "DISLIKE" ? DISLIKE_API_PATH : __privateGet(this, _data11).status === "INDIFFERENT" ? REMOVE_LIKE_API_PATH : LIKE_API_PATH; + } + buildRequest() { + const request = {}; + if (__privateGet(this, _data11).target) + request.target = __privateGet(this, _data11).target; + const params = this.getParams(); + if (params) + request.params = params; + return request; + } + getParams() { + switch (__privateGet(this, _data11).status) { + case "LIKE": + return __privateGet(this, _data11).likeParams; + case "DISLIKE": + return __privateGet(this, _data11).dislikeParams; + case "INDIFFERENT": + return __privateGet(this, _data11).removeLikeParams; + default: + return void 0; + } + } +}; +_data11 = new WeakMap(); +__name(_LikeEndpoint, "LikeEndpoint"); +__publicField(_LikeEndpoint, "type", "LikeEndpoint"); +var LikeEndpoint = _LikeEndpoint; + +// dist/src/parser/classes/endpoints/LiveChatItemContextMenuEndpoint.js +var API_PATH9 = "live_chat/get_item_context_menu"; +var _data12; +var _LiveChatItemContextMenuEndpoint = class _LiveChatItemContextMenuEndpoint extends YTNode { + constructor(data) { + super(); + __privateAdd(this, _data12); + __privateSet(this, _data12, data); + } + getApiPath() { + return API_PATH9; + } + buildRequest() { + const request = {}; + if (__privateGet(this, _data12).params) + request.params = __privateGet(this, _data12).params; + return request; + } +}; +_data12 = new WeakMap(); +__name(_LiveChatItemContextMenuEndpoint, "LiveChatItemContextMenuEndpoint"); +__publicField(_LiveChatItemContextMenuEndpoint, "type", "LiveChatItemContextMenuEndpoint"); +var LiveChatItemContextMenuEndpoint = _LiveChatItemContextMenuEndpoint; + +// dist/src/parser/classes/endpoints/ModifyChannelNotificationPreferenceEndpoint.js +var API_PATH10 = "notification/modify_channel_preference"; +var _data13; +var _ModifyChannelNotificationPreferenceEndpoint = class _ModifyChannelNotificationPreferenceEndpoint extends YTNode { + constructor(data) { + super(); + __privateAdd(this, _data13); + __privateSet(this, _data13, data); + } + getApiPath() { + return API_PATH10; + } + buildRequest() { + const request = {}; + if (__privateGet(this, _data13).params) + request.params = __privateGet(this, _data13).params; + if (__privateGet(this, _data13).secondaryParams) + request.secondaryParams = __privateGet(this, _data13).secondaryParams; + return request; + } +}; +_data13 = new WeakMap(); +__name(_ModifyChannelNotificationPreferenceEndpoint, "ModifyChannelNotificationPreferenceEndpoint"); +__publicField(_ModifyChannelNotificationPreferenceEndpoint, "type", "ModifyChannelNotificationPreferenceEndpoint"); +var ModifyChannelNotificationPreferenceEndpoint = _ModifyChannelNotificationPreferenceEndpoint; + +// dist/src/parser/classes/endpoints/PerformCommentActionEndpoint.js +var API_PATH11 = "comment/perform_comment_action"; +var _data14; +var _PerformCommentActionEndpoint = class _PerformCommentActionEndpoint extends YTNode { + constructor(data) { + super(); + __privateAdd(this, _data14); + __privateSet(this, _data14, data); + } + getApiPath() { + return API_PATH11; + } + buildRequest() { + const request = {}; + if (__privateGet(this, _data14).actions) + request.actions = __privateGet(this, _data14).actions; + if (__privateGet(this, _data14).action) + request.actions = [__privateGet(this, _data14).action]; + return request; + } +}; +_data14 = new WeakMap(); +__name(_PerformCommentActionEndpoint, "PerformCommentActionEndpoint"); +__publicField(_PerformCommentActionEndpoint, "type", "PerformCommentActionEndpoint"); +var PerformCommentActionEndpoint = _PerformCommentActionEndpoint; + +// dist/src/parser/classes/endpoints/PlaylistEditEndpoint.js +var API_PATH12 = "browse/edit_playlist"; +var _data15; +var _PlaylistEditEndpoint = class _PlaylistEditEndpoint extends YTNode { + constructor(data) { + super(); + __privateAdd(this, _data15); + __privateSet(this, _data15, data); + } + getApiPath() { + return API_PATH12; + } + buildRequest() { + const request = {}; + if (__privateGet(this, _data15).actions) + request.actions = __privateGet(this, _data15).actions; + if (__privateGet(this, _data15).playlistId) + request.playlistId = __privateGet(this, _data15).playlistId; + if (__privateGet(this, _data15).params) + request.params = __privateGet(this, _data15).params; + return request; + } +}; +_data15 = new WeakMap(); +__name(_PlaylistEditEndpoint, "PlaylistEditEndpoint"); +__publicField(_PlaylistEditEndpoint, "type", "PlaylistEditEndpoint"); +var PlaylistEditEndpoint = _PlaylistEditEndpoint; + +// dist/src/parser/classes/endpoints/WatchEndpoint.js +var API_PATH13 = "player"; +var _data16; +var _WatchEndpoint = class _WatchEndpoint extends YTNode { + constructor(data) { + super(); + __privateAdd(this, _data16); + __privateSet(this, _data16, data); + } + getApiPath() { + return API_PATH13; + } + buildRequest() { + const request = {}; + if (__privateGet(this, _data16).videoId) + request.videoId = __privateGet(this, _data16).videoId; + if (__privateGet(this, _data16).playlistId) + request.playlistId = __privateGet(this, _data16).playlistId; + if (__privateGet(this, _data16).index !== void 0 || __privateGet(this, _data16).playlistIndex !== void 0) + request.playlistIndex = __privateGet(this, _data16).index || __privateGet(this, _data16).playlistIndex; + if (__privateGet(this, _data16).playerParams || __privateGet(this, _data16).params) + request.params = __privateGet(this, _data16).playerParams || __privateGet(this, _data16).params; + if (__privateGet(this, _data16).startTimeSeconds) + request.startTimeSecs = __privateGet(this, _data16).startTimeSeconds; + if (__privateGet(this, _data16).overrideMutedAtStart) + request.overrideMutedAtStart = __privateGet(this, _data16).overrideMutedAtStart; + request.racyCheckOk = !!__privateGet(this, _data16).racyCheckOk; + request.contentCheckOk = !!__privateGet(this, _data16).contentCheckOk; + return request; + } +}; +_data16 = new WeakMap(); +__name(_WatchEndpoint, "WatchEndpoint"); +__publicField(_WatchEndpoint, "type", "WatchEndpoint"); +var WatchEndpoint = _WatchEndpoint; + +// dist/src/parser/classes/endpoints/PrefetchWatchCommand.js +var _PrefetchWatchCommand = class _PrefetchWatchCommand extends WatchEndpoint { + constructor(data) { + super(data); + } +}; +__name(_PrefetchWatchCommand, "PrefetchWatchCommand"); +__publicField(_PrefetchWatchCommand, "type", "PrefetchWatchCommand"); +var PrefetchWatchCommand = _PrefetchWatchCommand; + +// dist/src/parser/classes/endpoints/ReelWatchEndpoint.js +var API_PATH14 = "reel/reel_item_watch"; +var _data17; +var _ReelWatchEndpoint = class _ReelWatchEndpoint extends YTNode { + constructor(data) { + super(); + __privateAdd(this, _data17); + __privateSet(this, _data17, data); + } + getApiPath() { + return API_PATH14; + } + buildRequest() { + const request = {}; + if (__privateGet(this, _data17).videoId) { + request.playerRequest = { + videoId: __privateGet(this, _data17).videoId + }; + } + if (request.playerRequest) { + if (__privateGet(this, _data17).playerParams) + request.playerRequest.params = __privateGet(this, _data17).playerParams; + if (__privateGet(this, _data17).racyCheckOk) + request.playerRequest.racyCheckOk = !!__privateGet(this, _data17).racyCheckOk; + if (__privateGet(this, _data17).contentCheckOk) + request.playerRequest.contentCheckOk = !!__privateGet(this, _data17).contentCheckOk; + } + if (__privateGet(this, _data17).params) + request.params = __privateGet(this, _data17).params; + if (__privateGet(this, _data17).inputType) + request.inputType = __privateGet(this, _data17).inputType; + request.disablePlayerResponse = !!__privateGet(this, _data17).disablePlayerResponse; + return request; + } +}; +_data17 = new WeakMap(); +__name(_ReelWatchEndpoint, "ReelWatchEndpoint"); +__publicField(_ReelWatchEndpoint, "type", "ReelWatchEndpoint"); +var ReelWatchEndpoint = _ReelWatchEndpoint; + +// dist/src/parser/classes/endpoints/SearchEndpoint.js +var API_PATH15 = "search"; +var _data18; +var _SearchEndpoint = class _SearchEndpoint extends YTNode { + constructor(data) { + super(); + __privateAdd(this, _data18); + __privateSet(this, _data18, data); + } + getApiPath() { + return API_PATH15; + } + buildRequest() { + const request = {}; + if (__privateGet(this, _data18).query) + request.query = __privateGet(this, _data18).query; + if (__privateGet(this, _data18).params) + request.params = __privateGet(this, _data18).params; + if (__privateGet(this, _data18).webSearchboxStatsUrl) + request.webSearchboxStatsUrl = __privateGet(this, _data18).webSearchboxStatsUrl; + if (__privateGet(this, _data18).suggestStats) + request.suggestStats = __privateGet(this, _data18).suggestStats; + return request; + } +}; +_data18 = new WeakMap(); +__name(_SearchEndpoint, "SearchEndpoint"); +__publicField(_SearchEndpoint, "type", "SearchEndpoint"); +var SearchEndpoint = _SearchEndpoint; + +// dist/src/parser/classes/endpoints/ShareEntityServiceEndpoint.js +var API_PATH16 = "share/get_share_panel"; +var _data19; +var _ShareEntityServiceEndpoint = class _ShareEntityServiceEndpoint extends YTNode { + constructor(data) { + super(); + __privateAdd(this, _data19); + __privateSet(this, _data19, data); + } + getApiPath() { + return API_PATH16; + } + buildRequest() { + const request = {}; + if (__privateGet(this, _data19).serializedShareEntity) + request.serializedSharedEntity = __privateGet(this, _data19).serializedShareEntity; + if (__privateGet(this, _data19).clientParams) + request.clientParams = __privateGet(this, _data19).clientParams; + return request; + } +}; +_data19 = new WeakMap(); +__name(_ShareEntityServiceEndpoint, "ShareEntityServiceEndpoint"); +__publicField(_ShareEntityServiceEndpoint, "type", "ShareEntityServiceEndpoint"); +var ShareEntityServiceEndpoint = _ShareEntityServiceEndpoint; + +// dist/src/parser/classes/endpoints/ShareEndpoint.js +var _ShareEndpoint = class _ShareEndpoint extends ShareEntityServiceEndpoint { + constructor(data) { + super(data); + } +}; +__name(_ShareEndpoint, "ShareEndpoint"); +__publicField(_ShareEndpoint, "type", "ShareEndpoint"); +var ShareEndpoint = _ShareEndpoint; + +// dist/src/parser/classes/endpoints/ShareEntityEndpoint.js +var _ShareEntityEndpoint = class _ShareEntityEndpoint extends ShareEntityServiceEndpoint { + constructor(data) { + super(data); + } +}; +__name(_ShareEntityEndpoint, "ShareEntityEndpoint"); +__publicField(_ShareEntityEndpoint, "type", "ShareEntityEndpoint"); +var ShareEntityEndpoint = _ShareEntityEndpoint; + +// dist/src/parser/classes/endpoints/ShowEngagementPanelEndpoint.js +var _ShowEngagementPanelEndpoint = class _ShowEngagementPanelEndpoint extends YTNode { + constructor(data) { + super(); + __publicField(this, "panel_identifier"); + __publicField(this, "source_panel_identifier"); + this.panel_identifier = data.panelIdentifier; + this.source_panel_identifier = data.sourcePanelIdentifier; + } +}; +__name(_ShowEngagementPanelEndpoint, "ShowEngagementPanelEndpoint"); +__publicField(_ShowEngagementPanelEndpoint, "type", "ShowEngagementPanelEndpoint"); +var ShowEngagementPanelEndpoint = _ShowEngagementPanelEndpoint; + +// dist/src/parser/classes/endpoints/SignalServiceEndpoint.js +var _SignalServiceEndpoint = class _SignalServiceEndpoint extends YTNode { + constructor(data) { + super(); + __publicField(this, "actions"); + __publicField(this, "signal"); + if (Array.isArray(data.actions)) { + this.actions = parser_exports.parseArray(data.actions.map((action) => { + delete action.clickTrackingParams; + return action; + })); + } + this.signal = data.signal; + } +}; +__name(_SignalServiceEndpoint, "SignalServiceEndpoint"); +__publicField(_SignalServiceEndpoint, "type", "SignalServiceEndpoint"); +var SignalServiceEndpoint = _SignalServiceEndpoint; + +// dist/src/parser/classes/endpoints/SubscribeEndpoint.js +var API_PATH17 = "subscription/subscribe"; +var _data20; +var _SubscribeEndpoint = class _SubscribeEndpoint extends YTNode { + constructor(data) { + super(); + __privateAdd(this, _data20); + __privateSet(this, _data20, data); + } + getApiPath() { + return API_PATH17; + } + buildRequest() { + const request = {}; + if (__privateGet(this, _data20).channelIds) + request.channelIds = __privateGet(this, _data20).channelIds; + if (__privateGet(this, _data20).siloName) + request.siloName = __privateGet(this, _data20).siloName; + if (__privateGet(this, _data20).params) + request.params = __privateGet(this, _data20).params; + if (__privateGet(this, _data20).botguardResponse) + request.botguardResponse = __privateGet(this, _data20).botguardResponse; + if (__privateGet(this, _data20).feature) + request.clientFeature = __privateGet(this, _data20).feature; + return request; + } +}; +_data20 = new WeakMap(); +__name(_SubscribeEndpoint, "SubscribeEndpoint"); +__publicField(_SubscribeEndpoint, "type", "SubscribeEndpoint"); +var SubscribeEndpoint = _SubscribeEndpoint; + +// dist/src/parser/classes/endpoints/UnsubscribeEndpoint.js +var API_PATH18 = "subscription/unsubscribe"; +var _data21; +var _UnsubscribeEndpoint = class _UnsubscribeEndpoint extends YTNode { + constructor(data) { + super(); + __privateAdd(this, _data21); + __privateSet(this, _data21, data); + } + getApiPath() { + return API_PATH18; + } + buildRequest() { + const request = {}; + if (__privateGet(this, _data21).channelIds) + request.channelIds = __privateGet(this, _data21).channelIds; + if (__privateGet(this, _data21).siloName) + request.siloName = __privateGet(this, _data21).siloName; + if (__privateGet(this, _data21).params) + request.params = __privateGet(this, _data21).params; + return request; + } +}; +_data21 = new WeakMap(); +__name(_UnsubscribeEndpoint, "UnsubscribeEndpoint"); +__publicField(_UnsubscribeEndpoint, "type", "UnsubscribeEndpoint"); +var UnsubscribeEndpoint = _UnsubscribeEndpoint; + +// dist/src/parser/classes/endpoints/WatchNextEndpoint.js +var API_PATH19 = "next"; +var _data22; +var _WatchNextEndpoint = class _WatchNextEndpoint extends YTNode { + constructor(data) { + super(); + __privateAdd(this, _data22); + __privateSet(this, _data22, data); + } + getApiPath() { + return API_PATH19; + } + buildRequest() { + const request = {}; + if (__privateGet(this, _data22).videoId) + request.videoId = __privateGet(this, _data22).videoId; + if (__privateGet(this, _data22).playlistId) + request.playlistId = __privateGet(this, _data22).playlistId; + if (__privateGet(this, _data22).index !== void 0 || __privateGet(this, _data22).playlistIndex !== void 0) + request.playlistIndex = __privateGet(this, _data22).index || __privateGet(this, _data22).playlistIndex; + if (__privateGet(this, _data22).playerParams || __privateGet(this, _data22).params) + request.params = __privateGet(this, _data22).playerParams || __privateGet(this, _data22).params; + request.racyCheckOk = !!__privateGet(this, _data22).racyCheckOk; + request.contentCheckOk = !!__privateGet(this, _data22).contentCheckOk; + return request; + } +}; +_data22 = new WeakMap(); +__name(_WatchNextEndpoint, "WatchNextEndpoint"); +__publicField(_WatchNextEndpoint, "type", "WatchNextEndpoint"); +var WatchNextEndpoint = _WatchNextEndpoint; + +// dist/src/parser/classes/Endscreen.js +var _Endscreen = class _Endscreen extends YTNode { + constructor(data) { + super(); + __publicField(this, "elements"); + __publicField(this, "start_ms"); + this.elements = parser_exports.parseArray(data.elements); + this.start_ms = data.startMs; + } +}; +__name(_Endscreen, "Endscreen"); +__publicField(_Endscreen, "type", "Endscreen"); +var Endscreen = _Endscreen; + +// dist/src/parser/classes/EndscreenElement.js +var _EndscreenElement = class _EndscreenElement extends YTNode { + constructor(data) { + super(); + __publicField(this, "style"); + __publicField(this, "title"); + __publicField(this, "endpoint"); + __publicField(this, "image"); + __publicField(this, "icon"); + __publicField(this, "metadata"); + __publicField(this, "call_to_action"); + __publicField(this, "hovercard_button"); + __publicField(this, "is_subscribe"); + __publicField(this, "playlist_length"); + __publicField(this, "thumbnail_overlays"); + __publicField(this, "left"); + __publicField(this, "top"); + __publicField(this, "width"); + __publicField(this, "aspect_ratio"); + __publicField(this, "start_ms"); + __publicField(this, "end_ms"); + __publicField(this, "id"); + this.style = data.style; + this.title = new Text2(data.title); + this.endpoint = new NavigationEndpoint(data.endpoint); + if (Reflect.has(data, "image")) { + this.image = Thumbnail.fromResponse(data.image); + } + if (Reflect.has(data, "icon")) { + this.icon = Thumbnail.fromResponse(data.icon); + } + if (Reflect.has(data, "metadata")) { + this.metadata = new Text2(data.metadata); + } + if (Reflect.has(data, "callToAction")) { + this.call_to_action = new Text2(data.callToAction); + } + if (Reflect.has(data, "hovercardButton")) { + this.hovercard_button = parser_exports.parseItem(data.hovercardButton); + } + if (Reflect.has(data, "isSubscribe")) { + this.is_subscribe = !!data.isSubscribe; + } + if (Reflect.has(data, "playlistLength")) { + this.playlist_length = new Text2(data.playlistLength); + } + if (Reflect.has(data, "thumbnailOverlays")) { + this.thumbnail_overlays = parser_exports.parseArray(data.thumbnailOverlays); + } + this.left = parseFloat(data.left); + this.width = parseFloat(data.width); + this.top = parseFloat(data.top); + this.aspect_ratio = parseFloat(data.aspectRatio); + this.start_ms = parseFloat(data.startMs); + this.end_ms = parseFloat(data.endMs); + this.id = data.id; + } +}; +__name(_EndscreenElement, "EndscreenElement"); +__publicField(_EndscreenElement, "type", "EndscreenElement"); +var EndscreenElement = _EndscreenElement; + +// dist/src/parser/classes/EndScreenPlaylist.js +var _EndScreenPlaylist = class _EndScreenPlaylist extends YTNode { + constructor(data) { + super(); + __publicField(this, "id"); + __publicField(this, "title"); + __publicField(this, "author"); + __publicField(this, "endpoint"); + __publicField(this, "thumbnails"); + __publicField(this, "video_count"); + this.id = data.playlistId; + this.title = new Text2(data.title); + this.author = new Text2(data.longBylineText); + this.endpoint = new NavigationEndpoint(data.navigationEndpoint); + this.thumbnails = Thumbnail.fromResponse(data.thumbnail); + this.video_count = new Text2(data.videoCountText); + } +}; +__name(_EndScreenPlaylist, "EndScreenPlaylist"); +__publicField(_EndScreenPlaylist, "type", "EndScreenPlaylist"); +var EndScreenPlaylist = _EndScreenPlaylist; + +// dist/src/parser/classes/EndScreenVideo.js +var _EndScreenVideo = class _EndScreenVideo extends YTNode { + constructor(data) { + super(); + __publicField(this, "id"); + __publicField(this, "title"); + __publicField(this, "thumbnails"); + __publicField(this, "thumbnail_overlays"); + __publicField(this, "author"); + __publicField(this, "endpoint"); + __publicField(this, "short_view_count"); + __publicField(this, "badges"); + __publicField(this, "duration"); + this.id = data.videoId; + this.title = new Text2(data.title); + this.thumbnails = Thumbnail.fromResponse(data.thumbnail); + this.thumbnail_overlays = parser_exports.parseArray(data.thumbnailOverlays); + this.author = new Author(data.shortBylineText, data.ownerBadges); + this.endpoint = new NavigationEndpoint(data.navigationEndpoint); + this.short_view_count = new Text2(data.shortViewCountText); + this.badges = parser_exports.parseArray(data.badges); + this.duration = { + text: new Text2(data.lengthText).toString(), + seconds: data.lengthInSeconds + }; + } +}; +__name(_EndScreenVideo, "EndScreenVideo"); +__publicField(_EndScreenVideo, "type", "EndScreenVideo"); +var EndScreenVideo = _EndScreenVideo; + +// dist/src/parser/classes/ExpandableTab.js +var _ExpandableTab = class _ExpandableTab extends YTNode { + constructor(data) { + super(); + __publicField(this, "title"); + __publicField(this, "endpoint"); + __publicField(this, "selected"); + __publicField(this, "content"); + this.title = data.title; + this.endpoint = new NavigationEndpoint(data.endpoint); + this.selected = data.selected; + this.content = parser_exports.parseItem(data.content); + } +}; +__name(_ExpandableTab, "ExpandableTab"); +__publicField(_ExpandableTab, "type", "ExpandableTab"); +var ExpandableTab = _ExpandableTab; + +// dist/src/parser/classes/ExpandedShelfContents.js +var _ExpandedShelfContents = class _ExpandedShelfContents extends YTNode { + constructor(data) { + super(); + __publicField(this, "items"); + this.items = parser_exports.parseArray(data.items); + } + // XXX: Alias for consistency. + get contents() { + return this.items; + } +}; +__name(_ExpandedShelfContents, "ExpandedShelfContents"); +__publicField(_ExpandedShelfContents, "type", "ExpandedShelfContents"); +var ExpandedShelfContents = _ExpandedShelfContents; + +// dist/src/parser/classes/FancyDismissibleDialog.js +var _FancyDismissibleDialog = class _FancyDismissibleDialog extends YTNode { + constructor(data) { + super(); + __publicField(this, "dialog_message"); + __publicField(this, "confirm_label"); + this.dialog_message = new Text2(data.dialogMessage); + this.confirm_label = new Text2(data.confirmLabel); + } +}; +__name(_FancyDismissibleDialog, "FancyDismissibleDialog"); +__publicField(_FancyDismissibleDialog, "type", "FancyDismissibleDialog"); +var FancyDismissibleDialog = _FancyDismissibleDialog; + +// dist/src/parser/classes/FeedFilterChipBar.js +var _FeedFilterChipBar = class _FeedFilterChipBar extends YTNode { + constructor(data) { + super(); + __publicField(this, "contents"); + this.contents = parser_exports.parseArray(data.contents, ChipCloudChip); + } +}; +__name(_FeedFilterChipBar, "FeedFilterChipBar"); +__publicField(_FeedFilterChipBar, "type", "FeedFilterChipBar"); +var FeedFilterChipBar = _FeedFilterChipBar; + +// dist/src/parser/classes/FeedNudge.js +var _FeedNudge = class _FeedNudge extends YTNode { + constructor(data) { + super(); + __publicField(this, "title"); + __publicField(this, "subtitle"); + __publicField(this, "endpoint"); + __publicField(this, "apply_modernized_style"); + __publicField(this, "trim_style"); + __publicField(this, "background_style"); + this.title = new Text2(data.title); + this.subtitle = new Text2(data.subtitle); + this.endpoint = new NavigationEndpoint(data.impressionEndpoint); + this.apply_modernized_style = data.applyModernizedStyle; + this.trim_style = data.trimStyle; + this.background_style = data.backgroundStyle; + } +}; +__name(_FeedNudge, "FeedNudge"); +__publicField(_FeedNudge, "type", "FeedNudge"); +var FeedNudge = _FeedNudge; + +// dist/src/parser/classes/FeedTabbedHeader.js +var _FeedTabbedHeader = class _FeedTabbedHeader extends YTNode { + constructor(data) { + super(); + __publicField(this, "title"); + this.title = new Text2(data.title); + } +}; +__name(_FeedTabbedHeader, "FeedTabbedHeader"); +__publicField(_FeedTabbedHeader, "type", "FeedTabbedHeader"); +var FeedTabbedHeader = _FeedTabbedHeader; + +// dist/src/parser/classes/ToggleFormField.js +var _ToggleFormField = class _ToggleFormField extends YTNode { + constructor(data) { + super(); + __publicField(this, "label"); + __publicField(this, "toggled"); + __publicField(this, "toggle_on_action"); + __publicField(this, "toggle_off_action"); + this.label = new Text(data.label); + this.toggled = data.toggled; + if ("toggleOnAction" in data) + this.toggle_on_action = new NavigationEndpoint(data.toggleOnAction); + if ("toggleOffAction" in data) + this.toggle_off_action = new NavigationEndpoint(data.toggleOffAction); + } +}; +__name(_ToggleFormField, "ToggleFormField"); +__publicField(_ToggleFormField, "type", "ToggleFormField"); +var ToggleFormField = _ToggleFormField; + +// dist/src/parser/classes/Form.js +var _Form = class _Form extends YTNode { + constructor(data) { + super(); + __publicField(this, "fields"); + this.fields = parser_exports.parseArray(data.fields, ToggleFormField); + } +}; +__name(_Form, "Form"); +__publicField(_Form, "type", "Form"); +var Form = _Form; + +// dist/src/parser/classes/FormPopup.js +var _FormPopup = class _FormPopup extends YTNode { + constructor(data) { + super(); + __publicField(this, "title"); + __publicField(this, "form"); + __publicField(this, "buttons"); + this.title = new Text2(data.title); + this.form = parser_exports.parseItem(data.form, Form); + this.buttons = parser_exports.parseArray(data.buttons, Button); + } +}; +__name(_FormPopup, "FormPopup"); +__publicField(_FormPopup, "type", "FormPopup"); +var FormPopup = _FormPopup; + +// dist/src/parser/classes/GameDetails.js +var _GameDetails = class _GameDetails extends YTNode { + constructor(data) { + super(); + __publicField(this, "title"); + __publicField(this, "box_art"); + __publicField(this, "box_art_overlay_text"); + __publicField(this, "endpoint"); + __publicField(this, "is_official_box_art"); + this.title = new Text2(data.title); + this.box_art = Thumbnail.fromResponse(data.boxArt); + this.box_art_overlay_text = new Text2(data.boxArtOverlayText); + this.endpoint = new NavigationEndpoint(data.endpoint); + this.is_official_box_art = !!data.isOfficialBoxArt; + } +}; +__name(_GameDetails, "GameDetails"); +__publicField(_GameDetails, "type", "GameDetails"); +var GameDetails = _GameDetails; + +// dist/src/parser/classes/Grid.js +var _Grid = class _Grid extends YTNode { + constructor(data) { + var _a, _b, _c; + super(); + __publicField(this, "items"); + __publicField(this, "is_collapsible"); + __publicField(this, "visible_row_count"); + __publicField(this, "target_id"); + __publicField(this, "continuation"); + __publicField(this, "header"); + this.items = parser_exports.parseArray(data.items); + if (Reflect.has(data, "header")) { + this.header = parser_exports.parseItem(data.header); + } + if (Reflect.has(data, "isCollapsible")) { + this.is_collapsible = data.isCollapsible; + } + if (Reflect.has(data, "visibleRowCount")) { + this.visible_row_count = data.visibleRowCount; + } + if (Reflect.has(data, "targetId")) { + this.target_id = data.targetId; + } + this.continuation = ((_c = (_b = (_a = data.continuations) == null ? void 0 : _a[0]) == null ? void 0 : _b.nextContinuationData) == null ? void 0 : _c.continuation) || null; + } + // XXX: Alias for consistency. + get contents() { + return this.items; + } +}; +__name(_Grid, "Grid"); +__publicField(_Grid, "type", "Grid"); +var Grid = _Grid; + +// dist/src/parser/classes/GridChannel.js +var _GridChannel = class _GridChannel extends YTNode { + constructor(data) { + super(); + __publicField(this, "id"); + __publicField(this, "author"); + __publicField(this, "subscribers"); + __publicField(this, "video_count"); + __publicField(this, "endpoint"); + __publicField(this, "subscribe_button"); + this.id = data.channelId; + this.author = new Author({ + ...data.title, + navigationEndpoint: data.navigationEndpoint + }, data.ownerBadges, data.thumbnail); + this.subscribers = new Text2(data.subscriberCountText); + this.video_count = new Text2(data.videoCountText); + this.endpoint = new NavigationEndpoint(data.navigationEndpoint); + this.subscribe_button = parser_exports.parseItem(data.subscribeButton); + } +}; +__name(_GridChannel, "GridChannel"); +__publicField(_GridChannel, "type", "GridChannel"); +var GridChannel = _GridChannel; + +// dist/src/parser/classes/GridHeader.js +var _GridHeader = class _GridHeader extends YTNode { + constructor(data) { + super(); + __publicField(this, "title"); + this.title = new Text2(data.title); + } +}; +__name(_GridHeader, "GridHeader"); +__publicField(_GridHeader, "type", "GridHeader"); +var GridHeader = _GridHeader; + +// dist/src/parser/classes/GridMix.js +var _GridMix = class _GridMix extends YTNode { + constructor(data) { + var _a, _b; + super(); + __publicField(this, "id"); + __publicField(this, "title"); + __publicField(this, "author"); + __publicField(this, "thumbnails"); + __publicField(this, "video_count"); + __publicField(this, "video_count_short"); + __publicField(this, "endpoint"); + __publicField(this, "secondary_endpoint"); + __publicField(this, "thumbnail_overlays"); + this.id = data.playlistId; + this.title = new Text2(data.title); + this.author = ((_a = data.shortBylineText) == null ? void 0 : _a.simpleText) ? new Text2(data.shortBylineText) : ((_b = data.longBylineText) == null ? void 0 : _b.simpleText) ? new Text2(data.longBylineText) : null; + this.thumbnails = Thumbnail.fromResponse(data.thumbnail); + this.video_count = new Text2(data.videoCountText); + this.video_count_short = new Text2(data.videoCountShortText); + this.endpoint = new NavigationEndpoint(data.navigationEndpoint); + this.secondary_endpoint = new NavigationEndpoint(data.secondaryNavigationEndpoint); + this.thumbnail_overlays = parser_exports.parseArray(data.thumbnailOverlays); + } +}; +__name(_GridMix, "GridMix"); +__publicField(_GridMix, "type", "GridMix"); +var GridMix = _GridMix; + +// dist/src/parser/classes/GridMovie.js +var _GridMovie = class _GridMovie extends YTNode { + constructor(data) { + var _a; + super(); + __publicField(this, "id"); + __publicField(this, "title"); + __publicField(this, "thumbnails"); + __publicField(this, "duration"); + __publicField(this, "endpoint"); + __publicField(this, "badges"); + __publicField(this, "metadata"); + __publicField(this, "thumbnail_overlays"); + const length_alt = (_a = data.thumbnailOverlays.find((overlay) => overlay.hasOwnProperty("thumbnailOverlayTimeStatusRenderer"))) == null ? void 0 : _a.thumbnailOverlayTimeStatusRenderer; + this.id = data.videoId; + this.title = new Text2(data.title); + this.thumbnails = Thumbnail.fromResponse(data.thumbnail); + this.duration = data.lengthText ? new Text2(data.lengthText) : (length_alt == null ? void 0 : length_alt.text) ? new Text2(length_alt.text) : null; + this.endpoint = new NavigationEndpoint(data.navigationEndpoint); + this.badges = parser_exports.parseArray(data.badges, MetadataBadge); + this.metadata = new Text2(data.metadata); + this.thumbnail_overlays = parser_exports.parseArray(data.thumbnailOverlays); + } +}; +__name(_GridMovie, "GridMovie"); +__publicField(_GridMovie, "type", "GridMovie"); +var GridMovie = _GridMovie; + +// dist/src/parser/classes/GridPlaylist.js +var _GridPlaylist = class _GridPlaylist extends YTNode { + constructor(data) { + var _a; + super(); + __publicField(this, "id"); + __publicField(this, "title"); + __publicField(this, "author"); + __publicField(this, "badges"); + __publicField(this, "endpoint"); + __publicField(this, "view_playlist"); + __publicField(this, "thumbnails"); + __publicField(this, "thumbnail_renderer"); + __publicField(this, "sidebar_thumbnails"); + __publicField(this, "video_count"); + __publicField(this, "video_count_short"); + this.id = data.playlistId; + this.title = new Text2(data.title); + if (Reflect.has(data, "shortBylineText")) { + this.author = new Author(data.shortBylineText, data.ownerBadges); + } + this.badges = parser_exports.parseArray(data.ownerBadges); + this.endpoint = new NavigationEndpoint(data.navigationEndpoint); + this.view_playlist = new Text2(data.viewPlaylistText); + this.thumbnails = Thumbnail.fromResponse(data.thumbnail); + this.thumbnail_renderer = parser_exports.parseItem(data.thumbnailRenderer); + this.sidebar_thumbnails = [].concat(...((_a = data.sidebarThumbnails) == null ? void 0 : _a.map((thumbnail) => Thumbnail.fromResponse(thumbnail))) || []) || null; + this.video_count = new Text2(data.thumbnailText); + this.video_count_short = new Text2(data.videoCountShortText); + } +}; +__name(_GridPlaylist, "GridPlaylist"); +__publicField(_GridPlaylist, "type", "GridPlaylist"); +var GridPlaylist = _GridPlaylist; + +// dist/src/parser/classes/GridShelfView.js +var _GridShelfView = class _GridShelfView extends YTNode { + constructor(data) { + super(); + __publicField(this, "contents"); + __publicField(this, "header"); + __publicField(this, "content_aspect_ratio"); + __publicField(this, "enable_vertical_expansion"); + __publicField(this, "show_more_button"); + __publicField(this, "show_less_button"); + __publicField(this, "min_collapsed_item_count"); + this.contents = parser_exports.parseArray(data.contents); + this.header = parser_exports.parseItem(data.header); + this.content_aspect_ratio = data.contentAspectRatio; + this.enable_vertical_expansion = data.enableVerticalExpansion; + this.show_more_button = parser_exports.parseItem(data.showMoreButton, ButtonView); + this.show_less_button = parser_exports.parseItem(data.showLessButton, ButtonView); + this.min_collapsed_item_count = data.minCollapsedItemCount; + } +}; +__name(_GridShelfView, "GridShelfView"); +__publicField(_GridShelfView, "type", "GridShelfView"); +var GridShelfView = _GridShelfView; + +// dist/src/parser/classes/ShowCustomThumbnail.js +var _ShowCustomThumbnail = class _ShowCustomThumbnail extends YTNode { + constructor(data) { + super(); + __publicField(this, "thumbnail"); + this.thumbnail = Thumbnail.fromResponse(data.thumbnail); + } +}; +__name(_ShowCustomThumbnail, "ShowCustomThumbnail"); +__publicField(_ShowCustomThumbnail, "type", "ShowCustomThumbnail"); +var ShowCustomThumbnail = _ShowCustomThumbnail; + +// dist/src/parser/classes/ThumbnailOverlayBottomPanel.js +var _ThumbnailOverlayBottomPanel = class _ThumbnailOverlayBottomPanel extends YTNode { + constructor(data) { + super(); + __publicField(this, "text"); + __publicField(this, "icon_type"); + if (Reflect.has(data, "text")) { + this.text = new Text2(data.text); + } + if (Reflect.has(data, "icon") && Reflect.has(data.icon, "iconType")) { + this.icon_type = data.icon.iconType; + } + } +}; +__name(_ThumbnailOverlayBottomPanel, "ThumbnailOverlayBottomPanel"); +__publicField(_ThumbnailOverlayBottomPanel, "type", "ThumbnailOverlayBottomPanel"); +var ThumbnailOverlayBottomPanel = _ThumbnailOverlayBottomPanel; + +// dist/src/parser/classes/GridShow.js +var _GridShow = class _GridShow extends YTNode { + constructor(data) { + super(); + __publicField(this, "title"); + __publicField(this, "thumbnail_renderer"); + __publicField(this, "endpoint"); + __publicField(this, "long_byline_text"); + __publicField(this, "thumbnail_overlays"); + __publicField(this, "author"); + this.title = new Text2(data.title); + this.thumbnail_renderer = parseItem(data.thumbnailRenderer, ShowCustomThumbnail); + this.endpoint = new NavigationEndpoint(data.navigationEndpoint); + this.long_byline_text = new Text2(data.longBylineText); + this.thumbnail_overlays = parseArray(data.thumbnailOverlays, ThumbnailOverlayBottomPanel); + this.author = new Author(data.shortBylineText, void 0); + } +}; +__name(_GridShow, "GridShow"); +__publicField(_GridShow, "type", "GridShow"); +var GridShow = _GridShow; + +// dist/src/parser/classes/GridVideo.js +var _GridVideo = class _GridVideo extends YTNode { + constructor(data) { + var _a, _b; + super(); + __publicField(this, "video_id"); + __publicField(this, "title"); + __publicField(this, "thumbnails"); + __publicField(this, "thumbnail_overlays"); + __publicField(this, "rich_thumbnail"); + __publicField(this, "published"); + __publicField(this, "duration"); + __publicField(this, "author"); + __publicField(this, "views"); + __publicField(this, "short_view_count"); + __publicField(this, "endpoint"); + __publicField(this, "menu"); + __publicField(this, "buttons"); + __publicField(this, "upcoming"); + __publicField(this, "upcoming_text"); + __publicField(this, "is_reminder_set"); + const length_alt = (_a = data.thumbnailOverlays.find((overlay) => overlay.hasOwnProperty("thumbnailOverlayTimeStatusRenderer"))) == null ? void 0 : _a.thumbnailOverlayTimeStatusRenderer; + this.video_id = data.videoId; + this.title = new Text2(data.title); + this.thumbnails = Thumbnail.fromResponse(data.thumbnail); + this.thumbnail_overlays = parser_exports.parseArray(data.thumbnailOverlays); + this.rich_thumbnail = parser_exports.parseItem(data.richThumbnail); + this.published = new Text2(data.publishedTimeText); + this.duration = data.lengthText ? new Text2(data.lengthText) : (length_alt == null ? void 0 : length_alt.text) ? new Text2(length_alt.text) : null; + this.author = data.shortBylineText && new Author(data.shortBylineText, data.ownerBadges); + this.views = new Text2(data.viewCountText); + this.short_view_count = new Text2(data.shortViewCountText); + this.endpoint = new NavigationEndpoint(data.navigationEndpoint); + this.menu = parser_exports.parseItem(data.menu, Menu); + if (Reflect.has(data, "buttons")) { + this.buttons = parser_exports.parseArray(data.buttons); + } + if (Reflect.has(data, "upcomingEventData")) { + this.upcoming = new Date(Number(`${data.upcomingEventData.startTime}000`)); + this.upcoming_text = new Text2(data.upcomingEventData.upcomingEventText); + this.is_reminder_set = !!((_b = data.upcomingEventData) == null ? void 0 : _b.isReminderSet); + } + } + /** + * @deprecated Use {@linkcode video_id} instead. + */ + get id() { + return this.video_id; + } + get is_upcoming() { + return Boolean(this.upcoming && this.upcoming > /* @__PURE__ */ new Date()); + } +}; +__name(_GridVideo, "GridVideo"); +__publicField(_GridVideo, "type", "GridVideo"); +var GridVideo = _GridVideo; + +// dist/src/parser/classes/GuideEntry.js +var _GuideEntry = class _GuideEntry extends YTNode { + constructor(data) { + super(); + __publicField(this, "title"); + __publicField(this, "endpoint"); + __publicField(this, "icon_type"); + __publicField(this, "thumbnails"); + __publicField(this, "badges"); + __publicField(this, "is_primary"); + this.title = new Text2(data.formattedTitle); + this.endpoint = new NavigationEndpoint(data.navigationEndpoint || data.serviceEndpoint); + if (Reflect.has(data, "icon") && Reflect.has(data.icon, "iconType")) { + this.icon_type = data.icon.iconType; + } + if (Reflect.has(data, "thumbnail")) { + this.thumbnails = Thumbnail.fromResponse(data.thumbnail); + } + if (Reflect.has(data, "badges")) { + this.badges = data.badges; + } + this.is_primary = !!data.isPrimary; + } +}; +__name(_GuideEntry, "GuideEntry"); +__publicField(_GuideEntry, "type", "GuideEntry"); +var GuideEntry = _GuideEntry; + +// dist/src/parser/classes/GuideCollapsibleEntry.js +var _GuideCollapsibleEntry = class _GuideCollapsibleEntry extends YTNode { + constructor(data) { + super(); + __publicField(this, "expander_item"); + __publicField(this, "collapser_item"); + __publicField(this, "expandable_items"); + this.expander_item = parseItem(data.expanderItem, GuideEntry); + this.collapser_item = parseItem(data.collapserItem, GuideEntry); + this.expandable_items = parseArray(data.expandableItems); + } +}; +__name(_GuideCollapsibleEntry, "GuideCollapsibleEntry"); +__publicField(_GuideCollapsibleEntry, "type", "GuideCollapsibleEntry"); +var GuideCollapsibleEntry = _GuideCollapsibleEntry; + +// dist/src/parser/classes/GuideCollapsibleSectionEntry.js +var _GuideCollapsibleSectionEntry = class _GuideCollapsibleSectionEntry extends YTNode { + constructor(data) { + super(); + __publicField(this, "header_entry"); + __publicField(this, "expander_icon"); + __publicField(this, "collapser_icon"); + __publicField(this, "section_items"); + this.header_entry = parseItem(data.headerEntry); + this.expander_icon = data.expanderIcon.iconType; + this.collapser_icon = data.collapserIcon.iconType; + this.section_items = parseArray(data.sectionItems); + } +}; +__name(_GuideCollapsibleSectionEntry, "GuideCollapsibleSectionEntry"); +__publicField(_GuideCollapsibleSectionEntry, "type", "GuideCollapsibleSectionEntry"); +var GuideCollapsibleSectionEntry = _GuideCollapsibleSectionEntry; + +// dist/src/parser/classes/GuideDownloadsEntry.js +var _GuideDownloadsEntry = class _GuideDownloadsEntry extends GuideEntry { + constructor(data) { + super(data.entryRenderer.guideEntryRenderer); + __publicField(this, "always_show"); + this.always_show = !!data.alwaysShow; + } +}; +__name(_GuideDownloadsEntry, "GuideDownloadsEntry"); +__publicField(_GuideDownloadsEntry, "type", "GuideDownloadsEntry"); +var GuideDownloadsEntry = _GuideDownloadsEntry; + +// dist/src/parser/classes/GuideSection.js +var _GuideSection = class _GuideSection extends YTNode { + constructor(data) { + super(); + __publicField(this, "title"); + __publicField(this, "items"); + if (Reflect.has(data, "formattedTitle")) { + this.title = new Text2(data.formattedTitle); + } + this.items = parseArray(data.items); + } +}; +__name(_GuideSection, "GuideSection"); +__publicField(_GuideSection, "type", "GuideSection"); +var GuideSection = _GuideSection; + +// dist/src/parser/classes/GuideSubscriptionsSection.js +var _GuideSubscriptionsSection = class _GuideSubscriptionsSection extends GuideSection { +}; +__name(_GuideSubscriptionsSection, "GuideSubscriptionsSection"); +__publicField(_GuideSubscriptionsSection, "type", "GuideSubscriptionsSection"); +var GuideSubscriptionsSection = _GuideSubscriptionsSection; + +// dist/src/parser/classes/HashtagHeader.js +var _HashtagHeader = class _HashtagHeader extends YTNode { + constructor(data) { + super(); + __publicField(this, "hashtag"); + __publicField(this, "hashtag_info"); + this.hashtag = new Text2(data.hashtag); + this.hashtag_info = new Text2(data.hashtagInfoText); + } +}; +__name(_HashtagHeader, "HashtagHeader"); +__publicField(_HashtagHeader, "type", "HashtagHeader"); +var HashtagHeader = _HashtagHeader; + +// dist/src/parser/classes/HashtagTile.js +var _HashtagTile = class _HashtagTile extends YTNode { + constructor(data) { + super(); + __publicField(this, "hashtag"); + __publicField(this, "hashtag_info_text"); + __publicField(this, "hashtag_thumbnail"); + __publicField(this, "endpoint"); + __publicField(this, "hashtag_background_color"); + __publicField(this, "hashtag_video_count"); + __publicField(this, "hashtag_channel_count"); + this.hashtag = new Text2(data.hashtag); + this.hashtag_info_text = new Text2(data.hashtagInfoText); + this.hashtag_thumbnail = Thumbnail.fromResponse(data.hashtagThumbnail); + this.endpoint = new NavigationEndpoint(data.onTapCommand); + this.hashtag_background_color = data.hashtagBackgroundColor; + this.hashtag_video_count = new Text2(data.hashtagVideoCount); + this.hashtag_channel_count = new Text2(data.hashtagChannelCount); + } +}; +__name(_HashtagTile, "HashtagTile"); +__publicField(_HashtagTile, "type", "HashtagTile"); +var HashtagTile = _HashtagTile; + +// dist/src/parser/classes/HeroPlaylistThumbnail.js +var _HeroPlaylistThumbnail = class _HeroPlaylistThumbnail extends YTNode { + constructor(data) { + super(); + __publicField(this, "thumbnails"); + __publicField(this, "on_tap_endpoint"); + this.thumbnails = Thumbnail.fromResponse(data.thumbnail); + this.on_tap_endpoint = new NavigationEndpoint(data.onTap); + } +}; +__name(_HeroPlaylistThumbnail, "HeroPlaylistThumbnail"); +__publicField(_HeroPlaylistThumbnail, "type", "HeroPlaylistThumbnail"); +var HeroPlaylistThumbnail = _HeroPlaylistThumbnail; + +// dist/src/parser/classes/HighlightsCarousel.js +var _Panel = class _Panel extends YTNode { + constructor(data) { + super(); + __publicField(this, "thumbnail"); + __publicField(this, "background_image"); + __publicField(this, "strapline"); + __publicField(this, "title"); + __publicField(this, "description"); + __publicField(this, "text_on_tap_endpoint"); + __publicField(this, "cta"); + if (data.thumbnail) { + this.thumbnail = { + image: Thumbnail.fromResponse(data.thumbnail.image), + endpoint: new NavigationEndpoint(data.thumbnail.onTap), + on_long_press_endpoint: new NavigationEndpoint(data.thumbnail.onLongPress), + content_mode: data.thumbnail.contentMode, + crop_options: data.thumbnail.cropOptions + }; + } + this.background_image = { + image: Thumbnail.fromResponse(data.backgroundImage.image), + gradient_image: Thumbnail.fromResponse(data.backgroundImage.gradientImage) + }; + this.strapline = data.strapline; + this.title = data.title; + this.description = data.description; + this.cta = { + icon_name: data.cta.iconName, + title: data.cta.title, + endpoint: new NavigationEndpoint(data.cta.onTap), + accessibility_text: data.cta.accessibilityText, + state: data.cta.state + }; + this.text_on_tap_endpoint = new NavigationEndpoint(data.textOnTap); + } +}; +__name(_Panel, "Panel"); +__publicField(_Panel, "type", "Panel"); +var Panel = _Panel; +var _HighlightsCarousel = class _HighlightsCarousel extends YTNode { + constructor(data) { + super(); + __publicField(this, "panels"); + this.panels = observe(data.highlightsCarousel.panels.map((el) => new Panel(el))); + } +}; +__name(_HighlightsCarousel, "HighlightsCarousel"); +__publicField(_HighlightsCarousel, "type", "HighlightsCarousel"); +var HighlightsCarousel = _HighlightsCarousel; + +// dist/src/parser/classes/SearchSuggestion.js +var _SearchSuggestion = class _SearchSuggestion extends YTNode { + constructor(data) { + super(); + __publicField(this, "suggestion"); + __publicField(this, "endpoint"); + __publicField(this, "icon_type"); + __publicField(this, "service_endpoint"); + this.suggestion = new Text2(data.suggestion); + this.endpoint = new NavigationEndpoint(data.navigationEndpoint); + if (Reflect.has(data, "icon")) { + this.icon_type = data.icon.iconType; + } + if (Reflect.has(data, "serviceEndpoint")) { + this.service_endpoint = new NavigationEndpoint(data.serviceEndpoint); + } + } +}; +__name(_SearchSuggestion, "SearchSuggestion"); +__publicField(_SearchSuggestion, "type", "SearchSuggestion"); +var SearchSuggestion = _SearchSuggestion; + +// dist/src/parser/classes/HistorySuggestion.js +var _HistorySuggestion = class _HistorySuggestion extends SearchSuggestion { + constructor(data) { + super(data); + } +}; +__name(_HistorySuggestion, "HistorySuggestion"); +__publicField(_HistorySuggestion, "type", "HistorySuggestion"); +var HistorySuggestion = _HistorySuggestion; + +// dist/src/parser/classes/HorizontalMovieList.js +var _HorizontalMovieList = class _HorizontalMovieList extends YTNode { + constructor(data) { + super(); + __publicField(this, "items"); + __publicField(this, "previous_button"); + __publicField(this, "next_button"); + this.items = parser_exports.parseArray(data.items); + this.previous_button = parser_exports.parseItem(data.previousButton, Button); + this.next_button = parser_exports.parseItem(data.nextButton, Button); + } + // XXX: Alias for consistency. + get contents() { + return this.items; + } +}; +__name(_HorizontalMovieList, "HorizontalMovieList"); +__publicField(_HorizontalMovieList, "type", "HorizontalMovieList"); +var HorizontalMovieList = _HorizontalMovieList; + +// dist/src/parser/classes/IconLink.js +var _IconLink = class _IconLink extends YTNode { + constructor(data) { + var _a; + super(); + __publicField(this, "icon_type"); + __publicField(this, "tooltip"); + __publicField(this, "endpoint"); + this.icon_type = (_a = data.icon) == null ? void 0 : _a.iconType; + if (Reflect.has(data, "tooltip")) { + this.tooltip = new Text2(data.tooltip).toString(); + } + this.endpoint = new NavigationEndpoint(data.navigationEndpoint); + } +}; +__name(_IconLink, "IconLink"); +__publicField(_IconLink, "type", "IconLink"); +var IconLink = _IconLink; + +// dist/src/parser/classes/ImageBannerView.js +var _ImageBannerView = class _ImageBannerView extends YTNode { + constructor(data) { + super(); + __publicField(this, "image"); + __publicField(this, "style"); + this.image = Thumbnail.fromResponse(data.image); + this.style = data.style; + } +}; +__name(_ImageBannerView, "ImageBannerView"); +__publicField(_ImageBannerView, "type", "ImageBannerView"); +var ImageBannerView = _ImageBannerView; + +// dist/src/parser/classes/IncludingResultsFor.js +var _IncludingResultsFor = class _IncludingResultsFor extends YTNode { + constructor(data) { + super(); + __publicField(this, "including_results_for"); + __publicField(this, "corrected_query"); + __publicField(this, "corrected_query_endpoint"); + __publicField(this, "search_only_for"); + __publicField(this, "original_query"); + __publicField(this, "original_query_endpoint"); + this.including_results_for = new Text2(data.includingResultsFor); + this.corrected_query = new Text2(data.correctedQuery); + this.corrected_query_endpoint = new NavigationEndpoint(data.correctedQueryEndpoint); + this.search_only_for = Reflect.has(data, "searchOnlyFor") ? new Text2(data.searchOnlyFor) : void 0; + this.original_query = Reflect.has(data, "originalQuery") ? new Text2(data.originalQuery) : void 0; + this.original_query_endpoint = Reflect.has(data, "originalQueryEndpoint") ? new NavigationEndpoint(data.originalQueryEndpoint) : void 0; + } +}; +__name(_IncludingResultsFor, "IncludingResultsFor"); +__publicField(_IncludingResultsFor, "type", "IncludingResultsFor"); +var IncludingResultsFor = _IncludingResultsFor; + +// dist/src/parser/classes/InfoPanelContent.js +var _InfoPanelContent = class _InfoPanelContent extends YTNode { + constructor(data) { + super(); + __publicField(this, "title"); + __publicField(this, "source"); + __publicField(this, "paragraphs"); + __publicField(this, "attributed_paragraphs"); + __publicField(this, "thumbnail"); + __publicField(this, "source_endpoint"); + __publicField(this, "truncate_paragraphs"); + __publicField(this, "background"); + __publicField(this, "inline_link_icon_type"); + this.title = new Text2(data.title); + this.source = new Text2(data.source); + if (Reflect.has(data, "paragraphs")) + this.paragraphs = data.paragraphs.map((p) => new Text2(p)); + if (Reflect.has(data, "attributedParagraphs")) + this.attributed_paragraphs = data.attributedParagraphs.map((p) => Text2.fromAttributed(p)); + this.thumbnail = Thumbnail.fromResponse(data.thumbnail); + this.source_endpoint = new NavigationEndpoint(data.sourceEndpoint); + this.truncate_paragraphs = !!data.truncateParagraphs; + this.background = data.background; + if (Reflect.has(data, "inlineLinkIcon") && Reflect.has(data.inlineLinkIcon, "iconType")) { + this.inline_link_icon_type = data.inlineLinkIcon.iconType; + } + } +}; +__name(_InfoPanelContent, "InfoPanelContent"); +__publicField(_InfoPanelContent, "type", "InfoPanelContent"); +var InfoPanelContent = _InfoPanelContent; + +// dist/src/parser/classes/InfoPanelContainer.js +var _InfoPanelContainer = class _InfoPanelContainer extends YTNode { + constructor(data) { + var _a; + super(); + __publicField(this, "title"); + __publicField(this, "menu"); + __publicField(this, "content"); + __publicField(this, "header_endpoint"); + __publicField(this, "background"); + __publicField(this, "title_style"); + __publicField(this, "icon_type"); + this.title = new Text2(data.title); + this.menu = parser_exports.parseItem(data.menu, Menu); + this.content = parser_exports.parseItem(data.content, InfoPanelContent); + if (data.headerEndpoint) + this.header_endpoint = new NavigationEndpoint(data.headerEndpoint); + this.background = data.background; + this.title_style = data.titleStyle; + if (Reflect.has(data, "icon")) { + this.icon_type = (_a = data.icon) == null ? void 0 : _a.iconType; + } + } +}; +__name(_InfoPanelContainer, "InfoPanelContainer"); +__publicField(_InfoPanelContainer, "type", "InfoPanelContainer"); +var InfoPanelContainer = _InfoPanelContainer; + +// dist/src/parser/classes/InteractiveTabbedHeader.js +var _InteractiveTabbedHeader = class _InteractiveTabbedHeader extends YTNode { + constructor(data) { + super(); + __publicField(this, "header_type"); + __publicField(this, "title"); + __publicField(this, "description"); + __publicField(this, "metadata"); + __publicField(this, "badges"); + __publicField(this, "box_art"); + __publicField(this, "banner"); + __publicField(this, "buttons"); + __publicField(this, "auto_generated"); + this.header_type = data.type; + this.title = new Text2(data.title); + this.description = new Text2(data.description); + this.metadata = new Text2(data.metadata); + this.badges = parser_exports.parseArray(data.badges, MetadataBadge); + this.box_art = Thumbnail.fromResponse(data.boxArt); + this.banner = Thumbnail.fromResponse(data.banner); + this.buttons = parser_exports.parseArray(data.buttons, [SubscribeButton, Button]); + this.auto_generated = new Text2(data.autoGenerated); + } +}; +__name(_InteractiveTabbedHeader, "InteractiveTabbedHeader"); +__publicField(_InteractiveTabbedHeader, "type", "InteractiveTabbedHeader"); +var InteractiveTabbedHeader = _InteractiveTabbedHeader; + +// dist/src/parser/classes/ItemSectionHeader.js +var _ItemSectionHeader = class _ItemSectionHeader extends YTNode { + constructor(data) { + super(); + __publicField(this, "title"); + this.title = new Text2(data.title); + } +}; +__name(_ItemSectionHeader, "ItemSectionHeader"); +__publicField(_ItemSectionHeader, "type", "ItemSectionHeader"); +var ItemSectionHeader = _ItemSectionHeader; + +// dist/src/parser/classes/ItemSectionTab.js +var _ItemSectionTab = class _ItemSectionTab extends YTNode { + constructor(data) { + super(); + __publicField(this, "title"); + __publicField(this, "selected"); + __publicField(this, "endpoint"); + this.title = new Text2(data.title); + this.selected = !!data.selected; + this.endpoint = new NavigationEndpoint(data.endpoint); + } +}; +__name(_ItemSectionTab, "ItemSectionTab"); +__publicField(_ItemSectionTab, "type", "Tab"); +var ItemSectionTab = _ItemSectionTab; + +// dist/src/parser/classes/ItemSectionTabbedHeader.js +var _ItemSectionTabbedHeader = class _ItemSectionTabbedHeader extends YTNode { + constructor(data) { + super(); + __publicField(this, "title"); + __publicField(this, "tabs"); + __publicField(this, "end_items"); + this.title = new Text2(data.title); + this.tabs = parser_exports.parseArray(data.tabs, ItemSectionTab); + if (Reflect.has(data, "endItems")) { + this.end_items = parser_exports.parseArray(data.endItems); + } + } +}; +__name(_ItemSectionTabbedHeader, "ItemSectionTabbedHeader"); +__publicField(_ItemSectionTabbedHeader, "type", "ItemSectionTabbedHeader"); +var ItemSectionTabbedHeader = _ItemSectionTabbedHeader; + +// dist/src/parser/classes/SortFilterHeader.js +var _SortFilterHeader = class _SortFilterHeader extends YTNode { + constructor(data) { + super(); + __publicField(this, "filter_menu"); + this.filter_menu = parser_exports.parseItem(data.filterMenu, nodes_exports.SortFilterSubMenu); + } +}; +__name(_SortFilterHeader, "SortFilterHeader"); +__publicField(_SortFilterHeader, "type", "SortFilterHeader"); +var SortFilterHeader = _SortFilterHeader; + +// dist/src/parser/classes/ItemSection.js +var _ItemSection = class _ItemSection extends YTNode { + constructor(data) { + var _a, _b, _c; + super(); + __publicField(this, "header"); + __publicField(this, "contents"); + __publicField(this, "target_id"); + __publicField(this, "continuation"); + this.header = parser_exports.parseItem(data.header, [CommentsHeader, ItemSectionHeader, ItemSectionTabbedHeader, SortFilterHeader, FeedFilterChipBar]); + this.contents = parser_exports.parseArray(data.contents); + if (data.targetId || data.sectionIdentifier) { + this.target_id = data.targetId || data.sectionIdentifier; + } + if (data.continuations) { + this.continuation = (_c = (_b = (_a = data.continuations) == null ? void 0 : _a.at(0)) == null ? void 0 : _b.nextContinuationData) == null ? void 0 : _c.continuation; + } + } +}; +__name(_ItemSection, "ItemSection"); +__publicField(_ItemSection, "type", "ItemSection"); +var ItemSection = _ItemSection; + +// dist/src/parser/classes/LiveChat.js +var _LiveChat = class _LiveChat extends YTNode { + constructor(data) { + var _a, _b; + super(); + __publicField(this, "header"); + __publicField(this, "initial_display_state"); + __publicField(this, "continuation"); + __publicField(this, "client_messages"); + __publicField(this, "is_replay"); + this.header = parser_exports.parseItem(data.header); + this.initial_display_state = data.initialDisplayState; + this.continuation = (_b = (_a = data.continuations[0]) == null ? void 0 : _a.reloadContinuationData) == null ? void 0 : _b.continuation; + this.client_messages = { + reconnect_message: new Text2(data.clientMessages.reconnectMessage), + unable_to_reconnect_message: new Text2(data.clientMessages.unableToReconnectMessage), + fatal_error: new Text2(data.clientMessages.fatalError), + reconnected_message: new Text2(data.clientMessages.reconnectedMessage), + generic_error: new Text2(data.clientMessages.genericError) + }; + this.is_replay = !!data.isReplay; + } +}; +__name(_LiveChat, "LiveChat"); +__publicField(_LiveChat, "type", "LiveChat"); +var LiveChat = _LiveChat; + +// dist/src/parser/classes/livechat/items/LiveChatBannerHeader.js +var _LiveChatBannerHeader = class _LiveChatBannerHeader extends YTNode { + constructor(data) { + super(); + __publicField(this, "text"); + __publicField(this, "icon_type"); + __publicField(this, "context_menu_button"); + this.text = new Text2(data.text); + if (Reflect.has(data, "icon") && Reflect.has(data.icon, "iconType")) { + this.icon_type = data.icon.iconType; + } + this.context_menu_button = parser_exports.parseItem(data.contextMenuButton, Button); + } +}; +__name(_LiveChatBannerHeader, "LiveChatBannerHeader"); +__publicField(_LiveChatBannerHeader, "type", "LiveChatBannerHeader"); +var LiveChatBannerHeader = _LiveChatBannerHeader; + +// dist/src/parser/classes/livechat/items/LiveChatBanner.js +var _LiveChatBanner = class _LiveChatBanner extends YTNode { + constructor(data) { + super(); + __publicField(this, "header"); + __publicField(this, "contents"); + __publicField(this, "action_id"); + __publicField(this, "viewer_is_creator"); + __publicField(this, "target_id"); + __publicField(this, "is_stackable"); + __publicField(this, "background_type"); + __publicField(this, "banner_type"); + __publicField(this, "banner_properties_is_ephemeral"); + __publicField(this, "banner_properties_auto_collapse_delay_seconds"); + this.header = parser_exports.parseItem(data.header, LiveChatBannerHeader); + this.contents = parser_exports.parseItem(data.contents); + this.action_id = data.actionId; + if (Reflect.has(data, "viewerIsCreator")) { + this.viewer_is_creator = data.viewerIsCreator; + } + this.target_id = data.targetId; + this.is_stackable = data.isStackable; + if (Reflect.has(data, "backgroundType")) { + this.background_type = data.backgroundType; + } + this.banner_type = data.bannerType; + if (Reflect.has(data, "bannerProperties") && Reflect.has(data.bannerProperties, "isEphemeral")) { + this.banner_properties_is_ephemeral = Boolean(data.bannerProperties.isEphemeral); + } + if (Reflect.has(data, "bannerProperties") && Reflect.has(data.bannerProperties, "autoCollapseDelay") && Reflect.has(data.bannerProperties.autoCollapseDelay, "seconds")) { + this.banner_properties_auto_collapse_delay_seconds = data.bannerProperties.autoCollapseDelay.seconds; + } + } +}; +__name(_LiveChatBanner, "LiveChatBanner"); +__publicField(_LiveChatBanner, "type", "LiveChatBanner"); +var LiveChatBanner = _LiveChatBanner; + +// dist/src/parser/classes/livechat/AddBannerToLiveChatCommand.js +var _AddBannerToLiveChatCommand = class _AddBannerToLiveChatCommand extends YTNode { + constructor(data) { + super(); + __publicField(this, "banner"); + this.banner = parser_exports.parseItem(data.bannerRenderer, LiveChatBanner); + } +}; +__name(_AddBannerToLiveChatCommand, "AddBannerToLiveChatCommand"); +__publicField(_AddBannerToLiveChatCommand, "type", "AddBannerToLiveChatCommand"); +var AddBannerToLiveChatCommand = _AddBannerToLiveChatCommand; + +// dist/src/parser/classes/livechat/AddChatItemAction.js +var _AddChatItemAction = class _AddChatItemAction extends YTNode { + constructor(data) { + super(); + __publicField(this, "item"); + __publicField(this, "client_id"); + this.item = parser_exports.parseItem(data.item); + if (Reflect.has(data, "clientId")) { + this.client_id = data.clientId; + } + } +}; +__name(_AddChatItemAction, "AddChatItemAction"); +__publicField(_AddChatItemAction, "type", "AddChatItemAction"); +var AddChatItemAction = _AddChatItemAction; + +// dist/src/parser/classes/livechat/AddLiveChatTickerItemAction.js +var _AddLiveChatTickerItemAction = class _AddLiveChatTickerItemAction extends YTNode { + // TODO: check this assumption. + constructor(data) { + super(); + __publicField(this, "item"); + __publicField(this, "duration_sec"); + this.item = parser_exports.parseItem(data.item); + this.duration_sec = data.durationSec; + } +}; +__name(_AddLiveChatTickerItemAction, "AddLiveChatTickerItemAction"); +__publicField(_AddLiveChatTickerItemAction, "type", "AddLiveChatTickerItemAction"); +var AddLiveChatTickerItemAction = _AddLiveChatTickerItemAction; + +// dist/src/parser/classes/livechat/DimChatItemAction.js +var _DimChatItemAction = class _DimChatItemAction extends YTNode { + constructor(data) { + super(); + __publicField(this, "client_assigned_id"); + this.client_assigned_id = data.clientAssignedId; + } +}; +__name(_DimChatItemAction, "DimChatItemAction"); +__publicField(_DimChatItemAction, "type", "DimChatItemAction"); +var DimChatItemAction = _DimChatItemAction; + +// dist/src/parser/classes/livechat/items/BumperUserEduContentView.js +var _BumperUserEduContentView = class _BumperUserEduContentView extends YTNode { + constructor(data) { + super(); + __publicField(this, "text"); + __publicField(this, "image_name"); + __publicField(this, "image_color"); + this.text = Text2.fromAttributed(data.text); + this.image_name = data.image.sources[0].clientResource.imageName; + this.image_color = data.image.sources[0].clientResource.imageColor; + } +}; +__name(_BumperUserEduContentView, "BumperUserEduContentView"); +__publicField(_BumperUserEduContentView, "type", "BumperUserEduContentView"); +var BumperUserEduContentView = _BumperUserEduContentView; + +// dist/src/parser/classes/livechat/items/CreatorHeartView.js +var _CreatorHeartView = class _CreatorHeartView extends YTNode { + constructor(data) { + super(); + __publicField(this, "creator_thumbnail"); + __publicField(this, "hearted_icon_name"); + __publicField(this, "unhearted_icon_name"); + __publicField(this, "unhearted_icon_processor"); + __publicField(this, "hearted_hover_text"); + __publicField(this, "hearted_accessibility_label"); + __publicField(this, "unhearted_accessibility_label"); + __publicField(this, "engagement_state_key"); + this.creator_thumbnail = Thumbnail.fromResponse(data.creatorThumbnail); + this.hearted_icon_name = data.heartedIcon.sources[0].clientResource.imageName; + this.unhearted_icon_name = data.unheartedIcon.sources[0].clientResource.imageName; + this.unhearted_icon_processor = { + border_image_processor: { + image_tint: { + color: data.unheartedIcon.processor.borderImageProcessor.imageTint.color + } + } + }; + this.hearted_hover_text = data.heartedHoverText; + this.hearted_accessibility_label = data.heartedAccessibilityLabel; + this.unhearted_accessibility_label = data.unheartedAccessibilityLabel; + this.engagement_state_key = data.engagementStateKey; + } +}; +__name(_CreatorHeartView, "CreatorHeartView"); +__publicField(_CreatorHeartView, "type", "CreatorHeartView"); +var CreatorHeartView = _CreatorHeartView; + +// dist/src/parser/classes/livechat/items/LiveChatAutoModMessage.js +var _LiveChatAutoModMessage = class _LiveChatAutoModMessage extends YTNode { + constructor(data) { + super(); + __publicField(this, "menu_endpoint"); + __publicField(this, "moderation_buttons"); + __publicField(this, "auto_moderated_item"); + __publicField(this, "header_text"); + __publicField(this, "timestamp"); + __publicField(this, "id"); + this.menu_endpoint = new NavigationEndpoint(data.contextMenuEndpoint); + this.moderation_buttons = parser_exports.parseArray(data.moderationButtons, Button); + this.auto_moderated_item = parser_exports.parseItem(data.autoModeratedItem); + this.header_text = new Text2(data.headerText); + this.timestamp = Math.floor(parseInt(data.timestampUsec) / 1e3); + this.id = data.id; + } +}; +__name(_LiveChatAutoModMessage, "LiveChatAutoModMessage"); +__publicField(_LiveChatAutoModMessage, "type", "LiveChatAutoModMessage"); +var LiveChatAutoModMessage = _LiveChatAutoModMessage; + +// dist/src/parser/classes/livechat/items/LiveChatBannerChatSummary.js +var _LiveChatBannerChatSummary = class _LiveChatBannerChatSummary extends YTNode { + constructor(data) { + super(); + __publicField(this, "id"); + __publicField(this, "chat_summary"); + __publicField(this, "icon_type"); + __publicField(this, "like_feedback_button"); + __publicField(this, "dislike_feedback_button"); + this.id = data.liveChatSummaryId; + this.chat_summary = new Text2(data.chatSummary); + this.icon_type = data.icon.iconType; + this.like_feedback_button = parser_exports.parseItem(data.likeFeedbackButton, ToggleButtonView); + this.dislike_feedback_button = parser_exports.parseItem(data.dislikeFeedbackButton, ToggleButtonView); + } +}; +__name(_LiveChatBannerChatSummary, "LiveChatBannerChatSummary"); +__publicField(_LiveChatBannerChatSummary, "type", "LiveChatBannerChatSummary"); +var LiveChatBannerChatSummary = _LiveChatBannerChatSummary; + +// dist/src/parser/classes/livechat/items/LiveChatBannerPoll.js +var _LiveChatBannerPoll = class _LiveChatBannerPoll extends YTNode { + constructor(data) { + super(); + __publicField(this, "poll_question"); + __publicField(this, "author_photo"); + __publicField(this, "choices"); + __publicField(this, "collapsed_state_entity_key"); + __publicField(this, "live_chat_poll_state_entity_key"); + __publicField(this, "context_menu_button"); + this.poll_question = new Text2(data.pollQuestion); + this.author_photo = Thumbnail.fromResponse(data.authorPhoto); + this.choices = data.pollChoices.map((choice) => ({ + option_id: choice.pollOptionId, + text: new Text2(choice.text).toString() + // XXX: This toString should probably not be used here. + })); + this.collapsed_state_entity_key = data.collapsedStateEntityKey; + this.live_chat_poll_state_entity_key = data.liveChatPollStateEntityKey; + this.context_menu_button = parser_exports.parseItem(data.contextMenuButton, Button); + } +}; +__name(_LiveChatBannerPoll, "LiveChatBannerPoll"); +__publicField(_LiveChatBannerPoll, "type", "LiveChatBannerPoll"); +var LiveChatBannerPoll = _LiveChatBannerPoll; + +// dist/src/parser/classes/livechat/items/LiveChatBannerRedirect.js +var _LiveChatBannerRedirect = class _LiveChatBannerRedirect extends YTNode { + constructor(data) { + super(); + __publicField(this, "banner_message"); + __publicField(this, "author_photo"); + __publicField(this, "inline_action_button"); + __publicField(this, "context_menu_button"); + this.banner_message = new Text2(data.bannerMessage); + this.author_photo = Thumbnail.fromResponse(data.authorPhoto); + this.inline_action_button = parser_exports.parseItem(data.inlineActionButton, Button); + this.context_menu_button = parser_exports.parseItem(data.contextMenuButton, Button); + } +}; +__name(_LiveChatBannerRedirect, "LiveChatBannerRedirect"); +__publicField(_LiveChatBannerRedirect, "type", "LiveChatBannerRedirect"); +var LiveChatBannerRedirect = _LiveChatBannerRedirect; + +// dist/src/parser/classes/livechat/items/LiveChatItemBumperView.js +var _LiveChatItemBumperView = class _LiveChatItemBumperView extends YTNode { + constructor(data) { + super(); + __publicField(this, "content"); + this.content = parser_exports.parseItem(data.content, BumperUserEduContentView); + } +}; +__name(_LiveChatItemBumperView, "LiveChatItemBumperView"); +__publicField(_LiveChatItemBumperView, "type", "LiveChatItemBumperView"); +var LiveChatItemBumperView = _LiveChatItemBumperView; + +// dist/src/parser/classes/livechat/items/LiveChatMembershipItem.js +var _LiveChatMembershipItem = class _LiveChatMembershipItem extends YTNode { + constructor(data) { + super(); + __publicField(this, "id"); + __publicField(this, "timestamp"); + __publicField(this, "timestamp_usec"); + __publicField(this, "timestamp_text"); + __publicField(this, "header_primary_text"); + __publicField(this, "header_subtext"); + __publicField(this, "message"); + __publicField(this, "author"); + __publicField(this, "menu_endpoint"); + __publicField(this, "context_menu_accessibility_label"); + this.id = data.id; + this.timestamp = Math.floor(parseInt(data.timestampUsec) / 1e3); + this.timestamp_usec = data.timestampUsec; + if (Reflect.has(data, "timestampText")) { + this.timestamp_text = new Text2(data.timestampText); + } + if (Reflect.has(data, "headerPrimaryText")) { + this.header_primary_text = new Text2(data.headerPrimaryText); + } + this.header_subtext = new Text2(data.headerSubtext); + if (Reflect.has(data, "message")) { + this.message = new Text2(data.message); + } + this.author = new Author(data.authorName, data.authorBadges, data.authorPhoto, data.authorExternalChannelId); + this.menu_endpoint = new NavigationEndpoint(data.contextMenuEndpoint); + this.context_menu_accessibility_label = data.contextMenuAccessibility.accessibilityData.label; + } +}; +__name(_LiveChatMembershipItem, "LiveChatMembershipItem"); +__publicField(_LiveChatMembershipItem, "type", "LiveChatMembershipItem"); +var LiveChatMembershipItem = _LiveChatMembershipItem; + +// dist/src/parser/classes/livechat/items/LiveChatModeChangeMessage.js +var _LiveChatModeChangeMessage = class _LiveChatModeChangeMessage extends YTNode { + constructor(data) { + super(); + __publicField(this, "id"); + __publicField(this, "icon_type"); + __publicField(this, "text"); + __publicField(this, "subtext"); + __publicField(this, "timestamp"); + __publicField(this, "timestamp_usec"); + __publicField(this, "timestamp_text"); + this.id = data.id; + this.icon_type = data.icon.iconType; + this.text = new Text2(data.text); + this.subtext = new Text2(data.subtext); + this.timestamp = Math.floor(parseInt(data.timestampUsec) / 1e3); + this.timestamp_usec = data.timestampUsec; + this.timestamp_text = new Text2(data.timestampText); + } +}; +__name(_LiveChatModeChangeMessage, "LiveChatModeChangeMessage"); +__publicField(_LiveChatModeChangeMessage, "type", "LiveChatModeChangeMessage"); +var LiveChatModeChangeMessage = _LiveChatModeChangeMessage; + +// dist/src/parser/classes/livechat/items/PdgReplyButtonView.js +var _PdgReplyButtonView = class _PdgReplyButtonView extends YTNode { + constructor(data) { + super(); + __publicField(this, "reply_button"); + __publicField(this, "reply_count_entity_key"); + __publicField(this, "reply_count_placeholder"); + this.reply_button = parser_exports.parseItem(data.replyButton, ButtonView); + this.reply_count_entity_key = data.replyCountEntityKey; + this.reply_count_placeholder = Text2.fromAttributed(data.replyCountPlaceholder); + } +}; +__name(_PdgReplyButtonView, "PdgReplyButtonView"); +__publicField(_PdgReplyButtonView, "type", "PdgReplyButtonView"); +var PdgReplyButtonView = _PdgReplyButtonView; + +// dist/src/parser/classes/livechat/items/LiveChatPaidMessage.js +var _LiveChatPaidMessage = class _LiveChatPaidMessage extends YTNode { + constructor(data) { + super(); + __publicField(this, "id"); + __publicField(this, "message"); + __publicField(this, "author"); + __publicField(this, "author_name_text_color"); + __publicField(this, "header_background_color"); + __publicField(this, "header_text_color"); + __publicField(this, "body_background_color"); + __publicField(this, "body_text_color"); + __publicField(this, "purchase_amount"); + __publicField(this, "menu_endpoint"); + __publicField(this, "context_menu_accessibility_label"); + __publicField(this, "timestamp"); + __publicField(this, "timestamp_usec"); + __publicField(this, "timestamp_text"); + __publicField(this, "timestamp_color"); + __publicField(this, "header_overlay_image"); + __publicField(this, "text_input_background_color"); + __publicField(this, "lower_bumper"); + __publicField(this, "creator_heart_button"); + __publicField(this, "is_v2_style"); + __publicField(this, "reply_button"); + this.id = data.id; + this.message = new Text2(data.message); + this.author = new Author(data.authorName, data.authorBadges, data.authorPhoto, data.authorExternalChannelId); + this.author_name_text_color = data.authorNameTextColor; + this.header_background_color = data.headerBackgroundColor; + this.header_text_color = data.headerTextColor; + this.body_background_color = data.bodyBackgroundColor; + this.body_text_color = data.bodyTextColor; + this.purchase_amount = new Text2(data.purchaseAmountText).toString(); + this.menu_endpoint = new NavigationEndpoint(data.contextMenuEndpoint); + this.context_menu_accessibility_label = data.contextMenuAccessibility.accessibilityData.label; + this.timestamp = Math.floor(parseInt(data.timestampUsec) / 1e3); + this.timestamp_usec = data.timestampUsec; + if (Reflect.has(data, "timestampText")) { + this.timestamp_text = new Text2(data.timestampText).toString(); + } + this.timestamp_color = data.timestampColor; + if (Reflect.has(data, "headerOverlayImage")) { + this.header_overlay_image = Thumbnail.fromResponse(data.headerOverlayImage); + } + this.text_input_background_color = data.textInputBackgroundColor; + this.lower_bumper = parser_exports.parseItem(data.lowerBumper, LiveChatItemBumperView); + this.creator_heart_button = parser_exports.parseItem(data.creatorHeartButton, CreatorHeartView); + this.is_v2_style = data.isV2Style; + this.reply_button = parser_exports.parseItem(data.replyButton, PdgReplyButtonView); + } +}; +__name(_LiveChatPaidMessage, "LiveChatPaidMessage"); +__publicField(_LiveChatPaidMessage, "type", "LiveChatPaidMessage"); +var LiveChatPaidMessage = _LiveChatPaidMessage; + +// dist/src/parser/classes/livechat/items/LiveChatPaidSticker.js +var _LiveChatPaidSticker = class _LiveChatPaidSticker extends YTNode { + constructor(data) { + super(); + __publicField(this, "id"); + __publicField(this, "author"); + __publicField(this, "money_chip_background_color"); + __publicField(this, "money_chip_text_color"); + __publicField(this, "background_color"); + __publicField(this, "author_name_text_color"); + __publicField(this, "sticker"); + __publicField(this, "sticker_accessibility_label"); + __publicField(this, "sticker_display_width"); + __publicField(this, "sticker_display_height"); + __publicField(this, "purchase_amount"); + __publicField(this, "menu_endpoint"); + __publicField(this, "context_menu"); + __publicField(this, "context_menu_accessibility_label"); + __publicField(this, "timestamp"); + __publicField(this, "timestamp_usec"); + __publicField(this, "is_v2_style"); + this.id = data.id; + this.author = new Author(data.authorName, data.authorBadges, data.authorPhoto, data.authorExternalChannelId); + this.money_chip_background_color = data.moneyChipBackgroundColor; + this.money_chip_text_color = data.moneyChipTextColor; + this.background_color = data.backgroundColor; + this.author_name_text_color = data.authorNameTextColor; + this.sticker = Thumbnail.fromResponse(data.sticker); + this.sticker_accessibility_label = data.sticker.accessibility.accessibilityData.label; + this.sticker_display_width = data.stickerDisplayWidth; + this.sticker_display_height = data.stickerDisplayHeight; + this.purchase_amount = new Text2(data.purchaseAmountText).toString(); + this.menu_endpoint = new NavigationEndpoint(data.contextMenuEndpoint); + this.context_menu = this.menu_endpoint; + this.context_menu_accessibility_label = data.contextMenuAccessibility.accessibilityData.label; + this.timestamp = Math.floor(parseInt(data.timestampUsec) / 1e3); + this.timestamp_usec = data.timestampUsec; + this.is_v2_style = data.isV2Style; + } +}; +__name(_LiveChatPaidSticker, "LiveChatPaidSticker"); +__publicField(_LiveChatPaidSticker, "type", "LiveChatPaidSticker"); +var LiveChatPaidSticker = _LiveChatPaidSticker; + +// dist/src/parser/classes/livechat/items/LiveChatPlaceholderItem.js +var _LiveChatPlaceholderItem = class _LiveChatPlaceholderItem extends YTNode { + constructor(data) { + super(); + __publicField(this, "id"); + __publicField(this, "timestamp"); + this.id = data.id; + this.timestamp = Math.floor(parseInt(data.timestampUsec) / 1e3); + } +}; +__name(_LiveChatPlaceholderItem, "LiveChatPlaceholderItem"); +__publicField(_LiveChatPlaceholderItem, "type", "LiveChatPlaceholderItem"); +var LiveChatPlaceholderItem = _LiveChatPlaceholderItem; + +// dist/src/parser/classes/livechat/items/LiveChatProductItem.js +var _LiveChatProductItem = class _LiveChatProductItem extends YTNode { + constructor(data) { + super(); + __publicField(this, "title"); + __publicField(this, "accessibility_title"); + __publicField(this, "thumbnail"); + __publicField(this, "price"); + __publicField(this, "vendor_name"); + __publicField(this, "from_vendor_text"); + __publicField(this, "information_button"); + __publicField(this, "endpoint"); + __publicField(this, "creator_message"); + __publicField(this, "creator_name"); + __publicField(this, "author_photo"); + __publicField(this, "information_dialog"); + __publicField(this, "is_verified"); + __publicField(this, "creator_custom_message"); + this.title = data.title; + this.accessibility_title = data.accessibilityTitle; + this.thumbnail = Thumbnail.fromResponse(data.thumbnail); + this.price = data.price; + this.vendor_name = data.vendorName; + this.from_vendor_text = data.fromVendorText; + this.information_button = parser_exports.parseItem(data.informationButton); + this.endpoint = new NavigationEndpoint(data.onClickCommand); + this.creator_message = data.creatorMessage; + this.creator_name = data.creatorName; + this.author_photo = Thumbnail.fromResponse(data.authorPhoto); + this.information_dialog = parser_exports.parseItem(data.informationDialog); + this.is_verified = data.isVerified; + this.creator_custom_message = new Text2(data.creatorCustomMessage); + } +}; +__name(_LiveChatProductItem, "LiveChatProductItem"); +__publicField(_LiveChatProductItem, "type", "LiveChatProductItem"); +var LiveChatProductItem = _LiveChatProductItem; + +// dist/src/parser/classes/livechat/items/LiveChatRestrictedParticipation.js +var _LiveChatRestrictedParticipation = class _LiveChatRestrictedParticipation extends YTNode { + constructor(data) { + super(); + __publicField(this, "message"); + __publicField(this, "icon_type"); + this.message = new Text2(data.message); + if (Reflect.has(data, "icon") && Reflect.has(data.icon, "iconType")) { + this.icon_type = data.icon.iconType; + } + } +}; +__name(_LiveChatRestrictedParticipation, "LiveChatRestrictedParticipation"); +__publicField(_LiveChatRestrictedParticipation, "type", "LiveChatRestrictedParticipation"); +var LiveChatRestrictedParticipation = _LiveChatRestrictedParticipation; + +// dist/src/parser/classes/LiveChatAuthorBadge.js +var _LiveChatAuthorBadge = class _LiveChatAuthorBadge extends MetadataBadge { + constructor(data) { + super(data); + __publicField(this, "custom_thumbnail"); + this.custom_thumbnail = Thumbnail.fromResponse(data.customThumbnail); + } +}; +__name(_LiveChatAuthorBadge, "LiveChatAuthorBadge"); +__publicField(_LiveChatAuthorBadge, "type", "LiveChatAuthorBadge"); +var LiveChatAuthorBadge = _LiveChatAuthorBadge; + +// dist/src/parser/classes/livechat/items/LiveChatSponsorshipsHeader.js +var _LiveChatSponsorshipsHeader = class _LiveChatSponsorshipsHeader extends YTNode { + constructor(data) { + super(); + __publicField(this, "author_name"); + __publicField(this, "author_photo"); + __publicField(this, "author_badges"); + __publicField(this, "primary_text"); + __publicField(this, "menu_endpoint"); + __publicField(this, "context_menu_accessibility_label"); + __publicField(this, "image"); + this.author_name = new Text2(data.authorName); + this.author_photo = Thumbnail.fromResponse(data.authorPhoto); + this.author_badges = parser_exports.parseArray(data.authorBadges, LiveChatAuthorBadge); + this.primary_text = new Text2(data.primaryText); + this.menu_endpoint = new NavigationEndpoint(data.contextMenuEndpoint); + this.context_menu_accessibility_label = data.contextMenuAccessibility.accessibilityData.label; + this.image = Thumbnail.fromResponse(data.image); + } +}; +__name(_LiveChatSponsorshipsHeader, "LiveChatSponsorshipsHeader"); +__publicField(_LiveChatSponsorshipsHeader, "type", "LiveChatSponsorshipsHeader"); +var LiveChatSponsorshipsHeader = _LiveChatSponsorshipsHeader; + +// dist/src/parser/classes/livechat/items/LiveChatSponsorshipsGiftPurchaseAnnouncement.js +var _LiveChatSponsorshipsGiftPurchaseAnnouncement = class _LiveChatSponsorshipsGiftPurchaseAnnouncement extends YTNode { + constructor(data) { + super(); + __publicField(this, "id"); + __publicField(this, "timestamp_usec"); + __publicField(this, "author_external_channel_id"); + __publicField(this, "header"); + this.id = data.id; + this.timestamp_usec = data.timestampUsec; + this.author_external_channel_id = data.authorExternalChannelId; + this.header = parser_exports.parseItem(data.header, LiveChatSponsorshipsHeader); + } +}; +__name(_LiveChatSponsorshipsGiftPurchaseAnnouncement, "LiveChatSponsorshipsGiftPurchaseAnnouncement"); +__publicField(_LiveChatSponsorshipsGiftPurchaseAnnouncement, "type", "LiveChatSponsorshipsGiftPurchaseAnnouncement"); +var LiveChatSponsorshipsGiftPurchaseAnnouncement = _LiveChatSponsorshipsGiftPurchaseAnnouncement; + +// dist/src/parser/classes/livechat/items/LiveChatSponsorshipsGiftRedemptionAnnouncement.js +var _LiveChatSponsorshipsGiftRedemptionAnnouncement = class _LiveChatSponsorshipsGiftRedemptionAnnouncement extends YTNode { + constructor(data) { + super(); + __publicField(this, "id"); + __publicField(this, "timestamp_usec"); + __publicField(this, "timestamp_text"); + __publicField(this, "author"); + __publicField(this, "message"); + __publicField(this, "menu_endpoint"); + __publicField(this, "context_menu_accessibility_label"); + this.id = data.id; + this.timestamp_usec = data.timestampUsec; + this.timestamp_text = new Text2(data.timestampText); + this.author = new Author(data.authorName, data.authorBadges, data.authorPhoto, data.authorExternalChannelId); + this.message = new Text2(data.message); + this.menu_endpoint = new NavigationEndpoint(data.contextMenuEndpoint); + this.context_menu_accessibility_label = data.contextMenuAccessibility.accessibilityData.label; + } +}; +__name(_LiveChatSponsorshipsGiftRedemptionAnnouncement, "LiveChatSponsorshipsGiftRedemptionAnnouncement"); +__publicField(_LiveChatSponsorshipsGiftRedemptionAnnouncement, "type", "LiveChatSponsorshipsGiftRedemptionAnnouncement"); +var LiveChatSponsorshipsGiftRedemptionAnnouncement = _LiveChatSponsorshipsGiftRedemptionAnnouncement; + +// dist/src/parser/classes/livechat/items/LiveChatTextMessage.js +var _LiveChatTextMessage = class _LiveChatTextMessage extends YTNode { + constructor(data) { + super(); + __publicField(this, "id"); + __publicField(this, "message"); + __publicField(this, "inline_action_buttons"); + __publicField(this, "timestamp"); + __publicField(this, "timestamp_usec"); + __publicField(this, "timestamp_text"); + __publicField(this, "author"); + __publicField(this, "menu_endpoint"); + __publicField(this, "context_menu_accessibility_label"); + __publicField(this, "before_content_buttons"); + this.id = data.id; + this.message = new Text2(data.message); + this.inline_action_buttons = parser_exports.parseArray(data.inlineActionButtons, Button); + this.timestamp = Math.floor(parseInt(data.timestampUsec) / 1e3); + this.timestamp_usec = data.timestampUsec; + if (Reflect.has(data, "timestampText")) { + this.timestamp_text = new Text2(data.timestampText).toString(); + } + this.author = new Author(data.authorName, data.authorBadges, data.authorPhoto, data.authorExternalChannelId); + if (Reflect.has(data, "contextMenuEndpoint")) { + this.menu_endpoint = new NavigationEndpoint(data.contextMenuEndpoint); + } + if (Reflect.has(data, "contextMenuAccessibility") && Reflect.has(data.contextMenuAccessibility, "accessibilityData") && Reflect.has(data.contextMenuAccessibility.accessibilityData, "label")) { + this.context_menu_accessibility_label = data.contextMenuAccessibility.accessibilityData.label; + } + this.before_content_buttons = parser_exports.parseArray(data.beforeContentButtons, ButtonView); + } +}; +__name(_LiveChatTextMessage, "LiveChatTextMessage"); +__publicField(_LiveChatTextMessage, "type", "LiveChatTextMessage"); +var LiveChatTextMessage = _LiveChatTextMessage; + +// dist/src/parser/classes/livechat/items/LiveChatTickerPaidMessageItem.js +var _LiveChatTickerPaidMessageItem = class _LiveChatTickerPaidMessageItem extends YTNode { + constructor(data) { + var _a, _b; + super(); + __publicField(this, "id"); + __publicField(this, "author"); + __publicField(this, "amount"); + __publicField(this, "amount_text_color"); + __publicField(this, "start_background_color"); + __publicField(this, "end_background_color"); + __publicField(this, "duration_sec"); + __publicField(this, "full_duration_sec"); + __publicField(this, "show_item"); + __publicField(this, "show_item_endpoint"); + __publicField(this, "animation_origin"); + __publicField(this, "open_engagement_panel_command"); + this.id = data.id; + this.author = new Author(data.authorName || data.authorUsername, data.authorBadges, data.authorPhoto, data.authorExternalChannelId); + if (Reflect.has(data, "amount")) { + this.amount = new Text2(data.amount); + } + this.amount_text_color = data.amountTextColor; + this.start_background_color = data.startBackgroundColor; + this.end_background_color = data.endBackgroundColor; + this.duration_sec = data.durationSec; + this.full_duration_sec = data.fullDurationSec; + this.show_item = parser_exports.parseItem((_b = (_a = data.showItemEndpoint) == null ? void 0 : _a.showLiveChatItemEndpoint) == null ? void 0 : _b.renderer); + this.show_item_endpoint = new NavigationEndpoint(data.showItemEndpoint); + this.animation_origin = data.animationOrigin; + this.open_engagement_panel_command = new NavigationEndpoint(data.openEngagementPanelCommand); + } +}; +__name(_LiveChatTickerPaidMessageItem, "LiveChatTickerPaidMessageItem"); +__publicField(_LiveChatTickerPaidMessageItem, "type", "LiveChatTickerPaidMessageItem"); +var LiveChatTickerPaidMessageItem = _LiveChatTickerPaidMessageItem; + +// dist/src/parser/classes/livechat/items/LiveChatTickerPaidStickerItem.js +var _LiveChatTickerPaidStickerItem = class _LiveChatTickerPaidStickerItem extends YTNode { + constructor(data) { + var _a, _b; + super(); + __publicField(this, "id"); + __publicField(this, "author_external_channel_id"); + __publicField(this, "author_photo"); + __publicField(this, "start_background_color"); + __publicField(this, "end_background_color"); + __publicField(this, "duration_sec"); + __publicField(this, "full_duration_sec"); + __publicField(this, "show_item"); + __publicField(this, "show_item_endpoint"); + __publicField(this, "ticker_thumbnails"); + this.id = data.id; + this.author_external_channel_id = data.authorExternalChannelId; + this.author_photo = Thumbnail.fromResponse(data.authorPhoto); + this.start_background_color = data.startBackgroundColor; + this.end_background_color = data.endBackgroundColor; + this.duration_sec = data.durationSec; + this.full_duration_sec = data.fullDurationSec; + this.show_item = parser_exports.parseItem((_b = (_a = data.showItemEndpoint) == null ? void 0 : _a.showLiveChatItemEndpoint) == null ? void 0 : _b.renderer); + this.show_item_endpoint = new NavigationEndpoint(data.showItemEndpoint); + this.ticker_thumbnails = data.tickerThumbnails.map((item) => { + var _a2, _b2; + return { + thumbnails: Thumbnail.fromResponse(item), + label: (_b2 = (_a2 = item == null ? void 0 : item.accessibility) == null ? void 0 : _a2.accessibilityData) == null ? void 0 : _b2.label + }; + }); + } +}; +__name(_LiveChatTickerPaidStickerItem, "LiveChatTickerPaidStickerItem"); +__publicField(_LiveChatTickerPaidStickerItem, "type", "LiveChatTickerPaidStickerItem"); +var LiveChatTickerPaidStickerItem = _LiveChatTickerPaidStickerItem; + +// dist/src/parser/classes/livechat/items/LiveChatTickerSponsorItem.js +var _LiveChatTickerSponsorItem = class _LiveChatTickerSponsorItem extends YTNode { + constructor(data) { + super(); + __publicField(this, "id"); + __publicField(this, "detail"); + __publicField(this, "author"); + __publicField(this, "duration_sec"); + this.id = data.id; + this.detail = new Text2(data.detailText); + this.author = new Author(data.authorName, data.authorBadges, data.sponsorPhoto, data.authorExternalChannelId); + this.duration_sec = data.durationSec; + } +}; +__name(_LiveChatTickerSponsorItem, "LiveChatTickerSponsorItem"); +__publicField(_LiveChatTickerSponsorItem, "type", "LiveChatTickerSponsorItem"); +var LiveChatTickerSponsorItem = _LiveChatTickerSponsorItem; + +// dist/src/parser/classes/livechat/items/LiveChatViewerEngagementMessage.js +var _LiveChatViewerEngagementMessage = class _LiveChatViewerEngagementMessage extends YTNode { + constructor(data) { + super(); + __publicField(this, "id"); + __publicField(this, "timestamp"); + __publicField(this, "timestamp_usec"); + __publicField(this, "icon_type"); + __publicField(this, "message"); + __publicField(this, "action_button"); + __publicField(this, "menu_endpoint"); + __publicField(this, "context_menu_accessibility_label"); + this.id = data.id; + if (Reflect.has(data, "timestampUsec")) { + this.timestamp = Math.floor(parseInt(data.timestampUsec) / 1e3); + this.timestamp_usec = data.timestampUsec; + } + if (Reflect.has(data, "icon") && Reflect.has(data.icon, "iconType")) { + this.icon_type = data.icon.iconType; + } + this.message = new Text2(data.message); + this.action_button = parser_exports.parseItem(data.actionButton); + if (Reflect.has(data, "contextMenuEndpoint")) { + this.menu_endpoint = new NavigationEndpoint(data.contextMenuEndpoint); + } + if (Reflect.has(data, "contextMenuAccessibility") && Reflect.has(data.contextMenuAccessibility, "accessibilityData") && Reflect.has(data.contextMenuAccessibility.accessibilityData, "label")) { + this.context_menu_accessibility_label = data.contextMenuAccessibility.accessibilityData.label; + } + } +}; +__name(_LiveChatViewerEngagementMessage, "LiveChatViewerEngagementMessage"); +__publicField(_LiveChatViewerEngagementMessage, "type", "LiveChatViewerEngagementMessage"); +var LiveChatViewerEngagementMessage = _LiveChatViewerEngagementMessage; + +// dist/src/parser/classes/livechat/items/PollHeader.js +var _PollHeader = class _PollHeader extends YTNode { + constructor(data) { + super(); + __publicField(this, "poll_question"); + __publicField(this, "thumbnails"); + __publicField(this, "metadata"); + __publicField(this, "live_chat_poll_type"); + __publicField(this, "context_menu_button"); + this.poll_question = new Text2(data.pollQuestion); + this.thumbnails = Thumbnail.fromResponse(data.thumbnail); + this.metadata = new Text2(data.metadataText); + this.live_chat_poll_type = data.liveChatPollType; + this.context_menu_button = parser_exports.parseItem(data.contextMenuButton, Button); + } +}; +__name(_PollHeader, "PollHeader"); +__publicField(_PollHeader, "type", "PollHeader"); +var PollHeader = _PollHeader; + +// dist/src/parser/classes/livechat/LiveChatActionPanel.js +var _LiveChatActionPanel = class _LiveChatActionPanel extends YTNode { + constructor(data) { + super(); + __publicField(this, "id"); + __publicField(this, "contents"); + __publicField(this, "target_id"); + this.id = data.id; + this.contents = parser_exports.parse(data.contents); + this.target_id = data.targetId; + } +}; +__name(_LiveChatActionPanel, "LiveChatActionPanel"); +__publicField(_LiveChatActionPanel, "type", "LiveChatActionPanel"); +var LiveChatActionPanel = _LiveChatActionPanel; + +// dist/src/parser/classes/livechat/MarkChatItemAsDeletedAction.js +var _MarkChatItemAsDeletedAction = class _MarkChatItemAsDeletedAction extends YTNode { + constructor(data) { + super(); + __publicField(this, "deleted_state_message"); + __publicField(this, "target_item_id"); + this.deleted_state_message = new Text2(data.deletedStateMessage); + this.target_item_id = data.targetItemId; + } +}; +__name(_MarkChatItemAsDeletedAction, "MarkChatItemAsDeletedAction"); +__publicField(_MarkChatItemAsDeletedAction, "type", "MarkChatItemAsDeletedAction"); +var MarkChatItemAsDeletedAction = _MarkChatItemAsDeletedAction; + +// dist/src/parser/classes/livechat/MarkChatItemsByAuthorAsDeletedAction.js +var _MarkChatItemsByAuthorAsDeletedAction = class _MarkChatItemsByAuthorAsDeletedAction extends YTNode { + constructor(data) { + super(); + __publicField(this, "deleted_state_message"); + __publicField(this, "external_channel_id"); + this.deleted_state_message = new Text2(data.deletedStateMessage); + this.external_channel_id = data.externalChannelId; + } +}; +__name(_MarkChatItemsByAuthorAsDeletedAction, "MarkChatItemsByAuthorAsDeletedAction"); +__publicField(_MarkChatItemsByAuthorAsDeletedAction, "type", "MarkChatItemsByAuthorAsDeletedAction"); +var MarkChatItemsByAuthorAsDeletedAction = _MarkChatItemsByAuthorAsDeletedAction; + +// dist/src/parser/classes/livechat/RemoveBannerForLiveChatCommand.js +var _RemoveBannerForLiveChatCommand = class _RemoveBannerForLiveChatCommand extends YTNode { + constructor(data) { + super(); + __publicField(this, "target_action_id"); + this.target_action_id = data.targetActionId; + } +}; +__name(_RemoveBannerForLiveChatCommand, "RemoveBannerForLiveChatCommand"); +__publicField(_RemoveBannerForLiveChatCommand, "type", "RemoveBannerForLiveChatCommand"); +var RemoveBannerForLiveChatCommand = _RemoveBannerForLiveChatCommand; + +// dist/src/parser/classes/livechat/RemoveChatItemAction.js +var _RemoveChatItemAction = class _RemoveChatItemAction extends YTNode { + constructor(data) { + super(); + __publicField(this, "target_item_id"); + this.target_item_id = data.targetItemId; + } +}; +__name(_RemoveChatItemAction, "RemoveChatItemAction"); +__publicField(_RemoveChatItemAction, "type", "RemoveChatItemAction"); +var RemoveChatItemAction = _RemoveChatItemAction; + +// dist/src/parser/classes/livechat/RemoveChatItemByAuthorAction.js +var _RemoveChatItemByAuthorAction = class _RemoveChatItemByAuthorAction extends YTNode { + constructor(data) { + super(); + __publicField(this, "external_channel_id"); + this.external_channel_id = data.externalChannelId; + } +}; +__name(_RemoveChatItemByAuthorAction, "RemoveChatItemByAuthorAction"); +__publicField(_RemoveChatItemByAuthorAction, "type", "RemoveChatItemByAuthorAction"); +var RemoveChatItemByAuthorAction = _RemoveChatItemByAuthorAction; + +// dist/src/parser/classes/livechat/ReplaceChatItemAction.js +var _ReplaceChatItemAction = class _ReplaceChatItemAction extends YTNode { + constructor(data) { + super(); + __publicField(this, "target_item_id"); + __publicField(this, "replacement_item"); + this.target_item_id = data.targetItemId; + this.replacement_item = parser_exports.parseItem(data.replacementItem); + } +}; +__name(_ReplaceChatItemAction, "ReplaceChatItemAction"); +__publicField(_ReplaceChatItemAction, "type", "ReplaceChatItemAction"); +var ReplaceChatItemAction = _ReplaceChatItemAction; + +// dist/src/parser/classes/livechat/ReplaceLiveChatAction.js +var _ReplaceLiveChatAction = class _ReplaceLiveChatAction extends YTNode { + constructor(data) { + super(); + __publicField(this, "to_replace"); + __publicField(this, "replacement"); + this.to_replace = data.toReplace; + this.replacement = parser_exports.parseItem(data.replacement); + } +}; +__name(_ReplaceLiveChatAction, "ReplaceLiveChatAction"); +__publicField(_ReplaceLiveChatAction, "type", "ReplaceLiveChatAction"); +var ReplaceLiveChatAction = _ReplaceLiveChatAction; + +// dist/src/parser/classes/livechat/ReplayChatItemAction.js +var _ReplayChatItemAction = class _ReplayChatItemAction extends YTNode { + constructor(data) { + var _a; + super(); + __publicField(this, "actions"); + __publicField(this, "video_offset_time_msec"); + this.actions = parser_exports.parseArray((_a = data.actions) == null ? void 0 : _a.map((action) => { + delete action.clickTrackingParams; + return action; + })); + this.video_offset_time_msec = data.videoOffsetTimeMsec; + } +}; +__name(_ReplayChatItemAction, "ReplayChatItemAction"); +__publicField(_ReplayChatItemAction, "type", "ReplayChatItemAction"); +var ReplayChatItemAction = _ReplayChatItemAction; + +// dist/src/parser/classes/livechat/ShowLiveChatActionPanelAction.js +var _ShowLiveChatActionPanelAction = class _ShowLiveChatActionPanelAction extends YTNode { + constructor(data) { + super(); + __publicField(this, "panel_to_show"); + this.panel_to_show = parser_exports.parseItem(data.panelToShow, LiveChatActionPanel); + } +}; +__name(_ShowLiveChatActionPanelAction, "ShowLiveChatActionPanelAction"); +__publicField(_ShowLiveChatActionPanelAction, "type", "ShowLiveChatActionPanelAction"); +var ShowLiveChatActionPanelAction = _ShowLiveChatActionPanelAction; + +// dist/src/parser/classes/livechat/ShowLiveChatDialogAction.js +var _ShowLiveChatDialogAction = class _ShowLiveChatDialogAction extends YTNode { + constructor(data) { + super(); + __publicField(this, "dialog"); + this.dialog = parser_exports.parseItem(data.dialog); + } +}; +__name(_ShowLiveChatDialogAction, "ShowLiveChatDialogAction"); +__publicField(_ShowLiveChatDialogAction, "type", "ShowLiveChatDialogAction"); +var ShowLiveChatDialogAction = _ShowLiveChatDialogAction; + +// dist/src/parser/classes/livechat/ShowLiveChatTooltipCommand.js +var _ShowLiveChatTooltipCommand = class _ShowLiveChatTooltipCommand extends YTNode { + constructor(data) { + super(); + __publicField(this, "tooltip"); + this.tooltip = parser_exports.parseItem(data.tooltip); + } +}; +__name(_ShowLiveChatTooltipCommand, "ShowLiveChatTooltipCommand"); +__publicField(_ShowLiveChatTooltipCommand, "type", "ShowLiveChatTooltipCommand"); +var ShowLiveChatTooltipCommand = _ShowLiveChatTooltipCommand; + +// dist/src/parser/classes/livechat/UpdateDateTextAction.js +var _UpdateDateTextAction = class _UpdateDateTextAction extends YTNode { + constructor(data) { + super(); + __publicField(this, "date_text"); + this.date_text = new Text2(data.dateText).toString(); + } +}; +__name(_UpdateDateTextAction, "UpdateDateTextAction"); +__publicField(_UpdateDateTextAction, "type", "UpdateDateTextAction"); +var UpdateDateTextAction = _UpdateDateTextAction; + +// dist/src/parser/classes/livechat/UpdateDescriptionAction.js +var _UpdateDescriptionAction = class _UpdateDescriptionAction extends YTNode { + constructor(data) { + super(); + __publicField(this, "description"); + this.description = new Text2(data.description); + } +}; +__name(_UpdateDescriptionAction, "UpdateDescriptionAction"); +__publicField(_UpdateDescriptionAction, "type", "UpdateDescriptionAction"); +var UpdateDescriptionAction = _UpdateDescriptionAction; + +// dist/src/parser/classes/livechat/UpdateLiveChatPollAction.js +var _UpdateLiveChatPollAction = class _UpdateLiveChatPollAction extends YTNode { + constructor(data) { + super(); + __publicField(this, "poll_to_update"); + this.poll_to_update = parser_exports.parseItem(data.pollToUpdate); + } +}; +__name(_UpdateLiveChatPollAction, "UpdateLiveChatPollAction"); +__publicField(_UpdateLiveChatPollAction, "type", "UpdateLiveChatPollAction"); +var UpdateLiveChatPollAction = _UpdateLiveChatPollAction; + +// dist/src/parser/classes/livechat/UpdateTitleAction.js +var _UpdateTitleAction = class _UpdateTitleAction extends YTNode { + constructor(data) { + super(); + __publicField(this, "title"); + this.title = new Text2(data.title); + } +}; +__name(_UpdateTitleAction, "UpdateTitleAction"); +__publicField(_UpdateTitleAction, "type", "UpdateTitleAction"); +var UpdateTitleAction = _UpdateTitleAction; + +// dist/src/parser/classes/livechat/UpdateToggleButtonTextAction.js +var _UpdateToggleButtonTextAction = class _UpdateToggleButtonTextAction extends YTNode { + constructor(data) { + super(); + __publicField(this, "default_text"); + __publicField(this, "toggled_text"); + __publicField(this, "button_id"); + this.default_text = new Text2(data.defaultText).toString(); + this.toggled_text = new Text2(data.toggledText).toString(); + this.button_id = data.buttonId; + } +}; +__name(_UpdateToggleButtonTextAction, "UpdateToggleButtonTextAction"); +__publicField(_UpdateToggleButtonTextAction, "type", "UpdateToggleButtonTextAction"); +var UpdateToggleButtonTextAction = _UpdateToggleButtonTextAction; + +// dist/src/parser/classes/VideoViewCount.js +var _VideoViewCount = class _VideoViewCount extends YTNode { + constructor(data) { + super(); + __publicField(this, "original_view_count"); + __publicField(this, "unlabeled_view_count_value"); + __publicField(this, "short_view_count"); + __publicField(this, "extra_short_view_count"); + __publicField(this, "view_count"); + __publicField(this, "is_live"); + if ("originalViewCount" in data) { + this.original_view_count = parseInt(data.originalViewCount); + } + if ("unlabeledViewCountValue" in data) { + this.unlabeled_view_count_value = new Text2(data.unlabeledViewCountValue); + } + if ("shortViewCount" in data) { + this.short_view_count = new Text2(data.shortViewCount); + } + if ("extraShortViewCount" in data) { + this.extra_short_view_count = new Text2(data.extraShortViewCount); + } + if ("viewCount" in data) { + this.view_count = new Text2(data.viewCount); + } + this.is_live = !!data.isLive; + } +}; +__name(_VideoViewCount, "VideoViewCount"); +__publicField(_VideoViewCount, "type", "VideoViewCount"); +var VideoViewCount = _VideoViewCount; + +// dist/src/parser/classes/livechat/UpdateViewershipAction.js +var _UpdateViewershipAction = class _UpdateViewershipAction extends YTNode { + constructor(data) { + super(); + __publicField(this, "view_count_node"); + this.view_count_node = parser_exports.parseItem(data.viewCount, VideoViewCount); + } + /** + * @deprecated Use `view_count_node.view_count` instead. + */ + get view_count() { + var _a; + return (_a = this.view_count_node) == null ? void 0 : _a.view_count; + } + /** + * @deprecated Use `view_count_node.extra_short_view_count` instead. + */ + get extra_short_view_count() { + var _a; + return (_a = this.view_count_node) == null ? void 0 : _a.extra_short_view_count; + } + /** + * @deprecated Use `view_count_node.short_view_count` instead. + */ + get short_view_count() { + var _a; + return (_a = this.view_count_node) == null ? void 0 : _a.short_view_count; + } + /** + * @deprecated Use `view_count_node.original_view_count` instead. + */ + get original_view_count() { + var _a; + return (_a = this.view_count_node) == null ? void 0 : _a.original_view_count; + } + /** + * @deprecated Use `view_count_node.unlabeled_view_count_value` instead. + */ + get unlabeled_view_count_value() { + var _a; + return (_a = this.view_count_node) == null ? void 0 : _a.unlabeled_view_count_value; + } + /** + * @deprecated Use `view_count_node.is_live` instead. + */ + get is_live() { + var _a; + return (_a = this.view_count_node) == null ? void 0 : _a.is_live; + } +}; +__name(_UpdateViewershipAction, "UpdateViewershipAction"); +__publicField(_UpdateViewershipAction, "type", "UpdateViewershipAction"); +var UpdateViewershipAction = _UpdateViewershipAction; + +// dist/src/parser/classes/LiveChatDialog.js +var _LiveChatDialog = class _LiveChatDialog extends YTNode { + constructor(data) { + super(); + __publicField(this, "confirm_button"); + __publicField(this, "dialog_messages"); + this.confirm_button = parser_exports.parseItem(data.confirmButton, Button); + this.dialog_messages = data.dialogMessages.map((el) => new Text2(el)); + } +}; +__name(_LiveChatDialog, "LiveChatDialog"); +__publicField(_LiveChatDialog, "type", "LiveChatDialog"); +var LiveChatDialog = _LiveChatDialog; + +// dist/src/parser/classes/LiveChatHeader.js +var _LiveChatHeader = class _LiveChatHeader extends YTNode { + constructor(data) { + super(); + __publicField(this, "overflow_menu"); + __publicField(this, "collapse_button"); + __publicField(this, "view_selector"); + this.overflow_menu = parser_exports.parseItem(data.overflowMenu, Menu); + this.collapse_button = parser_exports.parseItem(data.collapseButton, Button); + this.view_selector = parser_exports.parseItem(data.viewSelector, SortFilterSubMenu); + } +}; +__name(_LiveChatHeader, "LiveChatHeader"); +__publicField(_LiveChatHeader, "type", "LiveChatHeader"); +var LiveChatHeader = _LiveChatHeader; + +// dist/src/parser/classes/LiveChatItemList.js +var _LiveChatItemList = class _LiveChatItemList extends YTNode { + constructor(data) { + super(); + __publicField(this, "max_items_to_display"); + __publicField(this, "more_comments_below_button"); + this.max_items_to_display = data.maxItemsToDisplay; + this.more_comments_below_button = parser_exports.parseItem(data.moreCommentsBelowButton, Button); + } +}; +__name(_LiveChatItemList, "LiveChatItemList"); +__publicField(_LiveChatItemList, "type", "LiveChatItemList"); +var LiveChatItemList = _LiveChatItemList; + +// dist/src/parser/classes/LiveChatMessageInput.js +var _LiveChatMessageInput = class _LiveChatMessageInput extends YTNode { + constructor(data) { + super(); + __publicField(this, "author_name"); + __publicField(this, "author_photo"); + __publicField(this, "send_button"); + __publicField(this, "target_id"); + this.author_name = new Text2(data.authorName); + this.author_photo = Thumbnail.fromResponse(data.authorPhoto); + this.send_button = parser_exports.parseItem(data.sendButton, Button); + this.target_id = data.targetId; + } +}; +__name(_LiveChatMessageInput, "LiveChatMessageInput"); +__publicField(_LiveChatMessageInput, "type", "LiveChatMessageInput"); +var LiveChatMessageInput = _LiveChatMessageInput; + +// dist/src/parser/classes/LiveChatParticipant.js +var _LiveChatParticipant = class _LiveChatParticipant extends YTNode { + constructor(data) { + super(); + __publicField(this, "name"); + __publicField(this, "photo"); + __publicField(this, "badges"); + this.name = new Text2(data.authorName); + this.photo = Thumbnail.fromResponse(data.authorPhoto); + this.badges = parser_exports.parseArray(data.authorBadges); + } +}; +__name(_LiveChatParticipant, "LiveChatParticipant"); +__publicField(_LiveChatParticipant, "type", "LiveChatParticipant"); +var LiveChatParticipant = _LiveChatParticipant; + +// dist/src/parser/classes/LiveChatParticipantsList.js +var _LiveChatParticipantsList = class _LiveChatParticipantsList extends YTNode { + constructor(data) { + super(); + __publicField(this, "title"); + __publicField(this, "participants"); + this.title = new Text2(data.title); + this.participants = parser_exports.parseArray(data.participants, LiveChatParticipant); + } +}; +__name(_LiveChatParticipantsList, "LiveChatParticipantsList"); +__publicField(_LiveChatParticipantsList, "type", "LiveChatParticipantsList"); +var LiveChatParticipantsList = _LiveChatParticipantsList; + +// dist/src/parser/classes/LockupMetadataView.js +var _LockupMetadataView = class _LockupMetadataView extends YTNode { + constructor(data) { + super(); + __publicField(this, "title"); + __publicField(this, "metadata"); + __publicField(this, "image"); + __publicField(this, "menu_button"); + this.title = Text2.fromAttributed(data.title); + this.metadata = parser_exports.parseItem(data.metadata, ContentMetadataView); + this.image = parser_exports.parseItem(data.image, [DecoratedAvatarView, AvatarStackView]); + this.menu_button = parser_exports.parseItem(data.menuButton, ButtonView); + } +}; +__name(_LockupMetadataView, "LockupMetadataView"); +__publicField(_LockupMetadataView, "type", "LockupMetadataView"); +var LockupMetadataView = _LockupMetadataView; + +// dist/src/parser/classes/LockupView.js +var _LockupView = class _LockupView extends YTNode { + constructor(data) { + super(); + __publicField(this, "content_image"); + __publicField(this, "metadata"); + __publicField(this, "content_id"); + __publicField(this, "content_type"); + __publicField(this, "renderer_context"); + this.content_image = parser_exports.parseItem(data.contentImage, [CollectionThumbnailView, ThumbnailView]); + this.metadata = parser_exports.parseItem(data.metadata, LockupMetadataView); + this.content_id = data.contentId; + this.content_type = data.contentType.replace("LOCKUP_CONTENT_TYPE_", ""); + this.renderer_context = new RendererContext(data.rendererContext); + } +}; +__name(_LockupView, "LockupView"); +__publicField(_LockupView, "type", "LockupView"); +var LockupView = _LockupView; + +// dist/src/parser/classes/MacroMarkersListEntity.js +var _MacroMarkersListEntity = class _MacroMarkersListEntity extends YTNode { + constructor(data) { + var _a, _b, _c, _d, _e, _f; + super(); + __publicField(this, "marker_entity_key"); + __publicField(this, "external_video_id"); + /** The type of markers in this entity (e.g., 'MARKER_TYPE_HEATMAP') */ + __publicField(this, "marker_type"); + __publicField(this, "markers"); + __publicField(this, "max_height_dp"); + __publicField(this, "min_height_dp"); + __publicField(this, "show_hide_animation_duration_millis"); + __publicField(this, "timed_marker_decorations"); + // Store raw API data for use in toHeatmap + __publicField(this, "raw_api_markers"); + __publicField(this, "raw_api_decorations"); + this.marker_entity_key = data.key; + this.external_video_id = data.externalVideoId; + this.marker_type = ((_a = data.markersList) == null ? void 0 : _a.markerType) || ""; + this.raw_api_markers = ((_b = data.markersList) == null ? void 0 : _b.markers) || []; + this.raw_api_decorations = ((_d = (_c = data.markersList) == null ? void 0 : _c.markersDecoration) == null ? void 0 : _d.timedMarkerDecorations) || []; + this.markers = observe(this.raw_api_markers.map((marker) => new HeatMarker(marker))); + const heatmapMetadata = (_f = (_e = data.markersList) == null ? void 0 : _e.markersMetadata) == null ? void 0 : _f.heatmapMetadata; + this.max_height_dp = (heatmapMetadata == null ? void 0 : heatmapMetadata.maxHeightDp) || 40; + this.min_height_dp = (heatmapMetadata == null ? void 0 : heatmapMetadata.minHeightDp) || 4; + this.show_hide_animation_duration_millis = (heatmapMetadata == null ? void 0 : heatmapMetadata.showHideAnimationDurationMillis) || 200; + this.timed_marker_decorations = observe(this.raw_api_decorations.map((decoration) => new TimedMarkerDecoration(decoration))); + } + /** + * Checks if this MacroMarkersListEntity represents heatmap data. + * Only heatmap markers can be converted to Heatmap objects. + */ + isHeatmap() { + return this.marker_type === "MARKER_TYPE_HEATMAP"; + } + /** + * Converts this MacroMarkersListEntity to a Heatmap object + * for compatibility with existing code. Only works for heatmap markers. + * @returns Heatmap object if this entity contains heatmap data, null otherwise + */ + toHeatmap() { + if (!this.isHeatmap()) { + return null; + } + const wrappedHeatMarkers = this.raw_api_markers.map((marker) => ({ HeatMarker: marker })); + const wrappedDecorations = this.raw_api_decorations.map((decoration) => ({ TimedMarkerDecoration: decoration })); + const heatmapRawPayload = { + maxHeightDp: this.max_height_dp, + minHeightDp: this.min_height_dp, + showHideAnimationDurationMillis: this.show_hide_animation_duration_millis, + heatMarkers: wrappedHeatMarkers, + heatMarkersDecorations: wrappedDecorations + }; + return parseItem({ Heatmap: heatmapRawPayload }, Heatmap); + } +}; +__name(_MacroMarkersListEntity, "MacroMarkersListEntity"); +__publicField(_MacroMarkersListEntity, "type", "MacroMarkersListEntity"); +var MacroMarkersListEntity = _MacroMarkersListEntity; + +// dist/src/parser/classes/menus/MenuNavigationItem.js +var _MenuNavigationItem = class _MenuNavigationItem extends Button { + constructor(data) { + super(data); + } +}; +__name(_MenuNavigationItem, "MenuNavigationItem"); +__publicField(_MenuNavigationItem, "type", "MenuNavigationItem"); +var MenuNavigationItem = _MenuNavigationItem; + +// dist/src/parser/classes/menus/MenuPopup.js +var _MenuPopup = class _MenuPopup extends YTNode { + constructor(data) { + super(); + __publicField(this, "items"); + this.items = parser_exports.parseArray(data.items, [MenuNavigationItem, MenuServiceItem]); + } +}; +__name(_MenuPopup, "MenuPopup"); +__publicField(_MenuPopup, "type", "MenuPopup"); +var MenuPopup = _MenuPopup; + +// dist/src/parser/classes/Notification.js +var _Notification = class _Notification extends YTNode { + constructor(data) { + super(); + __publicField(this, "thumbnails"); + __publicField(this, "video_thumbnails"); + __publicField(this, "short_message"); + __publicField(this, "sent_time"); + __publicField(this, "notification_id"); + __publicField(this, "endpoint"); + __publicField(this, "record_click_endpoint"); + __publicField(this, "menu"); + __publicField(this, "read"); + this.thumbnails = Thumbnail.fromResponse(data.thumbnail); + this.video_thumbnails = Thumbnail.fromResponse(data.videoThumbnail); + this.short_message = new Text2(data.shortMessage); + this.sent_time = new Text2(data.sentTimeText); + this.notification_id = data.notificationId; + this.endpoint = new NavigationEndpoint(data.navigationEndpoint); + this.record_click_endpoint = new NavigationEndpoint(data.recordClickEndpoint); + this.menu = parser_exports.parseItem(data.contextualMenu); + this.read = data.read; + } +}; +__name(_Notification, "Notification"); +__publicField(_Notification, "type", "Notification"); +var Notification = _Notification; + +// dist/src/parser/classes/menus/MultiPageMenuNotificationSection.js +var _MultiPageMenuNotificationSection = class _MultiPageMenuNotificationSection extends YTNode { + constructor(data) { + super(); + __publicField(this, "notification_section_title"); + __publicField(this, "items"); + if ("notificationSectionTitle" in data) { + this.notification_section_title = new Text2(data.notificationSectionTitle); + } + this.items = parser_exports.parseArray(data.items, [Notification, Message, ContinuationItem]); + } + // XXX: Alias for consistency. + get contents() { + return this.items; + } +}; +__name(_MultiPageMenuNotificationSection, "MultiPageMenuNotificationSection"); +__publicField(_MultiPageMenuNotificationSection, "type", "MultiPageMenuNotificationSection"); +var MultiPageMenuNotificationSection = _MultiPageMenuNotificationSection; + +// dist/src/parser/classes/menus/MusicMenuItemDivider.js +var _MusicMenuItemDivider = class _MusicMenuItemDivider extends YTNode { + constructor(_data23) { + super(); + } +}; +__name(_MusicMenuItemDivider, "MusicMenuItemDivider"); +__publicField(_MusicMenuItemDivider, "type", "MusicMenuItemDivider"); +var MusicMenuItemDivider = _MusicMenuItemDivider; + +// dist/src/parser/classes/menus/MusicMultiSelectMenuItem.js +var _MusicMultiSelectMenuItem = class _MusicMultiSelectMenuItem extends YTNode { + constructor(data) { + super(); + __publicField(this, "title"); + __publicField(this, "form_item_entity_key"); + __publicField(this, "selected_icon_type"); + __publicField(this, "endpoint"); + __publicField(this, "selected"); + this.title = new Text2(data.title).toString(); + this.form_item_entity_key = data.formItemEntityKey; + if (Reflect.has(data, "selectedIcon")) { + this.selected_icon_type = data.selectedIcon.iconType; + } + if (Reflect.has(data, "selectedCommand")) { + this.endpoint = new NavigationEndpoint(data.selectedCommand); + } + this.selected = !!this.endpoint; + } +}; +__name(_MusicMultiSelectMenuItem, "MusicMultiSelectMenuItem"); +__publicField(_MusicMultiSelectMenuItem, "type", "MusicMultiSelectMenuItem"); +var MusicMultiSelectMenuItem = _MusicMultiSelectMenuItem; + +// dist/src/parser/classes/menus/MusicMultiSelectMenu.js +var _MusicMultiSelectMenu = class _MusicMultiSelectMenu extends YTNode { + constructor(data) { + var _a; + super(); + __publicField(this, "title"); + __publicField(this, "options"); + if (Reflect.has(data, "title") && Reflect.has(data.title, "musicMenuTitleRenderer")) { + this.title = new Text2((_a = data.title.musicMenuTitleRenderer) == null ? void 0 : _a.primaryText); + } + this.options = parser_exports.parseArray(data.options, [MusicMultiSelectMenuItem, MusicMenuItemDivider]); + } +}; +__name(_MusicMultiSelectMenu, "MusicMultiSelectMenu"); +__publicField(_MusicMultiSelectMenu, "type", "MusicMultiSelectMenu"); +var MusicMultiSelectMenu = _MusicMultiSelectMenu; + +// dist/src/parser/classes/menus/SimpleMenuHeader.js +var _SimpleMenuHeader = class _SimpleMenuHeader extends YTNode { + constructor(data) { + super(); + __publicField(this, "title"); + __publicField(this, "buttons"); + this.title = new Text2(data.title); + this.buttons = parser_exports.parseArray(data.buttons, Button); + } +}; +__name(_SimpleMenuHeader, "SimpleMenuHeader"); +__publicField(_SimpleMenuHeader, "type", "SimpleMenuHeader"); +var SimpleMenuHeader = _SimpleMenuHeader; + +// dist/src/parser/classes/MerchandiseItem.js +var _MerchandiseItem = class _MerchandiseItem extends YTNode { + constructor(data) { + super(); + __publicField(this, "title"); + __publicField(this, "description"); + __publicField(this, "thumbnails"); + __publicField(this, "price"); + __publicField(this, "vendor_name"); + __publicField(this, "button_text"); + __publicField(this, "button_accessibility_text"); + __publicField(this, "from_vendor_text"); + __publicField(this, "additional_fees_text"); + __publicField(this, "region_format"); + __publicField(this, "endpoint"); + this.title = data.title; + this.description = data.description; + this.thumbnails = Thumbnail.fromResponse(data.thumbnail); + this.price = data.price; + this.vendor_name = data.vendorName; + this.button_text = data.buttonText; + this.button_accessibility_text = data.buttonAccessibilityText; + this.from_vendor_text = data.fromVendorText; + this.additional_fees_text = data.additionalFeesText; + this.region_format = data.regionFormat; + this.endpoint = new NavigationEndpoint(data.buttonCommand); + } +}; +__name(_MerchandiseItem, "MerchandiseItem"); +__publicField(_MerchandiseItem, "type", "MerchandiseItem"); +var MerchandiseItem = _MerchandiseItem; + +// dist/src/parser/classes/MetadataRow.js +var _MetadataRow = class _MetadataRow extends YTNode { + constructor(data) { + super(); + __publicField(this, "title"); + __publicField(this, "contents"); + this.title = new Text2(data.title); + this.contents = data.contents.map((content) => new Text2(content)); + } +}; +__name(_MetadataRow, "MetadataRow"); +__publicField(_MetadataRow, "type", "MetadataRow"); +var MetadataRow = _MetadataRow; + +// dist/src/parser/classes/MetadataRowContainer.js +var _MetadataRowContainer = class _MetadataRowContainer extends YTNode { + constructor(data) { + super(); + __publicField(this, "rows"); + __publicField(this, "collapsed_item_count"); + this.rows = parser_exports.parseArray(data.rows); + this.collapsed_item_count = data.collapsedItemCount; + } +}; +__name(_MetadataRowContainer, "MetadataRowContainer"); +__publicField(_MetadataRowContainer, "type", "MetadataRowContainer"); +var MetadataRowContainer = _MetadataRowContainer; + +// dist/src/parser/classes/MetadataRowHeader.js +var _MetadataRowHeader = class _MetadataRowHeader extends YTNode { + constructor(data) { + super(); + __publicField(this, "content"); + __publicField(this, "has_divider_line"); + this.content = new Text2(data.content); + this.has_divider_line = data.hasDividerLine; + } +}; +__name(_MetadataRowHeader, "MetadataRowHeader"); +__publicField(_MetadataRowHeader, "type", "MetadataRowHeader"); +var MetadataRowHeader = _MetadataRowHeader; + +// dist/src/parser/classes/MetadataScreen.js +var _MetadataScreen = class _MetadataScreen extends YTNode { + constructor(data) { + super(); + __publicField(this, "section_list"); + this.section_list = parser_exports.parseItem(data); + } +}; +__name(_MetadataScreen, "MetadataScreen"); +__publicField(_MetadataScreen, "type", "MetadataScreen"); +var MetadataScreen = _MetadataScreen; + +// dist/src/parser/classes/MicroformatData.js +var _MicroformatData = class _MicroformatData extends YTNode { + constructor(data) { + super(); + __publicField(this, "url_canonical"); + __publicField(this, "title"); + __publicField(this, "description"); + __publicField(this, "thumbnail"); + __publicField(this, "site_name"); + __publicField(this, "app_name"); + __publicField(this, "android_package"); + __publicField(this, "ios_app_store_id"); + __publicField(this, "ios_app_arguments"); + __publicField(this, "og_type"); + __publicField(this, "url_applinks_web"); + __publicField(this, "url_applinks_ios"); + __publicField(this, "url_applinks_android"); + __publicField(this, "url_twitter_ios"); + __publicField(this, "url_twitter_android"); + __publicField(this, "twitter_card_type"); + __publicField(this, "twitter_site_handle"); + __publicField(this, "schema_dot_org_type"); + __publicField(this, "noindex"); + __publicField(this, "is_unlisted"); + __publicField(this, "is_family_safe"); + __publicField(this, "tags"); + __publicField(this, "available_countries"); + this.url_canonical = data.urlCanonical; + this.title = data.title; + this.description = data.description; + this.thumbnail = Thumbnail.fromResponse(data.thumbnail); + this.site_name = data.siteName; + this.app_name = data.appName; + this.android_package = data.androidPackage; + this.ios_app_store_id = data.iosAppStoreId; + this.ios_app_arguments = data.iosAppArguments; + this.og_type = data.ogType; + this.url_applinks_web = data.urlApplinksWeb; + this.url_applinks_ios = data.urlApplinksIos; + this.url_applinks_android = data.urlApplinksAndroid; + this.url_twitter_ios = data.urlTwitterIos; + this.url_twitter_android = data.urlTwitterAndroid; + this.twitter_card_type = data.twitterCardType; + this.twitter_site_handle = data.twitterSiteHandle; + this.schema_dot_org_type = data.schemaDotOrgType; + this.noindex = data.noindex; + this.is_unlisted = data.unlisted; + this.is_family_safe = data.familySafe; + this.tags = data.tags; + this.available_countries = data.availableCountries; + } +}; +__name(_MicroformatData, "MicroformatData"); +__publicField(_MicroformatData, "type", "MicroformatData"); +var MicroformatData = _MicroformatData; + +// dist/src/parser/classes/Mix.js +var _Mix = class _Mix extends Playlist { + constructor(data) { + super(data); + } +}; +__name(_Mix, "Mix"); +__publicField(_Mix, "type", "Mix"); +var Mix = _Mix; + +// dist/src/parser/classes/ModalWithTitleAndButton.js +var _ModalWithTitleAndButton = class _ModalWithTitleAndButton extends YTNode { + constructor(data) { + super(); + __publicField(this, "title"); + __publicField(this, "content"); + __publicField(this, "button"); + this.title = new Text2(data.title); + this.content = new Text2(data.content); + this.button = parser_exports.parseItem(data.button, Button); + } +}; +__name(_ModalWithTitleAndButton, "ModalWithTitleAndButton"); +__publicField(_ModalWithTitleAndButton, "type", "ModalWithTitleAndButton"); +var ModalWithTitleAndButton = _ModalWithTitleAndButton; + +// dist/src/parser/classes/Movie.js +var _Movie = class _Movie extends YTNode { + constructor(data) { + var _a, _b, _c; + super(); + __publicField(this, "id"); + __publicField(this, "title"); + __publicField(this, "description_snippet"); + __publicField(this, "top_metadata_items"); + __publicField(this, "thumbnails"); + __publicField(this, "thumbnail_overlays"); + __publicField(this, "author"); + __publicField(this, "duration"); + __publicField(this, "endpoint"); + __publicField(this, "badges"); + __publicField(this, "use_vertical_poster"); + __publicField(this, "show_action_menu"); + __publicField(this, "menu"); + const overlay_time_status = ((_a = data.thumbnailOverlays.find((overlay) => overlay.thumbnailOverlayTimeStatusRenderer)) == null ? void 0 : _a.thumbnailOverlayTimeStatusRenderer.text) || "N/A"; + this.id = data.videoId; + this.title = new Text2(data.title); + if (Reflect.has(data, "descriptionSnippet")) { + this.description_snippet = new Text2(data.descriptionSnippet); + } + this.top_metadata_items = new Text2(data.topMetadataItems); + this.thumbnails = Thumbnail.fromResponse(data.thumbnail); + this.thumbnail_overlays = parser_exports.parseArray(data.thumbnailOverlays); + this.author = new Author(data.longBylineText, data.ownerBadges, (_c = (_b = data.channelThumbnailSupportedRenderers) == null ? void 0 : _b.channelThumbnailWithLinkRenderer) == null ? void 0 : _c.thumbnail); + this.duration = { + text: data.lengthText ? new Text2(data.lengthText).toString() : new Text2(overlay_time_status).toString(), + seconds: timeToSeconds(data.lengthText ? new Text2(data.lengthText).toString() : new Text2(overlay_time_status).toString()) + }; + this.endpoint = new NavigationEndpoint(data.navigationEndpoint); + this.badges = parser_exports.parseArray(data.badges); + this.use_vertical_poster = data.useVerticalPoster; + this.show_action_menu = data.showActionMenu; + this.menu = parser_exports.parseItem(data.menu, Menu); + } +}; +__name(_Movie, "Movie"); +__publicField(_Movie, "type", "Movie"); +var Movie = _Movie; + +// dist/src/parser/classes/MovingThumbnail.js +var _MovingThumbnail = class _MovingThumbnail extends YTNode { + constructor(data) { + var _a; + super(); + return (_a = data.movingThumbnailDetails) == null ? void 0 : _a.thumbnails.map((thumbnail) => new Thumbnail(thumbnail)).sort((a, b) => b.width - a.width); + } +}; +__name(_MovingThumbnail, "MovingThumbnail"); +__publicField(_MovingThumbnail, "type", "MovingThumbnail"); +var MovingThumbnail = _MovingThumbnail; + +// dist/src/parser/classes/MusicCardShelfHeaderBasic.js +var _MusicCardShelfHeaderBasic = class _MusicCardShelfHeaderBasic extends YTNode { + constructor(data) { + super(); + __publicField(this, "title"); + this.title = new Text2(data.title); + } +}; +__name(_MusicCardShelfHeaderBasic, "MusicCardShelfHeaderBasic"); +__publicField(_MusicCardShelfHeaderBasic, "type", "MusicCardShelfHeaderBasic"); +var MusicCardShelfHeaderBasic = _MusicCardShelfHeaderBasic; + +// dist/src/parser/classes/MusicInlineBadge.js +var _MusicInlineBadge = class _MusicInlineBadge extends YTNode { + constructor(data) { + super(); + __publicField(this, "icon_type"); + __publicField(this, "accessibility"); + this.icon_type = data.icon.iconType; + if ("accessibilityData" in data && "accessibilityData" in data.accessibilityData) { + this.accessibility = { + accessibility_data: new AccessibilityData(data.accessibilityData.accessibilityData) + }; + } + } + get label() { + var _a, _b; + return (_b = (_a = this.accessibility) == null ? void 0 : _a.accessibility_data) == null ? void 0 : _b.label; + } +}; +__name(_MusicInlineBadge, "MusicInlineBadge"); +__publicField(_MusicInlineBadge, "type", "MusicInlineBadge"); +var MusicInlineBadge = _MusicInlineBadge; + +// dist/src/parser/classes/MusicPlayButton.js +var _MusicPlayButton = class _MusicPlayButton extends YTNode { + constructor(data) { + super(); + __publicField(this, "endpoint"); + __publicField(this, "play_icon_type"); + __publicField(this, "pause_icon_type"); + __publicField(this, "icon_color"); + __publicField(this, "accessibility_play_data"); + __publicField(this, "accessibility_pause_data"); + this.endpoint = new NavigationEndpoint(data.playNavigationEndpoint); + this.play_icon_type = data.playIcon.iconType; + this.pause_icon_type = data.pauseIcon.iconType; + if ("accessibilityPlayData" in data && "accessibilityData" in data.accessibilityPlayData) { + this.accessibility_play_data = { + accessibility_data: new AccessibilityData(data.accessibilityPlayData.accessibilityData) + }; + } + if ("accessibilityPauseData" in data && "accessibilityData" in data.accessibilityPauseData) { + this.accessibility_pause_data = { + accessibility_data: new AccessibilityData(data.accessibilityPauseData.accessibilityData) + }; + } + this.icon_color = data.iconColor; + } + get play_label() { + var _a, _b; + return (_b = (_a = this.accessibility_play_data) == null ? void 0 : _a.accessibility_data) == null ? void 0 : _b.label; + } + get pause_label() { + var _a, _b; + return (_b = (_a = this.accessibility_pause_data) == null ? void 0 : _a.accessibility_data) == null ? void 0 : _b.label; + } +}; +__name(_MusicPlayButton, "MusicPlayButton"); +__publicField(_MusicPlayButton, "type", "MusicPlayButton"); +var MusicPlayButton = _MusicPlayButton; + +// dist/src/parser/classes/MusicItemThumbnailOverlay.js +var _MusicItemThumbnailOverlay = class _MusicItemThumbnailOverlay extends YTNode { + constructor(data) { + super(); + __publicField(this, "content"); + __publicField(this, "content_position"); + __publicField(this, "display_style"); + this.content = parser_exports.parseItem(data.content, MusicPlayButton); + this.content_position = data.contentPosition; + this.display_style = data.displayStyle; + } +}; +__name(_MusicItemThumbnailOverlay, "MusicItemThumbnailOverlay"); +__publicField(_MusicItemThumbnailOverlay, "type", "MusicItemThumbnailOverlay"); +var MusicItemThumbnailOverlay = _MusicItemThumbnailOverlay; + +// dist/src/parser/classes/MusicThumbnail.js +var _MusicThumbnail = class _MusicThumbnail extends YTNode { + constructor(data) { + super(); + __publicField(this, "contents"); + this.contents = Thumbnail.fromResponse(data.thumbnail); + } +}; +__name(_MusicThumbnail, "MusicThumbnail"); +__publicField(_MusicThumbnail, "type", "MusicThumbnail"); +var MusicThumbnail = _MusicThumbnail; + +// dist/src/parser/classes/MusicCardShelf.js +var _MusicCardShelf = class _MusicCardShelf extends YTNode { + constructor(data) { + super(); + __publicField(this, "thumbnail"); + __publicField(this, "title"); + __publicField(this, "subtitle"); + __publicField(this, "buttons"); + __publicField(this, "menu"); + __publicField(this, "on_tap"); + __publicField(this, "header"); + __publicField(this, "end_icon_type"); + __publicField(this, "subtitle_badges"); + __publicField(this, "thumbnail_overlay"); + __publicField(this, "contents"); + this.thumbnail = parser_exports.parseItem(data.thumbnail, MusicThumbnail); + this.title = new Text2(data.title); + this.subtitle = new Text2(data.subtitle); + this.buttons = parser_exports.parseArray(data.buttons, Button); + this.menu = parser_exports.parseItem(data.menu, Menu); + this.on_tap = new NavigationEndpoint(data.onTap); + this.header = parser_exports.parseItem(data.header, MusicCardShelfHeaderBasic); + if (Reflect.has(data, "endIcon") && Reflect.has(data.endIcon, "iconType")) { + this.end_icon_type = data.endIcon.iconType; + } + this.subtitle_badges = parser_exports.parseArray(data.subtitleBadges, MusicInlineBadge); + this.thumbnail_overlay = parser_exports.parseItem(data.thumbnailOverlay, MusicItemThumbnailOverlay); + if (Reflect.has(data, "contents")) { + this.contents = parser_exports.parseArray(data.contents); + } + } +}; +__name(_MusicCardShelf, "MusicCardShelf"); +__publicField(_MusicCardShelf, "type", "MusicCardShelf"); +var MusicCardShelf = _MusicCardShelf; + +// dist/src/parser/classes/MusicCarouselShelfBasicHeader.js +var _MusicCarouselShelfBasicHeader = class _MusicCarouselShelfBasicHeader extends YTNode { + constructor(data) { + super(); + __publicField(this, "title"); + __publicField(this, "strapline"); + __publicField(this, "thumbnail"); + __publicField(this, "more_content"); + __publicField(this, "end_icons"); + this.title = new Text2(data.title); + if (Reflect.has(data, "strapline")) { + this.strapline = new Text2(data.strapline); + } + if (Reflect.has(data, "thumbnail")) { + this.thumbnail = parser_exports.parseItem(data.thumbnail, MusicThumbnail); + } + if (Reflect.has(data, "moreContentButton")) { + this.more_content = parser_exports.parseItem(data.moreContentButton, Button); + } + if (Reflect.has(data, "endIcons")) { + this.end_icons = parser_exports.parseArray(data.endIcons, IconLink); + } + } +}; +__name(_MusicCarouselShelfBasicHeader, "MusicCarouselShelfBasicHeader"); +__publicField(_MusicCarouselShelfBasicHeader, "type", "MusicCarouselShelfBasicHeader"); +var MusicCarouselShelfBasicHeader = _MusicCarouselShelfBasicHeader; + +// dist/src/parser/classes/MusicMultiRowListItem.js +var _MusicMultiRowListItem = class _MusicMultiRowListItem extends YTNode { + constructor(data) { + super(); + __publicField(this, "thumbnail"); + __publicField(this, "overlay"); + __publicField(this, "on_tap"); + __publicField(this, "menu"); + __publicField(this, "subtitle"); + __publicField(this, "title"); + __publicField(this, "second_title"); + __publicField(this, "description"); + __publicField(this, "display_style"); + this.thumbnail = parser_exports.parseItem(data.thumbnail, MusicThumbnail); + this.overlay = parser_exports.parseItem(data.overlay, MusicItemThumbnailOverlay); + this.on_tap = new NavigationEndpoint(data.onTap); + this.menu = parser_exports.parseItem(data.menu, Menu); + this.subtitle = new Text2(data.subtitle); + this.title = new Text2(data.title); + if (Reflect.has(data, "secondTitle")) { + this.second_title = new Text2(data.secondTitle); + } + if (Reflect.has(data, "description")) { + this.description = new Text2(data.description); + } + if (Reflect.has(data, "displayStyle")) { + this.display_style = data.displayStyle; + } + } +}; +__name(_MusicMultiRowListItem, "MusicMultiRowListItem"); +__publicField(_MusicMultiRowListItem, "type", "MusicMultiRowListItem"); +var MusicMultiRowListItem = _MusicMultiRowListItem; + +// dist/src/parser/classes/MusicNavigationButton.js +var _MusicNavigationButton = class _MusicNavigationButton extends YTNode { + constructor(data) { + super(); + __publicField(this, "button_text"); + __publicField(this, "endpoint"); + this.button_text = new Text2(data.buttonText).toString(); + this.endpoint = new NavigationEndpoint(data.clickCommand); + } +}; +__name(_MusicNavigationButton, "MusicNavigationButton"); +__publicField(_MusicNavigationButton, "type", "MusicNavigationButton"); +var MusicNavigationButton = _MusicNavigationButton; + +// dist/src/parser/classes/MusicResponsiveListItemFixedColumn.js +var _MusicResponsiveListItemFixedColumn = class _MusicResponsiveListItemFixedColumn extends YTNode { + constructor(data) { + super(); + __publicField(this, "title"); + __publicField(this, "display_priority"); + this.title = new Text2(data.text); + this.display_priority = data.displayPriority; + } +}; +__name(_MusicResponsiveListItemFixedColumn, "MusicResponsiveListItemFixedColumn"); +__publicField(_MusicResponsiveListItemFixedColumn, "type", "musicResponsiveListItemFlexColumnRenderer"); +var MusicResponsiveListItemFixedColumn = _MusicResponsiveListItemFixedColumn; + +// dist/src/parser/classes/MusicResponsiveListItemFlexColumn.js +var _MusicResponsiveListItemFlexColumn = class _MusicResponsiveListItemFlexColumn extends YTNode { + constructor(data) { + super(); + __publicField(this, "title"); + __publicField(this, "display_priority"); + this.title = new Text2(data.text); + this.display_priority = data.displayPriority; + } +}; +__name(_MusicResponsiveListItemFlexColumn, "MusicResponsiveListItemFlexColumn"); +__publicField(_MusicResponsiveListItemFlexColumn, "type", "MusicResponsiveListItemFlexColumn"); +var MusicResponsiveListItemFlexColumn = _MusicResponsiveListItemFlexColumn; + +// dist/src/parser/classes/MusicResponsiveListItem.js +var _MusicResponsiveListItem_instances, parseOther_fn, parseVideoOrSong_fn, parseSong_fn, parseVideo_fn, parseArtist_fn, parseLibraryArtist_fn, parseNonMusicTrack_fn, parsePodcastShow_fn, parseAlbum_fn, parsePlaylist_fn; +var _MusicResponsiveListItem = class _MusicResponsiveListItem extends YTNode { + constructor(data) { + var _a, _b, _c, _d, _e, _f; + super(); + __privateAdd(this, _MusicResponsiveListItem_instances); + __publicField(this, "flex_columns"); + __publicField(this, "fixed_columns"); + __publicField(this, "endpoint"); + __publicField(this, "item_type"); + __publicField(this, "index"); + __publicField(this, "thumbnail"); + __publicField(this, "badges"); + __publicField(this, "menu"); + __publicField(this, "overlay"); + __publicField(this, "id"); + __publicField(this, "title"); + __publicField(this, "duration"); + __publicField(this, "album"); + __publicField(this, "artists"); + __publicField(this, "views"); + __publicField(this, "authors"); + __publicField(this, "name"); + __publicField(this, "subtitle"); + __publicField(this, "subscribers"); + __publicField(this, "song_count"); + // TODO: these might be replaceable with Author class + __publicField(this, "author"); + __publicField(this, "item_count"); + __publicField(this, "year"); + this.flex_columns = parser_exports.parseArray(data.flexColumns, MusicResponsiveListItemFlexColumn); + this.fixed_columns = parser_exports.parseArray(data.fixedColumns, MusicResponsiveListItemFixedColumn); + const playlist_item_data = { + video_id: ((_a = data == null ? void 0 : data.playlistItemData) == null ? void 0 : _a.videoId) || null, + playlist_set_video_id: ((_b = data == null ? void 0 : data.playlistItemData) == null ? void 0 : _b.playlistSetVideoId) || null + }; + if (Reflect.has(data, "navigationEndpoint")) { + this.endpoint = new NavigationEndpoint(data.navigationEndpoint); + } + let page_type = (_f = (_e = (_d = (_c = this.endpoint) == null ? void 0 : _c.payload) == null ? void 0 : _d.browseEndpointContextSupportedConfigs) == null ? void 0 : _e.browseEndpointContextMusicConfig) == null ? void 0 : _f.pageType; + if (!page_type) { + const is_non_music_track = this.flex_columns.find((col) => { + var _a2, _b2, _c2, _d2; + return ((_d2 = (_c2 = (_b2 = (_a2 = col.title.endpoint) == null ? void 0 : _a2.payload) == null ? void 0 : _b2.browseEndpointContextSupportedConfigs) == null ? void 0 : _c2.browseEndpointContextMusicConfig) == null ? void 0 : _d2.pageType) === "MUSIC_PAGE_TYPE_NON_MUSIC_AUDIO_TRACK_PAGE"; + }); + if (is_non_music_track) { + page_type = "MUSIC_PAGE_TYPE_NON_MUSIC_AUDIO_TRACK_PAGE"; + } + } + switch (page_type) { + case "MUSIC_PAGE_TYPE_ALBUM": + this.item_type = "album"; + __privateMethod(this, _MusicResponsiveListItem_instances, parseAlbum_fn).call(this); + break; + case "MUSIC_PAGE_TYPE_PLAYLIST": + this.item_type = "playlist"; + __privateMethod(this, _MusicResponsiveListItem_instances, parsePlaylist_fn).call(this); + break; + case "MUSIC_PAGE_TYPE_ARTIST": + case "MUSIC_PAGE_TYPE_USER_CHANNEL": + this.item_type = "artist"; + __privateMethod(this, _MusicResponsiveListItem_instances, parseArtist_fn).call(this); + break; + case "MUSIC_PAGE_TYPE_LIBRARY_ARTIST": + this.item_type = "library_artist"; + __privateMethod(this, _MusicResponsiveListItem_instances, parseLibraryArtist_fn).call(this); + break; + case "MUSIC_PAGE_TYPE_NON_MUSIC_AUDIO_TRACK_PAGE": + this.item_type = "non_music_track"; + __privateMethod(this, _MusicResponsiveListItem_instances, parseNonMusicTrack_fn).call(this, playlist_item_data); + break; + case "MUSIC_PAGE_TYPE_PODCAST_SHOW_DETAIL_PAGE": + this.item_type = "podcast_show"; + __privateMethod(this, _MusicResponsiveListItem_instances, parsePodcastShow_fn).call(this); + break; + default: + if (this.flex_columns[1]) { + __privateMethod(this, _MusicResponsiveListItem_instances, parseVideoOrSong_fn).call(this, playlist_item_data); + } else { + __privateMethod(this, _MusicResponsiveListItem_instances, parseOther_fn).call(this); + } + } + if (Reflect.has(data, "index")) { + this.index = new Text2(data.index); + } + if (Reflect.has(data, "thumbnail")) { + this.thumbnail = parser_exports.parseItem(data.thumbnail, MusicThumbnail); + } + if (Reflect.has(data, "badges")) { + this.badges = parser_exports.parseArray(data.badges); + } + if (Reflect.has(data, "menu")) { + this.menu = parser_exports.parseItem(data.menu, Menu); + } + if (Reflect.has(data, "overlay")) { + this.overlay = parser_exports.parseItem(data.overlay, MusicItemThumbnailOverlay); + } + } + get thumbnails() { + var _a; + return ((_a = this.thumbnail) == null ? void 0 : _a.contents) || []; + } +}; +_MusicResponsiveListItem_instances = new WeakSet(); +parseOther_fn = /* @__PURE__ */ __name(function() { + this.title = this.flex_columns[0].title.toString(); + if (this.endpoint) { + this.item_type = "endpoint"; + } else { + this.item_type = "unknown"; + } +}, "#parseOther"); +parseVideoOrSong_fn = /* @__PURE__ */ __name(function(playlist_item_data) { + var _a, _b, _c, _d, _e, _f, _g; + const music_video_type = (_g = (_f = (_e = (_d = (_c = (_b = (_a = this.flex_columns.at(0)) == null ? void 0 : _a.title.runs) == null ? void 0 : _b.at(0)) == null ? void 0 : _c.endpoint) == null ? void 0 : _d.payload) == null ? void 0 : _e.watchEndpointMusicSupportedConfigs) == null ? void 0 : _f.watchEndpointMusicConfig) == null ? void 0 : _g.musicVideoType; + switch (music_video_type) { + case "MUSIC_VIDEO_TYPE_UGC": + case "MUSIC_VIDEO_TYPE_OMV": + this.item_type = "video"; + __privateMethod(this, _MusicResponsiveListItem_instances, parseVideo_fn).call(this, playlist_item_data); + break; + case "MUSIC_VIDEO_TYPE_ATV": + this.item_type = "song"; + __privateMethod(this, _MusicResponsiveListItem_instances, parseSong_fn).call(this, playlist_item_data); + break; + default: + __privateMethod(this, _MusicResponsiveListItem_instances, parseOther_fn).call(this); + } +}, "#parseVideoOrSong"); +parseSong_fn = /* @__PURE__ */ __name(function(playlist_item_data) { + var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o; + this.id = playlist_item_data.video_id || ((_b = (_a = this.endpoint) == null ? void 0 : _a.payload) == null ? void 0 : _b.videoId); + this.title = this.flex_columns[0].title.toString(); + const duration_text = ((_e = (_d = (_c = this.flex_columns.at(1)) == null ? void 0 : _c.title.runs) == null ? void 0 : _d.find((run) => /^\d+$/.test(run.text.replace(/:/g, "")))) == null ? void 0 : _e.text) || ((_g = (_f = this.fixed_columns[0]) == null ? void 0 : _f.title) == null ? void 0 : _g.toString()); + if (duration_text) { + this.duration = { + text: duration_text, + seconds: timeToSeconds(duration_text) + }; + } + const album_run = ((_i = (_h = this.flex_columns.at(1)) == null ? void 0 : _h.title.runs) == null ? void 0 : _i.find((run) => isTextRun(run) && run.endpoint && run.endpoint.payload.browseId.startsWith("MPR"))) || ((_k = (_j = this.flex_columns.at(2)) == null ? void 0 : _j.title.runs) == null ? void 0 : _k.find((run) => isTextRun(run) && run.endpoint && run.endpoint.payload.browseId.startsWith("MPR"))); + if (album_run && isTextRun(album_run)) { + this.album = { + id: (_m = (_l = album_run.endpoint) == null ? void 0 : _l.payload) == null ? void 0 : _m.browseId, + name: album_run.text, + endpoint: album_run.endpoint + }; + } + const artist_runs = (_o = (_n = this.flex_columns.at(1)) == null ? void 0 : _n.title.runs) == null ? void 0 : _o.filter((run) => isTextRun(run) && run.endpoint && run.endpoint.payload.browseId.startsWith("UC")); + if (artist_runs) { + this.artists = artist_runs.map((run) => { + var _a2, _b2; + return { + name: run.text, + channel_id: isTextRun(run) ? (_b2 = (_a2 = run.endpoint) == null ? void 0 : _a2.payload) == null ? void 0 : _b2.browseId : void 0, + endpoint: isTextRun(run) ? run.endpoint : void 0 + }; + }); + } +}, "#parseSong"); +parseVideo_fn = /* @__PURE__ */ __name(function(playlist_item_data) { + var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j; + this.id = playlist_item_data.video_id; + this.title = this.flex_columns[0].title.toString(); + this.views = (_c = (_b = (_a = this.flex_columns.at(1)) == null ? void 0 : _a.title.runs) == null ? void 0 : _b.find((run) => run.text.match(/(.*?) views/))) == null ? void 0 : _c.toString(); + const author_runs = (_e = (_d = this.flex_columns.at(1)) == null ? void 0 : _d.title.runs) == null ? void 0 : _e.filter((run) => isTextRun(run) && run.endpoint && run.endpoint.payload.browseId.startsWith("UC")); + if (author_runs) { + this.authors = author_runs.map((run) => { + var _a2, _b2; + return { + name: run.text, + channel_id: isTextRun(run) ? (_b2 = (_a2 = run.endpoint) == null ? void 0 : _a2.payload) == null ? void 0 : _b2.browseId : void 0, + endpoint: isTextRun(run) ? run.endpoint : void 0 + }; + }); + } + const duration_text = ((_g = (_f = this.flex_columns[1].title.runs) == null ? void 0 : _f.find((run) => /^\d+$/.test(run.text.replace(/:/g, "")))) == null ? void 0 : _g.text) || ((_j = (_i = (_h = this.fixed_columns[0]) == null ? void 0 : _h.title.runs) == null ? void 0 : _i.find((run) => /^\d+$/.test(run.text.replace(/:/g, "")))) == null ? void 0 : _j.text); + if (duration_text) { + this.duration = { + text: duration_text, + seconds: timeToSeconds(duration_text) + }; + } +}, "#parseVideo"); +parseArtist_fn = /* @__PURE__ */ __name(function() { + var _a, _b, _c, _d, _e, _f; + this.id = (_b = (_a = this.endpoint) == null ? void 0 : _a.payload) == null ? void 0 : _b.browseId; + this.name = this.flex_columns[0].title.toString(); + this.subtitle = (_c = this.flex_columns.at(1)) == null ? void 0 : _c.title; + this.subscribers = ((_f = (_e = (_d = this.subtitle) == null ? void 0 : _d.runs) == null ? void 0 : _e.find((run) => /^(\d*\.)?\d+[M|K]? subscribers?$/i.test(run.text))) == null ? void 0 : _f.text) || ""; +}, "#parseArtist"); +parseLibraryArtist_fn = /* @__PURE__ */ __name(function() { + var _a, _b, _c, _d; + this.name = this.flex_columns[0].title.toString(); + this.subtitle = (_a = this.flex_columns.at(1)) == null ? void 0 : _a.title; + this.song_count = ((_d = (_c = (_b = this.subtitle) == null ? void 0 : _b.runs) == null ? void 0 : _c.find((run) => /^\d+(,\d+)? songs?$/i.test(run.text))) == null ? void 0 : _d.text) || ""; +}, "#parseLibraryArtist"); +parseNonMusicTrack_fn = /* @__PURE__ */ __name(function(playlist_item_data) { + var _a, _b; + this.id = playlist_item_data.video_id || ((_b = (_a = this.endpoint) == null ? void 0 : _a.payload) == null ? void 0 : _b.videoId); + this.title = this.flex_columns[0].title.toString(); +}, "#parseNonMusicTrack"); +parsePodcastShow_fn = /* @__PURE__ */ __name(function() { + var _a, _b; + this.id = (_b = (_a = this.endpoint) == null ? void 0 : _a.payload) == null ? void 0 : _b.browseId; + this.title = this.flex_columns[0].title.toString(); +}, "#parsePodcastShow"); +parseAlbum_fn = /* @__PURE__ */ __name(function() { + var _a, _b, _c, _d, _e, _f, _g, _h, _i; + this.id = (_b = (_a = this.endpoint) == null ? void 0 : _a.payload) == null ? void 0 : _b.browseId; + this.title = this.flex_columns[0].title.toString(); + const author_run = (_d = (_c = this.flex_columns.at(1)) == null ? void 0 : _c.title.runs) == null ? void 0 : _d.find((run) => isTextRun(run) && run.endpoint && run.endpoint.payload.browseId.startsWith("UC")); + if (author_run && isTextRun(author_run)) { + this.author = { + name: author_run.text, + channel_id: (_f = (_e = author_run.endpoint) == null ? void 0 : _e.payload) == null ? void 0 : _f.browseId, + endpoint: author_run.endpoint + }; + } + this.year = (_i = (_h = (_g = this.flex_columns.at(1)) == null ? void 0 : _g.title.runs) == null ? void 0 : _h.find((run) => /^[12][0-9]{3}$/.test(run.text))) == null ? void 0 : _i.text; +}, "#parseAlbum"); +parsePlaylist_fn = /* @__PURE__ */ __name(function() { + var _a, _b, _c, _d, _e, _f, _g, _h; + this.id = (_b = (_a = this.endpoint) == null ? void 0 : _a.payload) == null ? void 0 : _b.browseId; + this.title = this.flex_columns[0].title.toString(); + const item_count_run = (_d = (_c = this.flex_columns.at(1)) == null ? void 0 : _c.title.runs) == null ? void 0 : _d.find((run) => run.text.match(/\d+ (song|songs)/)); + this.item_count = item_count_run ? item_count_run.text : void 0; + const author_run = (_f = (_e = this.flex_columns.at(1)) == null ? void 0 : _e.title.runs) == null ? void 0 : _f.find((run) => isTextRun(run) && run.endpoint && run.endpoint.payload.browseId.startsWith("UC")); + if (author_run && isTextRun(author_run)) { + this.author = { + name: author_run.text, + channel_id: (_h = (_g = author_run.endpoint) == null ? void 0 : _g.payload) == null ? void 0 : _h.browseId, + endpoint: author_run.endpoint + }; + } +}, "#parsePlaylist"); +__name(_MusicResponsiveListItem, "MusicResponsiveListItem"); +__publicField(_MusicResponsiveListItem, "type", "MusicResponsiveListItem"); +var MusicResponsiveListItem = _MusicResponsiveListItem; + +// dist/src/parser/classes/MusicTwoRowItem.js +var _MusicTwoRowItem = class _MusicTwoRowItem extends YTNode { + constructor(data) { + var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v; + super(); + __publicField(this, "title"); + __publicField(this, "endpoint"); + __publicField(this, "id"); + __publicField(this, "subtitle"); + __publicField(this, "badges"); + __publicField(this, "item_type"); + __publicField(this, "subscribers"); + __publicField(this, "item_count"); + __publicField(this, "year"); + __publicField(this, "views"); + __publicField(this, "artists"); + __publicField(this, "author"); + __publicField(this, "thumbnail"); + __publicField(this, "thumbnail_overlay"); + __publicField(this, "menu"); + this.title = new Text2(data.title); + this.endpoint = new NavigationEndpoint(data.navigationEndpoint); + this.id = ((_b = (_a = this.endpoint) == null ? void 0 : _a.payload) == null ? void 0 : _b.browseId) || ((_d = (_c = this.endpoint) == null ? void 0 : _c.payload) == null ? void 0 : _d.videoId); + this.subtitle = new Text2(data.subtitle); + this.badges = parser_exports.parse(data.subtitleBadges); + const page_type = (_h = (_g = (_f = (_e = this.endpoint) == null ? void 0 : _e.payload) == null ? void 0 : _f.browseEndpointContextSupportedConfigs) == null ? void 0 : _g.browseEndpointContextMusicConfig) == null ? void 0 : _h.pageType; + switch (page_type) { + case "MUSIC_PAGE_TYPE_ARTIST": + this.item_type = "artist"; + break; + case "MUSIC_PAGE_TYPE_PLAYLIST": + this.item_type = "playlist"; + break; + case "MUSIC_PAGE_TYPE_ALBUM": + this.item_type = "album"; + break; + default: + if (((_j = (_i = this.endpoint) == null ? void 0 : _i.metadata) == null ? void 0 : _j.api_url) === "/next") { + this.item_type = "endpoint"; + } else if ((_k = this.subtitle.runs) == null ? void 0 : _k[0]) { + if (this.subtitle.runs[0].text !== "Song") { + this.item_type = "video"; + } else { + this.item_type = "song"; + } + } else if (this.endpoint) { + this.item_type = "endpoint"; + } else { + this.item_type = "unknown"; + } + break; + } + if (this.item_type == "artist") { + this.subscribers = ((_m = (_l = this.subtitle.runs) == null ? void 0 : _l.find((run) => /^(\d*\.)?\d+[M|K]? subscribers?$/i.test(run.text))) == null ? void 0 : _m.text) || ""; + } else if (this.item_type == "playlist") { + const item_count_run = (_n = this.subtitle.runs) == null ? void 0 : _n.find((run) => run.text.match(/\d+ songs|song/)); + this.item_count = item_count_run ? item_count_run.text : null; + } else if (this.item_type == "album") { + const artists = (_o = this.subtitle.runs) == null ? void 0 : _o.filter((run) => { + var _a2, _b2; + return (_b2 = (_a2 = run.endpoint) == null ? void 0 : _a2.payload) == null ? void 0 : _b2.browseId.startsWith("UC"); + }); + if (artists) { + this.artists = artists.map((artist) => { + var _a2, _b2; + return { + name: artist.text, + channel_id: (_b2 = (_a2 = artist.endpoint) == null ? void 0 : _a2.payload) == null ? void 0 : _b2.browseId, + endpoint: artist.endpoint + }; + }); + } + this.year = (_p = this.subtitle.runs) == null ? void 0 : _p.slice(-1)[0].text; + if (isNaN(Number(this.year))) + delete this.year; + } else if (this.item_type == "video") { + this.views = ((_r = (_q = this == null ? void 0 : this.subtitle.runs) == null ? void 0 : _q.find((run) => run == null ? void 0 : run.text.match(/(.*?) views/))) == null ? void 0 : _r.text) || "N/A"; + const author = (_s = this.subtitle.runs) == null ? void 0 : _s.find((run) => { + var _a2, _b2, _c2; + return (_c2 = (_b2 = (_a2 = run.endpoint) == null ? void 0 : _a2.payload) == null ? void 0 : _b2.browseId) == null ? void 0 : _c2.startsWith("UC"); + }); + if (author) { + this.author = { + name: author == null ? void 0 : author.text, + channel_id: (_u = (_t = author == null ? void 0 : author.endpoint) == null ? void 0 : _t.payload) == null ? void 0 : _u.browseId, + endpoint: author == null ? void 0 : author.endpoint + }; + } + } else if (this.item_type == "song") { + const artists = (_v = this.subtitle.runs) == null ? void 0 : _v.filter((run) => { + var _a2, _b2; + return (_b2 = (_a2 = run.endpoint) == null ? void 0 : _a2.payload) == null ? void 0 : _b2.browseId.startsWith("UC"); + }); + if (artists) { + this.artists = artists.map((artist) => { + var _a2, _b2; + return { + name: artist == null ? void 0 : artist.text, + channel_id: (_b2 = (_a2 = artist == null ? void 0 : artist.endpoint) == null ? void 0 : _a2.payload) == null ? void 0 : _b2.browseId, + endpoint: artist == null ? void 0 : artist.endpoint + }; + }); + } + } + this.thumbnail = Thumbnail.fromResponse(data.thumbnailRenderer.musicThumbnailRenderer.thumbnail); + this.thumbnail_overlay = parser_exports.parseItem(data.thumbnailOverlay, MusicItemThumbnailOverlay); + this.menu = parser_exports.parseItem(data.menu, Menu); + } +}; +__name(_MusicTwoRowItem, "MusicTwoRowItem"); +__publicField(_MusicTwoRowItem, "type", "MusicTwoRowItem"); +var MusicTwoRowItem = _MusicTwoRowItem; + +// dist/src/parser/classes/MusicCarouselShelf.js +var _MusicCarouselShelf = class _MusicCarouselShelf extends YTNode { + constructor(data) { + super(); + __publicField(this, "header"); + __publicField(this, "contents"); + __publicField(this, "num_items_per_column"); + this.header = parser_exports.parseItem(data.header, MusicCarouselShelfBasicHeader); + this.contents = parser_exports.parseArray(data.contents, [MusicTwoRowItem, MusicResponsiveListItem, MusicMultiRowListItem, MusicNavigationButton]); + if (Reflect.has(data, "numItemsPerColumn")) { + this.num_items_per_column = parseInt(data.numItemsPerColumn); + } + } +}; +__name(_MusicCarouselShelf, "MusicCarouselShelf"); +__publicField(_MusicCarouselShelf, "type", "MusicCarouselShelf"); +var MusicCarouselShelf = _MusicCarouselShelf; + +// dist/src/parser/classes/MusicDescriptionShelf.js +var _MusicDescriptionShelf = class _MusicDescriptionShelf extends YTNode { + constructor(data) { + super(); + __publicField(this, "description"); + __publicField(this, "max_collapsed_lines"); + __publicField(this, "max_expanded_lines"); + __publicField(this, "footer"); + this.description = new Text2(data.description); + if (Reflect.has(data, "maxCollapsedLines")) { + this.max_collapsed_lines = data.maxCollapsedLines; + } + if (Reflect.has(data, "maxExpandedLines")) { + this.max_expanded_lines = data.maxExpandedLines; + } + this.footer = new Text2(data.footer); + } +}; +__name(_MusicDescriptionShelf, "MusicDescriptionShelf"); +__publicField(_MusicDescriptionShelf, "type", "MusicDescriptionShelf"); +var MusicDescriptionShelf = _MusicDescriptionShelf; + +// dist/src/parser/classes/MusicDetailHeader.js +var _MusicDetailHeader = class _MusicDetailHeader extends YTNode { + constructor(data) { + var _a, _b, _c, _d, _e, _f, _g, _h, _i; + super(); + __publicField(this, "title"); + __publicField(this, "description"); + __publicField(this, "subtitle"); + __publicField(this, "second_subtitle"); + __publicField(this, "year"); + __publicField(this, "song_count"); + __publicField(this, "total_duration"); + __publicField(this, "thumbnails"); + __publicField(this, "badges"); + __publicField(this, "author"); + __publicField(this, "menu"); + this.title = new Text2(data.title); + this.description = new Text2(data.description); + this.subtitle = new Text2(data.subtitle); + this.second_subtitle = new Text2(data.secondSubtitle); + this.year = ((_b = (_a = this.subtitle.runs) == null ? void 0 : _a.find((run) => /^[12][0-9]{3}$/.test(run.text))) == null ? void 0 : _b.text) || ""; + this.song_count = ((_d = (_c = this.second_subtitle.runs) == null ? void 0 : _c[0]) == null ? void 0 : _d.text) || ""; + this.total_duration = ((_f = (_e = this.second_subtitle.runs) == null ? void 0 : _e[2]) == null ? void 0 : _f.text) || ""; + this.thumbnails = Thumbnail.fromResponse(data.thumbnail.croppedSquareThumbnailRenderer.thumbnail); + this.badges = parser_exports.parseArray(data.subtitleBadges); + const author = (_g = this.subtitle.runs) == null ? void 0 : _g.find((run) => { + var _a2, _b2; + return (_b2 = (_a2 = run == null ? void 0 : run.endpoint) == null ? void 0 : _a2.payload) == null ? void 0 : _b2.browseId.startsWith("UC"); + }); + if (author) { + this.author = { + name: author.text, + channel_id: (_i = (_h = author.endpoint) == null ? void 0 : _h.payload) == null ? void 0 : _i.browseId, + endpoint: author.endpoint + }; + } + this.menu = parser_exports.parseItem(data.menu); + } +}; +__name(_MusicDetailHeader, "MusicDetailHeader"); +__publicField(_MusicDetailHeader, "type", "MusicDetailHeader"); +var MusicDetailHeader = _MusicDetailHeader; + +// dist/src/parser/classes/MusicDownloadStateBadge.js +var _MusicDownloadStateBadge = class _MusicDownloadStateBadge extends YTNode { + constructor(data) { + super(); + __publicField(this, "playlist_id"); + __publicField(this, "supported_download_states"); + this.playlist_id = data.playlistId; + this.supported_download_states = data.supportedDownloadStates; + } +}; +__name(_MusicDownloadStateBadge, "MusicDownloadStateBadge"); +__publicField(_MusicDownloadStateBadge, "type", "MusicDownloadStateBadge"); +var MusicDownloadStateBadge = _MusicDownloadStateBadge; + +// dist/src/parser/classes/MusicEditablePlaylistDetailHeader.js +var _MusicEditablePlaylistDetailHeader = class _MusicEditablePlaylistDetailHeader extends YTNode { + constructor(data) { + super(); + __publicField(this, "header"); + __publicField(this, "edit_header"); + __publicField(this, "playlist_id"); + this.header = parser_exports.parseItem(data.header); + this.edit_header = parser_exports.parseItem(data.editHeader); + this.playlist_id = data.playlistId; + } +}; +__name(_MusicEditablePlaylistDetailHeader, "MusicEditablePlaylistDetailHeader"); +__publicField(_MusicEditablePlaylistDetailHeader, "type", "MusicEditablePlaylistDetailHeader"); +var MusicEditablePlaylistDetailHeader = _MusicEditablePlaylistDetailHeader; + +// dist/src/parser/classes/MusicElementHeader.js +var _MusicElementHeader = class _MusicElementHeader extends YTNode { + constructor(data) { + super(); + __publicField(this, "element"); + this.element = Reflect.has(data, "elementRenderer") ? parser_exports.parseItem(data, Element) : null; + } +}; +__name(_MusicElementHeader, "MusicElementHeader"); +__publicField(_MusicElementHeader, "type", "MusicElementHeader"); +var MusicElementHeader = _MusicElementHeader; + +// dist/src/parser/classes/MusicHeader.js +var _MusicHeader = class _MusicHeader extends YTNode { + constructor(data) { + super(); + __publicField(this, "header"); + __publicField(this, "title"); + if (Reflect.has(data, "header")) { + this.header = parser_exports.parseItem(data.header); + } + if (Reflect.has(data, "title")) { + this.title = new Text2(data.title); + } + } +}; +__name(_MusicHeader, "MusicHeader"); +__publicField(_MusicHeader, "type", "MusicHeader"); +var MusicHeader = _MusicHeader; + +// dist/src/parser/classes/MusicImmersiveHeader.js +var _MusicImmersiveHeader = class _MusicImmersiveHeader extends YTNode { + constructor(data) { + super(); + __publicField(this, "title"); + __publicField(this, "menu"); + __publicField(this, "more_button"); + __publicField(this, "play_button"); + __publicField(this, "share_endpoint"); + __publicField(this, "start_radio_button"); + __publicField(this, "subscription_button"); + __publicField(this, "description"); + __publicField(this, "thumbnail"); + this.title = new Text2(data.title); + this.menu = parser_exports.parseItem(data.menu, Menu); + this.more_button = parser_exports.parseItem(data.moreButton, ToggleButton); + this.play_button = parser_exports.parseItem(data.playButton, Button); + if ("shareEndpoint" in data) + this.share_endpoint = new NavigationEndpoint(data.shareEndpoint); + this.start_radio_button = parser_exports.parseItem(data.startRadioButton, Button); + this.subscription_button = parser_exports.parseItem(data.subscriptionButton, SubscribeButton); + this.description = new Text2(data.description); + this.thumbnail = parser_exports.parseItem(data.thumbnail, MusicThumbnail); + } +}; +__name(_MusicImmersiveHeader, "MusicImmersiveHeader"); +__publicField(_MusicImmersiveHeader, "type", "MusicImmersiveHeader"); +var MusicImmersiveHeader = _MusicImmersiveHeader; + +// dist/src/parser/classes/MusicLargeCardItemCarousel.js +var _ActionButton = class _ActionButton { + constructor(data) { + __publicField(this, "icon_name"); + __publicField(this, "endpoint"); + __publicField(this, "a11y_text"); + __publicField(this, "style"); + this.icon_name = data.iconName; + this.endpoint = new NavigationEndpoint(data.onTap); + this.a11y_text = data.a11yText; + this.style = data.style; + } +}; +__name(_ActionButton, "ActionButton"); +__publicField(_ActionButton, "type", "ActionButton"); +var ActionButton = _ActionButton; +var _Panel2 = class _Panel2 { + constructor(data) { + __publicField(this, "image"); + __publicField(this, "content_mode"); + __publicField(this, "crop_options"); + __publicField(this, "image_aspect_ratio"); + __publicField(this, "caption"); + __publicField(this, "action_buttons"); + this.image = Thumbnail.fromResponse(data.image.image); + this.content_mode = data.image.contentMode; + this.crop_options = data.image.cropOptions; + this.image_aspect_ratio = data.imageAspectRatio; + this.caption = data.caption; + this.action_buttons = data.actionButtons.map((el) => new ActionButton(el)); + } +}; +__name(_Panel2, "Panel"); +__publicField(_Panel2, "type", "Panel"); +var Panel2 = _Panel2; +var _MusicLargeCardItemCarousel = class _MusicLargeCardItemCarousel extends YTNode { + constructor(data) { + super(); + __publicField(this, "panels"); + __publicField(this, "header"); + this.header = data.shelf.header; + this.panels = data.shelf.panels.map((el) => new Panel2(el)); + } +}; +__name(_MusicLargeCardItemCarousel, "MusicLargeCardItemCarousel"); +__publicField(_MusicLargeCardItemCarousel, "type", "MusicLargeCardItemCarousel"); +var MusicLargeCardItemCarousel = _MusicLargeCardItemCarousel; + +// dist/src/parser/classes/MusicPlaylistEditHeader.js +var _MusicPlaylistEditHeader = class _MusicPlaylistEditHeader extends YTNode { + constructor(data) { + super(); + __publicField(this, "title"); + __publicField(this, "edit_title"); + __publicField(this, "edit_description"); + __publicField(this, "privacy"); + __publicField(this, "playlist_id"); + __publicField(this, "endpoint"); + __publicField(this, "privacy_dropdown"); + this.title = new Text2(data.title); + this.edit_title = new Text2(data.editTitle); + this.edit_description = new Text2(data.editDescription); + this.privacy = data.privacy; + this.playlist_id = data.playlistId; + this.endpoint = new NavigationEndpoint(data.collaborationSettingsCommand); + this.privacy_dropdown = parser_exports.parseItem(data.privacyDropdown, Dropdown); + } +}; +__name(_MusicPlaylistEditHeader, "MusicPlaylistEditHeader"); +__publicField(_MusicPlaylistEditHeader, "type", "MusicPlaylistEditHeader"); +var MusicPlaylistEditHeader = _MusicPlaylistEditHeader; + +// dist/src/parser/classes/MusicPlaylistShelf.js +var _MusicPlaylistShelf = class _MusicPlaylistShelf extends YTNode { + constructor(data) { + var _a, _b, _c; + super(); + __publicField(this, "playlist_id"); + __publicField(this, "contents"); + __publicField(this, "collapsed_item_count"); + __publicField(this, "continuation"); + this.playlist_id = data.playlistId; + this.contents = parser_exports.parseArray(data.contents, [MusicResponsiveListItem, ContinuationItem]); + this.collapsed_item_count = data.collapsedItemCount; + this.continuation = ((_c = (_b = (_a = data.continuations) == null ? void 0 : _a[0]) == null ? void 0 : _b.nextContinuationData) == null ? void 0 : _c.continuation) || null; + } +}; +__name(_MusicPlaylistShelf, "MusicPlaylistShelf"); +__publicField(_MusicPlaylistShelf, "type", "MusicPlaylistShelf"); +var MusicPlaylistShelf = _MusicPlaylistShelf; + +// dist/src/parser/classes/PlaylistPanelVideo.js +var _PlaylistPanelVideo = class _PlaylistPanelVideo extends YTNode { + constructor(data) { + var _a, _b, _c, _d, _e; + super(); + __publicField(this, "title"); + __publicField(this, "thumbnail"); + __publicField(this, "endpoint"); + __publicField(this, "selected"); + __publicField(this, "video_id"); + __publicField(this, "duration"); + __publicField(this, "author"); + __publicField(this, "album"); + __publicField(this, "artists"); + __publicField(this, "badges"); + __publicField(this, "menu"); + __publicField(this, "set_video_id"); + this.title = new Text2(data.title); + this.thumbnail = Thumbnail.fromResponse(data.thumbnail); + this.endpoint = new NavigationEndpoint(data.navigationEndpoint); + this.selected = data.selected; + this.video_id = data.videoId; + this.duration = { + text: new Text2(data.lengthText).toString(), + seconds: timeToSeconds(new Text2(data.lengthText).toString()) + }; + const album = (_a = new Text2(data.longBylineText).runs) == null ? void 0 : _a.find((run) => { + var _a2, _b2, _c2; + return (_c2 = (_b2 = (_a2 = run.endpoint) == null ? void 0 : _a2.payload) == null ? void 0 : _b2.browseId) == null ? void 0 : _c2.startsWith("MPR"); + }); + const artists = (_b = new Text2(data.longBylineText).runs) == null ? void 0 : _b.filter((run) => { + var _a2, _b2, _c2; + return (_c2 = (_b2 = (_a2 = run.endpoint) == null ? void 0 : _a2.payload) == null ? void 0 : _b2.browseId) == null ? void 0 : _c2.startsWith("UC"); + }); + this.author = new Text2(data.shortBylineText).toString(); + if (album) { + this.album = { + id: (_d = (_c = album.endpoint) == null ? void 0 : _c.payload) == null ? void 0 : _d.browseId, + name: album.text, + year: (_e = new Text2(data.longBylineText).runs) == null ? void 0 : _e.slice(-1)[0].text, + endpoint: album.endpoint + }; + } + if (artists) { + this.artists = artists.map((artist) => { + var _a2, _b2; + return { + name: artist.text, + channel_id: (_b2 = (_a2 = artist.endpoint) == null ? void 0 : _a2.payload) == null ? void 0 : _b2.browseId, + endpoint: artist.endpoint + }; + }); + } + this.badges = parser_exports.parseArray(data.badges); + this.menu = parser_exports.parseItem(data.menu); + this.set_video_id = data.playlistSetVideoId; + } +}; +__name(_PlaylistPanelVideo, "PlaylistPanelVideo"); +__publicField(_PlaylistPanelVideo, "type", "PlaylistPanelVideo"); +var PlaylistPanelVideo = _PlaylistPanelVideo; + +// dist/src/parser/classes/PlaylistPanelVideoWrapper.js +var _PlaylistPanelVideoWrapper = class _PlaylistPanelVideoWrapper extends YTNode { + constructor(data) { + super(); + __publicField(this, "primary"); + __publicField(this, "counterpart"); + this.primary = parser_exports.parseItem(data.primaryRenderer, PlaylistPanelVideo); + if (Reflect.has(data, "counterpart")) { + this.counterpart = observe(data.counterpart.map((item) => parser_exports.parseItem(item.counterpartRenderer, PlaylistPanelVideo)) || []); + } + } +}; +__name(_PlaylistPanelVideoWrapper, "PlaylistPanelVideoWrapper"); +__publicField(_PlaylistPanelVideoWrapper, "type", "PlaylistPanelVideoWrapper"); +var PlaylistPanelVideoWrapper = _PlaylistPanelVideoWrapper; + +// dist/src/parser/classes/PlaylistPanel.js +var _PlaylistPanel = class _PlaylistPanel extends YTNode { + constructor(data) { + var _a, _b, _c, _d, _e, _f; + super(); + __publicField(this, "title"); + __publicField(this, "title_text"); + __publicField(this, "contents"); + __publicField(this, "playlist_id"); + __publicField(this, "is_infinite"); + __publicField(this, "continuation"); + __publicField(this, "is_editable"); + __publicField(this, "preview_description"); + __publicField(this, "num_items_to_show"); + this.title = data.title; + this.title_text = new Text2(data.titleText); + this.contents = parser_exports.parseArray(data.contents, [PlaylistPanelVideoWrapper, PlaylistPanelVideo, AutomixPreviewVideo]); + this.playlist_id = data.playlistId; + this.is_infinite = data.isInfinite; + this.continuation = ((_c = (_b = (_a = data.continuations) == null ? void 0 : _a[0]) == null ? void 0 : _b.nextRadioContinuationData) == null ? void 0 : _c.continuation) || ((_f = (_e = (_d = data.continuations) == null ? void 0 : _d[0]) == null ? void 0 : _e.nextContinuationData) == null ? void 0 : _f.continuation); + this.is_editable = data.isEditable; + this.preview_description = data.previewDescription; + this.num_items_to_show = data.numItemsToShow; + } +}; +__name(_PlaylistPanel, "PlaylistPanel"); +__publicField(_PlaylistPanel, "type", "PlaylistPanel"); +var PlaylistPanel = _PlaylistPanel; + +// dist/src/parser/classes/MusicQueue.js +var _MusicQueue = class _MusicQueue extends YTNode { + constructor(data) { + super(); + __publicField(this, "content"); + this.content = parser_exports.parseItem(data.content, PlaylistPanel); + } +}; +__name(_MusicQueue, "MusicQueue"); +__publicField(_MusicQueue, "type", "MusicQueue"); +var MusicQueue = _MusicQueue; + +// dist/src/parser/classes/MusicResponsiveHeader.js +var _MusicResponsiveHeader = class _MusicResponsiveHeader extends YTNode { + constructor(data) { + super(); + __publicField(this, "thumbnail"); + __publicField(this, "buttons"); + __publicField(this, "title"); + __publicField(this, "subtitle"); + __publicField(this, "strapline_text_one"); + __publicField(this, "strapline_thumbnail"); + __publicField(this, "second_subtitle"); + __publicField(this, "subtitle_badge"); + __publicField(this, "description"); + this.thumbnail = parser_exports.parseItem(data.thumbnail, MusicThumbnail); + this.buttons = parser_exports.parseArray(data.buttons, [DownloadButton, ToggleButton, MusicPlayButton, Button, Menu]); + this.title = new Text2(data.title); + this.subtitle = new Text2(data.subtitle); + this.strapline_text_one = new Text2(data.straplineTextOne); + this.strapline_thumbnail = parser_exports.parseItem(data.straplineThumbnail, MusicThumbnail); + this.second_subtitle = new Text2(data.secondSubtitle); + if (Reflect.has(data, "subtitleBadge")) { + this.subtitle_badge = parser_exports.parseArray(data.subtitleBadge, MusicInlineBadge); + } + if (Reflect.has(data, "description")) { + this.description = parser_exports.parseItem(data.description, MusicDescriptionShelf); + } + } +}; +__name(_MusicResponsiveHeader, "MusicResponsiveHeader"); +__publicField(_MusicResponsiveHeader, "type", "MusicResponsiveHeader"); +var MusicResponsiveHeader = _MusicResponsiveHeader; + +// dist/src/parser/classes/MusicShelf.js +var _MusicShelf = class _MusicShelf extends YTNode { + constructor(data) { + var _a, _b, _c, _d; + super(); + __publicField(this, "title"); + __publicField(this, "contents"); + __publicField(this, "endpoint"); + __publicField(this, "continuation"); + __publicField(this, "bottom_text"); + __publicField(this, "bottom_button"); + __publicField(this, "subheaders"); + this.title = new Text2(data.title); + this.contents = parser_exports.parseArray(data.contents, MusicResponsiveListItem); + if (Reflect.has(data, "bottomEndpoint")) { + this.endpoint = new NavigationEndpoint(data.bottomEndpoint); + } + if (Reflect.has(data, "continuations")) { + this.continuation = ((_b = (_a = data.continuations) == null ? void 0 : _a[0].nextContinuationData) == null ? void 0 : _b.continuation) || ((_d = (_c = data.continuations) == null ? void 0 : _c[0].reloadContinuationData) == null ? void 0 : _d.continuation); + } + if (Reflect.has(data, "bottomText")) { + this.bottom_text = new Text2(data.bottomText); + } + if (Reflect.has(data, "bottomButton")) { + this.bottom_button = parser_exports.parseItem(data.bottomButton, Button); + } + if (Reflect.has(data, "subheaders")) { + this.subheaders = parser_exports.parseArray(data.subheaders); + } + } +}; +__name(_MusicShelf, "MusicShelf"); +__publicField(_MusicShelf, "type", "MusicShelf"); +var MusicShelf = _MusicShelf; + +// dist/src/parser/classes/MusicSideAlignedItem.js +var _MusicSideAlignedItem = class _MusicSideAlignedItem extends YTNode { + constructor(data) { + super(); + __publicField(this, "start_items"); + __publicField(this, "end_items"); + if (Reflect.has(data, "startItems")) { + this.start_items = parser_exports.parseArray(data.startItems); + } + if (Reflect.has(data, "endItems")) { + this.end_items = parser_exports.parseArray(data.endItems); + } + } +}; +__name(_MusicSideAlignedItem, "MusicSideAlignedItem"); +__publicField(_MusicSideAlignedItem, "type", "MusicSideAlignedItem"); +var MusicSideAlignedItem = _MusicSideAlignedItem; + +// dist/src/parser/classes/MusicSortFilterButton.js +var _MusicSortFilterButton = class _MusicSortFilterButton extends YTNode { + constructor(data) { + super(); + __publicField(this, "title"); + __publicField(this, "icon_type"); + __publicField(this, "menu"); + this.title = new Text2(data.title).toString(); + if (Reflect.has(data, "icon")) { + this.icon_type = data.icon.iconType; + } + this.menu = parser_exports.parseItem(data.menu, MusicMultiSelectMenu); + } +}; +__name(_MusicSortFilterButton, "MusicSortFilterButton"); +__publicField(_MusicSortFilterButton, "type", "MusicSortFilterButton"); +var MusicSortFilterButton = _MusicSortFilterButton; + +// dist/src/parser/classes/MusicTastebuilderShelfThumbnail.js +var _MusicTastebuilderShelfThumbnail = class _MusicTastebuilderShelfThumbnail extends YTNode { + constructor(data) { + super(); + __publicField(this, "thumbnail"); + this.thumbnail = Thumbnail.fromResponse(data.thumbnail); + } +}; +__name(_MusicTastebuilderShelfThumbnail, "MusicTastebuilderShelfThumbnail"); +__publicField(_MusicTastebuilderShelfThumbnail, "type", "MusicTastebuilderShelfThumbnail"); +var MusicTastebuilderShelfThumbnail = _MusicTastebuilderShelfThumbnail; + +// dist/src/parser/classes/MusicTastebuilderShelf.js +var _MusicTasteBuilderShelf = class _MusicTasteBuilderShelf extends YTNode { + constructor(data) { + super(); + __publicField(this, "thumbnail"); + __publicField(this, "primary_text"); + __publicField(this, "secondary_text"); + __publicField(this, "action_button"); + __publicField(this, "is_visible"); + this.thumbnail = parser_exports.parseItem(data.thumbnail, MusicTastebuilderShelfThumbnail); + this.primary_text = new Text2(data.primaryText); + this.secondary_text = new Text2(data.secondaryText); + this.action_button = parser_exports.parseItem(data.actionButton, Button); + this.is_visible = data.isVisible; + } +}; +__name(_MusicTasteBuilderShelf, "MusicTasteBuilderShelf"); +__publicField(_MusicTasteBuilderShelf, "type", "MusicTasteBuilderShelf"); +var MusicTasteBuilderShelf = _MusicTasteBuilderShelf; + +// dist/src/parser/classes/MusicVisualHeader.js +var _MusicVisualHeader = class _MusicVisualHeader extends YTNode { + constructor(data) { + var _a, _b; + super(); + __publicField(this, "title"); + __publicField(this, "thumbnail"); + __publicField(this, "menu"); + __publicField(this, "foreground_thumbnail"); + this.title = new Text2(data.title); + this.thumbnail = data.thumbnail ? Thumbnail.fromResponse((_a = data.thumbnail.musicThumbnailRenderer) == null ? void 0 : _a.thumbnail) : []; + this.menu = parser_exports.parseItem(data.menu, Menu); + this.foreground_thumbnail = data.foregroundThumbnail ? Thumbnail.fromResponse((_b = data.foregroundThumbnail.musicThumbnailRenderer) == null ? void 0 : _b.thumbnail) : []; + } +}; +__name(_MusicVisualHeader, "MusicVisualHeader"); +__publicField(_MusicVisualHeader, "type", "MusicVisualHeader"); +var MusicVisualHeader = _MusicVisualHeader; + +// dist/src/parser/classes/mweb/MobileTopbar.js +var _MobileTopbar = class _MobileTopbar extends YTNode { + constructor(data) { + super(); + __publicField(this, "placeholder_text"); + __publicField(this, "buttons"); + __publicField(this, "logo_type"); + this.placeholder_text = new Text2(data.placeholderText); + this.buttons = parser_exports.parseArray(data.buttons); + if (Reflect.has(data, "logo") && Reflect.has(data.logo, "iconType")) + this.logo_type = data.logo.iconType; + } +}; +__name(_MobileTopbar, "MobileTopbar"); +__publicField(_MobileTopbar, "type", "MobileTopbar"); +var MobileTopbar = _MobileTopbar; + +// dist/src/parser/classes/mweb/MultiPageMenuSection.js +var _MultiPageMenuSection = class _MultiPageMenuSection extends YTNode { + constructor(data) { + super(); + __publicField(this, "items"); + this.items = parser_exports.parseArray(data.items); + } +}; +__name(_MultiPageMenuSection, "MultiPageMenuSection"); +__publicField(_MultiPageMenuSection, "type", "MultiPageMenuSection"); +var MultiPageMenuSection = _MultiPageMenuSection; + +// dist/src/parser/classes/mweb/PivotBar.js +var _PivotBar = class _PivotBar extends YTNode { + constructor(data) { + super(); + __publicField(this, "items"); + this.items = parser_exports.parseArray(data.items); + } +}; +__name(_PivotBar, "PivotBar"); +__publicField(_PivotBar, "type", "PivotBar"); +var PivotBar = _PivotBar; + +// dist/src/parser/classes/mweb/PivotBarItem.js +var _PivotBarItem = class _PivotBarItem extends YTNode { + constructor(data) { + super(); + __publicField(this, "pivot_identifier"); + __publicField(this, "endpoint"); + __publicField(this, "title"); + __publicField(this, "accessibility_label"); + __publicField(this, "icon_type"); + __publicField(this, "accessibility"); + this.pivot_identifier = data.pivotIdentifier; + this.endpoint = new NavigationEndpoint(data.navigationEndpoint); + this.title = new Text(data.title); + if ("accessibility" in data && "accessibilityData" in data.accessibility) { + this.accessibility = { + accessibility_data: new AccessibilityData(data.accessibility.accessibilityData) + }; + } + if (Reflect.has(data, "icon") && Reflect.has(data.icon, "iconType")) + this.icon_type = data.icon.iconType; + } + get label() { + var _a, _b; + return (_b = (_a = this.accessibility) == null ? void 0 : _a.accessibility_data) == null ? void 0 : _b.label; + } +}; +__name(_PivotBarItem, "PivotBarItem"); +__publicField(_PivotBarItem, "type", "PivotBarItem"); +var PivotBarItem = _PivotBarItem; + +// dist/src/parser/classes/mweb/TopbarMenuButton.js +var _TopbarMenuButton = class _TopbarMenuButton extends YTNode { + constructor(data) { + super(); + __publicField(this, "icon_type"); + __publicField(this, "menu_renderer"); + __publicField(this, "target_id"); + if (Reflect.has(data, "icon") && Reflect.has(data.icon, "iconType")) + this.icon_type = data.icon.iconType; + this.menu_renderer = parser_exports.parseItem(data.menuRenderer); + this.target_id = data.targetId; + } +}; +__name(_TopbarMenuButton, "TopbarMenuButton"); +__publicField(_TopbarMenuButton, "type", "TopbarMenuButton"); +var TopbarMenuButton = _TopbarMenuButton; + +// dist/src/parser/classes/NotificationAction.js +var _NotificationAction = class _NotificationAction extends YTNode { + constructor(data) { + super(); + __publicField(this, "response_text"); + this.response_text = new Text2(data.responseText); + } +}; +__name(_NotificationAction, "NotificationAction"); +__publicField(_NotificationAction, "type", "NotificationAction"); +var NotificationAction = _NotificationAction; + +// dist/src/parser/classes/OpenOnePickAddVideoModalCommand.js +var _OpenOnePickAddVideoModalCommand = class _OpenOnePickAddVideoModalCommand extends YTNode { + constructor(data) { + super(); + __publicField(this, "list_id"); + __publicField(this, "modal_title"); + __publicField(this, "select_button_label"); + this.list_id = data.listId; + this.modal_title = data.modalTitle; + this.select_button_label = data.selectButtonLabel; + } +}; +__name(_OpenOnePickAddVideoModalCommand, "OpenOnePickAddVideoModalCommand"); +__publicField(_OpenOnePickAddVideoModalCommand, "type", "OpenOnePickAddVideoModalCommand"); +var OpenOnePickAddVideoModalCommand = _OpenOnePickAddVideoModalCommand; + +// dist/src/parser/classes/PageHeaderView.js +var _PageHeaderView = class _PageHeaderView extends YTNode { + constructor(data) { + super(); + __publicField(this, "title"); + __publicField(this, "image"); + __publicField(this, "animated_image"); + __publicField(this, "hero_image"); + __publicField(this, "metadata"); + __publicField(this, "actions"); + __publicField(this, "description"); + __publicField(this, "attributation"); + __publicField(this, "banner"); + this.title = parser_exports.parseItem(data.title, DynamicTextView); + this.image = parser_exports.parseItem(data.image, [ContentPreviewImageView, DecoratedAvatarView]); + this.animated_image = parser_exports.parseItem(data.animatedImage, ContentPreviewImageView); + this.hero_image = parser_exports.parseItem(data.heroImage, ContentPreviewImageView); + this.metadata = parser_exports.parseItem(data.metadata, ContentMetadataView); + this.actions = parser_exports.parseItem(data.actions, FlexibleActionsView); + this.description = parser_exports.parseItem(data.description, DescriptionPreviewView); + this.attributation = parser_exports.parseItem(data.attributation, AttributionView); + this.banner = parser_exports.parseItem(data.banner, ImageBannerView); + } +}; +__name(_PageHeaderView, "PageHeaderView"); +__publicField(_PageHeaderView, "type", "PageHeaderView"); +var PageHeaderView = _PageHeaderView; + +// dist/src/parser/classes/PageHeader.js +var _PageHeader = class _PageHeader extends YTNode { + constructor(data) { + super(); + __publicField(this, "page_title"); + __publicField(this, "content"); + this.page_title = data.pageTitle; + this.content = parser_exports.parseItem(data.content, PageHeaderView); + } +}; +__name(_PageHeader, "PageHeader"); +__publicField(_PageHeader, "type", "PageHeader"); +var PageHeader = _PageHeader; + +// dist/src/parser/classes/PageIntroduction.js +var _PageIntroduction = class _PageIntroduction extends YTNode { + constructor(data) { + super(); + __publicField(this, "header_text"); + __publicField(this, "body_text"); + __publicField(this, "page_title"); + __publicField(this, "header_icon_type"); + this.header_text = new Text2(data.headerText).toString(); + this.body_text = new Text2(data.bodyText).toString(); + this.page_title = new Text2(data.pageTitle).toString(); + this.header_icon_type = data.headerIcon.iconType; + } +}; +__name(_PageIntroduction, "PageIntroduction"); +__publicField(_PageIntroduction, "type", "PageIntroduction"); +var PageIntroduction = _PageIntroduction; + +// dist/src/parser/classes/PivotButton.js +var _PivotButton = class _PivotButton extends YTNode { + constructor(data) { + super(); + __publicField(this, "thumbnail"); + __publicField(this, "endpoint"); + __publicField(this, "content_description"); + __publicField(this, "target_id"); + __publicField(this, "sound_attribution_title"); + __publicField(this, "waveform_animation_style"); + __publicField(this, "background_animation_style"); + this.thumbnail = Thumbnail.fromResponse(data.thumbnail); + this.endpoint = new NavigationEndpoint(data.onClickCommand); + this.content_description = new Text2(data.contentDescription); + this.target_id = data.targetId; + this.sound_attribution_title = new Text2(data.soundAttributionTitle); + this.waveform_animation_style = data.waveformAnimationStyle; + this.background_animation_style = data.backgroundAnimationStyle; + } +}; +__name(_PivotButton, "PivotButton"); +__publicField(_PivotButton, "type", "PivotButton"); +var PivotButton = _PivotButton; + +// dist/src/parser/classes/PlayerAnnotationsExpanded.js +var _PlayerAnnotationsExpanded = class _PlayerAnnotationsExpanded extends YTNode { + constructor(data) { + super(); + __publicField(this, "featured_channel"); + __publicField(this, "allow_swipe_dismiss"); + __publicField(this, "annotation_id"); + if (Reflect.has(data, "featuredChannel")) { + this.featured_channel = { + start_time_ms: data.featuredChannel.startTimeMs, + end_time_ms: data.featuredChannel.endTimeMs, + watermark: Thumbnail.fromResponse(data.featuredChannel.watermark), + channel_name: data.featuredChannel.channelName, + endpoint: new NavigationEndpoint(data.featuredChannel.navigationEndpoint), + subscribe_button: parser_exports.parseItem(data.featuredChannel.subscribeButton) + }; + } + this.allow_swipe_dismiss = data.allowSwipeDismiss; + this.annotation_id = data.annotationId; + } +}; +__name(_PlayerAnnotationsExpanded, "PlayerAnnotationsExpanded"); +__publicField(_PlayerAnnotationsExpanded, "type", "PlayerAnnotationsExpanded"); +var PlayerAnnotationsExpanded = _PlayerAnnotationsExpanded; + +// dist/src/parser/classes/PlayerCaptchaView.js +var _PlayerCaptchaView = class _PlayerCaptchaView extends YTNode { + constructor(data) { + super(); + __publicField(this, "captcha_loading_message"); + __publicField(this, "challenge_reason"); + __publicField(this, "captcha_successful_message"); + __publicField(this, "captcha_cookie_set_failure_message"); + __publicField(this, "captcha_failed_message"); + if ("captchaLoadingMessage" in data) { + this.captcha_loading_message = Text2.fromAttributed(data.captchaLoadingMessage); + } + if ("challengeReason" in data) { + this.challenge_reason = Text2.fromAttributed(data.challengeReason); + } + if ("captchaSuccessfulMessage" in data) { + this.captcha_successful_message = Text2.fromAttributed(data.captchaSuccessfulMessage); + } + if ("captchaCookieSetFailureMessage" in data) { + this.captcha_cookie_set_failure_message = Text2.fromAttributed(data.captchaCookieSetFailureMessage); + } + if ("captchaFailedMessage" in data) { + this.captcha_failed_message = Text2.fromAttributed(data.captchaFailedMessage); + } + } +}; +__name(_PlayerCaptchaView, "PlayerCaptchaView"); +__publicField(_PlayerCaptchaView, "type", "PlayerCaptchaView"); +var PlayerCaptchaView = _PlayerCaptchaView; + +// dist/src/parser/classes/PlayerCaptionsTracklist.js +var _PlayerCaptionsTracklist = class _PlayerCaptionsTracklist extends YTNode { + constructor(data) { + super(); + __publicField(this, "caption_tracks"); + __publicField(this, "audio_tracks"); + __publicField(this, "default_audio_track_index"); + __publicField(this, "translation_languages"); + if (Reflect.has(data, "captionTracks")) { + this.caption_tracks = data.captionTracks.map((ct) => ({ + base_url: ct.baseUrl, + name: new Text2(ct.name), + vss_id: ct.vssId, + language_code: ct.languageCode, + kind: ct.kind, + is_translatable: ct.isTranslatable + })); + } + if (Reflect.has(data, "audioTracks")) { + this.audio_tracks = data.audioTracks.map((at) => ({ + audio_track_id: at.audioTrackId, + captions_initial_state: at.captionsInitialState, + default_caption_track_index: at.defaultCaptionTrackIndex, + has_default_track: at.hasDefaultTrack, + visibility: at.visibility, + caption_track_indices: at.captionTrackIndices + })); + } + if (Reflect.has(data, "defaultAudioTrackIndex")) { + this.default_audio_track_index = data.defaultAudioTrackIndex; + } + if (Reflect.has(data, "translationLanguages")) { + this.translation_languages = data.translationLanguages.map((tl) => ({ + language_code: tl.languageCode, + language_name: new Text2(tl.languageName) + })); + } + } +}; +__name(_PlayerCaptionsTracklist, "PlayerCaptionsTracklist"); +__publicField(_PlayerCaptionsTracklist, "type", "PlayerCaptionsTracklist"); +var PlayerCaptionsTracklist = _PlayerCaptionsTracklist; + +// dist/src/parser/classes/PlayerOverflow.js +var _PlayerOverflow = class _PlayerOverflow extends YTNode { + constructor(data) { + super(); + __publicField(this, "endpoint"); + __publicField(this, "enable_listen_first"); + this.endpoint = new NavigationEndpoint(data.endpoint); + this.enable_listen_first = data.enableListenFirst; + } +}; +__name(_PlayerOverflow, "PlayerOverflow"); +__publicField(_PlayerOverflow, "type", "PlayerOverflow"); +var PlayerOverflow = _PlayerOverflow; + +// dist/src/parser/classes/PlayerControlsOverlay.js +var _PlayerControlsOverlay = class _PlayerControlsOverlay extends YTNode { + constructor(data) { + super(); + __publicField(this, "overflow"); + this.overflow = parser_exports.parseItem(data.overflow, PlayerOverflow); + } +}; +__name(_PlayerControlsOverlay, "PlayerControlsOverlay"); +__publicField(_PlayerControlsOverlay, "type", "PlayerControlsOverlay"); +var PlayerControlsOverlay = _PlayerControlsOverlay; + +// dist/src/parser/classes/PlayerErrorMessage.js +var _PlayerErrorMessage = class _PlayerErrorMessage extends YTNode { + constructor(data) { + super(); + __publicField(this, "subreason"); + __publicField(this, "reason"); + __publicField(this, "proceed_button"); + __publicField(this, "thumbnails"); + __publicField(this, "icon_type"); + this.subreason = new Text2(data.subreason); + this.reason = new Text2(data.reason); + this.proceed_button = parser_exports.parseItem(data.proceedButton, Button); + this.thumbnails = Thumbnail.fromResponse(data.thumbnail); + if (Reflect.has(data, "icon")) { + this.icon_type = data.icon.iconType; + } + } +}; +__name(_PlayerErrorMessage, "PlayerErrorMessage"); +__publicField(_PlayerErrorMessage, "type", "PlayerErrorMessage"); +var PlayerErrorMessage = _PlayerErrorMessage; + +// dist/src/parser/classes/PlayerLegacyDesktopYpcOffer.js +var _PlayerLegacyDesktopYpcOffer = class _PlayerLegacyDesktopYpcOffer extends YTNode { + constructor(data) { + super(); + __publicField(this, "title"); + __publicField(this, "thumbnail"); + __publicField(this, "offer_description"); + __publicField(this, "offer_id"); + this.title = data.itemTitle; + this.thumbnail = data.itemThumbnail; + this.offer_description = data.offerDescription; + this.offer_id = data.offerId; + } +}; +__name(_PlayerLegacyDesktopYpcOffer, "PlayerLegacyDesktopYpcOffer"); +__publicField(_PlayerLegacyDesktopYpcOffer, "type", "PlayerLegacyDesktopYpcOffer"); +var PlayerLegacyDesktopYpcOffer = _PlayerLegacyDesktopYpcOffer; + +// dist/src/parser/classes/YpcTrailer.js +var _YpcTrailer = class _YpcTrailer extends YTNode { + constructor(data) { + super(); + __publicField(this, "video_message"); + __publicField(this, "player_response"); + this.video_message = data.fullVideoMessage; + this.player_response = data.unserializedPlayerResponse; + } +}; +__name(_YpcTrailer, "YpcTrailer"); +__publicField(_YpcTrailer, "type", "YpcTrailer"); +var YpcTrailer = _YpcTrailer; + +// dist/src/parser/classes/PlayerLegacyDesktopYpcTrailer.js +var _PlayerLegacyDesktopYpcTrailer = class _PlayerLegacyDesktopYpcTrailer extends YTNode { + constructor(data) { + super(); + __publicField(this, "video_id"); + __publicField(this, "title"); + __publicField(this, "thumbnail"); + __publicField(this, "offer_headline"); + __publicField(this, "offer_description"); + __publicField(this, "offer_id"); + __publicField(this, "offer_button_text"); + __publicField(this, "video_message"); + __publicField(this, "trailer"); + this.video_id = data.trailerVideoId; + this.title = data.itemTitle; + this.thumbnail = data.itemThumbnail; + this.offer_headline = data.offerHeadline; + this.offer_description = data.offerDescription; + this.offer_id = data.offerId; + this.offer_button_text = data.offerButtonText; + this.video_message = data.fullVideoMessage; + this.trailer = parser_exports.parseItem(data.ypcTrailer, YpcTrailer); + } +}; +__name(_PlayerLegacyDesktopYpcTrailer, "PlayerLegacyDesktopYpcTrailer"); +__publicField(_PlayerLegacyDesktopYpcTrailer, "type", "PlayerLegacyDesktopYpcTrailer"); +var PlayerLegacyDesktopYpcTrailer = _PlayerLegacyDesktopYpcTrailer; + +// dist/src/parser/classes/PlayerLiveStoryboardSpec.js +var _PlayerLiveStoryboardSpec = class _PlayerLiveStoryboardSpec extends YTNode { + constructor(data) { + super(); + __publicField(this, "board"); + const [template_url, thumbnail_width, thumbnail_height, columns, rows] = data.spec.split("#"); + this.board = { + type: "live", + template_url, + thumbnail_width: parseInt(thumbnail_width, 10), + thumbnail_height: parseInt(thumbnail_height, 10), + columns: parseInt(columns, 10), + rows: parseInt(rows, 10) + }; + } +}; +__name(_PlayerLiveStoryboardSpec, "PlayerLiveStoryboardSpec"); +__publicField(_PlayerLiveStoryboardSpec, "type", "PlayerLiveStoryboardSpec"); +var PlayerLiveStoryboardSpec = _PlayerLiveStoryboardSpec; + +// dist/src/parser/classes/PlayerMicroformat.js +var _PlayerMicroformat = class _PlayerMicroformat extends YTNode { + constructor(data) { + var _a, _b; + super(); + __publicField(this, "title"); + __publicField(this, "description"); + __publicField(this, "thumbnails"); + __publicField(this, "embed"); + __publicField(this, "length_seconds"); + __publicField(this, "channel"); + __publicField(this, "is_family_safe"); + __publicField(this, "is_unlisted"); + __publicField(this, "has_ypc_metadata"); + __publicField(this, "view_count"); + __publicField(this, "category"); + __publicField(this, "publish_date"); + __publicField(this, "upload_date"); + __publicField(this, "available_countries"); + __publicField(this, "start_timestamp"); + __publicField(this, "end_timestamp"); + this.title = new Text2(data.title); + this.description = new Text2(data.description); + this.thumbnails = Thumbnail.fromResponse(data.thumbnail); + if (Reflect.has(data, "embed")) { + this.embed = { + iframe_url: data.embed.iframeUrl, + flash_url: data.embed.flashUrl, + flash_secure_url: data.embed.flashSecureUrl, + width: data.embed.width, + height: data.embed.height + }; + } + this.length_seconds = parseInt(data.lengthSeconds); + this.channel = { + id: data.externalChannelId, + name: data.ownerChannelName, + url: data.ownerProfileUrl + }; + this.is_family_safe = !!data.isFamilySafe; + this.is_unlisted = !!data.isUnlisted; + this.has_ypc_metadata = !!data.hasYpcMetadata; + this.view_count = parseInt(data.viewCount); + this.category = data.category; + this.publish_date = data.publishDate; + this.upload_date = data.uploadDate; + this.available_countries = data.availableCountries; + this.start_timestamp = ((_a = data.liveBroadcastDetails) == null ? void 0 : _a.startTimestamp) ? new Date(data.liveBroadcastDetails.startTimestamp) : null; + this.end_timestamp = ((_b = data.liveBroadcastDetails) == null ? void 0 : _b.endTimestamp) ? new Date(data.liveBroadcastDetails.endTimestamp) : null; + } +}; +__name(_PlayerMicroformat, "PlayerMicroformat"); +__publicField(_PlayerMicroformat, "type", "PlayerMicroformat"); +var PlayerMicroformat = _PlayerMicroformat; + +// dist/src/parser/classes/PlayerOverlayAutoplay.js +var _PlayerOverlayAutoplay = class _PlayerOverlayAutoplay extends YTNode { + constructor(data) { + super(); + __publicField(this, "title"); + __publicField(this, "video_id"); + __publicField(this, "video_title"); + __publicField(this, "short_view_count"); + // @TODO: Find out what these are. + __publicField(this, "prefer_immediate_redirect"); + __publicField(this, "count_down_secs_for_fullscreen"); + __publicField(this, "published"); + __publicField(this, "background"); + __publicField(this, "thumbnail_overlays"); + __publicField(this, "author"); + __publicField(this, "cancel_button"); + __publicField(this, "next_button"); + __publicField(this, "close_button"); + this.title = new Text2(data.title); + this.video_id = data.videoId; + this.video_title = new Text2(data.videoTitle); + this.short_view_count = new Text2(data.shortViewCountText); + this.prefer_immediate_redirect = data.preferImmediateRedirect; + this.count_down_secs_for_fullscreen = data.countDownSecsForFullscreen; + this.published = new Text2(data.publishedTimeText); + this.background = Thumbnail.fromResponse(data.background); + this.thumbnail_overlays = parser_exports.parseArray(data.thumbnailOverlays); + this.author = new Author(data.byline); + this.cancel_button = parser_exports.parseItem(data.cancelButton, Button); + this.next_button = parser_exports.parseItem(data.nextButton, Button); + this.close_button = parser_exports.parseItem(data.closeButton, Button); + } +}; +__name(_PlayerOverlayAutoplay, "PlayerOverlayAutoplay"); +__publicField(_PlayerOverlayAutoplay, "type", "PlayerOverlayAutoplay"); +var PlayerOverlayAutoplay = _PlayerOverlayAutoplay; + +// dist/src/parser/classes/PlayerOverlayVideoDetails.js +var _PlayerOverlayVideoDetails = class _PlayerOverlayVideoDetails extends YTNode { + constructor(data) { + super(); + __publicField(this, "title"); + __publicField(this, "subtitle"); + this.title = new Text2(data.title); + this.subtitle = new Text2(data.subtitle); + } +}; +__name(_PlayerOverlayVideoDetails, "PlayerOverlayVideoDetails"); +__publicField(_PlayerOverlayVideoDetails, "type", "PlayerOverlayVideoDetails"); +var PlayerOverlayVideoDetails = _PlayerOverlayVideoDetails; + +// dist/src/parser/classes/WatchNextEndScreen.js +var _WatchNextEndScreen = class _WatchNextEndScreen extends YTNode { + constructor(data) { + super(); + __publicField(this, "results"); + __publicField(this, "title"); + this.results = parser_exports.parseArray(data.results, [EndScreenVideo, EndScreenPlaylist]); + this.title = new Text2(data.title).toString(); + } +}; +__name(_WatchNextEndScreen, "WatchNextEndScreen"); +__publicField(_WatchNextEndScreen, "type", "WatchNextEndScreen"); +var WatchNextEndScreen = _WatchNextEndScreen; + +// dist/src/parser/classes/PlayerOverlay.js +var _PlayerOverlay = class _PlayerOverlay extends YTNode { + constructor(data) { + super(); + __publicField(this, "end_screen"); + __publicField(this, "autoplay"); + __publicField(this, "share_button"); + __publicField(this, "add_to_menu"); + __publicField(this, "fullscreen_engagement"); + __publicField(this, "actions"); + __publicField(this, "browser_media_session"); + __publicField(this, "decorated_player_bar"); + __publicField(this, "video_details"); + this.end_screen = parser_exports.parseItem(data.endScreen, WatchNextEndScreen); + this.autoplay = parser_exports.parseItem(data.autoplay, PlayerOverlayAutoplay); + this.share_button = parser_exports.parseItem(data.shareButton, Button); + this.add_to_menu = parser_exports.parseItem(data.addToMenu, Menu); + this.fullscreen_engagement = parser_exports.parseItem(data.fullscreenEngagement); + this.actions = parser_exports.parseArray(data.actions); + this.browser_media_session = parser_exports.parseItem(data.browserMediaSession); + this.decorated_player_bar = parser_exports.parseItem(data.decoratedPlayerBarRenderer, DecoratedPlayerBar); + this.video_details = parser_exports.parseItem(data.videoDetails, PlayerOverlayVideoDetails); + } +}; +__name(_PlayerOverlay, "PlayerOverlay"); +__publicField(_PlayerOverlay, "type", "PlayerOverlay"); +var PlayerOverlay = _PlayerOverlay; + +// dist/src/parser/classes/PlaylistHeader.js +var _PlaylistHeader = class _PlaylistHeader extends YTNode { + constructor(data) { + super(); + __publicField(this, "id"); + __publicField(this, "title"); + __publicField(this, "subtitle"); + __publicField(this, "stats"); + __publicField(this, "brief_stats"); + __publicField(this, "author"); + __publicField(this, "description"); + __publicField(this, "num_videos"); + __publicField(this, "view_count"); + __publicField(this, "can_share"); + __publicField(this, "can_delete"); + __publicField(this, "is_editable"); + __publicField(this, "privacy"); + __publicField(this, "save_button"); + __publicField(this, "shuffle_play_button"); + __publicField(this, "menu"); + __publicField(this, "banner"); + this.id = data.playlistId; + this.title = new Text2(data.title); + this.subtitle = data.subtitle ? new Text2(data.subtitle) : null; + this.stats = data.stats.map((stat) => new Text2(stat)); + this.brief_stats = data.briefStats.map((stat) => new Text2(stat)); + this.author = data.ownerText || data.ownerEndpoint ? new Author({ ...data.ownerText, navigationEndpoint: data.ownerEndpoint }, data.ownerBadges, null) : null; + this.description = new Text2(data.descriptionText); + this.num_videos = new Text2(data.numVideosText); + this.view_count = new Text2(data.viewCountText); + this.can_share = data.shareData.canShare; + this.can_delete = data.editableDetails.canDelete; + this.is_editable = data.isEditable; + this.privacy = data.privacy; + this.save_button = parser_exports.parseItem(data.saveButton); + this.shuffle_play_button = parser_exports.parseItem(data.shufflePlayButton); + this.menu = parser_exports.parseItem(data.moreActionsMenu); + this.banner = parser_exports.parseItem(data.playlistHeaderBanner); + } +}; +__name(_PlaylistHeader, "PlaylistHeader"); +__publicField(_PlaylistHeader, "type", "PlaylistHeader"); +var PlaylistHeader = _PlaylistHeader; + +// dist/src/parser/classes/PlaylistInfoCardContent.js +var _PlaylistInfoCardContent = class _PlaylistInfoCardContent extends YTNode { + constructor(data) { + super(); + __publicField(this, "title"); + __publicField(this, "thumbnails"); + __publicField(this, "video_count"); + __publicField(this, "channel_name"); + __publicField(this, "endpoint"); + this.title = new Text2(data.playlistTitle); + this.thumbnails = Thumbnail.fromResponse(data.thumbnail); + this.video_count = new Text2(data.playlistVideoCount); + this.channel_name = new Text2(data.channelName); + this.endpoint = new NavigationEndpoint(data.action); + } +}; +__name(_PlaylistInfoCardContent, "PlaylistInfoCardContent"); +__publicField(_PlaylistInfoCardContent, "type", "PlaylistInfoCardContent"); +var PlaylistInfoCardContent = _PlaylistInfoCardContent; + +// dist/src/parser/classes/PlaylistMetadata.js +var _PlaylistMetadata = class _PlaylistMetadata extends YTNode { + constructor(data) { + super(); + __publicField(this, "title"); + __publicField(this, "description"); + this.title = data.title; + this.description = data.description || null; + } +}; +__name(_PlaylistMetadata, "PlaylistMetadata"); +__publicField(_PlaylistMetadata, "type", "PlaylistMetadata"); +var PlaylistMetadata = _PlaylistMetadata; + +// dist/src/parser/classes/PlaylistSidebar.js +var _PlaylistSidebar = class _PlaylistSidebar extends YTNode { + constructor(data) { + super(); + __publicField(this, "items"); + this.items = parser_exports.parseArray(data.items); + } + // XXX: alias for consistency + get contents() { + return this.items; + } +}; +__name(_PlaylistSidebar, "PlaylistSidebar"); +__publicField(_PlaylistSidebar, "type", "PlaylistSidebar"); +var PlaylistSidebar = _PlaylistSidebar; + +// dist/src/parser/classes/PlaylistSidebarPrimaryInfo.js +var _PlaylistSidebarPrimaryInfo = class _PlaylistSidebarPrimaryInfo extends YTNode { + constructor(data) { + super(); + __publicField(this, "stats"); + __publicField(this, "thumbnail_renderer"); + __publicField(this, "title"); + __publicField(this, "menu"); + __publicField(this, "endpoint"); + __publicField(this, "description"); + this.stats = data.stats.map((stat) => new Text2(stat)); + this.thumbnail_renderer = parser_exports.parseItem(data.thumbnailRenderer); + this.title = new Text2(data.title); + this.menu = parser_exports.parseItem(data.menu); + this.endpoint = new NavigationEndpoint(data.navigationEndpoint); + this.description = new Text2(data.description); + } +}; +__name(_PlaylistSidebarPrimaryInfo, "PlaylistSidebarPrimaryInfo"); +__publicField(_PlaylistSidebarPrimaryInfo, "type", "PlaylistSidebarPrimaryInfo"); +var PlaylistSidebarPrimaryInfo = _PlaylistSidebarPrimaryInfo; + +// dist/src/parser/classes/PlaylistSidebarSecondaryInfo.js +var _PlaylistSidebarSecondaryInfo = class _PlaylistSidebarSecondaryInfo extends YTNode { + constructor(data) { + super(); + __publicField(this, "owner"); + __publicField(this, "button"); + this.owner = parser_exports.parseItem(data.videoOwner); + this.button = parser_exports.parseItem(data.button); + } +}; +__name(_PlaylistSidebarSecondaryInfo, "PlaylistSidebarSecondaryInfo"); +__publicField(_PlaylistSidebarSecondaryInfo, "type", "PlaylistSidebarSecondaryInfo"); +var PlaylistSidebarSecondaryInfo = _PlaylistSidebarSecondaryInfo; + +// dist/src/parser/classes/PlaylistThumbnailOverlay.js +var _PlaylistThumbnailOverlay = class _PlaylistThumbnailOverlay extends YTNode { + constructor(data) { + super(); + __publicField(this, "icon_type"); + __publicField(this, "text"); + if (Reflect.has(data, "icon")) + this.icon_type = data.icon.iconType; + this.text = new Text2(data.text); + } +}; +__name(_PlaylistThumbnailOverlay, "PlaylistThumbnailOverlay"); +__publicField(_PlaylistThumbnailOverlay, "type", "PlaylistThumbnailOverlay"); +var PlaylistThumbnailOverlay = _PlaylistThumbnailOverlay; + +// dist/src/parser/classes/PlaylistVideo.js +var _PlaylistVideo = class _PlaylistVideo extends YTNode { + constructor(data) { + super(); + __publicField(this, "id"); + __publicField(this, "index"); + __publicField(this, "title"); + __publicField(this, "author"); + __publicField(this, "thumbnails"); + __publicField(this, "thumbnail_overlays"); + __publicField(this, "set_video_id"); + __publicField(this, "endpoint"); + __publicField(this, "is_playable"); + __publicField(this, "menu"); + __publicField(this, "upcoming"); + __publicField(this, "video_info"); + __publicField(this, "accessibility_label"); + __publicField(this, "style"); + __publicField(this, "duration"); + this.id = data.videoId; + this.index = new Text2(data.index); + this.title = new Text2(data.title); + this.author = new Author(data.shortBylineText); + this.thumbnails = Thumbnail.fromResponse(data.thumbnail); + this.thumbnail_overlays = parser_exports.parseArray(data.thumbnailOverlays); + this.set_video_id = data == null ? void 0 : data.setVideoId; + this.endpoint = new NavigationEndpoint(data.navigationEndpoint); + this.is_playable = data.isPlayable; + this.menu = parser_exports.parseItem(data.menu, Menu); + this.video_info = new Text2(data.videoInfo); + this.accessibility_label = data.title.accessibility.accessibilityData.label; + if (Reflect.has(data, "style")) { + this.style = data.style; + } + const upcoming = data.upcomingEventData && Number(`${data.upcomingEventData.startTime}000`); + if (upcoming) { + this.upcoming = new Date(upcoming); + } + this.duration = { + text: new Text2(data.lengthText).toString(), + seconds: parseInt(data.lengthSeconds) + }; + } + get is_live() { + var _a; + return ((_a = this.thumbnail_overlays.firstOfType(ThumbnailOverlayTimeStatus)) == null ? void 0 : _a.style) === "LIVE"; + } + get is_upcoming() { + var _a; + return ((_a = this.thumbnail_overlays.firstOfType(ThumbnailOverlayTimeStatus)) == null ? void 0 : _a.style) === "UPCOMING"; + } +}; +__name(_PlaylistVideo, "PlaylistVideo"); +__publicField(_PlaylistVideo, "type", "PlaylistVideo"); +var PlaylistVideo = _PlaylistVideo; + +// dist/src/parser/classes/PlaylistVideoList.js +var _PlaylistVideoList = class _PlaylistVideoList extends YTNode { + constructor(data) { + super(); + __publicField(this, "id"); + __publicField(this, "is_editable"); + __publicField(this, "can_reorder"); + __publicField(this, "videos"); + this.id = data.playlistId; + this.is_editable = data.isEditable; + this.can_reorder = data.canReorder; + this.videos = parser_exports.parseArray(data.contents); + } +}; +__name(_PlaylistVideoList, "PlaylistVideoList"); +__publicField(_PlaylistVideoList, "type", "PlaylistVideoList"); +var PlaylistVideoList = _PlaylistVideoList; + +// dist/src/parser/classes/Poll.js +var _Poll = class _Poll extends YTNode { + constructor(data) { + super(); + __publicField(this, "choices"); + __publicField(this, "poll_type"); + __publicField(this, "total_votes"); + __publicField(this, "live_chat_poll_id"); + this.choices = data.choices.map((choice) => ({ + text: new Text2(choice.text), + select_endpoint: choice.selectServiceEndpoint ? new NavigationEndpoint(choice.selectServiceEndpoint) : null, + deselect_endpoint: choice.deselectServiceEndpoint ? new NavigationEndpoint(choice.deselectServiceEndpoint) : null, + vote_ratio_if_selected: (choice == null ? void 0 : choice.voteRatioIfSelected) || null, + vote_percentage_if_selected: new Text2(choice.votePercentageIfSelected), + vote_ratio_if_not_selected: (choice == null ? void 0 : choice.voteRatioIfSelected) || null, + vote_percentage_if_not_selected: new Text2(choice.votePercentageIfSelected), + image: choice.image ? Thumbnail.fromResponse(choice.image) : null + })); + if (Reflect.has(data, "type")) + this.poll_type = data.type; + if (Reflect.has(data, "totalVotes")) + this.total_votes = new Text2(data.totalVotes); + if (Reflect.has(data, "liveChatPollId")) + this.live_chat_poll_id = data.liveChatPollId; + } +}; +__name(_Poll, "Poll"); +__publicField(_Poll, "type", "Poll"); +var Poll = _Poll; + +// dist/src/parser/classes/Post.js +var _Post = class _Post extends BackstagePost { + constructor(data) { + super(data); + } +}; +__name(_Post, "Post"); +__publicField(_Post, "type", "Post"); +var Post = _Post; + +// dist/src/parser/classes/PostMultiImage.js +var _PostMultiImage = class _PostMultiImage extends YTNode { + constructor(data) { + super(); + __publicField(this, "images"); + this.images = parser_exports.parseArray(data.images, BackstageImage); + } +}; +__name(_PostMultiImage, "PostMultiImage"); +__publicField(_PostMultiImage, "type", "PostMultiImage"); +var PostMultiImage = _PostMultiImage; + +// dist/src/parser/classes/PremiereTrailerBadge.js +var _PremiereTrailerBadge = class _PremiereTrailerBadge extends YTNode { + constructor(data) { + super(); + __publicField(this, "label"); + this.label = new Text2(data.label); + } +}; +__name(_PremiereTrailerBadge, "PremiereTrailerBadge"); +__publicField(_PremiereTrailerBadge, "type", "PremiereTrailerBadge"); +var PremiereTrailerBadge = _PremiereTrailerBadge; + +// dist/src/parser/classes/ProductListHeader.js +var _ProductListHeader = class _ProductListHeader extends YTNode { + constructor(data) { + super(); + __publicField(this, "title"); + __publicField(this, "suppress_padding_disclaimer"); + this.title = new Text2(data.title); + this.suppress_padding_disclaimer = !!data.suppressPaddingDisclaimer; + } +}; +__name(_ProductListHeader, "ProductListHeader"); +__publicField(_ProductListHeader, "type", "ProductListHeader"); +var ProductListHeader = _ProductListHeader; + +// dist/src/parser/classes/ProductListItem.js +var _ProductListItem = class _ProductListItem extends YTNode { + constructor(data) { + super(); + __publicField(this, "title"); + __publicField(this, "accessibility_title"); + __publicField(this, "thumbnail"); + __publicField(this, "price"); + __publicField(this, "endpoint"); + __publicField(this, "merchant_name"); + __publicField(this, "stay_in_app"); + __publicField(this, "view_button"); + this.title = new Text2(data.title); + this.accessibility_title = data.accessibilityTitle; + this.thumbnail = Thumbnail.fromResponse(data.thumbnail); + this.price = data.price; + this.endpoint = new NavigationEndpoint(data.onClickCommand); + this.merchant_name = data.merchantName; + this.stay_in_app = !!data.stayInApp; + this.view_button = parser_exports.parseItem(data.viewButton, Button); + } +}; +__name(_ProductListItem, "ProductListItem"); +__publicField(_ProductListItem, "type", "ProductListItem"); +var ProductListItem = _ProductListItem; + +// dist/src/parser/classes/ProfileColumn.js +var _ProfileColumn = class _ProfileColumn extends YTNode { + constructor(data) { + super(); + __publicField(this, "items"); + this.items = parser_exports.parseArray(data.items); + } + // XXX: Alias for consistency. + get contents() { + return this.items; + } +}; +__name(_ProfileColumn, "ProfileColumn"); +__publicField(_ProfileColumn, "type", "ProfileColumn"); +var ProfileColumn = _ProfileColumn; + +// dist/src/parser/classes/ProfileColumnStats.js +var _ProfileColumnStats = class _ProfileColumnStats extends YTNode { + constructor(data) { + super(); + __publicField(this, "items"); + this.items = parser_exports.parseArray(data.items); + } + // XXX: Alias for consistency. + get contents() { + return this.items; + } +}; +__name(_ProfileColumnStats, "ProfileColumnStats"); +__publicField(_ProfileColumnStats, "type", "ProfileColumnStats"); +var ProfileColumnStats = _ProfileColumnStats; + +// dist/src/parser/classes/ProfileColumnStatsEntry.js +var _ProfileColumnStatsEntry = class _ProfileColumnStatsEntry extends YTNode { + constructor(data) { + super(); + __publicField(this, "label"); + __publicField(this, "value"); + this.label = new Text2(data.label); + this.value = new Text2(data.value); + } +}; +__name(_ProfileColumnStatsEntry, "ProfileColumnStatsEntry"); +__publicField(_ProfileColumnStatsEntry, "type", "ProfileColumnStatsEntry"); +var ProfileColumnStatsEntry = _ProfileColumnStatsEntry; + +// dist/src/parser/classes/ProfileColumnUserInfo.js +var _ProfileColumnUserInfo = class _ProfileColumnUserInfo extends YTNode { + constructor(data) { + super(); + __publicField(this, "title"); + __publicField(this, "thumbnails"); + this.title = new Text2(data.title); + this.thumbnails = Thumbnail.fromResponse(data.thumbnail); + } +}; +__name(_ProfileColumnUserInfo, "ProfileColumnUserInfo"); +__publicField(_ProfileColumnUserInfo, "type", "ProfileColumnUserInfo"); +var ProfileColumnUserInfo = _ProfileColumnUserInfo; + +// dist/src/parser/classes/Quiz.js +var _Quiz = class _Quiz extends YTNode { + constructor(data) { + super(); + __publicField(this, "choices"); + __publicField(this, "total_votes"); + this.choices = data.choices.map((choice) => ({ + text: new Text2(choice.text), + is_correct: choice.isCorrect + })); + this.total_votes = new Text2(data.totalVotes); + } +}; +__name(_Quiz, "Quiz"); +__publicField(_Quiz, "type", "Quiz"); +var Quiz = _Quiz; + +// dist/src/parser/classes/RecognitionShelf.js +var _RecognitionShelf = class _RecognitionShelf extends YTNode { + constructor(data) { + super(); + __publicField(this, "title"); + __publicField(this, "subtitle"); + __publicField(this, "avatars"); + __publicField(this, "button"); + __publicField(this, "surface"); + this.title = new Text2(data.title); + this.subtitle = new Text2(data.subtitle); + this.avatars = data.avatars.map((avatar) => new Thumbnail(avatar)); + this.button = parser_exports.parseItem(data.button, Button); + this.surface = data.surface; + } +}; +__name(_RecognitionShelf, "RecognitionShelf"); +__publicField(_RecognitionShelf, "type", "RecognitionShelf"); +var RecognitionShelf = _RecognitionShelf; + +// dist/src/parser/classes/ReelItem.js +var _ReelItem = class _ReelItem extends YTNode { + constructor(data) { + super(); + __publicField(this, "id"); + __publicField(this, "title"); + __publicField(this, "thumbnails"); + __publicField(this, "views"); + __publicField(this, "endpoint"); + __publicField(this, "accessibility"); + this.id = data.videoId; + this.title = new Text2(data.headline); + this.thumbnails = Thumbnail.fromResponse(data.thumbnail); + this.views = new Text2(data.viewCountText); + this.endpoint = new NavigationEndpoint(data.navigationEndpoint); + if ("accessibility" in data && "accessibilityData" in data.accessibility) { + this.accessibility = { + accessibility_data: new AccessibilityData(data.accessibility.accessibilityData) + }; + } + } + get label() { + var _a, _b; + return (_b = (_a = this.accessibility) == null ? void 0 : _a.accessibility_data) == null ? void 0 : _b.label; + } +}; +__name(_ReelItem, "ReelItem"); +__publicField(_ReelItem, "type", "ReelItem"); +var ReelItem = _ReelItem; + +// dist/src/parser/classes/ReelPlayerHeader.js +var _ReelPlayerHeader = class _ReelPlayerHeader extends YTNode { + constructor(data) { + super(); + __publicField(this, "reel_title_text"); + __publicField(this, "timestamp_text"); + __publicField(this, "channel_title_text"); + __publicField(this, "channel_thumbnail"); + __publicField(this, "author"); + this.reel_title_text = new Text2(data.reelTitleText); + this.timestamp_text = new Text2(data.timestampText); + this.channel_title_text = new Text2(data.channelTitleText); + this.channel_thumbnail = Thumbnail.fromResponse(data.channelThumbnail); + this.author = new Author(data.channelNavigationEndpoint, void 0); + } +}; +__name(_ReelPlayerHeader, "ReelPlayerHeader"); +__publicField(_ReelPlayerHeader, "type", "ReelPlayerHeader"); +var ReelPlayerHeader = _ReelPlayerHeader; + +// dist/src/parser/classes/ReelPlayerOverlay.js +var _ReelPlayerOverlay = class _ReelPlayerOverlay extends YTNode { + constructor(data) { + super(); + __publicField(this, "like_button"); + __publicField(this, "reel_player_header_supported_renderers"); + __publicField(this, "menu"); + __publicField(this, "next_item_button"); + __publicField(this, "prev_item_button"); + __publicField(this, "subscribe_button_renderer"); + __publicField(this, "style"); + __publicField(this, "view_comments_button"); + __publicField(this, "share_button"); + __publicField(this, "pivot_button"); + __publicField(this, "info_panel"); + this.like_button = parser_exports.parseItem(data.likeButton, LikeButton); + this.reel_player_header_supported_renderers = parser_exports.parseItem(data.reelPlayerHeaderSupportedRenderers, ReelPlayerHeader); + this.menu = parser_exports.parseItem(data.menu, Menu); + this.next_item_button = parser_exports.parseItem(data.nextItemButton, Button); + this.prev_item_button = parser_exports.parseItem(data.prevItemButton, Button); + this.subscribe_button_renderer = parser_exports.parseItem(data.subscribeButtonRenderer, [Button, SubscribeButton]); + this.style = data.style; + this.view_comments_button = parser_exports.parseItem(data.viewCommentsButton, Button); + this.share_button = parser_exports.parseItem(data.shareButton, Button); + this.pivot_button = parser_exports.parseItem(data.pivotButton, PivotButton); + this.info_panel = parser_exports.parseItem(data.infoPanel, InfoPanelContainer); + } +}; +__name(_ReelPlayerOverlay, "ReelPlayerOverlay"); +__publicField(_ReelPlayerOverlay, "type", "ReelPlayerOverlay"); +var ReelPlayerOverlay = _ReelPlayerOverlay; + +// dist/src/parser/classes/RelatedChipCloud.js +var _RelatedChipCloud = class _RelatedChipCloud extends YTNode { + constructor(data) { + super(); + __publicField(this, "content"); + this.content = parser_exports.parseItem(data.content); + } +}; +__name(_RelatedChipCloud, "RelatedChipCloud"); +__publicField(_RelatedChipCloud, "type", "RelatedChipCloud"); +var RelatedChipCloud = _RelatedChipCloud; + +// dist/src/parser/classes/RichGrid.js +var _RichGrid = class _RichGrid extends YTNode { + constructor(data) { + super(); + __publicField(this, "header"); + __publicField(this, "contents"); + __publicField(this, "target_id"); + this.header = parser_exports.parseItem(data.header); + this.contents = parser_exports.parseArray(data.contents); + if (Reflect.has(data, "targetId")) + this.target_id = data.targetId; + } +}; +__name(_RichGrid, "RichGrid"); +__publicField(_RichGrid, "type", "RichGrid"); +var RichGrid = _RichGrid; + +// dist/src/parser/classes/RichItem.js +var _RichItem = class _RichItem extends YTNode { + constructor(data) { + super(); + __publicField(this, "content"); + this.content = parser_exports.parseItem(data.content); + } +}; +__name(_RichItem, "RichItem"); +__publicField(_RichItem, "type", "RichItem"); +var RichItem = _RichItem; + +// dist/src/parser/classes/RichListHeader.js +var _RichListHeader = class _RichListHeader extends YTNode { + constructor(data) { + super(); + __publicField(this, "title"); + __publicField(this, "subtitle"); + __publicField(this, "title_style"); + __publicField(this, "icon_type"); + this.title = new Text2(data.title); + this.subtitle = new Text2(data.subtitle); + if (Reflect.has(data, "titleStyle")) { + this.title_style = data.titleStyle.style; + } + if (Reflect.has(data, "icon")) { + this.icon_type = data.icon.iconType; + } + } +}; +__name(_RichListHeader, "RichListHeader"); +__publicField(_RichListHeader, "type", "RichListHeader"); +var RichListHeader = _RichListHeader; + +// dist/src/parser/classes/RichMetadata.js +var _RichMetadata = class _RichMetadata extends YTNode { + constructor(data) { + super(); + __publicField(this, "thumbnail"); + __publicField(this, "title"); + __publicField(this, "subtitle"); + __publicField(this, "call_to_action"); + __publicField(this, "icon_type"); + __publicField(this, "endpoint"); + this.thumbnail = Thumbnail.fromResponse(data.thumbnail); + this.title = new Text2(data.title); + this.subtitle = new Text2(data.subtitle); + this.call_to_action = new Text2(data.callToAction); + if (Reflect.has(data, "callToActionIcon")) { + this.icon_type = data.callToActionIcon.iconType; + } + this.endpoint = new NavigationEndpoint(data.endpoint); + } +}; +__name(_RichMetadata, "RichMetadata"); +__publicField(_RichMetadata, "type", "RichMetadata"); +var RichMetadata = _RichMetadata; + +// dist/src/parser/classes/RichMetadataRow.js +var _RichMetadataRow = class _RichMetadataRow extends YTNode { + constructor(data) { + super(); + __publicField(this, "contents"); + this.contents = parser_exports.parseArray(data.contents); + } +}; +__name(_RichMetadataRow, "RichMetadataRow"); +__publicField(_RichMetadataRow, "type", "RichMetadataRow"); +var RichMetadataRow = _RichMetadataRow; + +// dist/src/parser/classes/RichSection.js +var _RichSection = class _RichSection extends YTNode { + constructor(data) { + super(); + __publicField(this, "content"); + __publicField(this, "full_bleed"); + __publicField(this, "target_id"); + this.content = parser_exports.parseItem(data.content); + this.full_bleed = !!data.fullBleed; + if ("targetId" in data) { + this.target_id = data.targetId; + } + } +}; +__name(_RichSection, "RichSection"); +__publicField(_RichSection, "type", "RichSection"); +var RichSection = _RichSection; + +// dist/src/parser/classes/RichShelf.js +var _RichShelf = class _RichShelf extends YTNode { + constructor(data) { + super(); + __publicField(this, "title"); + __publicField(this, "contents"); + __publicField(this, "endpoint"); + __publicField(this, "subtitle"); + __publicField(this, "is_expanded"); + __publicField(this, "is_bottom_divider_hidden"); + __publicField(this, "is_top_divider_hidden"); + __publicField(this, "layout_sizing"); + __publicField(this, "icon_type"); + __publicField(this, "menu"); + __publicField(this, "next_button"); + __publicField(this, "previous_button"); + this.title = new Text2(data.title); + this.contents = parser_exports.parseArray(data.contents); + this.is_expanded = !!data.is_expanded; + this.is_bottom_divider_hidden = !!data.isBottomDividerHidden; + this.is_top_divider_hidden = !!data.isTopDividerHidden; + if ("endpoint" in data) { + this.endpoint = new NavigationEndpoint(data.endpoint); + } + if ("subtitle" in data) { + this.subtitle = new Text2(data.subtitle); + } + if ("layoutSizing" in data) { + this.layout_sizing = data.layoutSizing; + } + if ("icon" in data) { + this.icon_type = data.icon.iconType; + } + this.menu = parser_exports.parseItem(data.menu); + this.next_button = parser_exports.parseItem(data.nextButton); + this.previous_button = parser_exports.parseItem(data.previousButton); + } +}; +__name(_RichShelf, "RichShelf"); +__publicField(_RichShelf, "type", "RichShelf"); +var RichShelf = _RichShelf; + +// dist/src/parser/classes/SearchFilter.js +var _SearchFilter = class _SearchFilter extends YTNode { + constructor(data) { + super(); + __publicField(this, "label"); + __publicField(this, "endpoint"); + __publicField(this, "tooltip"); + __publicField(this, "status"); + this.label = new Text2(data.label); + this.endpoint = new NavigationEndpoint(data.endpoint || data.navigationEndpoint); + this.tooltip = data.tooltip; + if (Reflect.has(data, "status")) { + this.status = data.status; + } + } + get disabled() { + return this.status === "FILTER_STATUS_DISABLED"; + } + get selected() { + return this.status === "FILTER_STATUS_SELECTED"; + } +}; +__name(_SearchFilter, "SearchFilter"); +__publicField(_SearchFilter, "type", "SearchFilter"); +var SearchFilter2 = _SearchFilter; + +// dist/src/parser/classes/SearchFilterGroup.js +var _SearchFilterGroup = class _SearchFilterGroup extends YTNode { + constructor(data) { + super(); + __publicField(this, "title"); + __publicField(this, "filters"); + this.title = new Text2(data.title); + this.filters = parser_exports.parseArray(data.filters, SearchFilter2); + } +}; +__name(_SearchFilterGroup, "SearchFilterGroup"); +__publicField(_SearchFilterGroup, "type", "SearchFilterGroup"); +var SearchFilterGroup = _SearchFilterGroup; + +// dist/src/parser/classes/SearchFilterOptionsDialog.js +var _SearchFilterOptionsDialog = class _SearchFilterOptionsDialog extends YTNode { + constructor(data) { + super(); + __publicField(this, "title"); + __publicField(this, "groups"); + this.title = new Text2(data.title); + this.groups = parser_exports.parseArray(data.groups, SearchFilterGroup); + } +}; +__name(_SearchFilterOptionsDialog, "SearchFilterOptionsDialog"); +__publicField(_SearchFilterOptionsDialog, "type", "SearchFilterOptionsDialog"); +var SearchFilterOptionsDialog = _SearchFilterOptionsDialog; + +// dist/src/parser/classes/SearchHeader.js +var _SearchHeader = class _SearchHeader extends YTNode { + constructor(data) { + super(); + __publicField(this, "chip_bar"); + __publicField(this, "search_filter_button"); + this.chip_bar = parser_exports.parseItem(data.chipBar, ChipCloud); + this.search_filter_button = parser_exports.parseItem(data.searchFilterButton, Button); + } +}; +__name(_SearchHeader, "SearchHeader"); +__publicField(_SearchHeader, "type", "SearchHeader"); +var SearchHeader = _SearchHeader; + +// dist/src/parser/classes/SearchSubMenu.js +var _SearchSubMenu = class _SearchSubMenu extends YTNode { + constructor(data) { + super(); + __publicField(this, "title"); + __publicField(this, "groups"); + __publicField(this, "button"); + if (Reflect.has(data, "title")) + this.title = new Text2(data.title); + if (Reflect.has(data, "groups")) + this.groups = parser_exports.parseArray(data.groups, SearchFilterGroup); + if (Reflect.has(data, "button")) + this.button = parser_exports.parseItem(data.button, ToggleButton); + } +}; +__name(_SearchSubMenu, "SearchSubMenu"); +__publicField(_SearchSubMenu, "type", "SearchSubMenu"); +var SearchSubMenu = _SearchSubMenu; + +// dist/src/parser/classes/SearchSuggestionsSection.js +var _SearchSuggestionsSection = class _SearchSuggestionsSection extends YTNode { + constructor(data) { + super(); + __publicField(this, "contents"); + this.contents = parser_exports.parseArray(data.contents); + } +}; +__name(_SearchSuggestionsSection, "SearchSuggestionsSection"); +__publicField(_SearchSuggestionsSection, "type", "SearchSuggestionsSection"); +var SearchSuggestionsSection = _SearchSuggestionsSection; + +// dist/src/parser/classes/UniversalWatchCard.js +var _UniversalWatchCard = class _UniversalWatchCard extends YTNode { + constructor(data) { + super(); + __publicField(this, "header"); + __publicField(this, "call_to_action"); + __publicField(this, "sections"); + __publicField(this, "collapsed_label"); + this.header = parser_exports.parseItem(data.header); + this.call_to_action = parser_exports.parseItem(data.callToAction); + this.sections = parser_exports.parseArray(data.sections); + if (Reflect.has(data, "collapsedLabel")) { + this.collapsed_label = new Text2(data.collapsedLabel); + } + } +}; +__name(_UniversalWatchCard, "UniversalWatchCard"); +__publicField(_UniversalWatchCard, "type", "UniversalWatchCard"); +var UniversalWatchCard = _UniversalWatchCard; + +// dist/src/parser/classes/SecondarySearchContainer.js +var _SecondarySearchContainer = class _SecondarySearchContainer extends YTNode { + constructor(data) { + super(); + __publicField(this, "target_id"); + __publicField(this, "contents"); + this.contents = parser_exports.parseArray(data.contents, [UniversalWatchCard]); + } +}; +__name(_SecondarySearchContainer, "SecondarySearchContainer"); +__publicField(_SecondarySearchContainer, "type", "SecondarySearchContainer"); +var SecondarySearchContainer = _SecondarySearchContainer; + +// dist/src/parser/classes/SectionHeaderView.js +var _SectionHeaderView = class _SectionHeaderView extends YTNode { + constructor(data) { + super(); + __publicField(this, "headline"); + this.headline = Text2.fromAttributed(data.headline); + } +}; +__name(_SectionHeaderView, "SectionHeaderView"); +__publicField(_SectionHeaderView, "type", "SectionHeaderView"); +var SectionHeaderView = _SectionHeaderView; + +// dist/src/parser/classes/SegmentedLikeDislikeButton.js +var _SegmentedLikeDislikeButton = class _SegmentedLikeDislikeButton extends YTNode { + constructor(data) { + super(); + __publicField(this, "like_button"); + __publicField(this, "dislike_button"); + this.like_button = parser_exports.parseItem(data.likeButton, [ToggleButton, Button]); + this.dislike_button = parser_exports.parseItem(data.dislikeButton, [ToggleButton, Button]); + } +}; +__name(_SegmentedLikeDislikeButton, "SegmentedLikeDislikeButton"); +__publicField(_SegmentedLikeDislikeButton, "type", "SegmentedLikeDislikeButton"); +var SegmentedLikeDislikeButton = _SegmentedLikeDislikeButton; + +// dist/src/parser/classes/SettingBoolean.js +var _SettingBoolean = class _SettingBoolean extends YTNode { + constructor(data) { + super(); + __publicField(this, "title"); + __publicField(this, "summary"); + __publicField(this, "enable_endpoint"); + __publicField(this, "disable_endpoint"); + __publicField(this, "item_id"); + if (Reflect.has(data, "title")) { + this.title = new Text2(data.title); + } + if (Reflect.has(data, "summary")) { + this.summary = new Text2(data.summary); + } + if (Reflect.has(data, "enableServiceEndpoint")) { + this.enable_endpoint = new NavigationEndpoint(data.enableServiceEndpoint); + } + if (Reflect.has(data, "disableServiceEndpoint")) { + this.disable_endpoint = new NavigationEndpoint(data.disableServiceEndpoint); + } + this.item_id = data.itemId; + } +}; +__name(_SettingBoolean, "SettingBoolean"); +__publicField(_SettingBoolean, "type", "SettingBoolean"); +var SettingBoolean = _SettingBoolean; + +// dist/src/parser/classes/SettingsCheckbox.js +var _SettingsCheckbox = class _SettingsCheckbox extends YTNode { + constructor(data) { + super(); + __publicField(this, "title"); + __publicField(this, "help_text"); + __publicField(this, "enabled"); + __publicField(this, "disabled"); + __publicField(this, "id"); + this.title = new Text2(data.title); + this.help_text = new Text2(data.helpText); + this.enabled = data.enabled; + this.disabled = data.disabled; + this.id = data.id; + } +}; +__name(_SettingsCheckbox, "SettingsCheckbox"); +__publicField(_SettingsCheckbox, "type", "SettingsCheckbox"); +var SettingsCheckbox = _SettingsCheckbox; + +// dist/src/parser/classes/SettingsSwitch.js +var _SettingsSwitch = class _SettingsSwitch extends YTNode { + constructor(data) { + super(); + __publicField(this, "title"); + __publicField(this, "subtitle"); + __publicField(this, "enabled"); + __publicField(this, "enable_endpoint"); + __publicField(this, "disable_endpoint"); + this.title = new Text2(data.title); + this.subtitle = new Text2(data.subtitle); + this.enabled = data.enabled; + this.enable_endpoint = new NavigationEndpoint(data.enableServiceEndpoint); + this.disable_endpoint = new NavigationEndpoint(data.disableServiceEndpoint); + } +}; +__name(_SettingsSwitch, "SettingsSwitch"); +__publicField(_SettingsSwitch, "type", "SettingsSwitch"); +var SettingsSwitch = _SettingsSwitch; + +// dist/src/parser/classes/SettingsOptions.js +var _SettingsOptions = class _SettingsOptions extends YTNode { + constructor(data) { + super(); + __publicField(this, "title"); + __publicField(this, "text"); + __publicField(this, "options"); + this.title = new Text2(data.title); + if (Reflect.has(data, "text")) { + this.text = new Text2(data.text).toString(); + } + if (Reflect.has(data, "options")) { + this.options = parser_exports.parseArray(data.options, [ + SettingsSwitch, + Dropdown, + CopyLink, + SettingsCheckbox, + ChannelOptions + ]); + } + } +}; +__name(_SettingsOptions, "SettingsOptions"); +__publicField(_SettingsOptions, "type", "SettingsOptions"); +var SettingsOptions = _SettingsOptions; + +// dist/src/parser/classes/SettingsSidebar.js +var _SettingsSidebar = class _SettingsSidebar extends YTNode { + constructor(data) { + super(); + __publicField(this, "title"); + __publicField(this, "items"); + this.title = new Text2(data.title); + this.items = parser_exports.parseArray(data.items, CompactLink); + } + // XXX: Alias for consistency. + get contents() { + return this.items; + } +}; +__name(_SettingsSidebar, "SettingsSidebar"); +__publicField(_SettingsSidebar, "type", "SettingsSidebar"); +var SettingsSidebar = _SettingsSidebar; + +// dist/src/parser/classes/SharedPost.js +var _SharedPost = class _SharedPost extends YTNode { + constructor(data) { + super(); + __publicField(this, "thumbnail"); + __publicField(this, "content"); + __publicField(this, "published"); + __publicField(this, "menu"); + __publicField(this, "original_post"); + __publicField(this, "id"); + __publicField(this, "endpoint"); + __publicField(this, "expand_button"); + __publicField(this, "author"); + this.thumbnail = Thumbnail.fromResponse(data.thumbnail); + this.content = new Text2(data.content); + this.published = new Text2(data.publishedTimeText); + this.menu = parser_exports.parseItem(data.actionMenu, Menu); + this.original_post = parser_exports.parseItem(data.originalPost, [BackstagePost, Post]); + this.id = data.postId; + this.endpoint = new NavigationEndpoint(data.navigationEndpoint); + this.expand_button = parser_exports.parseItem(data.expandButton, Button); + this.author = new Author(data.displayName, void 0); + } +}; +__name(_SharedPost, "SharedPost"); +__publicField(_SharedPost, "type", "SharedPost"); +var SharedPost = _SharedPost; + +// dist/src/parser/classes/SharePanelHeader.js +var _SharePanelHeader = class _SharePanelHeader extends YTNode { + constructor(data) { + super(); + __publicField(this, "title"); + this.title = parser_exports.parseItem(data.title); + } +}; +__name(_SharePanelHeader, "SharePanelHeader"); +__publicField(_SharePanelHeader, "type", "SharePanelHeader"); +var SharePanelHeader = _SharePanelHeader; + +// dist/src/parser/classes/SharePanelTitleV15.js +var _SharePanelTitleV15 = class _SharePanelTitleV15 extends YTNode { + constructor(data) { + super(); + __publicField(this, "title"); + this.title = new Text2(data.title); + } +}; +__name(_SharePanelTitleV15, "SharePanelTitleV15"); +__publicField(_SharePanelTitleV15, "type", "SharePanelTitleV15"); +var SharePanelTitleV15 = _SharePanelTitleV15; + +// dist/src/parser/classes/ShareTarget.js +var _ShareTarget = class _ShareTarget extends YTNode { + constructor(data) { + super(); + __publicField(this, "endpoint"); + __publicField(this, "service_name"); + __publicField(this, "target_id"); + __publicField(this, "title"); + if (Reflect.has(data, "serviceEndpoint")) + this.endpoint = new NavigationEndpoint(data.serviceEndpoint); + else if (Reflect.has(data, "navigationEndpoint")) + this.endpoint = new NavigationEndpoint(data.navigationEndpoint); + this.service_name = data.serviceName; + this.target_id = data.targetId; + this.title = new Text2(data.title); + } +}; +__name(_ShareTarget, "ShareTarget"); +__publicField(_ShareTarget, "type", "ShareTarget"); +var ShareTarget = _ShareTarget; + +// dist/src/parser/classes/Shelf.js +var _Shelf = class _Shelf extends YTNode { + constructor(data) { + super(); + __publicField(this, "title"); + __publicField(this, "endpoint"); + __publicField(this, "content"); + __publicField(this, "icon_type"); + __publicField(this, "menu"); + __publicField(this, "play_all_button"); + __publicField(this, "subtitle"); + this.title = new Text2(data.title); + if (Reflect.has(data, "endpoint")) { + this.endpoint = new NavigationEndpoint(data.endpoint); + } + this.content = parser_exports.parseItem(data.content); + if (Reflect.has(data, "icon")) { + this.icon_type = data.icon.iconType; + } + if (Reflect.has(data, "menu")) { + this.menu = parser_exports.parseItem(data.menu); + } + if (Reflect.has(data, "playAllButton")) { + this.play_all_button = parser_exports.parseItem(data.playAllButton, Button); + } + if (Reflect.has(data, "subtitle")) { + this.subtitle = new Text2(data.subtitle); + } + } +}; +__name(_Shelf, "Shelf"); +__publicField(_Shelf, "type", "Shelf"); +var Shelf = _Shelf; + +// dist/src/parser/classes/ShortsLockupView.js +var _ShortsLockupView = class _ShortsLockupView extends YTNode { + constructor(data) { + var _a; + super(); + __publicField(this, "entity_id"); + __publicField(this, "accessibility_text"); + __publicField(this, "thumbnail"); + __publicField(this, "on_tap_endpoint"); + __publicField(this, "menu_on_tap"); + __publicField(this, "index_in_collection"); + __publicField(this, "menu_on_tap_a11y_label"); + __publicField(this, "overlay_metadata"); + __publicField(this, "inline_player_data"); + __publicField(this, "badge"); + this.entity_id = data.entityId; + this.accessibility_text = data.accessibilityText; + this.thumbnail = Thumbnail.fromResponse(data.thumbnail); + this.on_tap_endpoint = new NavigationEndpoint(data.onTap); + this.menu_on_tap = new NavigationEndpoint(data.menuOnTap); + this.index_in_collection = data.indexInCollection; + this.menu_on_tap_a11y_label = data.menuOnTapA11yLabel; + this.overlay_metadata = { + primary_text: data.overlayMetadata.primaryText ? Text2.fromAttributed(data.overlayMetadata.primaryText) : void 0, + secondary_text: data.overlayMetadata.secondaryText ? Text2.fromAttributed(data.overlayMetadata.secondaryText) : void 0 + }; + if ((_a = data.inlinePlayerData) == null ? void 0 : _a.onVisible) { + this.inline_player_data = new NavigationEndpoint(data.inlinePlayerData.onVisible); + } + if (data.badge) { + this.badge = parser_exports.parseItem(data.badge, BadgeView); + } + } +}; +__name(_ShortsLockupView, "ShortsLockupView"); +__publicField(_ShortsLockupView, "type", "ShortsLockupView"); +var ShortsLockupView = _ShortsLockupView; + +// dist/src/parser/classes/ShowingResultsFor.js +var _ShowingResultsFor = class _ShowingResultsFor extends YTNode { + constructor(data) { + super(); + __publicField(this, "corrected_query"); + __publicField(this, "original_query"); + __publicField(this, "corrected_query_endpoint"); + __publicField(this, "original_query_endpoint"); + __publicField(this, "search_instead_for"); + __publicField(this, "showing_results_for"); + this.corrected_query = new Text2(data.correctedQuery); + this.original_query = new Text2(data.originalQuery); + this.corrected_query_endpoint = new NavigationEndpoint(data.correctedQueryEndpoint); + this.original_query_endpoint = new NavigationEndpoint(data.originalQueryEndpoint); + this.search_instead_for = new Text2(data.searchInsteadFor); + this.showing_results_for = new Text2(data.showingResultsFor); + } +}; +__name(_ShowingResultsFor, "ShowingResultsFor"); +__publicField(_ShowingResultsFor, "type", "ShowingResultsFor"); +var ShowingResultsFor = _ShowingResultsFor; + +// dist/src/parser/classes/SimpleCardContent.js +var _SimpleCardContent = class _SimpleCardContent extends YTNode { + constructor(data) { + super(); + __publicField(this, "image"); + __publicField(this, "title"); + __publicField(this, "display_domain"); + __publicField(this, "show_link_icon"); + __publicField(this, "call_to_action"); + __publicField(this, "endpoint"); + this.image = Thumbnail.fromResponse(data.image); + this.title = new Text2(data.title); + this.display_domain = new Text2(data.displayDomain); + this.show_link_icon = data.showLinkIcon; + this.call_to_action = new Text2(data.callToAction); + this.endpoint = new NavigationEndpoint(data.command); + } +}; +__name(_SimpleCardContent, "SimpleCardContent"); +__publicField(_SimpleCardContent, "type", "SimpleCardContent"); +var SimpleCardContent = _SimpleCardContent; + +// dist/src/parser/classes/SimpleCardTeaser.js +var _SimpleCardTeaser = class _SimpleCardTeaser extends YTNode { + // @TODO: or string? + constructor(data) { + super(); + __publicField(this, "message"); + __publicField(this, "prominent"); + this.message = new Text2(data.message); + this.prominent = data.prominent; + } +}; +__name(_SimpleCardTeaser, "SimpleCardTeaser"); +__publicField(_SimpleCardTeaser, "type", "SimpleCardTeaser"); +var SimpleCardTeaser = _SimpleCardTeaser; + +// dist/src/parser/classes/SimpleTextSection.js +var _SimpleTextSection = class _SimpleTextSection extends YTNode { + constructor(data) { + super(); + __publicField(this, "lines"); + __publicField(this, "style"); + this.lines = data.lines.map((line) => new Text2(line)); + this.style = data.layoutStyle; + } +}; +__name(_SimpleTextSection, "SimpleTextSection"); +__publicField(_SimpleTextSection, "type", "SimpleTextSection"); +var SimpleTextSection = _SimpleTextSection; + +// dist/src/parser/classes/SingleActionEmergencySupport.js +var _SingleActionEmergencySupport = class _SingleActionEmergencySupport extends YTNode { + constructor(data) { + super(); + __publicField(this, "action_text"); + __publicField(this, "nav_text"); + __publicField(this, "details"); + __publicField(this, "icon_type"); + __publicField(this, "endpoint"); + this.action_text = new Text2(data.actionText); + this.nav_text = new Text2(data.navigationText); + this.details = new Text2(data.detailsText); + this.icon_type = data.icon.iconType; + this.endpoint = new NavigationEndpoint(data.navigationEndpoint); + } +}; +__name(_SingleActionEmergencySupport, "SingleActionEmergencySupport"); +__publicField(_SingleActionEmergencySupport, "type", "SingleActionEmergencySupport"); +var SingleActionEmergencySupport = _SingleActionEmergencySupport; + +// dist/src/parser/classes/Tab.js +var _Tab = class _Tab extends YTNode { + constructor(data) { + super(); + __publicField(this, "title"); + __publicField(this, "selected"); + __publicField(this, "endpoint"); + __publicField(this, "content"); + this.title = data.title || "N/A"; + this.selected = !!data.selected; + this.endpoint = new NavigationEndpoint(data.endpoint); + this.content = parser_exports.parseItem(data.content, [SectionList, MusicQueue, RichGrid]); + } +}; +__name(_Tab, "Tab"); +__publicField(_Tab, "type", "Tab"); +var Tab = _Tab; + +// dist/src/parser/classes/SingleColumnBrowseResults.js +var _SingleColumnBrowseResults = class _SingleColumnBrowseResults extends YTNode { + constructor(data) { + super(); + __publicField(this, "tabs"); + this.tabs = parser_exports.parseArray(data.tabs, Tab); + } +}; +__name(_SingleColumnBrowseResults, "SingleColumnBrowseResults"); +__publicField(_SingleColumnBrowseResults, "type", "SingleColumnBrowseResults"); +var SingleColumnBrowseResults = _SingleColumnBrowseResults; + +// dist/src/parser/classes/SingleColumnMusicWatchNextResults.js +var _SingleColumnMusicWatchNextResults = class _SingleColumnMusicWatchNextResults extends YTNode { + constructor(data) { + super(); + __publicField(this, "contents"); + this.contents = parser_exports.parse(data); + } +}; +__name(_SingleColumnMusicWatchNextResults, "SingleColumnMusicWatchNextResults"); +__publicField(_SingleColumnMusicWatchNextResults, "type", "SingleColumnMusicWatchNextResults"); +var SingleColumnMusicWatchNextResults = _SingleColumnMusicWatchNextResults; + +// dist/src/parser/classes/SingleHeroImage.js +var _SingleHeroImage = class _SingleHeroImage extends YTNode { + constructor(data) { + super(); + __publicField(this, "thumbnails"); + __publicField(this, "style"); + this.thumbnails = Thumbnail.fromResponse(data.thumbnail); + this.style = data.style; + } +}; +__name(_SingleHeroImage, "SingleHeroImage"); +__publicField(_SingleHeroImage, "type", "SingleHeroImage"); +var SingleHeroImage = _SingleHeroImage; + +// dist/src/parser/classes/SlimOwner.js +var _SlimOwner = class _SlimOwner extends YTNode { + constructor(data) { + super(); + __publicField(this, "thumbnail"); + __publicField(this, "title"); + __publicField(this, "endpoint"); + __publicField(this, "subscribe_button"); + this.thumbnail = Thumbnail.fromResponse(data.thumbnail); + this.title = new Text2(data.title); + this.endpoint = new NavigationEndpoint(data.navigationEndpoint); + this.subscribe_button = parser_exports.parseItem(data.subscribeButton, SubscribeButton); + } +}; +__name(_SlimOwner, "SlimOwner"); +__publicField(_SlimOwner, "type", "SlimOwner"); +var SlimOwner = _SlimOwner; + +// dist/src/parser/classes/SlimVideoMetadata.js +var _SlimVideoMetadata = class _SlimVideoMetadata extends YTNode { + constructor(data) { + super(); + __publicField(this, "title"); + __publicField(this, "collapsed_subtitle"); + __publicField(this, "expanded_subtitle"); + __publicField(this, "owner"); + __publicField(this, "description"); + __publicField(this, "video_id"); + __publicField(this, "date"); + this.title = new Text2(data.title); + this.collapsed_subtitle = new Text2(data.collapsedSubtitle); + this.expanded_subtitle = new Text2(data.expandedSubtitle); + this.owner = parser_exports.parseItem(data.owner); + this.description = new Text2(data.description); + this.video_id = data.videoId; + this.date = new Text2(data.dateText); + } +}; +__name(_SlimVideoMetadata, "SlimVideoMetadata"); +__publicField(_SlimVideoMetadata, "type", "SlimVideoMetadata"); +var SlimVideoMetadata = _SlimVideoMetadata; + +// dist/src/parser/classes/StartAt.js +var _StartAt = class _StartAt extends YTNode { + constructor(data) { + super(); + __publicField(this, "start_at_option_label"); + this.start_at_option_label = new Text2(data.startAtOptionLabel); + } +}; +__name(_StartAt, "StartAt"); +__publicField(_StartAt, "type", "StartAt"); +var StartAt = _StartAt; + +// dist/src/parser/classes/Tabbed.js +var _Tabbed = class _Tabbed extends YTNode { + constructor(data) { + super(); + __publicField(this, "contents"); + this.contents = parser_exports.parse(data); + } +}; +__name(_Tabbed, "Tabbed"); +__publicField(_Tabbed, "type", "Tabbed"); +var Tabbed = _Tabbed; + +// dist/src/parser/classes/TabbedSearchResults.js +var _TabbedSearchResults = class _TabbedSearchResults extends YTNode { + constructor(data) { + super(); + __publicField(this, "tabs"); + this.tabs = parser_exports.parseArray(data.tabs, Tab); + } +}; +__name(_TabbedSearchResults, "TabbedSearchResults"); +__publicField(_TabbedSearchResults, "type", "TabbedSearchResults"); +var TabbedSearchResults = _TabbedSearchResults; + +// dist/src/parser/classes/TextHeader.js +var _TextHeader = class _TextHeader extends YTNode { + constructor(data) { + super(); + __publicField(this, "title"); + __publicField(this, "style"); + this.title = new Text2(data.title); + this.style = data.style; + } +}; +__name(_TextHeader, "TextHeader"); +__publicField(_TextHeader, "type", "TextHeader"); +var TextHeader = _TextHeader; + +// dist/src/parser/classes/ThirdPartyShareTargetSection.js +var _ThirdPartyShareTargetSection = class _ThirdPartyShareTargetSection extends YTNode { + constructor(data) { + super(); + __publicField(this, "share_targets"); + this.share_targets = parser_exports.parseArray(data.shareTargets, ShareTarget); + } +}; +__name(_ThirdPartyShareTargetSection, "ThirdPartyShareTargetSection"); +__publicField(_ThirdPartyShareTargetSection, "type", "ThirdPartyShareTargetSection"); +var ThirdPartyShareTargetSection = _ThirdPartyShareTargetSection; + +// dist/src/parser/classes/ThumbnailLandscapePortrait.js +var _ThumbnailLandscapePortrait = class _ThumbnailLandscapePortrait extends YTNode { + constructor(data) { + super(); + __publicField(this, "landscape"); + __publicField(this, "portrait"); + this.landscape = Thumbnail.fromResponse(data.landscape); + this.portrait = Thumbnail.fromResponse(data.portrait); + } +}; +__name(_ThumbnailLandscapePortrait, "ThumbnailLandscapePortrait"); +__publicField(_ThumbnailLandscapePortrait, "type", "ThumbnailLandscapePortrait"); +var ThumbnailLandscapePortrait = _ThumbnailLandscapePortrait; + +// dist/src/parser/classes/ThumbnailOverlayEndorsement.js +var _ThumbnailOverlayEndorsement = class _ThumbnailOverlayEndorsement extends YTNode { + constructor(data) { + super(); + __publicField(this, "text"); + this.text = new Text2(data.text).toString(); + } +}; +__name(_ThumbnailOverlayEndorsement, "ThumbnailOverlayEndorsement"); +__publicField(_ThumbnailOverlayEndorsement, "type", "ThumbnailOverlayEndorsement"); +var ThumbnailOverlayEndorsement = _ThumbnailOverlayEndorsement; + +// dist/src/parser/classes/ThumbnailOverlayHoverText.js +var _ThumbnailOverlayHoverText = class _ThumbnailOverlayHoverText extends YTNode { + constructor(data) { + super(); + __publicField(this, "text"); + __publicField(this, "icon_type"); + this.text = new Text2(data.text); + this.icon_type = data.icon.iconType; + } +}; +__name(_ThumbnailOverlayHoverText, "ThumbnailOverlayHoverText"); +__publicField(_ThumbnailOverlayHoverText, "type", "ThumbnailOverlayHoverText"); +var ThumbnailOverlayHoverText = _ThumbnailOverlayHoverText; + +// dist/src/parser/classes/ThumbnailOverlayInlineUnplayable.js +var _ThumbnailOverlayInlineUnplayable = class _ThumbnailOverlayInlineUnplayable extends YTNode { + constructor(data) { + super(); + __publicField(this, "text"); + __publicField(this, "icon_type"); + this.text = new Text2(data.text).toString(); + this.icon_type = data.icon.iconType; + } +}; +__name(_ThumbnailOverlayInlineUnplayable, "ThumbnailOverlayInlineUnplayable"); +__publicField(_ThumbnailOverlayInlineUnplayable, "type", "ThumbnailOverlayInlineUnplayable"); +var ThumbnailOverlayInlineUnplayable = _ThumbnailOverlayInlineUnplayable; + +// dist/src/parser/classes/ThumbnailOverlayLoadingPreview.js +var _ThumbnailOverlayLoadingPreview = class _ThumbnailOverlayLoadingPreview extends YTNode { + constructor(data) { + super(); + __publicField(this, "text"); + this.text = new Text2(data.text); + } +}; +__name(_ThumbnailOverlayLoadingPreview, "ThumbnailOverlayLoadingPreview"); +__publicField(_ThumbnailOverlayLoadingPreview, "type", "ThumbnailOverlayLoadingPreview"); +var ThumbnailOverlayLoadingPreview = _ThumbnailOverlayLoadingPreview; + +// dist/src/parser/classes/ThumbnailOverlayNowPlaying.js +var _ThumbnailOverlayNowPlaying = class _ThumbnailOverlayNowPlaying extends YTNode { + constructor(data) { + super(); + __publicField(this, "text"); + this.text = new Text2(data.text).toString(); + } +}; +__name(_ThumbnailOverlayNowPlaying, "ThumbnailOverlayNowPlaying"); +__publicField(_ThumbnailOverlayNowPlaying, "type", "ThumbnailOverlayNowPlaying"); +var ThumbnailOverlayNowPlaying = _ThumbnailOverlayNowPlaying; + +// dist/src/parser/classes/ThumbnailOverlayPinking.js +var _ThumbnailOverlayPinking = class _ThumbnailOverlayPinking extends YTNode { + constructor(data) { + super(); + __publicField(this, "hack"); + this.hack = data.hack; + } +}; +__name(_ThumbnailOverlayPinking, "ThumbnailOverlayPinking"); +__publicField(_ThumbnailOverlayPinking, "type", "ThumbnailOverlayPinking"); +var ThumbnailOverlayPinking = _ThumbnailOverlayPinking; + +// dist/src/parser/classes/ThumbnailOverlayPlaybackStatus.js +var _ThumbnailOverlayPlaybackStatus = class _ThumbnailOverlayPlaybackStatus extends YTNode { + constructor(data) { + super(); + __publicField(this, "texts"); + this.texts = data.texts.map((text) => new Text2(text)); + } +}; +__name(_ThumbnailOverlayPlaybackStatus, "ThumbnailOverlayPlaybackStatus"); +__publicField(_ThumbnailOverlayPlaybackStatus, "type", "ThumbnailOverlayPlaybackStatus"); +var ThumbnailOverlayPlaybackStatus = _ThumbnailOverlayPlaybackStatus; + +// dist/src/parser/classes/ThumbnailOverlayResumePlayback.js +var _ThumbnailOverlayResumePlayback = class _ThumbnailOverlayResumePlayback extends YTNode { + constructor(data) { + super(); + __publicField(this, "percent_duration_watched"); + this.percent_duration_watched = data.percentDurationWatched; + } +}; +__name(_ThumbnailOverlayResumePlayback, "ThumbnailOverlayResumePlayback"); +__publicField(_ThumbnailOverlayResumePlayback, "type", "ThumbnailOverlayResumePlayback"); +var ThumbnailOverlayResumePlayback = _ThumbnailOverlayResumePlayback; + +// dist/src/parser/classes/ThumbnailOverlaySidePanel.js +var _ThumbnailOverlaySidePanel = class _ThumbnailOverlaySidePanel extends YTNode { + constructor(data) { + super(); + __publicField(this, "text"); + __publicField(this, "icon_type"); + this.text = new Text2(data.text); + this.icon_type = data.icon.iconType; + } +}; +__name(_ThumbnailOverlaySidePanel, "ThumbnailOverlaySidePanel"); +__publicField(_ThumbnailOverlaySidePanel, "type", "ThumbnailOverlaySidePanel"); +var ThumbnailOverlaySidePanel = _ThumbnailOverlaySidePanel; + +// dist/src/parser/classes/ThumbnailOverlayToggleButton.js +var _ThumbnailOverlayToggleButton = class _ThumbnailOverlayToggleButton extends YTNode { + constructor(data) { + super(); + __publicField(this, "is_toggled"); + __publicField(this, "icon_type"); + __publicField(this, "tooltip"); + __publicField(this, "toggled_endpoint"); + __publicField(this, "untoggled_endpoint"); + if (Reflect.has(data, "isToggled")) { + this.is_toggled = data.isToggled; + } + this.icon_type = { + toggled: data.toggledIcon.iconType, + untoggled: data.untoggledIcon.iconType + }; + this.tooltip = { + toggled: data.toggledTooltip, + untoggled: data.untoggledTooltip + }; + if (data.toggledServiceEndpoint) + this.toggled_endpoint = new NavigationEndpoint(data.toggledServiceEndpoint); + if (data.untoggledServiceEndpoint) + this.untoggled_endpoint = new NavigationEndpoint(data.untoggledServiceEndpoint); + } +}; +__name(_ThumbnailOverlayToggleButton, "ThumbnailOverlayToggleButton"); +__publicField(_ThumbnailOverlayToggleButton, "type", "ThumbnailOverlayToggleButton"); +var ThumbnailOverlayToggleButton = _ThumbnailOverlayToggleButton; + +// dist/src/parser/classes/TitleAndButtonListHeader.js +var _TitleAndButtonListHeader = class _TitleAndButtonListHeader extends YTNode { + constructor(data) { + super(); + __publicField(this, "title"); + this.title = new Text2(data.title); + } +}; +__name(_TitleAndButtonListHeader, "TitleAndButtonListHeader"); +__publicField(_TitleAndButtonListHeader, "type", "TitleAndButtonListHeader"); +var TitleAndButtonListHeader = _TitleAndButtonListHeader; + +// dist/src/parser/classes/ToggleMenuServiceItem.js +var _ToggleMenuServiceItem = class _ToggleMenuServiceItem extends YTNode { + constructor(data) { + super(); + __publicField(this, "text"); + __publicField(this, "toggled_text"); + __publicField(this, "icon_type"); + __publicField(this, "toggled_icon_type"); + __publicField(this, "default_endpoint"); + __publicField(this, "toggled_endpoint"); + this.text = new Text2(data.defaultText); + this.toggled_text = new Text2(data.toggledText); + this.icon_type = data.defaultIcon.iconType; + this.toggled_icon_type = data.toggledIcon.iconType; + this.default_endpoint = new NavigationEndpoint(data.defaultServiceEndpoint); + this.toggled_endpoint = new NavigationEndpoint(data.toggledServiceEndpoint); + } +}; +__name(_ToggleMenuServiceItem, "ToggleMenuServiceItem"); +__publicField(_ToggleMenuServiceItem, "type", "ToggleMenuServiceItem"); +var ToggleMenuServiceItem = _ToggleMenuServiceItem; + +// dist/src/parser/classes/Tooltip.js +var _Tooltip = class _Tooltip extends YTNode { + constructor(data) { + super(); + __publicField(this, "promo_config"); + __publicField(this, "target_id"); + __publicField(this, "details"); + __publicField(this, "suggested_position"); + __publicField(this, "dismiss_stratedy"); + __publicField(this, "dwell_time_ms"); + this.promo_config = { + promo_id: data.promoConfig.promoId, + impression_endpoints: data.promoConfig.impressionEndpoints.map((endpoint) => new NavigationEndpoint(endpoint)), + accept: new NavigationEndpoint(data.promoConfig.acceptCommand), + dismiss: new NavigationEndpoint(data.promoConfig.dismissCommand) + }; + this.target_id = data.targetId; + this.details = new Text2(data.detailsText); + this.suggested_position = data.suggestedPosition.type; + this.dismiss_stratedy = data.dismissStrategy.type; + this.dwell_time_ms = parseInt(data.dwellTimeMs); + } +}; +__name(_Tooltip, "Tooltip"); +__publicField(_Tooltip, "type", "Tooltip"); +var Tooltip = _Tooltip; + +// dist/src/parser/classes/TopicChannelDetails.js +var _TopicChannelDetails = class _TopicChannelDetails extends YTNode { + constructor(data) { + var _a; + super(); + __publicField(this, "title"); + __publicField(this, "avatar"); + __publicField(this, "subtitle"); + __publicField(this, "subscribe_button"); + __publicField(this, "endpoint"); + this.title = new Text2(data.title); + this.avatar = Thumbnail.fromResponse((_a = data.thumbnail) != null ? _a : data.avatar); + this.subtitle = new Text2(data.subtitle); + this.subscribe_button = parser_exports.parseItem(data.subscribeButton, SubscribeButton); + this.endpoint = new NavigationEndpoint(data.navigationEndpoint); + } +}; +__name(_TopicChannelDetails, "TopicChannelDetails"); +__publicField(_TopicChannelDetails, "type", "TopicChannelDetails"); +var TopicChannelDetails = _TopicChannelDetails; + +// dist/src/parser/classes/TwoColumnBrowseResults.js +var _TwoColumnBrowseResults = class _TwoColumnBrowseResults extends YTNode { + constructor(data) { + super(); + __publicField(this, "tabs"); + __publicField(this, "secondary_contents"); + this.tabs = parser_exports.parseArray(data.tabs, [Tab, ExpandableTab]); + this.secondary_contents = parser_exports.parseItem(data.secondaryContents, [SectionList, BrowseFeedActions, ProfileColumn]); + } +}; +__name(_TwoColumnBrowseResults, "TwoColumnBrowseResults"); +__publicField(_TwoColumnBrowseResults, "type", "TwoColumnBrowseResults"); +var TwoColumnBrowseResults = _TwoColumnBrowseResults; + +// dist/src/parser/classes/TwoColumnSearchResults.js +var _TwoColumnSearchResults = class _TwoColumnSearchResults extends YTNode { + constructor(data) { + super(); + __publicField(this, "header"); + __publicField(this, "primary_contents"); + __publicField(this, "secondary_contents"); + __publicField(this, "target_id"); + this.header = parser_exports.parseItem(data.header); + this.primary_contents = parser_exports.parseItem(data.primaryContents, [RichGrid, SectionList]); + this.secondary_contents = parser_exports.parseItem(data.secondaryContents, [SecondarySearchContainer]); + if ("targetId" in data) { + this.target_id = data.targetId; + } + } +}; +__name(_TwoColumnSearchResults, "TwoColumnSearchResults"); +__publicField(_TwoColumnSearchResults, "type", "TwoColumnSearchResults"); +var TwoColumnSearchResults = _TwoColumnSearchResults; + +// dist/src/parser/classes/TwoColumnWatchNextResults.js +var _TwoColumnWatchNextResults_instances, parseAutoplaySet_fn; +var _TwoColumnWatchNextResults = class _TwoColumnWatchNextResults extends YTNode { + constructor(data) { + var _a, _b, _c, _d, _e; + super(); + __privateAdd(this, _TwoColumnWatchNextResults_instances); + __publicField(this, "results"); + __publicField(this, "secondary_results"); + __publicField(this, "conversation_bar"); + __publicField(this, "playlist"); + __publicField(this, "autoplay"); + this.results = parser_exports.parseArray((_a = data.results) == null ? void 0 : _a.results.contents); + this.secondary_results = parser_exports.parseArray((_b = data.secondaryResults) == null ? void 0 : _b.secondaryResults.results); + this.conversation_bar = parser_exports.parseItem(data == null ? void 0 : data.conversationBar); + const playlistData = (_c = data.playlist) == null ? void 0 : _c.playlist; + if (playlistData) { + this.playlist = { + id: playlistData.playlistId, + title: playlistData.title, + author: ((_d = playlistData.shortBylineText) == null ? void 0 : _d.simpleText) ? new Text2(playlistData.shortBylineText) : new Author(playlistData.longBylineText), + contents: parser_exports.parseArray(playlistData.contents), + current_index: playlistData.currentIndex, + is_infinite: !!playlistData.isInfinite, + menu: parser_exports.parseItem(playlistData.menu, Menu) + }; + } + const autoplayData = (_e = data.autoplay) == null ? void 0 : _e.autoplay; + if (autoplayData) { + this.autoplay = { + sets: autoplayData.sets.map((set) => __privateMethod(this, _TwoColumnWatchNextResults_instances, parseAutoplaySet_fn).call(this, set)) + }; + if (autoplayData.modifiedSets) { + this.autoplay.modified_sets = autoplayData.modifiedSets.map((set) => __privateMethod(this, _TwoColumnWatchNextResults_instances, parseAutoplaySet_fn).call(this, set)); + } + if (autoplayData.countDownSecs) { + this.autoplay.count_down_secs = autoplayData.countDownSecs; + } + } + } +}; +_TwoColumnWatchNextResults_instances = new WeakSet(); +parseAutoplaySet_fn = /* @__PURE__ */ __name(function(data) { + const result = { + autoplay_video: new NavigationEndpoint(data.autoplayVideo) + }; + if (data.nextButtonVideo) { + result.next_button_video = new NavigationEndpoint(data.nextButtonVideo); + } + return result; +}, "#parseAutoplaySet"); +__name(_TwoColumnWatchNextResults, "TwoColumnWatchNextResults"); +__publicField(_TwoColumnWatchNextResults, "type", "TwoColumnWatchNextResults"); +var TwoColumnWatchNextResults = _TwoColumnWatchNextResults; + +// dist/src/parser/classes/UnifiedSharePanel.js +var _UnifiedSharePanel = class _UnifiedSharePanel extends YTNode { + constructor(data) { + super(); + __publicField(this, "third_party_network_section"); + __publicField(this, "header"); + __publicField(this, "share_panel_version"); + __publicField(this, "show_loading_spinner"); + if (data.contents) { + const contents = data.contents.find((content) => content.thirdPartyNetworkSection); + if (contents) { + this.third_party_network_section = { + share_target_container: parser_exports.parseItem(contents.thirdPartyNetworkSection.shareTargetContainer, ThirdPartyShareTargetSection), + copy_link_container: parser_exports.parseItem(contents.thirdPartyNetworkSection.copyLinkContainer, CopyLink), + start_at_container: parser_exports.parseItem(contents.thirdPartyNetworkSection.startAtContainer, StartAt) + }; + } + } + this.header = parser_exports.parseItem(data.header, SharePanelHeader); + this.share_panel_version = data.sharePanelVersion; + if (Reflect.has(data, "showLoadingSpinner")) + this.show_loading_spinner = data.showLoadingSpinner; + } +}; +__name(_UnifiedSharePanel, "UnifiedSharePanel"); +__publicField(_UnifiedSharePanel, "type", "UnifiedSharePanel"); +var UnifiedSharePanel = _UnifiedSharePanel; + +// dist/src/parser/classes/UpsellDialog.js +var _UpsellDialog = class _UpsellDialog extends YTNode { + constructor(data) { + super(); + __publicField(this, "message_title"); + __publicField(this, "message_text"); + __publicField(this, "action_button"); + __publicField(this, "dismiss_button"); + __publicField(this, "is_visible"); + this.message_title = new Text2(data.dialogMessageTitle); + this.message_text = new Text2(data.dialogMessageText); + this.action_button = parser_exports.parseItem(data.actionButton, Button); + this.dismiss_button = parser_exports.parseItem(data.dismissButton, Button); + this.is_visible = data.isVisible; + } +}; +__name(_UpsellDialog, "UpsellDialog"); +__publicField(_UpsellDialog, "type", "UpsellDialog"); +var UpsellDialog = _UpsellDialog; + +// dist/src/parser/classes/VerticalList.js +var _VerticalList = class _VerticalList extends YTNode { + constructor(data) { + super(); + __publicField(this, "items"); + __publicField(this, "collapsed_item_count"); + // Number? + __publicField(this, "collapsed_state_button_text"); + this.items = parser_exports.parseArray(data.items); + this.collapsed_item_count = data.collapsedItemCount; + this.collapsed_state_button_text = new Text2(data.collapsedStateButtonText); + } + // XXX: Alias for consistency. + get contents() { + return this.items; + } +}; +__name(_VerticalList, "VerticalList"); +__publicField(_VerticalList, "type", "VerticalList"); +var VerticalList = _VerticalList; + +// dist/src/parser/classes/VerticalWatchCardList.js +var _VerticalWatchCardList = class _VerticalWatchCardList extends YTNode { + constructor(data) { + super(); + __publicField(this, "items"); + __publicField(this, "view_all_text"); + __publicField(this, "view_all_endpoint"); + this.items = parser_exports.parseArray(data.items); + this.view_all_text = new Text2(data.viewAllText); + this.view_all_endpoint = new NavigationEndpoint(data.viewAllEndpoint); + } + // XXX: Alias for consistency. + get contents() { + return this.items; + } +}; +__name(_VerticalWatchCardList, "VerticalWatchCardList"); +__publicField(_VerticalWatchCardList, "type", "VerticalWatchCardList"); +var VerticalWatchCardList = _VerticalWatchCardList; + +// dist/src/parser/classes/VideoInfoCardContent.js +var _VideoInfoCardContent = class _VideoInfoCardContent extends YTNode { + constructor(data) { + super(); + __publicField(this, "title"); + __publicField(this, "channel_name"); + __publicField(this, "view_count"); + __publicField(this, "video_thumbnails"); + __publicField(this, "duration"); + __publicField(this, "endpoint"); + this.title = new Text2(data.videoTitle); + this.channel_name = new Text2(data.channelName); + this.view_count = new Text2(data.viewCountText); + this.video_thumbnails = Thumbnail.fromResponse(data.videoThumbnail); + this.duration = new Text2(data.lengthString); + this.endpoint = new NavigationEndpoint(data.action); + } +}; +__name(_VideoInfoCardContent, "VideoInfoCardContent"); +__publicField(_VideoInfoCardContent, "type", "VideoInfoCardContent"); +var VideoInfoCardContent = _VideoInfoCardContent; + +// dist/src/parser/classes/VideoMetadataCarouselView.js +var _VideoMetadataCarouselView = class _VideoMetadataCarouselView extends YTNode { + constructor(data) { + super(); + __publicField(this, "carousel_titles"); + __publicField(this, "carousel_items"); + this.carousel_titles = parser_exports.parse(data.carouselTitles, true, CarouselTitleView); + this.carousel_items = parser_exports.parse(data.carouselItems, true, CarouselItemView); + } +}; +__name(_VideoMetadataCarouselView, "VideoMetadataCarouselView"); +__publicField(_VideoMetadataCarouselView, "type", "VideoMetadataCarouselView"); +var VideoMetadataCarouselView = _VideoMetadataCarouselView; + +// dist/src/parser/classes/misc/SubscriptionButton.js +var _SubscriptionButton = class _SubscriptionButton { + constructor(data) { + __publicField(this, "text"); + __publicField(this, "subscribed"); + __publicField(this, "subscription_type"); + this.text = new Text2(data.text); + this.subscribed = data.isSubscribed; + if ("subscriptionType" in data) + this.subscription_type = data.subscriptionType; + } +}; +__name(_SubscriptionButton, "SubscriptionButton"); +__publicField(_SubscriptionButton, "type", "SubscriptionButton"); +var SubscriptionButton = _SubscriptionButton; + +// dist/src/parser/classes/VideoOwner.js +var _VideoOwner = class _VideoOwner extends YTNode { + constructor(data) { + super(); + __publicField(this, "subscription_button"); + __publicField(this, "subscriber_count"); + __publicField(this, "author"); + if ("subscriptionButton" in data) + this.subscription_button = new SubscriptionButton(data.subscriptionButton); + this.subscriber_count = new Text2(data.subscriberCountText); + this.author = new Author({ + ...data.title, + navigationEndpoint: data.navigationEndpoint + }, data.badges, data.thumbnail); + } +}; +__name(_VideoOwner, "VideoOwner"); +__publicField(_VideoOwner, "type", "VideoOwner"); +var VideoOwner = _VideoOwner; + +// dist/src/parser/classes/VideoPrimaryInfo.js +var _VideoPrimaryInfo = class _VideoPrimaryInfo extends YTNode { + constructor(data) { + super(); + __publicField(this, "title"); + __publicField(this, "super_title_link"); + __publicField(this, "station_name"); + __publicField(this, "view_count"); + __publicField(this, "badges"); + __publicField(this, "published"); + __publicField(this, "relative_date"); + __publicField(this, "menu"); + this.title = new Text2(data.title); + if ("superTitleLink" in data) + this.super_title_link = new Text2(data.superTitleLink); + if ("stationName" in data) + this.station_name = new Text2(data.stationName); + this.view_count = parser_exports.parseItem(data.viewCount, VideoViewCount); + this.badges = parser_exports.parseArray(data.badges, MetadataBadge); + this.published = new Text2(data.dateText); + this.relative_date = new Text2(data.relativeDateText); + this.menu = parser_exports.parseItem(data.videoActions, Menu); + } +}; +__name(_VideoPrimaryInfo, "VideoPrimaryInfo"); +__publicField(_VideoPrimaryInfo, "type", "VideoPrimaryInfo"); +var VideoPrimaryInfo = _VideoPrimaryInfo; + +// dist/src/parser/classes/VideoSecondaryInfo.js +var _VideoSecondaryInfo = class _VideoSecondaryInfo extends YTNode { + constructor(data) { + super(); + __publicField(this, "owner"); + __publicField(this, "description"); + __publicField(this, "description_placeholder"); + __publicField(this, "subscribe_button"); + __publicField(this, "metadata"); + __publicField(this, "show_more_text"); + __publicField(this, "show_less_text"); + __publicField(this, "default_expanded"); + __publicField(this, "description_collapsed_lines"); + this.owner = parser_exports.parseItem(data.owner, VideoOwner); + this.description = new Text2(data.description); + if ("attributedDescription" in data) + this.description = Text2.fromAttributed(data.attributedDescription); + if ("descriptionPlaceholder" in data) + this.description_placeholder = new Text2(data.descriptionPlaceholder); + this.subscribe_button = parser_exports.parseItem(data.subscribeButton, [SubscribeButton, Button]); + this.metadata = parser_exports.parseItem(data.metadataRowContainer, MetadataRowContainer); + this.show_more_text = new Text2(data.showMoreText); + this.show_less_text = new Text2(data.showLessText); + this.default_expanded = data.defaultExpanded; + this.description_collapsed_lines = data.descriptionCollapsedLines; + } +}; +__name(_VideoSecondaryInfo, "VideoSecondaryInfo"); +__publicField(_VideoSecondaryInfo, "type", "VideoSecondaryInfo"); +var VideoSecondaryInfo = _VideoSecondaryInfo; + +// dist/src/parser/classes/WatchCardCompactVideo.js +var _WatchCardCompactVideo = class _WatchCardCompactVideo extends YTNode { + constructor(data) { + super(); + __publicField(this, "title"); + __publicField(this, "subtitle"); + __publicField(this, "duration"); + __publicField(this, "style"); + this.title = new Text2(data.title); + this.subtitle = new Text2(data.subtitle); + this.duration = { + text: new Text2(data.lengthText).toString(), + seconds: timeToSeconds(data.lengthText.simpleText) + }; + this.style = data.style; + } +}; +__name(_WatchCardCompactVideo, "WatchCardCompactVideo"); +__publicField(_WatchCardCompactVideo, "type", "WatchCardCompactVideo"); +var WatchCardCompactVideo = _WatchCardCompactVideo; + +// dist/src/parser/classes/WatchCardHeroVideo.js +var _WatchCardHeroVideo = class _WatchCardHeroVideo extends YTNode { + constructor(data) { + var _a; + super(); + __publicField(this, "endpoint"); + __publicField(this, "call_to_action_button"); + __publicField(this, "hero_image"); + __publicField(this, "label"); + this.endpoint = new NavigationEndpoint(data.navigationEndpoint); + this.call_to_action_button = parser_exports.parseItem(data.callToActionButton); + this.hero_image = parser_exports.parseItem(data.heroImage); + this.label = ((_a = data.lengthText) == null ? void 0 : _a.accessibility.accessibilityData.label) || ""; + } +}; +__name(_WatchCardHeroVideo, "WatchCardHeroVideo"); +__publicField(_WatchCardHeroVideo, "type", "WatchCardHeroVideo"); +var WatchCardHeroVideo = _WatchCardHeroVideo; + +// dist/src/parser/classes/WatchCardRichHeader.js +var _WatchCardRichHeader = class _WatchCardRichHeader extends YTNode { + constructor(data) { + super(); + __publicField(this, "title"); + __publicField(this, "title_endpoint"); + __publicField(this, "subtitle"); + __publicField(this, "author"); + __publicField(this, "style"); + this.title = new Text2(data.title); + this.title_endpoint = new NavigationEndpoint(data.titleNavigationEndpoint); + this.subtitle = new Text2(data.subtitle); + this.author = new Author(data, data.titleBadge ? [data.titleBadge] : null, data.avatar); + this.author.name = this.title.toString(); + this.style = data.style; + } +}; +__name(_WatchCardRichHeader, "WatchCardRichHeader"); +__publicField(_WatchCardRichHeader, "type", "WatchCardRichHeader"); +var WatchCardRichHeader = _WatchCardRichHeader; + +// dist/src/parser/classes/WatchCardSectionSequence.js +var _WatchCardSectionSequence = class _WatchCardSectionSequence extends YTNode { + constructor(data) { + super(); + __publicField(this, "lists"); + this.lists = parser_exports.parseArray(data.lists); + } +}; +__name(_WatchCardSectionSequence, "WatchCardSectionSequence"); +__publicField(_WatchCardSectionSequence, "type", "WatchCardSectionSequence"); +var WatchCardSectionSequence = _WatchCardSectionSequence; + +// dist/src/parser/classes/WatchNextTabbedResults.js +var _WatchNextTabbedResults = class _WatchNextTabbedResults extends TwoColumnBrowseResults { + constructor(data) { + super(data); + } +}; +__name(_WatchNextTabbedResults, "WatchNextTabbedResults"); +__publicField(_WatchNextTabbedResults, "type", "WatchNextTabbedResults"); +var WatchNextTabbedResults = _WatchNextTabbedResults; + +// dist/src/parser/classes/ytkids/AnchoredSection.js +var _AnchoredSection = class _AnchoredSection extends YTNode { + constructor(data) { + var _a, _b; + super(); + __publicField(this, "title"); + __publicField(this, "content"); + __publicField(this, "endpoint"); + __publicField(this, "category_assets"); + __publicField(this, "category_type"); + this.title = data.title; + this.content = parser_exports.parseItem(data.content, SectionList); + this.endpoint = new NavigationEndpoint(data.navigationEndpoint); + this.category_assets = { + asset_key: (_a = data.categoryAssets) == null ? void 0 : _a.assetKey, + background_color: (_b = data.categoryAssets) == null ? void 0 : _b.backgroundColor + }; + this.category_type = data.categoryType; + } +}; +__name(_AnchoredSection, "AnchoredSection"); +__publicField(_AnchoredSection, "type", "AnchoredSection"); +var AnchoredSection = _AnchoredSection; + +// dist/src/parser/classes/ytkids/KidsBlocklistPickerItem.js +var _actions3; +var _KidsBlocklistPickerItem = class _KidsBlocklistPickerItem extends YTNode { + constructor(data) { + super(); + __privateAdd(this, _actions3); + __publicField(this, "child_display_name"); + __publicField(this, "child_account_description"); + __publicField(this, "avatar"); + __publicField(this, "block_button"); + __publicField(this, "blocked_entity_key"); + this.child_display_name = new Text2(data.childDisplayName); + this.child_account_description = new Text2(data.childAccountDescription); + this.avatar = Thumbnail.fromResponse(data.avatar); + this.block_button = parser_exports.parseItem(data.blockButton, [ToggleButton]); + this.blocked_entity_key = data.blockedEntityKey; + } + async blockChannel() { + if (!__privateGet(this, _actions3)) + throw new InnertubeError("An active caller must be provide to perform this operation."); + const button = this.block_button; + if (!button) + throw new InnertubeError("Block button was not found.", { child_display_name: this.child_display_name }); + if (button.is_toggled) + throw new InnertubeError("This channel is already blocked.", { child_display_name: this.child_display_name }); + const response = await button.endpoint.call(__privateGet(this, _actions3), { parse: false }); + return response; + } + setActions(actions) { + __privateSet(this, _actions3, actions); + } +}; +_actions3 = new WeakMap(); +__name(_KidsBlocklistPickerItem, "KidsBlocklistPickerItem"); +__publicField(_KidsBlocklistPickerItem, "type", "KidsBlocklistPickerItem"); +var KidsBlocklistPickerItem = _KidsBlocklistPickerItem; + +// dist/src/parser/classes/ytkids/KidsBlocklistPicker.js +var _KidsBlocklistPicker = class _KidsBlocklistPicker extends YTNode { + constructor(data) { + super(); + __publicField(this, "title"); + __publicField(this, "child_rows"); + __publicField(this, "done_button"); + __publicField(this, "successful_toast_action_message"); + this.title = new Text2(data.title); + this.child_rows = parser_exports.parse(data.childRows, true, [KidsBlocklistPickerItem]); + this.done_button = parser_exports.parseItem(data.doneButton, [Button]); + this.successful_toast_action_message = new Text2(data.successfulToastActionMessage); + } +}; +__name(_KidsBlocklistPicker, "KidsBlocklistPicker"); +__publicField(_KidsBlocklistPicker, "type", "KidsBlocklistPicker"); +var KidsBlocklistPicker = _KidsBlocklistPicker; + +// dist/src/parser/classes/ytkids/KidsCategoryTab.js +var _KidsCategoryTab = class _KidsCategoryTab extends YTNode { + constructor(data) { + var _a, _b; + super(); + __publicField(this, "title"); + __publicField(this, "category_assets"); + __publicField(this, "category_type"); + __publicField(this, "endpoint"); + this.title = new Text2(data.title); + this.category_assets = { + asset_key: (_a = data.categoryAssets) == null ? void 0 : _a.assetKey, + background_color: (_b = data.categoryAssets) == null ? void 0 : _b.backgroundColor + }; + this.category_type = data.categoryType; + this.endpoint = new NavigationEndpoint(data.endpoint); + } +}; +__name(_KidsCategoryTab, "KidsCategoryTab"); +__publicField(_KidsCategoryTab, "type", "KidsCategoryTab"); +var KidsCategoryTab = _KidsCategoryTab; + +// dist/src/parser/classes/ytkids/KidsCategoriesHeader.js +var _KidsCategoriesHeader = class _KidsCategoriesHeader extends YTNode { + constructor(data) { + super(); + __publicField(this, "category_tabs"); + __publicField(this, "privacy_button"); + this.category_tabs = parser_exports.parseArray(data.categoryTabs, KidsCategoryTab); + this.privacy_button = parser_exports.parseItem(data.privacyButtonRenderer, Button); + } +}; +__name(_KidsCategoriesHeader, "KidsCategoriesHeader"); +__publicField(_KidsCategoriesHeader, "type", "kidsCategoriesHeader"); +var KidsCategoriesHeader = _KidsCategoriesHeader; + +// dist/src/parser/classes/ytkids/KidsHomeScreen.js +var _KidsHomeScreen = class _KidsHomeScreen extends YTNode { + constructor(data) { + super(); + __publicField(this, "anchors"); + this.anchors = parser_exports.parseArray(data.anchors, AnchoredSection); + } +}; +__name(_KidsHomeScreen, "KidsHomeScreen"); +__publicField(_KidsHomeScreen, "type", "kidsHomeScreen"); +var KidsHomeScreen = _KidsHomeScreen; + +// dist/src/parser/generator.js +var generator_exports = {}; +__export(generator_exports, { + camelToSnake: () => camelToSnake, + createRuntimeClass: () => createRuntimeClass, + generateRuntimeClass: () => generateRuntimeClass, + generateTypescriptClass: () => generateTypescriptClass, + inferType: () => inferType, + introspect: () => introspect, + isArrayType: () => isArrayType, + isIgnoredKey: () => isIgnoredKey, + isMiscType: () => isMiscType, + isRenderer: () => isRenderer, + isRendererList: () => isRendererList, + mergeKeyInfo: () => mergeKeyInfo, + parse: () => parse2, + toParser: () => toParser, + toTypeDeclaration: () => toTypeDeclaration +}); +var IGNORED_KEYS = /* @__PURE__ */ new Set([ + "trackingParams", + "accessibility", + "accessibilityData" +]); +var RENDERER_EXAMPLES = {}; +function camelToSnake(str) { + return str.replace(/[A-Z]/g, (letter) => `_${letter.toLowerCase()}`); +} +__name(camelToSnake, "camelToSnake"); +function inferType(key, value) { + let return_value = false; + if (typeof value === "object" && value != null) { + if (return_value = isRenderer(value)) { + RENDERER_EXAMPLES[return_value] = Reflect.get(value, Reflect.ownKeys(value)[0]); + return { + type: "renderer", + renderers: [return_value], + optional: false + }; + } + if (return_value = isRendererList(value)) { + for (const [key2, value2] of Object.entries(return_value)) { + RENDERER_EXAMPLES[key2] = value2; + } + return { + type: "array", + array_type: "renderer", + renderers: Object.keys(return_value), + optional: false + }; + } + if (return_value = isMiscType(key, value)) { + return return_value; + } + if (return_value = isArrayType(value)) { + return return_value; + } + } + const primitive_type = typeof value; + if (primitive_type === "object") + return { + type: "object", + keys: Object.entries(value).map(([key2, value2]) => [key2, inferType(key2, value2)]), + optional: false + }; + return { + type: "primitive", + typeof: [primitive_type], + optional: false + }; +} +__name(inferType, "inferType"); +function isRendererList(value) { + const arr = Array.isArray(value); + if (arr && value.length === 0) + return false; + const is_list = arr && value.every((item) => isRenderer(item)); + return is_list ? Object.fromEntries(value.map((item) => { + const key = Reflect.ownKeys(item)[0].toString(); + return [sanitizeClassName(key), item[key]]; + })) : false; +} +__name(isRendererList, "isRendererList"); +function isMiscType(key, value) { + if (typeof value === "object" && value !== null) { + if (key.endsWith("Endpoint") || key.endsWith("Command") || key === "endpoint") { + return { + type: "misc", + endpoint: new NavigationEndpoint(value), + optional: false, + misc_type: "NavigationEndpoint" + }; + } + if (Reflect.has(value, "simpleText") || Reflect.has(value, "runs")) { + const textNode = new Text2(value); + return { + type: "misc", + misc_type: "Text", + optional: false, + endpoint: textNode.endpoint, + text: textNode.toString() + }; + } + if (Reflect.has(value, "thumbnails") && Array.isArray(Reflect.get(value, "thumbnails"))) { + return { + type: "misc", + misc_type: "Thumbnail", + optional: false + }; + } + } + return false; +} +__name(isMiscType, "isMiscType"); +function isRenderer(value) { + const is_object = typeof value === "object"; + if (!is_object) + return false; + const keys = Reflect.ownKeys(value); + if (keys.length === 1) { + const first_key = keys[0].toString(); + if (first_key.endsWith("Renderer") || first_key.endsWith("Model")) { + return sanitizeClassName(first_key); + } + } + return false; +} +__name(isRenderer, "isRenderer"); +function isArrayType(value) { + if (!Array.isArray(value)) + return false; + if (value.length === 0) + return { + type: "array", + array_type: "primitive", + items: { + type: "primitive", + typeof: ["never"], + optional: false + }, + optional: false + }; + const array_entry_types = value.map((item) => typeof item); + const all_same_type = array_entry_types.every((type2) => type2 === array_entry_types[0]); + if (!all_same_type) + return { + type: "array", + array_type: "primitive", + items: { + type: "primitive", + typeof: ["unknown"], + optional: false + }, + optional: false + }; + const type = array_entry_types[0]; + if (type !== "object") + return { + type: "array", + array_type: "primitive", + items: { + type: "primitive", + typeof: [type], + optional: false + }, + optional: false + }; + let key_type = []; + for (let i = 0; i < value.length; i++) { + const current_keys = Object.entries(value[i]).map(([key, value2]) => [key, inferType(key, value2)]); + if (i === 0) { + key_type = current_keys; + continue; + } + key_type = mergeKeyInfo(key_type, current_keys).resolved_key_info; + } + return { + type: "array", + array_type: "object", + items: { + type: "object", + keys: key_type, + optional: false + }, + optional: false + }; +} +__name(isArrayType, "isArrayType"); +function introspectKeysFirstPass(classdata) { + if (typeof classdata !== "object" || classdata === null) { + throw new InnertubeError("Generator: Cannot introspect non-object", { + classdata + }); + } + const keys = Reflect.ownKeys(classdata).filter((key) => !isIgnoredKey(key)).filter((key) => typeof key === "string"); + return keys.map((key) => { + const value = Reflect.get(classdata, key); + const inferred_type = inferType(key, value); + return [key, inferred_type]; + }); +} +__name(introspectKeysFirstPass, "introspectKeysFirstPass"); +function introspectKeysSecondPass(key_info) { + var _a; + const channel_nav = key_info.filter(([, value]) => { + var _a2; + if (value.type !== "misc") + return false; + if (!(value.misc_type === "NavigationEndpoint" || value.misc_type === "Text")) + return false; + return ((_a2 = value.endpoint) == null ? void 0 : _a2.metadata.page_type) === "WEB_PAGE_TYPE_CHANNEL"; + }); + const most_probable_match = channel_nav.sort(([, a], [, b]) => { + if (a.type !== "misc" || b.type !== "misc") + return 0; + if (a.misc_type !== "Text" || b.misc_type !== "Text") + return 0; + return b.text.length - a.text.length; + }); + const excluded_keys = /* @__PURE__ */ new Set(); + const canonical_channel_nave = most_probable_match[0]; + let author; + if (canonical_channel_nave) { + excluded_keys.add(canonical_channel_nave[0]); + const keys = key_info.map(([key]) => key); + const badges = keys.filter((key) => key.endsWith("Badges") || key === "badges"); + const likely_badges = badges.filter((key) => key.startsWith("owner") || key.startsWith("author")); + const canonical_badges = (_a = likely_badges[0]) != null ? _a : badges[0]; + const badge_key_info = key_info.find(([key]) => key === canonical_badges); + const is_badges = badge_key_info ? badge_key_info[1].type === "array" && badge_key_info[1].array_type === "renderer" && Reflect.has(badge_key_info[1].renderers, "MetadataBadge") : false; + if (is_badges && canonical_badges) + excluded_keys.add(canonical_badges); + author = { + type: "misc", + misc_type: "Author", + optional: false, + params: [ + canonical_channel_nave[0], + is_badges ? canonical_badges : void 0 + ] + }; + } + if (author) { + key_info.push(["author", author]); + } + return key_info.filter(([key]) => !excluded_keys.has(key)); +} +__name(introspectKeysSecondPass, "introspectKeysSecondPass"); +function introspect2(classdata) { + const key_info = introspectKeysFirstPass(classdata); + return introspectKeysSecondPass(key_info); +} +__name(introspect2, "introspect2"); +function introspect(classdata) { + const key_info = introspect2(classdata); + const dependencies = /* @__PURE__ */ new Map(); + for (const [, value] of key_info) { + if (value.type === "renderer" || value.type === "array" && value.array_type === "renderer") + for (const renderer of value.renderers) { + const example = RENDERER_EXAMPLES[renderer]; + if (example) + dependencies.set(renderer, example); + } + } + const unimplemented_dependencies = Array.from(dependencies).filter(([classname]) => !hasParser(classname)); + return { + key_info, + unimplemented_dependencies + }; +} +__name(introspect, "introspect"); +function isIgnoredKey(key) { + return typeof key === "string" && IGNORED_KEYS.has(key); +} +__name(isIgnoredKey, "isIgnoredKey"); +function createRuntimeClass(classname, key_info, logger) { + var _a, _key_info; + logger({ + error_type: "class_not_found", + classname, + key_info + }); + const node = (_a = class extends YTNode { + static set key_info(key_info2) { + __privateSet(this, _key_info, new Map(key_info2)); + } + static get key_info() { + return [...__privateGet(this, _key_info).entries()]; + } + constructor(data) { + super(); + const { key_info: key_info2, unimplemented_dependencies } = introspect(data); + const { resolved_key_info, changed_keys } = mergeKeyInfo(node.key_info, key_info2); + const did_change = changed_keys.length > 0; + if (did_change) { + node.key_info = resolved_key_info; + logger({ + error_type: "class_changed", + classname, + key_info: node.key_info, + changed_keys + }); + } + for (const [name, data2] of unimplemented_dependencies) + generateRuntimeClass(name, data2, logger); + for (const [key, value] of key_info2) { + let snake_key = camelToSnake(key); + if (value.type === "misc" && value.misc_type === "NavigationEndpoint") + snake_key = "endpoint"; + Reflect.set(this, snake_key, parse2(key, value, data)); + } + } + }, _key_info = new WeakMap(), __name(_a, "node"), __publicField(_a, "type", classname), __privateAdd(_a, _key_info, /* @__PURE__ */ new Map()), _a); + node.key_info = key_info; + Object.defineProperty(node, "name", { value: classname, writable: false }); + return node; +} +__name(createRuntimeClass, "createRuntimeClass"); +function generateRuntimeClass(classname, classdata, logger) { + const { key_info, unimplemented_dependencies } = introspect(classdata); + const JITNode = createRuntimeClass(classname, key_info, logger); + addRuntimeParser(classname, JITNode); + for (const [name, data] of unimplemented_dependencies) + generateRuntimeClass(name, data, logger); + return JITNode; +} +__name(generateRuntimeClass, "generateRuntimeClass"); +function generateTypescriptClass(classname, key_info) { + const props = []; + const constructor_lines = [ + "super();" + ]; + for (const [key, value] of key_info) { + let snake_key = camelToSnake(key); + if (value.type === "misc" && value.misc_type === "NavigationEndpoint") + snake_key = "endpoint"; + props.push(`${snake_key}${value.optional ? "?" : ""}: ${toTypeDeclaration(value)};`); + constructor_lines.push(`this.${snake_key} = ${toParser(key, value)};`); + } + return `class ${classname} extends YTNode { + static type = '${classname}'; + + ${props.join("\n ")} + + constructor(data: RawNode) { + ${constructor_lines.join("\n ")} + } +} +`; +} +__name(generateTypescriptClass, "generateTypescriptClass"); +function toTypeDeclarationObject(indentation, keys) { + return `{ +${keys.map(([key, value]) => `${" ".repeat((indentation + 2) * 2)}${camelToSnake(key)}${value.optional ? "?" : ""}: ${toTypeDeclaration(value, indentation + 1)}`).join(",\n")} +${" ".repeat((indentation + 1) * 2)}}`; +} +__name(toTypeDeclarationObject, "toTypeDeclarationObject"); +function toTypeDeclaration(inference_type, indentation = 0) { + switch (inference_type.type) { + case "renderer": { + return `${inference_type.renderers.map((type) => `YTNodes.${type}`).join(" | ")} | null`; + } + case "array": { + switch (inference_type.array_type) { + case "renderer": + return `ObservedArray<${inference_type.renderers.map((type) => `YTNodes.${type}`).join(" | ")}> | null`; + case "primitive": { + const items_list = inference_type.items.typeof; + if (inference_type.items.optional && !items_list.includes("undefined")) + items_list.push("undefined"); + const items = items_list.length === 1 ? `${items_list[0]}` : `(${items_list.join(" | ")})`; + return `${items}[]`; + } + case "object": + return `${toTypeDeclarationObject(indentation, inference_type.items.keys)}[]`; + default: + throw new Error("Unreachable code reached! Switch missing case!"); + } + } + case "object": { + return toTypeDeclarationObject(indentation, inference_type.keys); + } + case "misc": { + switch (inference_type.misc_type) { + case "Thumbnail": + return "Thumbnail[]"; + default: + return inference_type.misc_type; + } + } + case "primitive": { + return inference_type.typeof.join(" | "); + } + } +} +__name(toTypeDeclaration, "toTypeDeclaration"); +function toParserObject(indentation, keys, key_path, key) { + const new_keypath = [...key_path, key]; + return `{ +${keys.map(([key2, value]) => `${" ".repeat((indentation + 2) * 2)}${camelToSnake(key2)}: ${toParser(key2, value, new_keypath, indentation + 1)}`).join(",\n")} +${" ".repeat((indentation + 1) * 2)}}`; +} +__name(toParserObject, "toParserObject"); +function toParser(key, inference_type, key_path = ["data"], indentation = 1) { + let parser = "undefined"; + switch (inference_type.type) { + case "renderer": + { + parser = `Parser.parseItem(${key_path.join(".")}.${key}, ${toParserValidTypes(inference_type.renderers)})`; + } + break; + case "array": + { + switch (inference_type.array_type) { + case "renderer": + parser = `Parser.parse(${key_path.join(".")}.${key}, true, ${toParserValidTypes(inference_type.renderers)})`; + break; + case "object": + parser = `${key_path.join(".")}.${key}.map((item: any) => (${toParserObject(indentation, inference_type.items.keys, [], "item")}))`; + break; + case "primitive": + parser = `${key_path.join(".")}.${key}`; + break; + default: + throw new Error("Unreachable code reached! Switch missing case!"); + } + } + break; + case "object": + { + parser = toParserObject(indentation, inference_type.keys, key_path, key); + } + break; + case "misc": + switch (inference_type.misc_type) { + case "Thumbnail": + parser = `Thumbnail.fromResponse(${key_path.join(".")}.${key})`; + break; + case "Author": { + const author_parser = `new Author(${key_path.join(".")}.${inference_type.params[0]}, ${inference_type.params[1] ? `${key_path.join(".")}.${inference_type.params[1]}` : "undefined"})`; + if (inference_type.optional) + return `Reflect.has(${key_path.join(".")}, '${inference_type.params[0]}') ? ${author_parser} : undefined`; + return author_parser; + } + default: + parser = `new ${inference_type.misc_type}(${key_path.join(".")}.${key})`; + break; + } + if (parser === "undefined") + throw new Error("Unreachable code reached! Switch missing case!"); + break; + case "primitive": + parser = `${key_path.join(".")}.${key}`; + break; + } + if (inference_type.optional) + return `Reflect.has(${key_path.join(".")}, '${key}') ? ${parser} : undefined`; + return parser; +} +__name(toParser, "toParser"); +function toParserValidTypes(types) { + if (types.length === 1) { + return `YTNodes.${types[0]}`; + } + return `[ ${types.map((type) => `YTNodes.${type}`).join(", ")} ]`; +} +__name(toParserValidTypes, "toParserValidTypes"); +function accessDataFromKeyPath(root, key_path) { + let data = root; + for (const key of key_path) + data = data[key]; + return data; +} +__name(accessDataFromKeyPath, "accessDataFromKeyPath"); +function hasDataFromKeyPath(root, key_path) { + let data = root; + for (const key of key_path) + if (!Reflect.has(data, key)) + return false; + else + data = data[key]; + return true; +} +__name(hasDataFromKeyPath, "hasDataFromKeyPath"); +function parseObject(key, data, key_path, keys, should_optional) { + const obj = {}; + const new_key_path = [...key_path, key]; + for (const [key2, value] of keys) { + obj[key2] = should_optional ? parse2(key2, value, data, new_key_path) : void 0; + } + return obj; +} +__name(parseObject, "parseObject"); +function parse2(key, inference_type, data, key_path = ["data"]) { + const should_optional = !inference_type.optional || hasDataFromKeyPath({ data }, [...key_path, key]); + switch (inference_type.type) { + case "renderer": { + return should_optional ? parseItem(accessDataFromKeyPath({ data }, [...key_path, key]), inference_type.renderers.map((type) => getParserByName(type))) : void 0; + } + case "array": { + switch (inference_type.array_type) { + case "renderer": + return should_optional ? parse(accessDataFromKeyPath({ data }, [...key_path, key]), true, inference_type.renderers.map((type) => getParserByName(type))) : void 0; + case "object": + return should_optional ? accessDataFromKeyPath({ data }, [...key_path, key]).map((_, idx) => { + return parseObject(`${idx}`, data, [...key_path, key], inference_type.items.keys, should_optional); + }) : void 0; + case "primitive": + return should_optional ? accessDataFromKeyPath({ data }, [...key_path, key]) : void 0; + default: + throw new Error("Unreachable code reached! Switch missing case!"); + } + } + case "object": { + return parseObject(key, data, key_path, inference_type.keys, should_optional); + } + case "misc": + switch (inference_type.misc_type) { + case "NavigationEndpoint": + return should_optional ? new NavigationEndpoint(accessDataFromKeyPath({ data }, [...key_path, key])) : void 0; + case "Text": + return should_optional ? new Text2(accessDataFromKeyPath({ data }, [...key_path, key])) : void 0; + case "Thumbnail": + return should_optional ? Thumbnail.fromResponse(accessDataFromKeyPath({ data }, [...key_path, key])) : void 0; + case "Author": { + const author_should_optional = !inference_type.optional || hasDataFromKeyPath({ data }, [...key_path, inference_type.params[0]]); + return author_should_optional ? new Author(accessDataFromKeyPath({ data }, [...key_path, inference_type.params[0]]), inference_type.params[1] ? accessDataFromKeyPath({ data }, [...key_path, inference_type.params[1]]) : void 0) : void 0; + } + default: + throw new Error("Unreachable code reached! Switch missing case!"); + } + case "primitive": + return accessDataFromKeyPath({ data }, [...key_path, key]); + } +} +__name(parse2, "parse"); +function mergeKeyInfo(key_info, new_key_info) { + const changed_keys = /* @__PURE__ */ new Map(); + const current_keys = new Set(key_info.map(([key]) => key)); + const new_keys = new Set(new_key_info.map(([key]) => key)); + const added_keys = new_key_info.filter(([key]) => !current_keys.has(key)); + const removed_keys = key_info.filter(([key]) => !new_keys.has(key)); + const common_keys = key_info.filter(([key]) => new_keys.has(key)); + const new_key_map = new Map(new_key_info); + for (const [key, type] of common_keys) { + const new_type = new_key_map.get(key); + if (!new_type) + continue; + if (type.type !== new_type.type) { + changed_keys.set(key, { + type: "primitive", + typeof: ["unknown"], + optional: true + }); + continue; + } + switch (type.type) { + case "object": + { + if (new_type.type !== "object") + continue; + const { resolved_key_info: resolved_key_info2 } = mergeKeyInfo(type.keys, new_type.keys); + const resolved_key = { + type: "object", + keys: resolved_key_info2, + optional: type.optional || new_type.optional + }; + const did_change = JSON.stringify(resolved_key) !== JSON.stringify(type); + if (did_change) + changed_keys.set(key, resolved_key); + } + break; + case "renderer": + { + if (new_type.type !== "renderer") + continue; + const union_map = { + ...type.renderers, + ...new_type.renderers + }; + const either_optional = type.optional || new_type.optional; + const resolved_key = { + type: "renderer", + renderers: union_map, + optional: either_optional + }; + const did_change = JSON.stringify({ + ...resolved_key, + renderers: Object.keys(resolved_key.renderers) + }) !== JSON.stringify({ + ...type, + renderers: Object.keys(type.renderers) + }); + if (did_change) + changed_keys.set(key, resolved_key); + } + break; + case "array": { + if (new_type.type !== "array") + continue; + switch (type.array_type) { + case "renderer": + { + if (new_type.array_type !== "renderer") { + changed_keys.set(key, { + type: "array", + array_type: "primitive", + items: { + type: "primitive", + typeof: ["unknown"], + optional: true + }, + optional: true + }); + continue; + } + const union_map = { + ...type.renderers, + ...new_type.renderers + }; + const either_optional = type.optional || new_type.optional; + const resolved_key = { + type: "array", + array_type: "renderer", + renderers: union_map, + optional: either_optional + }; + const did_change = JSON.stringify({ + ...resolved_key, + renderers: Object.keys(resolved_key.renderers) + }) !== JSON.stringify({ + ...type, + renderers: Object.keys(type.renderers) + }); + if (did_change) + changed_keys.set(key, resolved_key); + } + break; + case "object": + { + if (new_type.array_type === "primitive" && new_type.items.typeof.length == 1 && new_type.items.typeof[0] === "never") { + continue; + } + if (new_type.array_type !== "object") { + changed_keys.set(key, { + type: "array", + array_type: "primitive", + items: { + type: "primitive", + typeof: ["unknown"], + optional: true + }, + optional: true + }); + continue; + } + const { resolved_key_info: resolved_key_info2 } = mergeKeyInfo(type.items.keys, new_type.items.keys); + const resolved_key = { + type: "array", + array_type: "object", + items: { + type: "object", + keys: resolved_key_info2, + optional: type.items.optional || new_type.items.optional + }, + optional: type.optional || new_type.optional + }; + const did_change = JSON.stringify(resolved_key) !== JSON.stringify(type); + if (did_change) + changed_keys.set(key, resolved_key); + } + break; + case "primitive": + { + if (type.items.typeof.includes("never") && new_type.array_type === "object") { + changed_keys.set(key, new_type); + continue; + } + if (new_type.array_type !== "primitive") { + changed_keys.set(key, { + type: "array", + array_type: "primitive", + items: { + type: "primitive", + typeof: ["unknown"], + optional: true + }, + optional: true + }); + continue; + } + const key_types = /* @__PURE__ */ new Set([...new_type.items.typeof, ...type.items.typeof]); + if (key_types.size > 1 && key_types.has("never")) + key_types.delete("never"); + const resolved_key = { + type: "array", + array_type: "primitive", + items: { + type: "primitive", + typeof: Array.from(key_types), + optional: type.items.optional || new_type.items.optional + }, + optional: type.optional || new_type.optional + }; + const did_change = JSON.stringify(resolved_key) !== JSON.stringify(type); + if (did_change) + changed_keys.set(key, resolved_key); + } + break; + default: + throw new Error("Unreachable code reached! Switch missing case!"); + } + break; + } + case "misc": + { + if (new_type.type !== "misc") + continue; + if (type.misc_type !== new_type.misc_type) { + changed_keys.set(key, { + type: "primitive", + typeof: ["unknown"], + optional: true + }); + } + switch (type.misc_type) { + case "Author": + { + if (new_type.misc_type !== "Author") + break; + const had_optional_param = type.params[1] || new_type.params[1]; + const either_optional = type.optional || new_type.optional; + const resolved_key = { + type: "misc", + misc_type: "Author", + optional: either_optional, + params: [new_type.params[0], had_optional_param] + }; + const did_change = JSON.stringify(resolved_key) !== JSON.stringify(type); + if (did_change) + changed_keys.set(key, resolved_key); + } + break; + } + } + break; + case "primitive": + { + if (new_type.type !== "primitive") + continue; + const resolved_key = { + type: "primitive", + typeof: Array.from(/* @__PURE__ */ new Set([...new_type.typeof, ...type.typeof])), + optional: type.optional || new_type.optional + }; + const did_change = JSON.stringify(resolved_key) !== JSON.stringify(type); + if (did_change) + changed_keys.set(key, resolved_key); + } + break; + } + } + for (const [key, type] of added_keys) { + changed_keys.set(key, { + ...type, + optional: true + }); + } + for (const [key, type] of removed_keys) { + changed_keys.set(key, { + ...type, + optional: true + }); + } + const unchanged_keys = key_info.filter(([key]) => !changed_keys.has(key)); + const resolved_key_info_map = new Map([...unchanged_keys, ...changed_keys]); + const resolved_key_info = [...resolved_key_info_map.entries()]; + return { + resolved_key_info, + changed_keys: [...changed_keys.entries()] + }; +} +__name(mergeKeyInfo, "mergeKeyInfo"); + +// dist/src/parser/continuations.js +var _ItemSectionContinuation = class _ItemSectionContinuation extends YTNode { + constructor(data) { + var _a, _b, _c; + super(); + __publicField(this, "contents"); + __publicField(this, "continuation"); + this.contents = parseArray(data.contents); + if (Array.isArray(data.continuations)) { + this.continuation = (_c = (_b = (_a = data.continuations) == null ? void 0 : _a.at(0)) == null ? void 0 : _b.nextContinuationData) == null ? void 0 : _c.continuation; + } + } +}; +__name(_ItemSectionContinuation, "ItemSectionContinuation"); +__publicField(_ItemSectionContinuation, "type", "itemSectionContinuation"); +var ItemSectionContinuation = _ItemSectionContinuation; +var _NavigateAction = class _NavigateAction extends YTNode { + constructor(data) { + super(); + __publicField(this, "endpoint"); + this.endpoint = new NavigationEndpoint(data.endpoint); + } +}; +__name(_NavigateAction, "NavigateAction"); +__publicField(_NavigateAction, "type", "navigateAction"); +var NavigateAction = _NavigateAction; +var _ShowMiniplayerCommand = class _ShowMiniplayerCommand extends YTNode { + constructor(data) { + super(); + __publicField(this, "miniplayer_command"); + __publicField(this, "show_premium_branding"); + this.miniplayer_command = new NavigationEndpoint(data.miniplayerCommand); + this.show_premium_branding = data.showPremiumBranding; + } +}; +__name(_ShowMiniplayerCommand, "ShowMiniplayerCommand"); +__publicField(_ShowMiniplayerCommand, "type", "showMiniplayerCommand"); +var ShowMiniplayerCommand = _ShowMiniplayerCommand; +var _ReloadContinuationItemsCommand = class _ReloadContinuationItemsCommand extends YTNode { + constructor(data) { + super(); + __publicField(this, "target_id"); + __publicField(this, "contents"); + __publicField(this, "slot"); + this.target_id = data.targetId; + this.contents = parse(data.continuationItems, true); + this.slot = data == null ? void 0 : data.slot; + } +}; +__name(_ReloadContinuationItemsCommand, "ReloadContinuationItemsCommand"); +__publicField(_ReloadContinuationItemsCommand, "type", "reloadContinuationItemsCommand"); +var ReloadContinuationItemsCommand = _ReloadContinuationItemsCommand; +var _SectionListContinuation = class _SectionListContinuation extends YTNode { + constructor(data) { + var _a, _b, _c, _d, _e, _f; + super(); + __publicField(this, "continuation"); + __publicField(this, "contents"); + this.contents = parse(data.contents, true); + this.continuation = ((_c = (_b = (_a = data.continuations) == null ? void 0 : _a[0]) == null ? void 0 : _b.nextContinuationData) == null ? void 0 : _c.continuation) || ((_f = (_e = (_d = data.continuations) == null ? void 0 : _d[0]) == null ? void 0 : _e.reloadContinuationData) == null ? void 0 : _f.continuation) || null; + } +}; +__name(_SectionListContinuation, "SectionListContinuation"); +__publicField(_SectionListContinuation, "type", "sectionListContinuation"); +var SectionListContinuation = _SectionListContinuation; +var _MusicPlaylistShelfContinuation = class _MusicPlaylistShelfContinuation extends YTNode { + constructor(data) { + var _a; + super(); + __publicField(this, "continuation"); + __publicField(this, "contents"); + this.contents = parse(data.contents, true); + this.continuation = ((_a = data.continuations) == null ? void 0 : _a[0].nextContinuationData.continuation) || null; + } +}; +__name(_MusicPlaylistShelfContinuation, "MusicPlaylistShelfContinuation"); +__publicField(_MusicPlaylistShelfContinuation, "type", "musicPlaylistShelfContinuation"); +var MusicPlaylistShelfContinuation = _MusicPlaylistShelfContinuation; +var _MusicShelfContinuation = class _MusicShelfContinuation extends YTNode { + constructor(data) { + var _a, _b, _c, _d; + super(); + __publicField(this, "continuation"); + __publicField(this, "contents"); + this.contents = parseArray(data.contents); + this.continuation = ((_b = (_a = data.continuations) == null ? void 0 : _a[0].nextContinuationData) == null ? void 0 : _b.continuation) || ((_d = (_c = data.continuations) == null ? void 0 : _c[0].reloadContinuationData) == null ? void 0 : _d.continuation) || null; + } +}; +__name(_MusicShelfContinuation, "MusicShelfContinuation"); +__publicField(_MusicShelfContinuation, "type", "musicShelfContinuation"); +var MusicShelfContinuation = _MusicShelfContinuation; +var _GridContinuation = class _GridContinuation extends YTNode { + constructor(data) { + var _a; + super(); + __publicField(this, "continuation"); + __publicField(this, "items"); + this.items = parse(data.items, true); + this.continuation = ((_a = data.continuations) == null ? void 0 : _a[0].nextContinuationData.continuation) || null; + } + get contents() { + return this.items; + } +}; +__name(_GridContinuation, "GridContinuation"); +__publicField(_GridContinuation, "type", "gridContinuation"); +var GridContinuation = _GridContinuation; +var _PlaylistPanelContinuation = class _PlaylistPanelContinuation extends YTNode { + constructor(data) { + var _a, _b, _c, _d, _e, _f; + super(); + __publicField(this, "continuation"); + __publicField(this, "contents"); + this.contents = parseArray(data.contents); + this.continuation = ((_c = (_b = (_a = data.continuations) == null ? void 0 : _a[0]) == null ? void 0 : _b.nextContinuationData) == null ? void 0 : _c.continuation) || ((_f = (_e = (_d = data.continuations) == null ? void 0 : _d[0]) == null ? void 0 : _e.nextRadioContinuationData) == null ? void 0 : _f.continuation) || null; + } +}; +__name(_PlaylistPanelContinuation, "PlaylistPanelContinuation"); +__publicField(_PlaylistPanelContinuation, "type", "playlistPanelContinuation"); +var PlaylistPanelContinuation = _PlaylistPanelContinuation; +var _Continuation = class _Continuation extends YTNode { + constructor(data) { + var _a, _b, _c; + super(); + __publicField(this, "continuation_type"); + __publicField(this, "timeout_ms"); + __publicField(this, "time_until_last_message_ms"); + __publicField(this, "token"); + this.continuation_type = data.type; + this.timeout_ms = (_a = data.continuation) == null ? void 0 : _a.timeoutMs; + this.time_until_last_message_ms = (_b = data.continuation) == null ? void 0 : _b.timeUntilLastMessageMsec; + this.token = (_c = data.continuation) == null ? void 0 : _c.continuation; + } +}; +__name(_Continuation, "Continuation"); +__publicField(_Continuation, "type", "continuation"); +var Continuation = _Continuation; +var _LiveChatContinuation = class _LiveChatContinuation extends YTNode { + constructor(data) { + var _a, _b, _c, _d, _e, _f, _g, _h; + super(); + __publicField(this, "actions"); + __publicField(this, "action_panel"); + __publicField(this, "item_list"); + __publicField(this, "header"); + __publicField(this, "participants_list"); + __publicField(this, "popout_message"); + __publicField(this, "emojis"); + __publicField(this, "continuation"); + __publicField(this, "viewer_name"); + this.actions = parse((_a = data.actions) == null ? void 0 : _a.map((action) => { + delete action.clickTrackingParams; + return action; + }), true) || observe([]); + this.action_panel = parseItem(data.actionPanel); + this.item_list = parseItem(data.itemList, LiveChatItemList); + this.header = parseItem(data.header, LiveChatHeader); + this.participants_list = parseItem(data.participantsList, LiveChatParticipantsList); + this.popout_message = parseItem(data.popoutMessage, Message); + this.emojis = ((_b = data.emojis) == null ? void 0 : _b.map((emoji) => ({ + emoji_id: emoji.emojiId, + shortcuts: emoji.shortcuts, + search_terms: emoji.searchTerms, + image: Thumbnail.fromResponse(emoji.image), + is_custom_emoji: emoji.isCustomEmoji + }))) || []; + let continuation, type; + if ((_c = data.continuations) == null ? void 0 : _c[0].timedContinuationData) { + type = "timed"; + continuation = (_d = data.continuations) == null ? void 0 : _d[0].timedContinuationData; + } else if ((_e = data.continuations) == null ? void 0 : _e[0].invalidationContinuationData) { + type = "invalidation"; + continuation = (_f = data.continuations) == null ? void 0 : _f[0].invalidationContinuationData; + } else if ((_g = data.continuations) == null ? void 0 : _g[0].liveChatReplayContinuationData) { + type = "replay"; + continuation = (_h = data.continuations) == null ? void 0 : _h[0].liveChatReplayContinuationData; + } + this.continuation = new Continuation({ continuation, type }); + this.viewer_name = data.viewerName; + } +}; +__name(_LiveChatContinuation, "LiveChatContinuation"); +__publicField(_LiveChatContinuation, "type", "liveChatContinuation"); +var LiveChatContinuation = _LiveChatContinuation; +var _ContinuationCommand2 = class _ContinuationCommand2 extends YTNode { + constructor(data) { + super(); + __publicField(this, "request"); + __publicField(this, "token"); + this.request = data.request; + this.token = data.token; + } +}; +__name(_ContinuationCommand2, "ContinuationCommand"); +__publicField(_ContinuationCommand2, "type", "ContinuationCommand"); +var ContinuationCommand2 = _ContinuationCommand2; + +// dist/protos/generated/misc/common.js +function createBaseKeyValuePair() { + return { key: void 0, value: void 0 }; +} +__name(createBaseKeyValuePair, "createBaseKeyValuePair"); +var KeyValuePair = { + encode(message, writer = new BinaryWriter()) { + if (message.key !== void 0) { + writer.uint32(10).string(message.key); + } + if (message.value !== void 0) { + writer.uint32(18).string(message.value); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === void 0 ? reader.len : reader.pos + length; + const message = createBaseKeyValuePair(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + message.key = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + message.value = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + } +}; +function createBaseFormatXTags() { + return { xtags: [] }; +} +__name(createBaseFormatXTags, "createBaseFormatXTags"); +var FormatXTags = { + encode(message, writer = new BinaryWriter()) { + for (const v of message.xtags) { + KeyValuePair.encode(v, writer.uint32(10).fork()).join(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === void 0 ? reader.len : reader.pos + length; + const message = createBaseFormatXTags(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + message.xtags.push(KeyValuePair.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + } +}; + +// dist/src/parser/classes/misc/Format.js +var _this_response_nsig_cache; +var _Format = class _Format { + constructor(data, this_response_nsig_cache) { + __privateAdd(this, _this_response_nsig_cache); + __publicField(this, "itag"); + __publicField(this, "url"); + __publicField(this, "width"); + __publicField(this, "height"); + __publicField(this, "last_modified"); + __publicField(this, "last_modified_ms"); + __publicField(this, "content_length"); + __publicField(this, "quality"); + __publicField(this, "xtags"); + __publicField(this, "drm_families"); + __publicField(this, "fps"); + __publicField(this, "quality_label"); + __publicField(this, "projection_type"); + __publicField(this, "average_bitrate"); + __publicField(this, "bitrate"); + __publicField(this, "spatial_audio_type"); + __publicField(this, "target_duration_dec"); + __publicField(this, "fair_play_key_uri"); + __publicField(this, "stereo_layout"); + __publicField(this, "max_dvr_duration_sec"); + __publicField(this, "high_replication"); + __publicField(this, "audio_quality"); + __publicField(this, "approx_duration_ms"); + __publicField(this, "audio_sample_rate"); + __publicField(this, "audio_channels"); + __publicField(this, "loudness_db"); + __publicField(this, "signature_cipher"); + __publicField(this, "is_drc"); + __publicField(this, "is_vb"); + __publicField(this, "is_sr"); + __publicField(this, "drm_track_type"); + __publicField(this, "distinct_params"); + __publicField(this, "track_absolute_loudness_lkfs"); + __publicField(this, "mime_type"); + __publicField(this, "is_type_otf"); + __publicField(this, "init_range"); + __publicField(this, "index_range"); + __publicField(this, "cipher"); + __publicField(this, "audio_track"); + __publicField(this, "has_audio"); + __publicField(this, "has_video"); + __publicField(this, "has_text"); + __publicField(this, "language"); + __publicField(this, "is_dubbed"); + __publicField(this, "is_auto_dubbed"); + __publicField(this, "is_descriptive"); + __publicField(this, "is_secondary"); + __publicField(this, "is_original"); + __publicField(this, "color_info"); + __publicField(this, "caption_track"); + var _a, _b, _c, _d, _e, _f, _g; + if (this_response_nsig_cache) + __privateSet(this, _this_response_nsig_cache, this_response_nsig_cache); + this.itag = data.itag; + this.mime_type = data.mimeType; + this.is_type_otf = data.type === "FORMAT_STREAM_TYPE_OTF"; + this.bitrate = data.bitrate; + this.average_bitrate = data.averageBitrate; + if (Reflect.has(data, "width") && Reflect.has(data, "height")) { + this.width = parseInt(data.width); + this.height = parseInt(data.height); + } + if (Reflect.has(data, "projectionType")) + this.projection_type = data.projectionType; + if (Reflect.has(data, "stereoLayout")) + this.stereo_layout = (_a = data.stereoLayout) == null ? void 0 : _a.replace("STEREO_LAYOUT_", ""); + if (Reflect.has(data, "initRange")) + this.init_range = { + start: parseInt(data.initRange.start), + end: parseInt(data.initRange.end) + }; + if (Reflect.has(data, "indexRange")) + this.index_range = { + start: parseInt(data.indexRange.start), + end: parseInt(data.indexRange.end) + }; + this.last_modified = new Date(Math.floor(parseInt(data.lastModified) / 1e3)); + this.last_modified_ms = data.lastModified; + if (Reflect.has(data, "contentLength")) + this.content_length = parseInt(data.contentLength); + if (Reflect.has(data, "quality")) + this.quality = data.quality; + if (Reflect.has(data, "qualityLabel")) + this.quality_label = data.qualityLabel; + if (Reflect.has(data, "fps")) + this.fps = data.fps; + if (Reflect.has(data, "url")) + this.url = data.url; + if (Reflect.has(data, "cipher")) + this.cipher = data.cipher; + if (Reflect.has(data, "signatureCipher")) + this.signature_cipher = data.signatureCipher; + if (Reflect.has(data, "audioQuality")) + this.audio_quality = data.audioQuality; + this.approx_duration_ms = parseInt(data.approxDurationMs); + if (Reflect.has(data, "audioSampleRate")) + this.audio_sample_rate = parseInt(data.audioSampleRate); + if (Reflect.has(data, "audioChannels")) + this.audio_channels = data.audioChannels; + if (Reflect.has(data, "loudnessDb")) + this.loudness_db = data.loudnessDb; + if (Reflect.has(data, "spatialAudioType")) + this.spatial_audio_type = (_b = data.spatialAudioType) == null ? void 0 : _b.replace("SPATIAL_AUDIO_TYPE_", ""); + if (Reflect.has(data, "maxDvrDurationSec")) + this.max_dvr_duration_sec = data.maxDvrDurationSec; + if (Reflect.has(data, "targetDurationSec")) + this.target_duration_dec = data.targetDurationSec; + this.has_audio = !!data.audioBitrate || !!data.audioQuality; + this.has_video = !!data.qualityLabel; + this.has_text = !!data.captionTrack; + if (Reflect.has(data, "xtags")) + this.xtags = data.xtags; + if (Reflect.has(data, "fairPlayKeyUri")) + this.fair_play_key_uri = data.fairPlayKeyUri; + if (Reflect.has(data, "drmFamilies")) + this.drm_families = data.drmFamilies; + if (Reflect.has(data, "drmTrackType")) + this.drm_track_type = data.drmTrackType; + if (Reflect.has(data, "distinctParams")) + this.distinct_params = data.distinctParams; + if (Reflect.has(data, "trackAbsoluteLoudnessLkfs")) + this.track_absolute_loudness_lkfs = data.trackAbsoluteLoudnessLkfs; + if (Reflect.has(data, "highReplication")) + this.high_replication = data.highReplication; + if (Reflect.has(data, "colorInfo")) + this.color_info = { + primaries: (_c = data.colorInfo.primaries) == null ? void 0 : _c.replace("COLOR_PRIMARIES_", ""), + transfer_characteristics: (_d = data.colorInfo.transferCharacteristics) == null ? void 0 : _d.replace("COLOR_TRANSFER_CHARACTERISTICS_", ""), + matrix_coefficients: (_e = data.colorInfo.matrixCoefficients) == null ? void 0 : _e.replace("COLOR_MATRIX_COEFFICIENTS_", "") + }; + if (Reflect.has(data, "audioTrack")) + this.audio_track = { + audio_is_default: data.audioTrack.audioIsDefault, + display_name: data.audioTrack.displayName, + id: data.audioTrack.id + }; + if (Reflect.has(data, "captionTrack")) + this.caption_track = { + display_name: data.captionTrack.displayName, + vss_id: data.captionTrack.vssId, + language_code: data.captionTrack.languageCode, + kind: data.captionTrack.kind, + id: data.captionTrack.id + }; + const xtags = this.xtags ? FormatXTags.decode(base64ToU8(decodeURIComponent(this.xtags).replace(/-/g, "+").replace(/_/g, "/"))).xtags : []; + if (this.has_audio || this.has_text) { + this.language = ((_f = xtags.find((tag) => tag.key === "lang")) == null ? void 0 : _f.value) || null; + if (this.has_audio) { + this.is_drc = !!data.isDrc || xtags.some((tag) => tag.key === "drc" && tag.value === "1"); + this.is_vb = !!data.isVb || xtags.some((tag) => tag.key === "vb" && tag.value === "1"); + const audio_content = (_g = xtags.find((tag) => tag.key === "acont")) == null ? void 0 : _g.value; + this.is_dubbed = audio_content === "dubbed"; + this.is_descriptive = audio_content === "descriptive"; + this.is_secondary = audio_content === "secondary"; + this.is_auto_dubbed = audio_content === "dubbed-auto"; + this.is_original = audio_content === "original" || !this.is_dubbed && !this.is_descriptive && !this.is_secondary && !this.is_auto_dubbed && !this.is_drc; + } + if (this.has_text && !this.language && this.caption_track) { + this.language = this.caption_track.language_code; + } + } + if (this.has_video) { + this.is_sr = xtags.some((tag) => tag.key === "sr" && tag.value === "1"); + } + } + /** + * Deciphers the URL using the provided player instance. + * @param player - An optional instance of the Player class used to decipher the URL. + * @returns The deciphered URL as a string. If no player is provided, returns the original URL or an empty string. + */ + async decipher(player) { + if (!player) + return this.url || ""; + return player.decipher(this.url, this.signature_cipher, this.cipher, __privateGet(this, _this_response_nsig_cache)); + } +}; +_this_response_nsig_cache = new WeakMap(); +__name(_Format, "Format"); +var Format = _Format; + +// dist/src/parser/classes/misc/VideoDetails.js +var _VideoDetails = class _VideoDetails { + constructor(data) { + __publicField(this, "id"); + __publicField(this, "channel_id"); + __publicField(this, "title"); + __publicField(this, "duration"); + __publicField(this, "keywords"); + __publicField(this, "is_owner_viewing"); + __publicField(this, "short_description"); + __publicField(this, "thumbnail"); + __publicField(this, "allow_ratings"); + __publicField(this, "view_count"); + __publicField(this, "author"); + __publicField(this, "is_private"); + __publicField(this, "is_live"); + __publicField(this, "is_live_content"); + __publicField(this, "is_live_dvr_enabled"); + __publicField(this, "is_upcoming"); + __publicField(this, "is_crawlable"); + __publicField(this, "is_post_live_dvr"); + __publicField(this, "is_low_latency_live_stream"); + __publicField(this, "live_chunk_readahead"); + this.id = data.videoId; + this.channel_id = data.channelId; + this.title = data.title; + this.duration = parseInt(data.lengthSeconds); + this.keywords = data.keywords; + this.is_owner_viewing = !!data.isOwnerViewing; + this.short_description = data.shortDescription; + this.thumbnail = Thumbnail.fromResponse(data.thumbnail); + this.allow_ratings = !!data.allowRatings; + this.view_count = parseInt(data.viewCount); + this.author = data.author; + this.is_private = !!data.isPrivate; + this.is_live = !!data.isLive; + this.is_live_content = !!data.isLiveContent; + this.is_live_dvr_enabled = !!data.isLiveDvrEnabled; + this.is_low_latency_live_stream = !!data.isLowLatencyLiveStream; + this.is_upcoming = !!data.isUpcoming; + this.is_post_live_dvr = !!data.isPostLiveDvr; + this.is_crawlable = !!data.isCrawlable; + this.live_chunk_readahead = data.liveChunkReadahead; + } +}; +__name(_VideoDetails, "VideoDetails"); +var VideoDetails = _VideoDetails; + +// dist/src/parser/parser.js +var TAG2 = "Parser"; +var IGNORED_LIST = /* @__PURE__ */ new Set([ + "AdSlot", + "DisplayAd", + "SearchPyv", + "MealbarPromo", + "PrimetimePromo", + "PromotedSparklesWeb", + "CompactPromotedVideo", + "BrandVideoShelf", + "BrandVideoSingleton", + "StatementBanner", + "GuideSigninPromo", + "AdsEngagementPanelContent", + "MiniGameCardView", + "GenAiFeedbackFormView" +]); +var RUNTIME_NODES = new Map(Object.entries(nodes_exports)); +var DYNAMIC_NODES = /* @__PURE__ */ new Map(); +var MEMO = null; +var ERROR_HANDLER = /* @__PURE__ */ __name(({ classname, ...context }) => { + switch (context.error_type) { + case "parse": + if (context.error instanceof Error) { + Log_exports.warn(TAG2, new InnertubeError(`Something went wrong at ${classname}! +This is a bug, please report it at ${package_default.bugs.url}`, { + stack: context.error.stack, + classdata: JSON.stringify(context.classdata, null, 2) + })); + } + break; + case "typecheck": + Log_exports.warn(TAG2, new ParsingError(`Type mismatch, got ${classname} expected ${Array.isArray(context.expected) ? context.expected.join(" | ") : context.expected}.`, context.classdata)); + break; + case "mutation_data_missing": + Log_exports.warn(TAG2, new InnertubeError(`Mutation data required for processing ${classname}, but none found. +This is a bug, please report it at ${package_default.bugs.url}`)); + break; + case "mutation_data_invalid": + Log_exports.warn(TAG2, new InnertubeError(`Mutation data missing or invalid for ${context.failed} out of ${context.total} MusicMultiSelectMenuItems. The titles of the failed items are: ${context.titles.join(", ")}. +This is a bug, please report it at ${package_default.bugs.url}`)); + break; + case "class_not_found": + Log_exports.warn(TAG2, new InnertubeError(`${classname} not found! +This is a bug, want to help us fix it? Follow the instructions at ${package_default.homepage.split("#", 1)[0]}/blob/main/docs/updating-the-parser.md or report it at ${package_default.bugs.url}! +Introspected and JIT generated this class in the meantime: +${generateTypescriptClass(classname, context.key_info)}`)); + break; + case "class_changed": + Log_exports.warn(TAG2, `${classname} changed! +The following keys where altered: ${context.changed_keys.map(([key]) => camelToSnake(key)).join(", ")} +The class has changed to: +${generateTypescriptClass(classname, context.key_info)}`); + break; + default: + Log_exports.warn(TAG2, "Unreachable code reached at ParserErrorHandler"); + break; + } +}, "ERROR_HANDLER"); +function setParserErrorHandler(handler) { + ERROR_HANDLER = handler; +} +__name(setParserErrorHandler, "setParserErrorHandler"); +function _clearMemo() { + MEMO = null; +} +__name(_clearMemo, "_clearMemo"); +function _createMemo() { + MEMO = new Memo(); +} +__name(_createMemo, "_createMemo"); +function _addToMemo(classname, result) { + if (!MEMO) + return; + const list = MEMO.get(classname); + if (!list) + return MEMO.set(classname, [result]); + list.push(result); +} +__name(_addToMemo, "_addToMemo"); +function _getMemo() { + if (!MEMO) + throw new Error("Parser#getMemo() called before Parser#createMemo()"); + return MEMO; +} +__name(_getMemo, "_getMemo"); +function shouldIgnore(classname) { + return IGNORED_LIST.has(classname); +} +__name(shouldIgnore, "shouldIgnore"); +function sanitizeClassName(input) { + return (input.charAt(0).toUpperCase() + input.slice(1)).replace(/Renderer|Model/g, "").replace(/Radio/g, "Mix").trim(); +} +__name(sanitizeClassName, "sanitizeClassName"); +function getParserByName(classname) { + const ParserConstructor = RUNTIME_NODES.get(classname); + if (!ParserConstructor) { + const error2 = new Error(`Module not found: ${classname}`); + error2.code = "MODULE_NOT_FOUND"; + throw error2; + } + return ParserConstructor; +} +__name(getParserByName, "getParserByName"); +function hasParser(classname) { + return RUNTIME_NODES.has(classname); +} +__name(hasParser, "hasParser"); +function addRuntimeParser(classname, ParserConstructor) { + RUNTIME_NODES.set(classname, ParserConstructor); + DYNAMIC_NODES.set(classname, ParserConstructor); +} +__name(addRuntimeParser, "addRuntimeParser"); +function getDynamicParsers() { + return Object.fromEntries(DYNAMIC_NODES); +} +__name(getDynamicParsers, "getDynamicParsers"); +function parseResponse(data) { + var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p; + const parsed_data = {}; + _createMemo(); + const contents = parse(data.contents); + const contents_memo = _getMemo(); + if (contents) { + parsed_data.contents = contents; + parsed_data.contents_memo = contents_memo; + } + _clearMemo(); + _createMemo(); + const on_response_received_actions = data.onResponseReceivedActions ? parseRR(data.onResponseReceivedActions) : null; + const on_response_received_actions_memo = _getMemo(); + if (on_response_received_actions) { + parsed_data.on_response_received_actions = on_response_received_actions; + parsed_data.on_response_received_actions_memo = on_response_received_actions_memo; + } + _clearMemo(); + _createMemo(); + const on_response_received_endpoints = data.onResponseReceivedEndpoints ? parseRR(data.onResponseReceivedEndpoints) : null; + const on_response_received_endpoints_memo = _getMemo(); + if (on_response_received_endpoints) { + parsed_data.on_response_received_endpoints = on_response_received_endpoints; + parsed_data.on_response_received_endpoints_memo = on_response_received_endpoints_memo; + } + _clearMemo(); + _createMemo(); + const on_response_received_commands = data.onResponseReceivedCommands ? parseRR(data.onResponseReceivedCommands) : null; + const on_response_received_commands_memo = _getMemo(); + if (on_response_received_commands) { + parsed_data.on_response_received_commands = on_response_received_commands; + parsed_data.on_response_received_commands_memo = on_response_received_commands_memo; + } + _clearMemo(); + _createMemo(); + const continuation_contents = data.continuationContents ? parseLC(data.continuationContents) : null; + const continuation_contents_memo = _getMemo(); + if (continuation_contents) { + parsed_data.continuation_contents = continuation_contents; + parsed_data.continuation_contents_memo = continuation_contents_memo; + } + _clearMemo(); + _createMemo(); + const actions = data.actions ? parseActions(data.actions) : null; + const actions_memo = _getMemo(); + if (actions) { + parsed_data.actions = actions; + parsed_data.actions_memo = actions_memo; + } + _clearMemo(); + _createMemo(); + const live_chat_item_context_menu_supported_renderers = data.liveChatItemContextMenuSupportedRenderers ? parseItem(data.liveChatItemContextMenuSupportedRenderers) : null; + const live_chat_item_context_menu_supported_renderers_memo = _getMemo(); + if (live_chat_item_context_menu_supported_renderers) { + parsed_data.live_chat_item_context_menu_supported_renderers = live_chat_item_context_menu_supported_renderers; + parsed_data.live_chat_item_context_menu_supported_renderers_memo = live_chat_item_context_menu_supported_renderers_memo; + } + _clearMemo(); + _createMemo(); + const header = data.header ? parse(data.header) : null; + const header_memo = _getMemo(); + if (header) { + parsed_data.header = header; + parsed_data.header_memo = header_memo; + } + _clearMemo(); + _createMemo(); + const sidebar = data.sidebar ? parseItem(data.sidebar) : null; + const sidebar_memo = _getMemo(); + if (sidebar) { + parsed_data.sidebar = sidebar; + parsed_data.sidebar_memo = sidebar_memo; + } + _clearMemo(); + _createMemo(); + const items = parse(data.items); + if (items) { + parsed_data.items = items; + parsed_data.items_memo = _getMemo(); + } + _clearMemo(); + applyMutations(contents_memo, (_b = (_a = data.frameworkUpdates) == null ? void 0 : _a.entityBatchUpdate) == null ? void 0 : _b.mutations); + if (on_response_received_endpoints_memo) { + applyCommentsMutations(on_response_received_endpoints_memo, (_d = (_c = data.frameworkUpdates) == null ? void 0 : _c.entityBatchUpdate) == null ? void 0 : _d.mutations); + } + const continuation = data.continuation ? parseC(data.continuation) : null; + if (continuation) { + parsed_data.continuation = continuation; + } + const continuation_endpoint = data.continuationEndpoint ? parseLC(data.continuationEndpoint) : null; + if (continuation_endpoint) { + parsed_data.continuation_endpoint = continuation_endpoint; + } + const metadata = parse(data.metadata); + if (metadata) { + parsed_data.metadata = metadata; + } + const microformat = parseItem(data.microformat); + if (microformat) { + parsed_data.microformat = microformat; + } + const overlay = parseItem(data.overlay); + if (overlay) { + parsed_data.overlay = overlay; + } + const alerts = parseArray(data.alerts, [Alert, AlertWithButton]); + if (alerts.length) { + parsed_data.alerts = alerts; + } + const refinements = data.refinements; + if (refinements) { + parsed_data.refinements = refinements; + } + const estimated_results = data.estimatedResults ? parseInt(data.estimatedResults) : null; + if (estimated_results) { + parsed_data.estimated_results = estimated_results; + } + const player_overlays = parse(data.playerOverlays); + if (player_overlays) { + parsed_data.player_overlays = player_overlays; + } + const background = parseItem(data.background, MusicThumbnail); + if (background) { + parsed_data.background = background; + } + const playback_tracking = data.playbackTracking ? { + videostats_watchtime_url: data.playbackTracking.videostatsWatchtimeUrl.baseUrl, + videostats_playback_url: data.playbackTracking.videostatsPlaybackUrl.baseUrl + } : null; + if (playback_tracking) { + parsed_data.playback_tracking = playback_tracking; + } + const playability_status = data.playabilityStatus ? { + status: data.playabilityStatus.status, + reason: data.playabilityStatus.reason || "", + embeddable: !!data.playabilityStatus.playableInEmbed || false, + audio_only_playability: parseItem(data.playabilityStatus.audioOnlyPlayability, AudioOnlyPlayability), + error_screen: parseItem(data.playabilityStatus.errorScreen) + } : null; + if (playability_status) { + parsed_data.playability_status = playability_status; + } + if (data.streamingData) { + const this_response_nsig_cache = /* @__PURE__ */ new Map(); + parsed_data.streaming_data = { + expires: new Date(Date.now() + parseInt(data.streamingData.expiresInSeconds) * 1e3), + formats: parseFormats(data.streamingData.formats, this_response_nsig_cache), + adaptive_formats: parseFormats(data.streamingData.adaptiveFormats, this_response_nsig_cache), + dash_manifest_url: data.streamingData.dashManifestUrl, + hls_manifest_url: data.streamingData.hlsManifestUrl, + server_abr_streaming_url: data.streamingData.serverAbrStreamingUrl + }; + } + if (data.playerConfig) { + parsed_data.player_config = { + audio_config: { + loudness_db: (_e = data.playerConfig.audioConfig) == null ? void 0 : _e.loudnessDb, + perceptual_loudness_db: (_f = data.playerConfig.audioConfig) == null ? void 0 : _f.perceptualLoudnessDb, + enable_per_format_loudness: (_g = data.playerConfig.audioConfig) == null ? void 0 : _g.enablePerFormatLoudness + }, + stream_selection_config: { + max_bitrate: ((_h = data.playerConfig.streamSelectionConfig) == null ? void 0 : _h.maxBitrate) || "0" + }, + media_common_config: { + dynamic_readahead_config: { + max_read_ahead_media_time_ms: ((_j = (_i = data.playerConfig.mediaCommonConfig) == null ? void 0 : _i.dynamicReadaheadConfig) == null ? void 0 : _j.maxReadAheadMediaTimeMs) || 0, + min_read_ahead_media_time_ms: ((_l = (_k = data.playerConfig.mediaCommonConfig) == null ? void 0 : _k.dynamicReadaheadConfig) == null ? void 0 : _l.minReadAheadMediaTimeMs) || 0, + read_ahead_growth_rate_ms: ((_n = (_m = data.playerConfig.mediaCommonConfig) == null ? void 0 : _m.dynamicReadaheadConfig) == null ? void 0 : _n.readAheadGrowthRateMs) || 0 + }, + media_ustreamer_request_config: { + video_playback_ustreamer_config: (_p = (_o = data.playerConfig.mediaCommonConfig) == null ? void 0 : _o.mediaUstreamerRequestConfig) == null ? void 0 : _p.videoPlaybackUstreamerConfig + } + } + }; + } + const current_video_endpoint = data.currentVideoEndpoint ? new NavigationEndpoint(data.currentVideoEndpoint) : null; + if (current_video_endpoint) { + parsed_data.current_video_endpoint = current_video_endpoint; + } + const endpoint = data.endpoint ? new NavigationEndpoint(data.endpoint) : null; + if (endpoint) { + parsed_data.endpoint = endpoint; + } + const captions = parseItem(data.captions, PlayerCaptionsTracklist); + if (captions) { + parsed_data.captions = captions; + } + const video_details = data.videoDetails ? new VideoDetails(data.videoDetails) : null; + if (video_details) { + parsed_data.video_details = video_details; + } + const annotations = parseArray(data.annotations, PlayerAnnotationsExpanded); + if (annotations.length) { + parsed_data.annotations = annotations; + } + const storyboards = parseItem(data.storyboards, [PlayerStoryboardSpec, PlayerLiveStoryboardSpec]); + if (storyboards) { + parsed_data.storyboards = storyboards; + } + const endscreen = parseItem(data.endscreen, Endscreen); + if (endscreen) { + parsed_data.endscreen = endscreen; + } + const cards = parseItem(data.cards, CardCollection); + if (cards) { + parsed_data.cards = cards; + } + const engagement_panels = parseArray(data.engagementPanels, EngagementPanelSectionList); + if (engagement_panels.length) { + parsed_data.engagement_panels = engagement_panels; + } + if (data.bgChallenge) { + const interpreter_url = { + private_do_not_access_or_else_trusted_resource_url_wrapped_value: data.bgChallenge.interpreterUrl.privateDoNotAccessOrElseTrustedResourceUrlWrappedValue, + private_do_not_access_or_else_safe_script_wrapped_value: data.bgChallenge.interpreterUrl.privateDoNotAccessOrElseSafeScriptWrappedValue + }; + parsed_data.bg_challenge = { + interpreter_url, + interpreter_hash: data.bgChallenge.interpreterHash, + program: data.bgChallenge.program, + global_name: data.bgChallenge.globalName, + client_experiments_state_blob: data.bgChallenge.clientExperimentsStateBlob + }; + } + if (data.challenge) { + parsed_data.challenge = data.challenge; + } + if (data.playerResponse) { + parsed_data.player_response = parseResponse(data.playerResponse); + } + if (data.watchNextResponse) { + parsed_data.watch_next_response = parseResponse(data.watchNextResponse); + } + if (data.cpnInfo) { + parsed_data.cpn_info = { + cpn: data.cpnInfo.cpn, + cpn_source: data.cpnInfo.cpnSource + }; + } + if (data.entries) { + parsed_data.entries = data.entries.map((entry) => new NavigationEndpoint(entry)); + } + if (data.targetId) { + parsed_data.target_id = data.targetId; + } + return parsed_data; +} +__name(parseResponse, "parseResponse"); +function parseItem(data, validTypes) { + if (!data) + return null; + const keys = Object.keys(data); + if (!keys.length) + return null; + const classname = sanitizeClassName(keys[0]); + if (!shouldIgnore(classname)) { + try { + const has_target_class = hasParser(classname); + const TargetClass = has_target_class ? getParserByName(classname) : generateRuntimeClass(classname, data[keys[0]], ERROR_HANDLER); + if (validTypes) { + if (Array.isArray(validTypes)) { + if (!validTypes.some((type) => type.type === TargetClass.type)) { + ERROR_HANDLER({ + classdata: data[keys[0]], + classname, + error_type: "typecheck", + expected: validTypes.map((type) => type.type) + }); + return null; + } + } else if (TargetClass.type !== validTypes.type) { + ERROR_HANDLER({ + classdata: data[keys[0]], + classname, + error_type: "typecheck", + expected: validTypes.type + }); + return null; + } + } + const result = new TargetClass(data[keys[0]]); + _addToMemo(classname, result); + return result; + } catch (err) { + ERROR_HANDLER({ + classname, + classdata: data[keys[0]], + error: err, + error_type: "parse" + }); + return null; + } + } + return null; +} +__name(parseItem, "parseItem"); +function parseArray(data, validTypes) { + if (Array.isArray(data)) { + const results = []; + for (const item of data) { + const result = parseItem(item, validTypes); + if (result) { + results.push(result); + } + } + return observe(results); + } else if (!data) { + return observe([]); + } + throw new ParsingError("Expected array but got a single item"); +} +__name(parseArray, "parseArray"); +function parse(data, requireArray, validTypes) { + if (!data) + return null; + if (Array.isArray(data)) { + const results = []; + for (const item of data) { + const result = parseItem(item, validTypes); + if (result) { + results.push(result); + } + } + const res = observe(results); + return requireArray ? res : new SuperParsedResult(res); + } else if (requireArray) { + throw new ParsingError("Expected array but got a single item"); + } + return new SuperParsedResult(parseItem(data, validTypes)); +} +__name(parse, "parse"); +var command_regexp = /Command$/; +var endpoint_regexp = /Endpoint$/; +var action_regexp = /Action$/; +function parseCommand(data) { + let keys = []; + try { + keys = Object.keys(data); + } catch { + } + for (const key of keys) { + const value = data[key]; + if (command_regexp.test(key) || endpoint_regexp.test(key) || action_regexp.test(key)) { + const classname = sanitizeClassName(key); + if (shouldIgnore(classname)) + return void 0; + try { + const has_target_class = hasParser(classname); + if (has_target_class) + return new (getParserByName(classname))(value); + } catch (error2) { + ERROR_HANDLER({ + error: error2, + classname, + classdata: value, + error_type: "parse" + }); + } + } + } +} +__name(parseCommand, "parseCommand"); +function parseCommands(commands) { + if (Array.isArray(commands)) { + const results = []; + for (const item of commands) { + const result = parseCommand(item); + if (result) { + results.push(result); + } + } + return observe(results); + } else if (!commands) + return observe([]); + throw new ParsingError("Expected array but got a single item"); +} +__name(parseCommands, "parseCommands"); +function parseC(data) { + if (data.timedContinuationData) + return new Continuation({ continuation: data.timedContinuationData, type: "timed" }); + return null; +} +__name(parseC, "parseC"); +function parseLC(data) { + if (data.itemSectionContinuation) + return new ItemSectionContinuation(data.itemSectionContinuation); + if (data.sectionListContinuation) + return new SectionListContinuation(data.sectionListContinuation); + if (data.liveChatContinuation) + return new LiveChatContinuation(data.liveChatContinuation); + if (data.musicPlaylistShelfContinuation) + return new MusicPlaylistShelfContinuation(data.musicPlaylistShelfContinuation); + if (data.musicShelfContinuation) + return new MusicShelfContinuation(data.musicShelfContinuation); + if (data.gridContinuation) + return new GridContinuation(data.gridContinuation); + if (data.playlistPanelContinuation) + return new PlaylistPanelContinuation(data.playlistPanelContinuation); + if (data.continuationCommand) + return new ContinuationCommand2(data.continuationCommand); + return null; +} +__name(parseLC, "parseLC"); +function parseRR(actions) { + return observe(actions.map((action) => { + if (action.navigateAction) + return new NavigateAction(action.navigateAction); + else if (action.showMiniplayerCommand) + return new ShowMiniplayerCommand(action.showMiniplayerCommand); + else if (action.reloadContinuationItemsCommand) + return new ReloadContinuationItemsCommand(action.reloadContinuationItemsCommand); + else if (action.appendContinuationItemsAction) + return new AppendContinuationItemsAction(action.appendContinuationItemsAction); + else if (action.openPopupAction) + return new OpenPopupAction(action.openPopupAction); + }).filter((item) => item)); +} +__name(parseRR, "parseRR"); +function parseActions(data) { + if (Array.isArray(data)) { + return parse(data.map((action) => { + delete action.clickTrackingParams; + return action; + })); + } + return new SuperParsedResult(parseItem(data)); +} +__name(parseActions, "parseActions"); +function parseFormats(formats, this_response_nsig_cache) { + return (formats == null ? void 0 : formats.map((format) => new Format(format, this_response_nsig_cache))) || []; +} +__name(parseFormats, "parseFormats"); +function applyMutations(memo, mutations) { + const music_multi_select_menu_items = memo.getType(MusicMultiSelectMenuItem); + if (music_multi_select_menu_items.length > 0 && !mutations) { + ERROR_HANDLER({ + error_type: "mutation_data_missing", + classname: "MusicMultiSelectMenuItem" + }); + } else { + const missing_or_invalid_mutations = []; + for (const menu_item of music_multi_select_menu_items) { + const mutation = mutations.find((mutation2) => { + var _a, _b; + return ((_b = (_a = mutation2.payload) == null ? void 0 : _a.musicFormBooleanChoice) == null ? void 0 : _b.id) === menu_item.form_item_entity_key; + }); + const choice = mutation == null ? void 0 : mutation.payload.musicFormBooleanChoice; + if ((choice == null ? void 0 : choice.selected) !== void 0 && (choice == null ? void 0 : choice.opaqueToken)) { + menu_item.selected = choice.selected; + } else { + missing_or_invalid_mutations.push(`'${menu_item.title}'`); + } + } + if (missing_or_invalid_mutations.length > 0) { + ERROR_HANDLER({ + error_type: "mutation_data_invalid", + classname: "MusicMultiSelectMenuItem", + total: music_multi_select_menu_items.length, + failed: missing_or_invalid_mutations.length, + titles: missing_or_invalid_mutations + }); + } + } + if (mutations) { + const heat_map_mutations = mutations.filter((mutation) => { + var _a, _b; + return ((_a = mutation.payload) == null ? void 0 : _a.macroMarkersListEntity) && ((_b = mutation.payload.macroMarkersListEntity.markersList) == null ? void 0 : _b.markerType) === "MARKER_TYPE_HEATMAP"; + }); + for (const mutation of heat_map_mutations) { + const macro_markers_entity = new MacroMarkersListEntity(mutation.payload.macroMarkersListEntity); + const list = memo.get("MacroMarkersListEntity"); + if (!list) { + memo.set("MacroMarkersListEntity", [macro_markers_entity]); + } else { + list.push(macro_markers_entity); + } + } + } +} +__name(applyMutations, "applyMutations"); +function applyCommentsMutations(memo, mutations) { + var _a, _b, _c, _d, _e, _f, _g, _h; + const comment_view_items = memo.getType(CommentView); + if (comment_view_items.length > 0) { + if (!mutations) { + ERROR_HANDLER({ + error_type: "mutation_data_missing", + classname: "CommentView" + }); + } + for (const comment_view of comment_view_items) { + const comment_mutation = (_b = (_a = mutations.find((mutation) => { + var _a2, _b2; + return ((_b2 = (_a2 = mutation.payload) == null ? void 0 : _a2.commentEntityPayload) == null ? void 0 : _b2.key) === comment_view.keys.comment; + })) == null ? void 0 : _a.payload) == null ? void 0 : _b.commentEntityPayload; + const toolbar_state_mutation = (_d = (_c = mutations.find((mutation) => { + var _a2, _b2; + return ((_b2 = (_a2 = mutation.payload) == null ? void 0 : _a2.engagementToolbarStateEntityPayload) == null ? void 0 : _b2.key) === comment_view.keys.toolbar_state; + })) == null ? void 0 : _c.payload) == null ? void 0 : _d.engagementToolbarStateEntityPayload; + const engagement_toolbar = (_f = (_e = mutations.find((mutation) => mutation.entityKey === comment_view.keys.toolbar_surface)) == null ? void 0 : _e.payload) == null ? void 0 : _f.engagementToolbarSurfaceEntityPayload; + const comment_surface_mutation = (_h = (_g = mutations.find((mutation) => { + var _a2, _b2; + return ((_b2 = (_a2 = mutation.payload) == null ? void 0 : _a2.commentSurfaceEntityPayload) == null ? void 0 : _b2.key) === comment_view.keys.comment_surface; + })) == null ? void 0 : _g.payload) == null ? void 0 : _h.commentSurfaceEntityPayload; + comment_view.applyMutations(comment_mutation, toolbar_state_mutation, engagement_toolbar, comment_surface_mutation); + } + } +} +__name(applyCommentsMutations, "applyCommentsMutations"); + +// dist/src/parser/youtube/index.js +var youtube_exports = {}; +__export(youtube_exports, { + AccountInfo: () => AccountInfo, + Channel: () => Channel2, + ChannelListContinuation: () => ChannelListContinuation, + Comments: () => Comments, + FilteredChannelList: () => FilteredChannelList, + Guide: () => Guide, + HashtagFeed: () => HashtagFeed, + History: () => History, + HomeFeed: () => HomeFeed, + ItemMenu: () => ItemMenu, + Library: () => Library, + LiveChat: () => LiveChat2, + NotificationsMenu: () => NotificationsMenu, + Playlist: () => Playlist2, + Search: () => Search, + Settings: () => Settings, + SmoothedQueue: () => SmoothedQueue, + TranscriptInfo: () => TranscriptInfo, + VideoInfo: () => VideoInfo +}); + +// dist/src/parser/youtube/AccountInfo.js +var _page; +var _AccountInfo = class _AccountInfo { + constructor(response) { + __privateAdd(this, _page); + __publicField(this, "contents"); + __privateSet(this, _page, parser_exports.parseResponse(response.data)); + if (!__privateGet(this, _page).contents) + throw new InnertubeError("Page contents not found"); + const account_section_list = __privateGet(this, _page).contents.array().as(AccountSectionList)[0]; + if (!account_section_list) + throw new InnertubeError("Account section list not found"); + this.contents = account_section_list.contents[0]; + } + get page() { + return __privateGet(this, _page); + } +}; +_page = new WeakMap(); +__name(_AccountInfo, "AccountInfo"); +var AccountInfo = _AccountInfo; + +// dist/src/core/mixins/Feed.js +var _page2, _actions4, _memo, _continuation2, _Feed_instances, isParsed_fn, getBodyContinuations_fn; +var _Feed = class _Feed { + constructor(actions, response, already_parsed = false) { + __privateAdd(this, _Feed_instances); + __privateAdd(this, _page2); + __privateAdd(this, _actions4); + __privateAdd(this, _memo); + __privateAdd(this, _continuation2); + if (__privateMethod(this, _Feed_instances, isParsed_fn).call(this, response) || already_parsed) { + __privateSet(this, _page2, response); + } else { + __privateSet(this, _page2, parser_exports.parseResponse(response.data)); + } + const memo = concatMemos(...[ + __privateGet(this, _page2).contents_memo, + __privateGet(this, _page2).continuation_contents_memo, + __privateGet(this, _page2).on_response_received_commands_memo, + __privateGet(this, _page2).on_response_received_endpoints_memo, + __privateGet(this, _page2).on_response_received_actions_memo, + __privateGet(this, _page2).sidebar_memo, + __privateGet(this, _page2).header_memo + ]); + if (!memo) + throw new InnertubeError("No memo found in feed"); + __privateSet(this, _memo, memo); + __privateSet(this, _actions4, actions); + } + /** + * Get all videos on a given page via memo + */ + static getVideosFromMemo(memo) { + return memo.getType(Video, GridVideo, ReelItem, ShortsLockupView, CompactVideo, PlaylistVideo, PlaylistPanelVideo, WatchCardCompactVideo); + } + /** + * Get all playlists on a given page via memo + */ + static getPlaylistsFromMemo(memo) { + const playlists = memo.getType(Playlist, GridPlaylist); + const lockup_views = memo.getType(LockupView).filter((lockup) => { + return ["PLAYLIST", "ALBUM", "PODCAST"].includes(lockup.content_type); + }); + if (lockup_views.length > 0) { + playlists.push(...lockup_views); + } + return playlists; + } + /** + * Get all the videos in the feed + */ + get videos() { + return _Feed.getVideosFromMemo(__privateGet(this, _memo)); + } + /** + * Get all the community posts in the feed + */ + get posts() { + return __privateGet(this, _memo).getType(BackstagePost, Post, SharedPost); + } + /** + * Get all the channels in the feed + */ + get channels() { + return __privateGet(this, _memo).getType(Channel, GridChannel); + } + /** + * Get all playlists in the feed + */ + get playlists() { + return _Feed.getPlaylistsFromMemo(__privateGet(this, _memo)); + } + get memo() { + return __privateGet(this, _memo); + } + /** + * Returns contents from the page. + */ + get page_contents() { + var _a; + const tab_content = (_a = __privateGet(this, _memo).getType(Tab)) == null ? void 0 : _a[0].content; + const reload_continuation_items = __privateGet(this, _memo).getType(ReloadContinuationItemsCommand)[0]; + const append_continuation_items = __privateGet(this, _memo).getType(AppendContinuationItemsAction)[0]; + return tab_content || reload_continuation_items || append_continuation_items; + } + /** + * Returns all segments/sections from the page. + */ + get shelves() { + return __privateGet(this, _memo).getType(Shelf, RichShelf, ReelShelf); + } + /** + * Finds shelf by title. + */ + getShelf(title) { + return this.shelves.find((shelf) => shelf.title.toString() === title); + } + /** + * Returns secondary contents from the page. + */ + get secondary_contents() { + var _a, _b; + if (!((_a = __privateGet(this, _page2).contents) == null ? void 0 : _a.is_node)) + return null; + const node = (_b = __privateGet(this, _page2).contents) == null ? void 0 : _b.item(); + if (!node.is(TwoColumnBrowseResults, TwoColumnSearchResults)) + return null; + return node.secondary_contents; + } + get actions() { + return __privateGet(this, _actions4); + } + /** + * Get the original page data + */ + get page() { + return __privateGet(this, _page2); + } + /** + * Checks if the feed has continuation. + */ + get has_continuation() { + return __privateMethod(this, _Feed_instances, getBodyContinuations_fn).call(this).length > 0; + } + /** + * Retrieves continuation data as it is. + */ + async getContinuationData() { + if (__privateGet(this, _continuation2)) { + if (__privateGet(this, _continuation2).length === 0) + throw new InnertubeError("There are no continuations."); + return await __privateGet(this, _continuation2)[0].endpoint.call(__privateGet(this, _actions4), { parse: true }); + } + __privateSet(this, _continuation2, __privateMethod(this, _Feed_instances, getBodyContinuations_fn).call(this)); + if (__privateGet(this, _continuation2)) + return this.getContinuationData(); + } + /** + * Retrieves next batch of contents and returns a new {@link Feed} object. + */ + async getContinuation() { + const continuation_data = await this.getContinuationData(); + if (!continuation_data) + throw new InnertubeError("Could not get continuation data"); + return new _Feed(this.actions, continuation_data, true); + } +}; +_page2 = new WeakMap(); +_actions4 = new WeakMap(); +_memo = new WeakMap(); +_continuation2 = new WeakMap(); +_Feed_instances = new WeakSet(); +isParsed_fn = /* @__PURE__ */ __name(function(response) { + return !("data" in response); +}, "#isParsed"); +getBodyContinuations_fn = /* @__PURE__ */ __name(function() { + if (__privateGet(this, _page2).header_memo) { + const header_continuations = __privateGet(this, _page2).header_memo.getType(ContinuationItem); + return __privateGet(this, _memo).getType(ContinuationItem).filter((continuation) => !header_continuations.includes(continuation)); + } + return __privateGet(this, _memo).getType(ContinuationItem); +}, "#getBodyContinuations"); +__name(_Feed, "Feed"); +var Feed = _Feed; + +// dist/src/core/mixins/FilterableFeed.js +var _chips; +var _FilterableFeed = class _FilterableFeed extends Feed { + constructor(actions, data, already_parsed = false) { + super(actions, data, already_parsed); + __privateAdd(this, _chips); + } + /** + * Returns the filter chips. + */ + get filter_chips() { + var _a, _b; + if (__privateGet(this, _chips)) + return __privateGet(this, _chips) || []; + if (((_a = this.memo.getType(FeedFilterChipBar)) == null ? void 0 : _a.length) > 1) + throw new InnertubeError("There are too many feed filter chipbars, you'll need to find the correct one yourself in this.page"); + if (((_b = this.memo.getType(FeedFilterChipBar)) == null ? void 0 : _b.length) === 0) + throw new InnertubeError("There are no feed filter chipbars"); + __privateSet(this, _chips, this.memo.getType(ChipCloudChip)); + return __privateGet(this, _chips) || []; + } + /** + * Returns available filters. + */ + get filters() { + return this.filter_chips.map((chip) => chip.text.toString()) || []; + } + /** + * Applies given filter and returns a new {@link Feed} object. + */ + async getFilteredFeed(filter) { + var _a; + let target_filter; + if (typeof filter === "string") { + if (!this.filters.includes(filter)) + throw new InnertubeError("Filter not found", { available_filters: this.filters }); + target_filter = this.filter_chips.find((chip) => chip.text.toString() === filter); + } else if (filter.type === "ChipCloudChip") { + target_filter = filter; + } else { + throw new InnertubeError("Invalid filter"); + } + if (!target_filter) + throw new InnertubeError("Filter not found"); + if (target_filter.is_selected) + return this; + const response = await ((_a = target_filter.endpoint) == null ? void 0 : _a.call(this.actions, { parse: true })); + if (!response) + throw new InnertubeError("Failed to get filtered feed"); + return new Feed(this.actions, response, true); + } +}; +_chips = new WeakMap(); +__name(_FilterableFeed, "FilterableFeed"); +var FilterableFeed = _FilterableFeed; + +// dist/src/core/mixins/index.js +var mixins_exports = {}; +__export(mixins_exports, { + Feed: () => Feed, + FilterableFeed: () => FilterableFeed, + MediaInfo: () => MediaInfo, + TabbedFeed: () => TabbedFeed +}); + +// dist/src/core/mixins/MediaInfo.js +var _page3, _actions5, _cpn, _playback_tracking; +var _MediaInfo = class _MediaInfo { + constructor(data, actions, cpn) { + __privateAdd(this, _page3); + __privateAdd(this, _actions5); + __privateAdd(this, _cpn); + __privateAdd(this, _playback_tracking); + __publicField(this, "basic_info"); + __publicField(this, "annotations"); + __publicField(this, "storyboards"); + __publicField(this, "endscreen"); + __publicField(this, "captions"); + __publicField(this, "cards"); + __publicField(this, "streaming_data"); + __publicField(this, "playability_status"); + __publicField(this, "player_config"); + var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v; + __privateSet(this, _actions5, actions); + const info2 = parser_exports.parseResponse(data[0].data.playerResponse ? data[0].data.playerResponse : data[0].data); + const next = ((_a = data[1]) == null ? void 0 : _a.data) ? parser_exports.parseResponse(data[1].data) : void 0; + __privateSet(this, _page3, [info2, next]); + __privateSet(this, _cpn, cpn); + if (((_b = info2.playability_status) == null ? void 0 : _b.status) === "ERROR") + throw new InnertubeError("This video is unavailable", info2.playability_status); + if (info2.microformat && !((_c = info2.microformat) == null ? void 0 : _c.is(PlayerMicroformat, MicroformatData))) + throw new InnertubeError("Unsupported microformat", info2.microformat); + this.basic_info = { + ...info2.video_details, + /** + * Microformat is a bit redundant, so only + * a few things there are interesting to us. + */ + ...{ + embed: ((_d = info2.microformat) == null ? void 0 : _d.is(PlayerMicroformat)) ? (_e = info2.microformat) == null ? void 0 : _e.embed : null, + channel: ((_f = info2.microformat) == null ? void 0 : _f.is(PlayerMicroformat)) ? (_g = info2.microformat) == null ? void 0 : _g.channel : null, + is_unlisted: (_h = info2.microformat) == null ? void 0 : _h.is_unlisted, + is_family_safe: (_i = info2.microformat) == null ? void 0 : _i.is_family_safe, + category: ((_j = info2.microformat) == null ? void 0 : _j.is(PlayerMicroformat)) ? (_k = info2.microformat) == null ? void 0 : _k.category : null, + has_ypc_metadata: ((_l = info2.microformat) == null ? void 0 : _l.is(PlayerMicroformat)) ? (_m = info2.microformat) == null ? void 0 : _m.has_ypc_metadata : null, + start_timestamp: ((_n = info2.microformat) == null ? void 0 : _n.is(PlayerMicroformat)) ? info2.microformat.start_timestamp : null, + end_timestamp: ((_o = info2.microformat) == null ? void 0 : _o.is(PlayerMicroformat)) ? info2.microformat.end_timestamp : null, + view_count: ((_p = info2.microformat) == null ? void 0 : _p.is(PlayerMicroformat)) && isNaN((_q = info2.video_details) == null ? void 0 : _q.view_count) ? info2.microformat.view_count : (_r = info2.video_details) == null ? void 0 : _r.view_count, + url_canonical: ((_s = info2.microformat) == null ? void 0 : _s.is(MicroformatData)) ? (_t = info2.microformat) == null ? void 0 : _t.url_canonical : null, + tags: ((_u = info2.microformat) == null ? void 0 : _u.is(MicroformatData)) ? (_v = info2.microformat) == null ? void 0 : _v.tags : null + }, + like_count: void 0, + is_liked: void 0, + is_disliked: void 0 + }; + this.annotations = info2.annotations; + this.storyboards = info2.storyboards; + this.endscreen = info2.endscreen; + this.captions = info2.captions; + this.cards = info2.cards; + this.streaming_data = info2.streaming_data; + this.playability_status = info2.playability_status; + this.player_config = info2.player_config; + __privateSet(this, _playback_tracking, info2.playback_tracking); + } + /** + * Generates a DASH manifest from the streaming data. + * @param options + * @returns DASH manifest + */ + async toDash(options = {}) { + var _a, _b; + const player_response = __privateGet(this, _page3)[0]; + const manifest_options = options.manifest_options || {}; + if (player_response.video_details && player_response.video_details.is_live) { + throw new InnertubeError("Generating DASH manifests for live videos is not supported. Please use the DASH and HLS manifests provided by YouTube in `streaming_data.dash_manifest_url` and `streaming_data.hls_manifest_url` instead."); + } + let storyboards; + let captions; + if (manifest_options.include_thumbnails && player_response.storyboards) { + storyboards = player_response.storyboards; + } + if (typeof manifest_options.captions_format === "string" && ((_a = player_response.captions) == null ? void 0 : _a.caption_tracks)) { + captions = player_response.captions.caption_tracks; + } + return FormatUtils_exports.toDash(this.streaming_data, (_b = this.page[0].video_details) == null ? void 0 : _b.is_post_live_dvr, options.url_transformer, options.format_filter, __privateGet(this, _cpn), __privateGet(this, _actions5).session.player, __privateGet(this, _actions5), storyboards, captions, manifest_options); + } + /** + * Get a cleaned up representation of the adaptive_formats + */ + getStreamingInfo(url_transformer, format_filter) { + var _a; + return getStreamingInfo(this.streaming_data, (_a = this.page[0].video_details) == null ? void 0 : _a.is_post_live_dvr, url_transformer, format_filter, this.cpn, __privateGet(this, _actions5).session.player, __privateGet(this, _actions5), __privateGet(this, _page3)[0].storyboards ? __privateGet(this, _page3)[0].storyboards : void 0); + } + /** + * Selects the format that best matches the given options. + * @param options - Options + */ + chooseFormat(options) { + return FormatUtils_exports.chooseFormat(options, this.streaming_data); + } + /** + * Downloads the video. + * @param options - Download options. + */ + async download(options = {}) { + const player_response = __privateGet(this, _page3)[0]; + if (player_response.video_details && (player_response.video_details.is_live || player_response.video_details.is_post_live_dvr)) { + throw new InnertubeError("Downloading is not supported for live and Post-Live-DVR videos, as they are split up into 5 second segments that are individual files, which require using a tool such as ffmpeg to stitch them together, so they cannot be returned in a single stream."); + } + return FormatUtils_exports.download(options, __privateGet(this, _actions5), this.playability_status, this.streaming_data, __privateGet(this, _actions5).session.player, this.cpn); + } + /** + * Retrieves the video's transcript. + */ + async getTranscript() { + var _a; + const next_response = this.page[1]; + if (!next_response) + throw new InnertubeError("Cannot get transcript from basic video info."); + if (!next_response.engagement_panels) + throw new InnertubeError("Engagement panels not found. Video likely has no transcript."); + const transcript_panel = next_response.engagement_panels.find((panel) => { + return panel.panel_identifier === "engagement-panel-searchable-transcript"; + }); + if (!transcript_panel) + throw new InnertubeError("Transcript panel not found. Video likely has no transcript."); + const transcript_continuation = (_a = transcript_panel.content) == null ? void 0 : _a.as(ContinuationItem); + if (!transcript_continuation) + throw new InnertubeError("Transcript continuation not found."); + const response = await transcript_continuation.endpoint.call(this.actions); + return new TranscriptInfo(this.actions, response); + } + async addToWatchHistory(client_name, client_version, replacement = "https://www.") { + if (!__privateGet(this, _playback_tracking)) + throw new InnertubeError("Playback tracking not available"); + const url_params = { + cpn: __privateGet(this, _cpn), + fmt: 251, + rtn: 0, + rt: 0 + }; + const url = __privateGet(this, _playback_tracking).videostats_playback_url.replace("https://s.", replacement); + return await __privateGet(this, _actions5).stats(url, { + client_name: client_name || Constants_exports.CLIENTS.WEB.NAME, + client_version: client_version || Constants_exports.CLIENTS.WEB.VERSION + }, url_params); + } + async updateWatchTime(startTime, client_name = Constants_exports.CLIENTS.WEB.NAME, client_version = Constants_exports.CLIENTS.WEB.VERSION, replacement = "https://www.") { + if (!__privateGet(this, _playback_tracking)) + throw new InnertubeError("Playback tracking not available"); + const url_params = { + cpn: __privateGet(this, _cpn), + st: startTime.toFixed(3), + et: startTime.toFixed(3), + cmt: startTime.toFixed(3), + final: "1" + }; + const url = __privateGet(this, _playback_tracking).videostats_watchtime_url.replace("https://s.", replacement); + return await __privateGet(this, _actions5).stats(url, { + client_name, + client_version + }, url_params); + } + get actions() { + return __privateGet(this, _actions5); + } + /** + * Content Playback Nonce. + */ + get cpn() { + return __privateGet(this, _cpn); + } + /** + * Parsed InnerTube response. + */ + get page() { + return __privateGet(this, _page3); + } +}; +_page3 = new WeakMap(); +_actions5 = new WeakMap(); +_cpn = new WeakMap(); +_playback_tracking = new WeakMap(); +__name(_MediaInfo, "MediaInfo"); +var MediaInfo = _MediaInfo; + +// dist/src/core/mixins/TabbedFeed.js +var _actions6, _tabs; +var _TabbedFeed = class _TabbedFeed extends Feed { + constructor(actions, data, already_parsed = false) { + var _a; + super(actions, data, already_parsed); + __privateAdd(this, _actions6); + __privateAdd(this, _tabs); + __privateSet(this, _actions6, actions); + __privateSet(this, _tabs, (_a = this.page.contents_memo) == null ? void 0 : _a.getType(Tab)); + } + get tabs() { + var _a, _b; + return (_b = (_a = __privateGet(this, _tabs)) == null ? void 0 : _a.map((tab) => tab.title.toString())) != null ? _b : []; + } + async getTabByName(title) { + var _a; + const tab = (_a = __privateGet(this, _tabs)) == null ? void 0 : _a.find((tab2) => tab2.title.toLowerCase() === title.toLowerCase()); + if (!tab) + throw new InnertubeError(`Tab "${title}" not found`); + if (tab.selected) + return this; + const response = await tab.endpoint.call(__privateGet(this, _actions6)); + return new _TabbedFeed(__privateGet(this, _actions6), response, false); + } + async getTabByURL(url) { + var _a; + const tab = (_a = __privateGet(this, _tabs)) == null ? void 0 : _a.find((tab2) => { + var _a2; + return ((_a2 = tab2.endpoint.metadata.url) == null ? void 0 : _a2.split("/").pop()) === url; + }); + if (!tab) + throw new InnertubeError(`Tab "${url}" not found`); + if (tab.selected) + return this; + const response = await tab.endpoint.call(__privateGet(this, _actions6)); + return new _TabbedFeed(__privateGet(this, _actions6), response, false); + } + hasTabWithURL(url) { + var _a, _b; + return (_b = (_a = __privateGet(this, _tabs)) == null ? void 0 : _a.some((tab) => { + var _a2; + return ((_a2 = tab.endpoint.metadata.url) == null ? void 0 : _a2.split("/").pop()) === url; + })) != null ? _b : false; + } + get title() { + var _a, _b, _c; + return (_c = (_b = (_a = this.page.contents_memo) == null ? void 0 : _a.getType(Tab)) == null ? void 0 : _b.find((tab) => tab.selected)) == null ? void 0 : _c.title.toString(); + } +}; +_actions6 = new WeakMap(); +_tabs = new WeakMap(); +__name(_TabbedFeed, "TabbedFeed"); +var TabbedFeed = _TabbedFeed; + +// dist/src/parser/youtube/Channel.js +var _Channel2 = class _Channel2 extends TabbedFeed { + constructor(actions, data, already_parsed = false) { + var _a, _b, _c, _d, _e; + super(actions, data, already_parsed); + __publicField(this, "header"); + __publicField(this, "metadata"); + __publicField(this, "subscribe_button"); + __publicField(this, "current_tab"); + this.header = (_b = (_a = this.page.header) == null ? void 0 : _a.item()) == null ? void 0 : _b.as(C4TabbedHeader, CarouselHeader, InteractiveTabbedHeader, PageHeader); + const metadata = (_c = this.page.metadata) == null ? void 0 : _c.item().as(ChannelMetadata); + const microformat = (_d = this.page.microformat) == null ? void 0 : _d.as(MicroformatData); + if (this.page.alerts) { + const alert = this.page.alerts[0]; + if ((alert == null ? void 0 : alert.alert_type) === "ERROR") { + throw new ChannelError(alert.text.toString()); + } + } + if (!metadata && !this.page.contents) + throw new InnertubeError("Invalid channel", this); + this.metadata = { ...metadata, ...microformat || {} }; + this.subscribe_button = (_e = this.page.header_memo) == null ? void 0 : _e.getType(SubscribeButton)[0]; + if (this.page.contents) + this.current_tab = this.page.contents.item().as(TwoColumnBrowseResults).tabs.find((tab) => tab.selected); + } + /** + * Applies given filter to the list. Use {@link filters} to get available filters. + * @param filter - The filter to apply + */ + async applyFilter(filter) { + let target_filter; + const filter_chipbar = this.memo.getType(FeedFilterChipBar)[0]; + if (typeof filter === "string") { + target_filter = filter_chipbar == null ? void 0 : filter_chipbar.contents.find((chip) => chip.text === filter); + if (!target_filter) + throw new InnertubeError(`Filter ${filter} not found`, { available_filters: this.filters }); + } else { + target_filter = filter; + } + if (!target_filter.endpoint) + throw new InnertubeError("Invalid filter", filter); + const page = await target_filter.endpoint.call(this.actions, { parse: true }); + if (!page) + throw new InnertubeError("No page returned", { filter: target_filter }); + return new FilteredChannelList(this.actions, page, true); + } + /** + * Applies given sort filter to the list. Use {@link sort_filters} to get available filters. + * @param sort - The sort filter to apply + */ + async applySort(sort) { + const sort_filter_sub_menu = this.memo.getType(SortFilterSubMenu)[0]; + if (!sort_filter_sub_menu || !sort_filter_sub_menu.sub_menu_items) + throw new InnertubeError("No sort filter sub menu found"); + const target_sort = sort_filter_sub_menu.sub_menu_items.find((item) => item.title === sort); + if (!target_sort) + throw new InnertubeError(`Sort filter ${sort} not found`, { available_sort_filters: this.sort_filters }); + if (target_sort.selected) + return this; + const page = await target_sort.endpoint.call(this.actions, { parse: true }); + return new _Channel2(this.actions, page, true); + } + /** + * Applies given content type filter to the list. Use {@link content_type_filters} to get available filters. + * @param content_type_filter - The content type filter to apply + */ + async applyContentTypeFilter(content_type_filter) { + var _a, _b, _c; + const sub_menu = (_c = (_b = (_a = this.current_tab) == null ? void 0 : _a.content) == null ? void 0 : _b.as(SectionList).sub_menu) == null ? void 0 : _c.as(ChannelSubMenu); + if (!sub_menu) + throw new InnertubeError("Sub menu not found"); + const item = sub_menu.content_type_sub_menu_items.find((item2) => item2.title === content_type_filter); + if (!item) + throw new InnertubeError(`Sub menu item ${content_type_filter} not found`, { available_filters: this.content_type_filters }); + if (item.selected) + return this; + const page = await item.endpoint.call(this.actions, { parse: true }); + return new _Channel2(this.actions, page, true); + } + get filters() { + var _a, _b; + return ((_b = (_a = this.memo.getType(FeedFilterChipBar)) == null ? void 0 : _a[0]) == null ? void 0 : _b.contents.filterType(ChipCloudChip).map((chip) => chip.text)) || []; + } + get sort_filters() { + var _a; + const sort_filter_sub_menu = this.memo.getType(SortFilterSubMenu)[0]; + return ((_a = sort_filter_sub_menu == null ? void 0 : sort_filter_sub_menu.sub_menu_items) == null ? void 0 : _a.map((item) => item.title)) || []; + } + get content_type_filters() { + var _a, _b, _c; + const sub_menu = (_c = (_b = (_a = this.current_tab) == null ? void 0 : _a.content) == null ? void 0 : _b.as(SectionList).sub_menu) == null ? void 0 : _c.as(ChannelSubMenu); + return (sub_menu == null ? void 0 : sub_menu.content_type_sub_menu_items.map((item) => item.title)) || []; + } + async getHome() { + const tab = await this.getTabByURL("featured"); + return new _Channel2(this.actions, tab.page, true); + } + async getVideos() { + const tab = await this.getTabByURL("videos"); + return new _Channel2(this.actions, tab.page, true); + } + async getShorts() { + const tab = await this.getTabByURL("shorts"); + return new _Channel2(this.actions, tab.page, true); + } + async getLiveStreams() { + const tab = await this.getTabByURL("streams"); + return new _Channel2(this.actions, tab.page, true); + } + async getReleases() { + const tab = await this.getTabByURL("releases"); + return new _Channel2(this.actions, tab.page, true); + } + async getPodcasts() { + const tab = await this.getTabByURL("podcasts"); + return new _Channel2(this.actions, tab.page, true); + } + async getCourses() { + const tab = await this.getTabByURL("courses"); + return new _Channel2(this.actions, tab.page, true); + } + async getPlaylists() { + const tab = await this.getTabByURL("playlists"); + return new _Channel2(this.actions, tab.page, true); + } + async getCommunity() { + const tab = await this.getTabByURL("posts"); + return new _Channel2(this.actions, tab.page, true); + } + /** + * Retrieves the about page. + * Note that this does not return a new {@link Channel} object. + */ + async getAbout() { + var _a, _b, _c, _d, _e; + if (this.hasTabWithURL("about")) { + const tab = await this.getTabByURL("about"); + return tab.memo.getType(ChannelAboutFullMetadata)[0]; + } + const tagline = ((_a = this.header) == null ? void 0 : _a.is(C4TabbedHeader)) && this.header.tagline; + if (tagline || ((_b = this.header) == null ? void 0 : _b.is(PageHeader)) && ((_c = this.header.content) == null ? void 0 : _c.description)) { + if (tagline && tagline.more_endpoint instanceof NavigationEndpoint) { + const response2 = await tagline.more_endpoint.call(this.actions); + const tab = new TabbedFeed(this.actions, response2, false); + return tab.memo.getType(ChannelAboutFullMetadata)[0]; + } + const endpoint = (_e = (_d = this.page.header_memo) == null ? void 0 : _d.getType(ContinuationItem)[0]) == null ? void 0 : _e.endpoint; + if (!endpoint) { + throw new InnertubeError("Failed to extract continuation to get channel about"); + } + const response = await endpoint.call(this.actions, { parse: true }); + if (!response.on_response_received_endpoints_memo) { + throw new InnertubeError("Unexpected response while fetching channel about", { response }); + } + return response.on_response_received_endpoints_memo.getType(AboutChannel)[0]; + } + throw new InnertubeError("About not found"); + } + /** + * Searches within the channel. + */ + async search(query) { + var _a; + const tab = (_a = this.memo.getType(ExpandableTab)) == null ? void 0 : _a[0]; + if (!tab) + throw new InnertubeError("Search tab not found", this); + const page = await tab.endpoint.call(this.actions, { query, parse: true }); + return new _Channel2(this.actions, page, true); + } + get has_home() { + return this.hasTabWithURL("featured"); + } + get has_videos() { + return this.hasTabWithURL("videos"); + } + get has_shorts() { + return this.hasTabWithURL("shorts"); + } + get has_live_streams() { + return this.hasTabWithURL("streams"); + } + get has_releases() { + return this.hasTabWithURL("releases"); + } + get has_podcasts() { + return this.hasTabWithURL("podcasts"); + } + get has_courses() { + return this.hasTabWithURL("courses"); + } + get has_playlists() { + return this.hasTabWithURL("playlists"); + } + get has_community() { + return this.hasTabWithURL("posts"); + } + get has_about() { + var _a, _b, _c, _d, _e; + return this.hasTabWithURL("about") || !!(((_a = this.header) == null ? void 0 : _a.is(C4TabbedHeader)) && ((_b = this.header.tagline) == null ? void 0 : _b.more_endpoint)) || !!(((_c = this.header) == null ? void 0 : _c.is(PageHeader)) && ((_e = (_d = this.header.content) == null ? void 0 : _d.description) == null ? void 0 : _e.more_endpoint)); + } + get has_search() { + var _a; + return ((_a = this.memo.getType(ExpandableTab)) == null ? void 0 : _a.length) > 0; + } + async getContinuation() { + const page = await super.getContinuationData(); + if (!page) + throw new InnertubeError("Could not get continuation data"); + return new ChannelListContinuation(this.actions, page, true); + } +}; +__name(_Channel2, "Channel"); +var Channel2 = _Channel2; +var _ChannelListContinuation = class _ChannelListContinuation extends Feed { + constructor(actions, data, already_parsed = false) { + var _a, _b; + super(actions, data, already_parsed); + __publicField(this, "contents"); + this.contents = ((_a = this.page.on_response_received_actions) == null ? void 0 : _a[0]) || ((_b = this.page.on_response_received_endpoints) == null ? void 0 : _b[0]); + } + async getContinuation() { + const page = await super.getContinuationData(); + if (!page) + throw new InnertubeError("Could not get continuation data"); + return new _ChannelListContinuation(this.actions, page, true); + } +}; +__name(_ChannelListContinuation, "ChannelListContinuation"); +var ChannelListContinuation = _ChannelListContinuation; +var _FilteredChannelList = class _FilteredChannelList extends FilterableFeed { + constructor(actions, data, already_parsed = false) { + var _a; + super(actions, data, already_parsed); + __publicField(this, "applied_filter"); + __publicField(this, "contents"); + this.applied_filter = this.memo.getType(ChipCloudChip).find((chip) => chip.is_selected); + if (this.page.on_response_received_actions && this.page.on_response_received_actions.length > 1) { + this.page.on_response_received_actions.shift(); + } + this.contents = (_a = this.page.on_response_received_actions) == null ? void 0 : _a[0]; + } + /** + * Applies given filter to the list. + * @param filter - The filter to apply + */ + async applyFilter(filter) { + const feed = await super.getFilteredFeed(filter); + return new _FilteredChannelList(this.actions, feed.page, true); + } + async getContinuation() { + const page = await super.getContinuationData(); + if (!(page == null ? void 0 : page.on_response_received_actions_memo)) + throw new InnertubeError("Unexpected continuation data", page); + page.on_response_received_actions_memo.set("FeedFilterChipBar", this.memo.getType(FeedFilterChipBar)); + page.on_response_received_actions_memo.set("ChipCloudChip", this.memo.getType(ChipCloudChip)); + return new _FilteredChannelList(this.actions, page, true); + } +}; +__name(_FilteredChannelList, "FilteredChannelList"); +var FilteredChannelList = _FilteredChannelList; + +// dist/src/parser/youtube/Comments.js +var _page4, _actions7, _continuation3; +var _Comments = class _Comments { + constructor(actions, data, already_parsed = false) { + __privateAdd(this, _page4); + __privateAdd(this, _actions7); + __privateAdd(this, _continuation3); + __publicField(this, "header"); + __publicField(this, "contents"); + var _a, _b, _c, _d, _e; + __privateSet(this, _page4, already_parsed ? data : parser_exports.parseResponse(data)); + __privateSet(this, _actions7, actions); + const contents = __privateGet(this, _page4).on_response_received_endpoints; + if (!contents) + throw new InnertubeError("Comments page did not have any content."); + const header_node = (_a = contents.at(0)) == null ? void 0 : _a.as(AppendContinuationItemsAction, ReloadContinuationItemsCommand); + const body_node = (_b = contents.at(1)) == null ? void 0 : _b.as(AppendContinuationItemsAction, ReloadContinuationItemsCommand); + this.header = (_c = header_node == null ? void 0 : header_node.contents) == null ? void 0 : _c.firstOfType(CommentsHeader); + const threads = ((_d = body_node == null ? void 0 : body_node.contents) == null ? void 0 : _d.filterType(CommentThread)) || []; + this.contents = observe(threads.map((thread) => { + if (thread.comment) + thread.comment.setActions(__privateGet(this, _actions7)); + thread.setActions(__privateGet(this, _actions7)); + return thread; + })); + __privateSet(this, _continuation3, (_e = body_node == null ? void 0 : body_node.contents) == null ? void 0 : _e.firstOfType(ContinuationItem)); + } + /** + * Applies given sort option to the comments. + * @param sort - Sort type. + */ + async applySort(sort) { + var _a, _b, _c, _d; + if (!this.header) + throw new InnertubeError("Page header is missing. Cannot apply sort option."); + let button; + if (sort === "TOP_COMMENTS") { + button = (_b = (_a = this.header.sort_menu) == null ? void 0 : _a.sub_menu_items) == null ? void 0 : _b.at(0); + } else if (sort === "NEWEST_FIRST") { + button = (_d = (_c = this.header.sort_menu) == null ? void 0 : _c.sub_menu_items) == null ? void 0 : _d.at(1); + } + if (!button) + throw new InnertubeError("Could not find target button."); + if (button.selected) + return this; + const response = await button.endpoint.call(__privateGet(this, _actions7), { parse: true }); + return new _Comments(__privateGet(this, _actions7), response, true); + } + /** + * Creates a top-level comment. + * @param text - Comment text. + */ + async createComment(text) { + var _a; + if (!this.header) + throw new InnertubeError("Page header is missing. Cannot create comment."); + const button = (_a = this.header.create_renderer) == null ? void 0 : _a.as(CommentSimplebox).submit_button; + if (!button) + throw new InnertubeError("Could not find target button. You are probably not logged in."); + if (!button.endpoint) + throw new InnertubeError("Button does not have an endpoint."); + return await button.endpoint.call(__privateGet(this, _actions7), { commentText: text }); + } + /** + * Retrieves next batch of comments. + */ + async getContinuation() { + if (!__privateGet(this, _continuation3)) + throw new InnertubeError("Continuation not found"); + const data = await __privateGet(this, _continuation3).endpoint.call(__privateGet(this, _actions7), { parse: true }); + const page = Object.assign({}, __privateGet(this, _page4)); + if (!page.on_response_received_endpoints || !data.on_response_received_endpoints) + throw new InnertubeError("Invalid reponse format, missing on_response_received_endpoints."); + page.on_response_received_endpoints.pop(); + page.on_response_received_endpoints.push(data.on_response_received_endpoints[0]); + return new _Comments(__privateGet(this, _actions7), page, true); + } + get has_continuation() { + return !!__privateGet(this, _continuation3); + } + get page() { + return __privateGet(this, _page4); + } +}; +_page4 = new WeakMap(); +_actions7 = new WeakMap(); +_continuation3 = new WeakMap(); +__name(_Comments, "Comments"); +var Comments = _Comments; + +// dist/src/parser/youtube/Guide.js +var _page5; +var _Guide = class _Guide { + constructor(data) { + __privateAdd(this, _page5); + __publicField(this, "contents"); + __privateSet(this, _page5, parser_exports.parseResponse(data)); + if (__privateGet(this, _page5).items) + this.contents = __privateGet(this, _page5).items.array().as(GuideSection, GuideSubscriptionsSection); + } + get page() { + return __privateGet(this, _page5); + } +}; +_page5 = new WeakMap(); +__name(_Guide, "Guide"); +var Guide = _Guide; + +// dist/src/parser/youtube/History.js +var _History = class _History extends Feed { + constructor(actions, data, already_parsed = false) { + super(actions, data, already_parsed); + __publicField(this, "sections"); + __publicField(this, "feed_actions"); + this.sections = this.memo.getType(ItemSection); + this.feed_actions = this.memo.getType(BrowseFeedActions)[0]; + } + /** + * Retrieves next batch of contents. + */ + async getContinuation() { + const response = await this.getContinuationData(); + if (!response) + throw new Error("No continuation data found"); + return new _History(this.actions, response, true); + } + /** + * Removes a video from watch history. + */ + async removeVideo(video_id, pages_to_load = 1) { + var _a, _b, _c; + let pagesToLoad = pages_to_load; + while (pagesToLoad > 0) { + let feedbackToken; + for (const section of this.sections) { + for (const content of section.contents) { + if (content.is(Video)) { + if (content.video_id === video_id && content.menu) { + feedbackToken = content.menu.top_level_buttons[0].as(Button).endpoint.payload.feedbackToken; + break; + } + } else if (content.is(LockupView)) { + if (content.content_id === video_id) { + const listItems = (_c = (_b = (_a = content.metadata) == null ? void 0 : _a.menu_button) == null ? void 0 : _b.on_tap) == null ? void 0 : _c.payload.panelLoadingStrategy.inlineContent.sheetViewModel.content.listViewModel.listItems; + const listItem = listItems.find((video) => { + var _a2; + return ((_a2 = video.listItemViewModel) == null ? void 0 : _a2.title.content) === "Remove from watch history"; + }); + feedbackToken = listItem.listItemViewModel.rendererContext.commandContext.onTap.innertubeCommand.feedbackEndpoint.feedbackToken; + break; + } + } + } + if (feedbackToken) { + break; + } + } + if (feedbackToken) { + const body = { feedbackTokens: [feedbackToken] }; + const response = await this.actions.execute("/feedback", body); + const data = response.data; + if (!data.feedbackResponses[0].isProcessed) { + throw new Error("Failed to remove video from watch history"); + } + return true; + } + if (--pagesToLoad > 0) { + try { + Object.assign(this, await this.getContinuation()); + } catch { + throw new Error("Unable to find video in watch history"); + } + } else { + throw new Error("Unable to find video in watch history"); + } + } + return false; + } +}; +__name(_History, "History"); +var History = _History; + +// dist/src/parser/youtube/HomeFeed.js +var _HomeFeed = class _HomeFeed extends FilterableFeed { + constructor(actions, data, already_parsed = false) { + var _a; + super(actions, data, already_parsed); + __publicField(this, "contents"); + __publicField(this, "header"); + this.header = this.memo.getType(FeedTabbedHeader)[0]; + this.contents = this.memo.getType(RichGrid)[0] || ((_a = this.page.on_response_received_actions) == null ? void 0 : _a[0]); + } + /** + * Applies given filter to the feed. Use {@link filters} to get available filters. + * @param filter - Filter to apply. + */ + async applyFilter(filter) { + const feed = await super.getFilteredFeed(filter); + return new _HomeFeed(this.actions, feed.page, true); + } + /** + * Retrieves next batch of contents. + */ + async getContinuation() { + var _a; + const feed = await super.getContinuation(); + feed.page.header = this.page.header; + if (this.header) + (_a = feed.page.header_memo) == null ? void 0 : _a.set(this.header.type, [this.header]); + return new _HomeFeed(this.actions, feed.page, true); + } +}; +__name(_HomeFeed, "HomeFeed"); +var HomeFeed = _HomeFeed; + +// dist/src/parser/youtube/HashtagFeed.js +var _HashtagFeed = class _HashtagFeed extends FilterableFeed { + constructor(actions, response) { + super(actions, response); + __publicField(this, "header"); + __publicField(this, "contents"); + if (!this.page.contents_memo) + throw new InnertubeError("Unexpected response", this.page); + const tab = this.page.contents_memo.getType(Tab)[0]; + if (!tab.content) + throw new InnertubeError("Content tab has no content", tab); + if (this.page.header) { + this.header = this.page.header.item().as(HashtagHeader, PageHeader); + } + this.contents = tab.content.as(RichGrid); + } + /** + * Applies given filter and returns a new {@link HashtagFeed} object. Use {@link HashtagFeed.filters} to get available filters. + * @param filter - Filter to apply. + */ + async applyFilter(filter) { + const response = await super.getFilteredFeed(filter); + return new _HashtagFeed(this.actions, response.page); + } +}; +__name(_HashtagFeed, "HashtagFeed"); +var HashtagFeed = _HashtagFeed; + +// dist/src/parser/youtube/ItemMenu.js +var _page6, _actions8, _items; +var _ItemMenu = class _ItemMenu { + constructor(data, actions) { + __privateAdd(this, _page6); + __privateAdd(this, _actions8); + __privateAdd(this, _items); + __privateSet(this, _page6, data); + __privateSet(this, _actions8, actions); + const menu = data == null ? void 0 : data.live_chat_item_context_menu_supported_renderers; + if (!menu || !menu.is(Menu)) + throw new InnertubeError('Response did not have a "live_chat_item_context_menu_supported_renderers" property. The call may have failed.'); + __privateSet(this, _items, menu.as(Menu).items); + } + async selectItem(item) { + let endpoint; + if (item instanceof Button) { + if (!item.endpoint) + throw new InnertubeError("Item does not have an endpoint."); + endpoint = item.endpoint; + } else { + const button = __privateGet(this, _items).find((button2) => { + if (!button2.is(MenuServiceItem)) { + return false; + } + const menuServiceItem = button2.as(MenuServiceItem); + return menuServiceItem.icon_type === item; + }); + if (!button || !button.is(MenuServiceItem)) + throw new InnertubeError(`Button "${item}" not found.`); + endpoint = button.endpoint; + } + if (!endpoint) + throw new InnertubeError("Target button does not have an endpoint."); + return await endpoint.call(__privateGet(this, _actions8), { parse: true }); + } + items() { + return __privateGet(this, _items); + } + page() { + return __privateGet(this, _page6); + } +}; +_page6 = new WeakMap(); +_actions8 = new WeakMap(); +_items = new WeakMap(); +__name(_ItemMenu, "ItemMenu"); +var ItemMenu = _ItemMenu; + +// dist/src/parser/youtube/Playlist.js +var _Playlist_instances, getStat_fn; +var _Playlist2 = class _Playlist2 extends Feed { + constructor(actions, data, already_parsed = false) { + var _a, _b, _c, _d, _e; + super(actions, data, already_parsed); + __privateAdd(this, _Playlist_instances); + __publicField(this, "info"); + __publicField(this, "menu"); + __publicField(this, "endpoint"); + __publicField(this, "messages"); + const header = this.memo.getType(PlaylistHeader)[0]; + const primary_info = this.memo.getType(PlaylistSidebarPrimaryInfo)[0]; + const secondary_info = this.memo.getType(PlaylistSidebarSecondaryInfo)[0]; + const video_list = this.memo.getType(PlaylistVideoList)[0]; + const alert = (_a = this.page.alerts) == null ? void 0 : _a.firstOfType(Alert); + if (alert && alert.alert_type === "ERROR") + throw new InnertubeError(alert.text.toString(), alert); + if (!primary_info && !secondary_info && Object.keys(this.page).length === 0) + throw new InnertubeError("Got empty continuation response. This is likely the end of the playlist."); + this.info = { + ...(_b = this.page.metadata) == null ? void 0 : _b.item().as(PlaylistMetadata), + ...{ + subtitle: header ? header.subtitle : null, + author: (_d = (_c = secondary_info == null ? void 0 : secondary_info.owner) == null ? void 0 : _c.as(VideoOwner).author) != null ? _d : header == null ? void 0 : header.author, + thumbnails: (_e = primary_info == null ? void 0 : primary_info.thumbnail_renderer) == null ? void 0 : _e.as(PlaylistVideoThumbnail, PlaylistCustomThumbnail).thumbnail, + total_items: __privateMethod(this, _Playlist_instances, getStat_fn).call(this, 0, primary_info), + views: __privateMethod(this, _Playlist_instances, getStat_fn).call(this, 1, primary_info), + last_updated: __privateMethod(this, _Playlist_instances, getStat_fn).call(this, 2, primary_info), + can_share: header == null ? void 0 : header.can_share, + can_delete: header == null ? void 0 : header.can_delete, + can_reorder: video_list == null ? void 0 : video_list.can_reorder, + is_editable: video_list == null ? void 0 : video_list.is_editable, + privacy: header == null ? void 0 : header.privacy + } + }; + this.menu = primary_info == null ? void 0 : primary_info.menu; + this.endpoint = primary_info == null ? void 0 : primary_info.endpoint; + this.messages = this.memo.getType(Message); + } + get items() { + return observe(this.videos.as(PlaylistVideo, ReelItem, ShortsLockupView).filter((video) => video.style !== "PLAYLIST_VIDEO_RENDERER_STYLE_RECOMMENDED_VIDEO")); + } + get has_continuation() { + const section_list = this.memo.getType(SectionList)[0]; + if (!section_list) + return super.has_continuation; + return !!this.memo.getType(ContinuationItem).find((node) => !section_list.contents.includes(node)); + } + async getContinuationData() { + const section_list = this.memo.getType(SectionList)[0]; + if (!section_list) + return await super.getContinuationData(); + const playlist_contents_continuation = this.memo.getType(ContinuationItem).find((node) => !section_list.contents.includes(node)); + if (!playlist_contents_continuation) + throw new InnertubeError("There are no continuations."); + return await playlist_contents_continuation.endpoint.call(this.actions, { parse: true }); + } + async getContinuation() { + const page = await this.getContinuationData(); + if (!page) + throw new InnertubeError("Could not get continuation data"); + return new _Playlist2(this.actions, page, true); + } +}; +_Playlist_instances = new WeakSet(); +getStat_fn = /* @__PURE__ */ __name(function(index, primary_info) { + var _a; + if (!primary_info || !primary_info.stats) + return "N/A"; + return ((_a = primary_info.stats[index]) == null ? void 0 : _a.toString()) || "N/A"; +}, "#getStat"); +__name(_Playlist2, "Playlist"); +var Playlist2 = _Playlist2; + +// dist/src/parser/youtube/Library.js +var _Library_instances, getAll_fn; +var _Library = class _Library extends Feed { + constructor(actions, data) { + super(actions, data); + __privateAdd(this, _Library_instances); + __publicField(this, "header"); + __publicField(this, "sections"); + if (!this.page.contents_memo) + throw new InnertubeError("Page contents not found"); + this.header = this.memo.getType(PageHeader)[0]; + const shelves = this.page.contents_memo.getType(Shelf); + this.sections = shelves.map((shelf) => { + var _a; + return { + type: shelf.icon_type, + title: shelf.title, + contents: ((_a = shelf.content) == null ? void 0 : _a.key("items").array()) || [], + getAll: /* @__PURE__ */ __name(() => __privateMethod(this, _Library_instances, getAll_fn).call(this, shelf), "getAll") + }; + }); + } + get history() { + return this.sections.find((section) => section.type === "WATCH_HISTORY"); + } + get watch_later() { + return this.sections.find((section) => section.type === "WATCH_LATER"); + } + get liked_videos() { + return this.sections.find((section) => section.type === "LIKE"); + } + get playlists_section() { + return this.sections.find((section) => section.type === "PLAYLISTS"); + } + get clips() { + return this.sections.find((section) => section.type === "CONTENT_CUT"); + } +}; +_Library_instances = new WeakSet(); +getAll_fn = /* @__PURE__ */ __name(async function(shelf) { + var _a; + if (!((_a = shelf.menu) == null ? void 0 : _a.as(Menu).top_level_buttons)) + throw new InnertubeError(`The ${shelf.title.text} shelf doesn't have more items`); + const button = shelf.menu.as(Menu).top_level_buttons.firstOfType(Button); + if (!button) + throw new InnertubeError("Did not find target button."); + const page = await button.as(Button).endpoint.call(this.actions, { parse: true }); + switch (shelf.icon_type) { + case "LIKE": + case "WATCH_LATER": + return new Playlist2(this.actions, page, true); + case "WATCH_HISTORY": + return new History(this.actions, page, true); + case "CONTENT_CUT": + return new Feed(this.actions, page, true); + default: + throw new InnertubeError("Target shelf not implemented."); + } +}, "#getAll"); +__name(_Library, "Library"); +var Library = _Library; + +// dist/src/parser/youtube/SmoothedQueue.js +function flattenQueue(queue) { + const nodes = []; + for (const group of queue) { + if (Array.isArray(group)) { + for (const node of group) { + nodes.push(node); + } + } else { + nodes.push(group); + } + } + return nodes; +} +__name(flattenQueue, "flattenQueue"); +var _DelayQueue = class _DelayQueue { + constructor() { + __publicField(this, "front"); + __publicField(this, "back"); + this.front = []; + this.back = []; + } + isEmpty() { + return !this.front.length && !this.back.length; + } + clear() { + this.front = []; + this.back = []; + } + getValues() { + return this.front.concat(this.back.reverse()); + } +}; +__name(_DelayQueue, "DelayQueue"); +var DelayQueue = _DelayQueue; +var _last_update_time, _estimated_update_interval, _callback, _action_queue, _next_update_id, _poll_response_delay_queue; +var _SmoothedQueue = class _SmoothedQueue { + constructor() { + __privateAdd(this, _last_update_time); + __privateAdd(this, _estimated_update_interval); + __privateAdd(this, _callback); + __privateAdd(this, _action_queue); + __privateAdd(this, _next_update_id); + __privateAdd(this, _poll_response_delay_queue); + __privateSet(this, _last_update_time, null); + __privateSet(this, _estimated_update_interval, null); + __privateSet(this, _callback, null); + __privateSet(this, _action_queue, []); + __privateSet(this, _next_update_id, null); + __privateSet(this, _poll_response_delay_queue, new DelayQueue()); + } + enqueueActionGroup(group) { + if (__privateGet(this, _last_update_time) !== null) { + const delay = Date.now() - __privateGet(this, _last_update_time); + __privateGet(this, _poll_response_delay_queue).back.push(delay); + if (5 < __privateGet(this, _poll_response_delay_queue).front.length + __privateGet(this, _poll_response_delay_queue).back.length) { + if (!__privateGet(this, _poll_response_delay_queue).front.length) { + __privateGet(this, _poll_response_delay_queue).front = __privateGet(this, _poll_response_delay_queue).back; + __privateGet(this, _poll_response_delay_queue).front.reverse(); + __privateGet(this, _poll_response_delay_queue).back = []; + } + __privateGet(this, _poll_response_delay_queue).front.pop(); + } + __privateSet(this, _estimated_update_interval, Math.max(...__privateGet(this, _poll_response_delay_queue).getValues())); + } + __privateSet(this, _last_update_time, Date.now()); + __privateGet(this, _action_queue).push(group); + if (__privateGet(this, _next_update_id) === null) { + __privateSet(this, _next_update_id, setTimeout(this.emitSmoothedActions.bind(this))); + } + } + emitSmoothedActions() { + __privateSet(this, _next_update_id, null); + if (__privateGet(this, _action_queue).length) { + let delay = 1e4; + if (__privateGet(this, _estimated_update_interval) !== null && __privateGet(this, _last_update_time) !== null) { + delay = __privateGet(this, _estimated_update_interval) - Date.now() + __privateGet(this, _last_update_time); + } + delay = __privateGet(this, _action_queue).length < delay / 80 ? 1 : Math.ceil(__privateGet(this, _action_queue).length / (delay / 80)); + const actions = flattenQueue(__privateGet(this, _action_queue).splice(0, delay)); + if (__privateGet(this, _callback)) { + __privateGet(this, _callback).call(this, actions); + } + if (__privateGet(this, _action_queue) !== null) { + if (delay == 1) { + delay = __privateGet(this, _estimated_update_interval) / __privateGet(this, _action_queue).length; + delay *= Math.random() + 0.5; + delay = Math.min(1e3, delay); + delay = Math.max(80, delay); + } else { + delay = 80; + } + __privateSet(this, _next_update_id, setTimeout(this.emitSmoothedActions.bind(this), delay)); + } + } + } + clear() { + if (__privateGet(this, _next_update_id) !== null) { + clearTimeout(__privateGet(this, _next_update_id)); + __privateSet(this, _next_update_id, null); + } + __privateSet(this, _action_queue, []); + } + set callback(cb) { + __privateSet(this, _callback, cb); + } + get callback() { + return __privateGet(this, _callback); + } + get action_queue() { + return __privateGet(this, _action_queue); + } + get estimated_update_interval() { + return __privateGet(this, _estimated_update_interval); + } + get last_update_time() { + return __privateGet(this, _last_update_time); + } + get next_update_id() { + return __privateGet(this, _next_update_id); + } + get poll_response_delay_queue() { + return __privateGet(this, _poll_response_delay_queue); + } +}; +_last_update_time = new WeakMap(); +_estimated_update_interval = new WeakMap(); +_callback = new WeakMap(); +_action_queue = new WeakMap(); +_next_update_id = new WeakMap(); +_poll_response_delay_queue = new WeakMap(); +__name(_SmoothedQueue, "SmoothedQueue"); +var SmoothedQueue = _SmoothedQueue; + +// dist/src/parser/youtube/LiveChat.js +var _actions9, _video_id, _channel_id, _continuation4, _mcontinuation, _retry_count, _LiveChat_instances, pollLivechat_fn, emitSmoothedActions_fn, pollMetadata_fn, wait_fn; +var _LiveChat2 = class _LiveChat2 extends EventEmitterLike { + constructor(video_info) { + var _a, _b; + super(); + __privateAdd(this, _LiveChat_instances); + __privateAdd(this, _actions9); + __privateAdd(this, _video_id); + __privateAdd(this, _channel_id); + __privateAdd(this, _continuation4); + __privateAdd(this, _mcontinuation); + __privateAdd(this, _retry_count, 0); + __publicField(this, "smoothed_queue"); + __publicField(this, "initial_info"); + __publicField(this, "metadata"); + __publicField(this, "running", false); + __publicField(this, "is_replay", false); + __privateSet(this, _video_id, video_info.basic_info.id); + __privateSet(this, _channel_id, video_info.basic_info.channel_id); + __privateSet(this, _actions9, video_info.actions); + __privateSet(this, _continuation4, (_a = video_info.livechat) == null ? void 0 : _a.continuation); + this.is_replay = ((_b = video_info.livechat) == null ? void 0 : _b.is_replay) || false; + this.smoothed_queue = new SmoothedQueue(); + this.smoothed_queue.callback = async (actions) => { + if (!actions.length) { + await __privateMethod(this, _LiveChat_instances, wait_fn).call(this, 2e3); + } else if (actions.length < 10) { + await __privateMethod(this, _LiveChat_instances, emitSmoothedActions_fn).call(this, actions); + } else if (this.is_replay) { + __privateMethod(this, _LiveChat_instances, emitSmoothedActions_fn).call(this, actions); + await __privateMethod(this, _LiveChat_instances, wait_fn).call(this, 2e3); + } else { + __privateMethod(this, _LiveChat_instances, emitSmoothedActions_fn).call(this, actions); + } + if (this.running) { + __privateMethod(this, _LiveChat_instances, pollLivechat_fn).call(this); + } + }; + } + on(type, listener) { + super.on(type, listener); + } + once(type, listener) { + super.once(type, listener); + } + start() { + if (!this.running) { + this.running = true; + __privateMethod(this, _LiveChat_instances, pollLivechat_fn).call(this); + __privateMethod(this, _LiveChat_instances, pollMetadata_fn).call(this); + } + } + stop() { + this.smoothed_queue.clear(); + this.running = false; + } + /** + * Sends a message. + * @param text - Text to send. + */ + async sendMessage(text) { + const writer = LiveMessageParams.encode({ + params: { + ids: { + videoId: __privateGet(this, _video_id), + channelId: __privateGet(this, _channel_id) + } + }, + number0: 1, + number1: 4 + }); + const params = btoa(encodeURIComponent(u8ToBase64(writer.finish()))); + const response = await __privateGet(this, _actions9).execute("/live_chat/send_message", { + richMessage: { textSegments: [{ text }] }, + clientMessageId: Platform.shim.uuidv4(), + client: "WEB", + parse: true, + params + }); + if (!response.actions) + throw new InnertubeError("Unexpected response from send_message", response); + return response.actions.array().as(AddChatItemAction, RunAttestationCommand); + } + /** + * Applies given filter to the live chat. + * @param filter - Filter to apply. + */ + applyFilter(filter) { + var _a, _b, _c, _d, _e, _f, _g; + if (!this.initial_info) + throw new InnertubeError("Cannot apply filter before initial info is retrieved."); + const menu_items = (_c = (_b = (_a = this.initial_info) == null ? void 0 : _a.header) == null ? void 0 : _b.view_selector) == null ? void 0 : _c.sub_menu_items; + if (filter === "TOP_CHAT") { + if ((_d = menu_items == null ? void 0 : menu_items.at(0)) == null ? void 0 : _d.selected) + return; + __privateSet(this, _continuation4, (_e = menu_items == null ? void 0 : menu_items.at(0)) == null ? void 0 : _e.continuation); + } else { + if ((_f = menu_items == null ? void 0 : menu_items.at(1)) == null ? void 0 : _f.selected) + return; + __privateSet(this, _continuation4, (_g = menu_items == null ? void 0 : menu_items.at(1)) == null ? void 0 : _g.continuation); + } + } + /** + * Retrieves given chat item's menu. + */ + async getItemMenu(item) { + if (!item.hasKey("menu_endpoint") || !item.key("menu_endpoint").isInstanceof(NavigationEndpoint)) + throw new InnertubeError("This item does not have a menu.", item); + const response = await item.key("menu_endpoint").instanceof(NavigationEndpoint).call(__privateGet(this, _actions9), { parse: true }); + if (!response) + throw new InnertubeError("Could not retrieve item menu.", item); + return new ItemMenu(response, __privateGet(this, _actions9)); + } + /** + * Equivalent to "clicking" a button. + */ + async selectButton(button) { + return await button.endpoint.call(__privateGet(this, _actions9), { parse: true }); + } +}; +_actions9 = new WeakMap(); +_video_id = new WeakMap(); +_channel_id = new WeakMap(); +_continuation4 = new WeakMap(); +_mcontinuation = new WeakMap(); +_retry_count = new WeakMap(); +_LiveChat_instances = new WeakSet(); +pollLivechat_fn = /* @__PURE__ */ __name(function() { + (async () => { + try { + const response = await __privateGet(this, _actions9).execute(this.is_replay ? "live_chat/get_live_chat_replay" : "live_chat/get_live_chat", { continuation: __privateGet(this, _continuation4), parse: true }); + const contents = response.continuation_contents; + if (!contents) { + this.emit("error", new InnertubeError("Unexpected live chat incremental continuation response", response)); + this.emit("end"); + this.stop(); + } + if (!(contents instanceof LiveChatContinuation)) { + this.stop(); + this.emit("end"); + return; + } + __privateSet(this, _continuation4, contents.continuation.token); + if (contents.header) { + this.initial_info = contents; + this.emit("start", contents); + if (this.running) + __privateMethod(this, _LiveChat_instances, pollLivechat_fn).call(this); + } else { + this.smoothed_queue.enqueueActionGroup(contents.actions); + } + __privateSet(this, _retry_count, 0); + } catch (err) { + this.emit("error", err); + if (__privateWrapper(this, _retry_count)._++ < 10) { + await __privateMethod(this, _LiveChat_instances, wait_fn).call(this, 2e3); + __privateMethod(this, _LiveChat_instances, pollLivechat_fn).call(this); + } else { + this.emit("error", new InnertubeError("Reached retry limit for incremental continuation requests", err)); + this.emit("end"); + this.stop(); + } + } + })(); +}, "#pollLivechat"); +emitSmoothedActions_fn = /* @__PURE__ */ __name(async function(action_queue) { + const base = 1e4; + let delay = action_queue.length < base / 80 ? 1 : Math.ceil(action_queue.length / (base / 80)); + const emit_delay_ms = delay == 1 ? (delay = base / action_queue.length, delay *= Math.random() + 0.5, delay = Math.min(1e3, delay), delay = Math.max(80, delay)) : delay = 80; + for (const action of action_queue) { + await __privateMethod(this, _LiveChat_instances, wait_fn).call(this, emit_delay_ms); + this.emit("chat-update", action); + } +}, "#emitSmoothedActions"); +pollMetadata_fn = /* @__PURE__ */ __name(function() { + (async () => { + var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k; + try { + const payload = { videoId: __privateGet(this, _video_id) }; + if (__privateGet(this, _mcontinuation)) { + payload.continuation = __privateGet(this, _mcontinuation); + } + const response = await __privateGet(this, _actions9).execute("/updated_metadata", payload); + const data = parser_exports.parseResponse(response.data); + __privateSet(this, _mcontinuation, (_a = data.continuation) == null ? void 0 : _a.token); + this.metadata = { + title: ((_b = data.actions) == null ? void 0 : _b.array().firstOfType(UpdateTitleAction)) || ((_c = this.metadata) == null ? void 0 : _c.title), + description: ((_d = data.actions) == null ? void 0 : _d.array().firstOfType(UpdateDescriptionAction)) || ((_e = this.metadata) == null ? void 0 : _e.description), + views: ((_f = data.actions) == null ? void 0 : _f.array().firstOfType(UpdateViewershipAction)) || ((_g = this.metadata) == null ? void 0 : _g.views), + likes: ((_h = data.actions) == null ? void 0 : _h.array().firstOfType(UpdateToggleButtonTextAction)) || ((_i = this.metadata) == null ? void 0 : _i.likes), + date: ((_j = data.actions) == null ? void 0 : _j.array().firstOfType(UpdateDateTextAction)) || ((_k = this.metadata) == null ? void 0 : _k.date) + }; + this.emit("metadata-update", this.metadata); + await __privateMethod(this, _LiveChat_instances, wait_fn).call(this, 5e3); + if (this.running) + __privateMethod(this, _LiveChat_instances, pollMetadata_fn).call(this); + } catch { + await __privateMethod(this, _LiveChat_instances, wait_fn).call(this, 2e3); + if (this.running) + __privateMethod(this, _LiveChat_instances, pollMetadata_fn).call(this); + } + })(); +}, "#pollMetadata"); +wait_fn = /* @__PURE__ */ __name(async function(ms) { + return new Promise((resolve) => setTimeout(() => resolve(), ms)); +}, "#wait"); +__name(_LiveChat2, "LiveChat"); +var LiveChat2 = _LiveChat2; + +// dist/src/parser/youtube/NotificationsMenu.js +var _page7, _actions10; +var _NotificationsMenu = class _NotificationsMenu { + constructor(actions, response) { + __privateAdd(this, _page7); + __privateAdd(this, _actions10); + __publicField(this, "header"); + __publicField(this, "contents"); + __privateSet(this, _actions10, actions); + __privateSet(this, _page7, parser_exports.parseResponse(response.data)); + if (!__privateGet(this, _page7).actions_memo) + throw new InnertubeError("Page actions not found"); + this.header = __privateGet(this, _page7).actions_memo.getType(SimpleMenuHeader)[0]; + this.contents = __privateGet(this, _page7).actions_memo.getType(Notification); + } + async getContinuation() { + var _a; + const continuation = (_a = __privateGet(this, _page7).actions_memo) == null ? void 0 : _a.getType(ContinuationItem)[0]; + if (!continuation) + throw new InnertubeError("Continuation not found"); + const response = await continuation.endpoint.call(__privateGet(this, _actions10), { parse: false }); + return new _NotificationsMenu(__privateGet(this, _actions10), response); + } + get page() { + return __privateGet(this, _page7); + } +}; +_page7 = new WeakMap(); +_actions10 = new WeakMap(); +__name(_NotificationsMenu, "NotificationsMenu"); +var NotificationsMenu = _NotificationsMenu; + +// dist/src/parser/youtube/Search.js +var _Search = class _Search extends Feed { + constructor(actions, data, already_parsed = false) { + var _a, _b, _c; + super(actions, data, already_parsed); + __publicField(this, "header"); + __publicField(this, "results"); + __publicField(this, "refinements"); + __publicField(this, "estimated_results"); + __publicField(this, "sub_menu"); + __publicField(this, "watch_card"); + __publicField(this, "refinement_cards"); + const contents = ((_a = this.page.contents_memo) == null ? void 0 : _a.getType(SectionList)[0].contents) || ((_b = this.page.on_response_received_commands) == null ? void 0 : _b[0].as(AppendContinuationItemsAction, ReloadContinuationItemsCommand).contents); + if (!contents) + throw new InnertubeError("No contents found in search response"); + if (this.page.header) + this.header = this.page.header.item().as(SearchHeader); + this.results = observe(contents.filterType(ItemSection).flatMap((section) => section.contents)); + this.refinements = this.page.refinements || []; + this.estimated_results = this.page.estimated_results || 0; + if (this.page.contents_memo) { + this.sub_menu = this.page.contents_memo.getType(SearchSubMenu)[0]; + this.watch_card = this.page.contents_memo.getType(UniversalWatchCard)[0]; + } + this.refinement_cards = (_c = this.results) == null ? void 0 : _c.firstOfType(HorizontalCardList); + } + /** + * Applies given refinement card and returns a new {@link Search} object. Use {@link refinement_card_queries} to get a list of available refinement cards. + */ + async selectRefinementCard(card) { + var _a; + let target_card; + if (typeof card === "string") { + if (!this.refinement_cards) + throw new InnertubeError("No refinement cards found."); + target_card = (_a = this.refinement_cards) == null ? void 0 : _a.cards.find((refinement_card) => { + return refinement_card.is(SearchRefinementCard) && refinement_card.query === card; + }); + if (!target_card) + throw new InnertubeError(`Refinement card "${card}" not found`, { available_cards: this.refinement_card_queries }); + } else if (card.type === "SearchRefinementCard") { + target_card = card; + } else { + throw new InnertubeError("Invalid refinement card!"); + } + const page = await target_card.endpoint.call(this.actions, { parse: true }); + return new _Search(this.actions, page, true); + } + /** + * Returns a list of refinement card queries. + */ + get refinement_card_queries() { + var _a; + return ((_a = this.refinement_cards) == null ? void 0 : _a.cards.as(SearchRefinementCard).map((card) => card.query)) || []; + } + /** + * Retrieves next batch of search results. + */ + async getContinuation() { + const response = await this.getContinuationData(); + if (!response) + throw new InnertubeError("Could not get continuation data"); + return new _Search(this.actions, response, true); + } +}; +__name(_Search, "Search"); +var Search = _Search; + +// dist/src/parser/youtube/Settings.js +var _page8, _actions11; +var _Settings = class _Settings { + constructor(actions, response) { + __privateAdd(this, _page8); + __privateAdd(this, _actions11); + __publicField(this, "sidebar"); + __publicField(this, "introduction"); + __publicField(this, "sections"); + var _a, _b, _c, _d; + __privateSet(this, _actions11, actions); + __privateSet(this, _page8, parser_exports.parseResponse(response.data)); + this.sidebar = (_a = __privateGet(this, _page8).sidebar) == null ? void 0 : _a.as(SettingsSidebar); + if (!__privateGet(this, _page8).contents) + throw new InnertubeError("Page contents not found"); + const tab = __privateGet(this, _page8).contents.item().as(TwoColumnBrowseResults).tabs.find((tab2) => tab2.selected); + if (!tab) + throw new InnertubeError("Target tab not found"); + const contents = (_b = tab.content) == null ? void 0 : _b.as(SectionList).contents.as(ItemSection); + this.introduction = (_d = (_c = contents == null ? void 0 : contents.shift()) == null ? void 0 : _c.contents) == null ? void 0 : _d.firstOfType(PageIntroduction); + this.sections = contents == null ? void 0 : contents.map((el) => { + var _a2; + return { + title: ((_a2 = el.header) == null ? void 0 : _a2.is(CommentsHeader, ItemSectionHeader, ItemSectionTabbedHeader)) ? el.header.title.toString() : null, + contents: el.contents + }; + }); + } + /** + * Selects an item from the sidebar menu. Use {@link sidebar_items} to see available items. + */ + async selectSidebarItem(target_item) { + if (!this.sidebar) + throw new InnertubeError("Sidebar not available"); + let item; + if (typeof target_item === "string") { + item = this.sidebar.items.find((link) => link.title === target_item); + if (!item) + throw new InnertubeError(`Item "${target_item}" not found`, { available_items: this.sidebar_items }); + } else if (target_item == null ? void 0 : target_item.is(CompactLink)) { + item = target_item; + } else { + throw new InnertubeError("Invalid item", { target_item }); + } + const response = await item.endpoint.call(__privateGet(this, _actions11), { parse: false }); + return new _Settings(__privateGet(this, _actions11), response); + } + /** + * Finds a setting by name and returns it. Use {@link setting_options} to see available options. + */ + getSettingOption(name) { + var _a; + if (!this.sections) + throw new InnertubeError("Sections not available"); + for (const section of this.sections) { + if (!section.contents) + continue; + for (const el of section.contents) { + const options = el.as(SettingsOptions).options; + if (options) { + for (const option of options) { + if (option.is(SettingsSwitch) && ((_a = option.title) == null ? void 0 : _a.toString()) === name) + return option; + } + } + } + } + throw new InnertubeError(`Option "${name}" not found`, { available_options: this.setting_options }); + } + /** + * Returns settings available in the page. + */ + get setting_options() { + if (!this.sections) + throw new InnertubeError("Sections not available"); + let options = []; + for (const section of this.sections) { + if (!section.contents) + continue; + for (const el of section.contents) { + if (el.as(SettingsOptions).options) + options = options.concat(el.as(SettingsOptions).options); + } + } + return options.map((opt) => { + var _a; + return (_a = opt.title) == null ? void 0 : _a.toString(); + }).filter((el) => el); + } + /** + * Returns options available in the sidebar. + */ + get sidebar_items() { + if (!this.sidebar) + throw new InnertubeError("Sidebar not available"); + return this.sidebar.items.map((item) => item.title.toString()); + } + get page() { + return __privateGet(this, _page8); + } +}; +_page8 = new WeakMap(); +_actions11 = new WeakMap(); +__name(_Settings, "Settings"); +var Settings = _Settings; + +// dist/src/parser/youtube/VideoInfo.js +var _watch_next_continuation; +var _VideoInfo = class _VideoInfo extends MediaInfo { + constructor(data, actions, cpn) { + var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D; + super(data, actions, cpn); + __publicField(this, "primary_info"); + __publicField(this, "secondary_info"); + __publicField(this, "playlist"); + __publicField(this, "game_info"); + __publicField(this, "merchandise"); + __publicField(this, "related_chip_cloud"); + __publicField(this, "watch_next_feed"); + __publicField(this, "player_overlays"); + __publicField(this, "comments_entry_point_header"); + __publicField(this, "livechat"); + __publicField(this, "autoplay"); + __publicField(this, "heat_map"); + __privateAdd(this, _watch_next_continuation); + const [info2, next] = this.page; + if (this.streaming_data) { + const default_audio_track = this.streaming_data.adaptive_formats.find((format) => { + var _a2; + return (_a2 = format.audio_track) == null ? void 0 : _a2.audio_is_default; + }); + if (default_audio_track) { + this.streaming_data.formats.forEach((format) => format.language = default_audio_track.language); + } else if (((_a = this.captions) == null ? void 0 : _a.caption_tracks) && ((_b = this.captions) == null ? void 0 : _b.caption_tracks.length) > 0) { + const auto_generated_caption_track = this.captions.caption_tracks.find((caption) => caption.kind === "asr"); + const language_code = auto_generated_caption_track == null ? void 0 : auto_generated_caption_track.language_code; + this.streaming_data.adaptive_formats.forEach((format) => { + if (format.has_audio) { + format.language = language_code; + } + }); + this.streaming_data.formats.forEach((format) => format.language = language_code); + } + } + const two_col = (_c = next == null ? void 0 : next.contents) == null ? void 0 : _c.item().as(TwoColumnWatchNextResults); + const results = two_col == null ? void 0 : two_col.results; + const secondary_results = two_col == null ? void 0 : two_col.secondary_results; + if (results && secondary_results) { + if (((_d = info2.microformat) == null ? void 0 : _d.is(PlayerMicroformat)) && ((_e = info2.microformat) == null ? void 0 : _e.category) === "Gaming") { + const row = (_h = (_g = (_f = results.firstOfType(VideoSecondaryInfo)) == null ? void 0 : _f.metadata) == null ? void 0 : _g.rows) == null ? void 0 : _h.firstOfType(RichMetadataRow); + if (row == null ? void 0 : row.is(RichMetadataRow)) { + this.game_info = { + title: (_j = (_i = row == null ? void 0 : row.contents) == null ? void 0 : _i.firstOfType(RichMetadata)) == null ? void 0 : _j.title, + release_year: (_l = (_k = row == null ? void 0 : row.contents) == null ? void 0 : _k.firstOfType(RichMetadata)) == null ? void 0 : _l.subtitle + }; + } + } + this.primary_info = results.firstOfType(VideoPrimaryInfo); + this.secondary_info = results.firstOfType(VideoSecondaryInfo); + this.merchandise = results.firstOfType(MerchandiseShelf); + this.related_chip_cloud = (_m = secondary_results.firstOfType(RelatedChipCloud)) == null ? void 0 : _m.content.as(ChipCloud); + if (two_col == null ? void 0 : two_col.playlist) { + this.playlist = two_col.playlist; + } + this.watch_next_feed = ((_n = secondary_results.firstOfType(ItemSection)) == null ? void 0 : _n.contents) || secondary_results; + if (this.watch_next_feed && Array.isArray(this.watch_next_feed) && ((_o = this.watch_next_feed.at(-1)) == null ? void 0 : _o.is(ContinuationItem))) + __privateSet(this, _watch_next_continuation, (_p = this.watch_next_feed.pop()) == null ? void 0 : _p.as(ContinuationItem)); + this.player_overlays = (_q = next == null ? void 0 : next.player_overlays) == null ? void 0 : _q.item().as(PlayerOverlay); + if (two_col == null ? void 0 : two_col.autoplay) { + this.autoplay = two_col.autoplay; + } + const segmented_like_dislike_button = (_s = (_r = this.primary_info) == null ? void 0 : _r.menu) == null ? void 0 : _s.top_level_buttons.firstOfType(SegmentedLikeDislikeButton); + if (((_t = segmented_like_dislike_button == null ? void 0 : segmented_like_dislike_button.like_button) == null ? void 0 : _t.is(ToggleButton)) && ((_u = segmented_like_dislike_button == null ? void 0 : segmented_like_dislike_button.dislike_button) == null ? void 0 : _u.is(ToggleButton))) { + this.basic_info.like_count = (_v = segmented_like_dislike_button == null ? void 0 : segmented_like_dislike_button.like_button) == null ? void 0 : _v.like_count; + this.basic_info.is_liked = (_w = segmented_like_dislike_button == null ? void 0 : segmented_like_dislike_button.like_button) == null ? void 0 : _w.is_toggled; + this.basic_info.is_disliked = (_x = segmented_like_dislike_button == null ? void 0 : segmented_like_dislike_button.dislike_button) == null ? void 0 : _x.is_toggled; + } + const segmented_like_dislike_button_view = (_z = (_y = this.primary_info) == null ? void 0 : _y.menu) == null ? void 0 : _z.top_level_buttons.firstOfType(SegmentedLikeDislikeButtonView); + if (segmented_like_dislike_button_view) { + this.basic_info.like_count = segmented_like_dislike_button_view.like_count; + if (segmented_like_dislike_button_view.like_button) { + const like_status = segmented_like_dislike_button_view.like_button.like_status_entity.like_status; + this.basic_info.is_liked = like_status === "LIKE"; + this.basic_info.is_disliked = like_status === "DISLIKE"; + } + } + const comments_entry_point = results.find((node) => { + return node.is(ItemSection) && node.target_id === "comments-entry-point"; + }); + this.comments_entry_point_header = (_A = comments_entry_point == null ? void 0 : comments_entry_point.contents) == null ? void 0 : _A.firstOfType(CommentsEntryPointHeader); + this.livechat = (_B = next == null ? void 0 : next.contents_memo) == null ? void 0 : _B.getType(LiveChat)[0]; + const macro_markers_list_for_heatmap = (_D = (_C = this.page[1]) == null ? void 0 : _C.contents_memo) == null ? void 0 : _D.getType(MacroMarkersListEntity); + let calculated_heat_map = null; + if (macro_markers_list_for_heatmap) { + const heatmap_markers_entity = macro_markers_list_for_heatmap.find((markers) => markers.isHeatmap()); + if (heatmap_markers_entity) { + try { + calculated_heat_map = heatmap_markers_entity.toHeatmap(); + } catch { + } + } + } + this.heat_map = calculated_heat_map; + } + } + /** + * Applies given filter to the watch next feed. Use {@link filters} to get available filters. + * @param target_filter - Filter to apply. + */ + async selectFilter(target_filter) { + var _a, _b, _c, _d; + if (!this.related_chip_cloud) + throw new InnertubeError("Chip cloud not found, cannot apply filter"); + let cloud_chip; + if (typeof target_filter === "string") { + const filter = (_b = (_a = this.related_chip_cloud) == null ? void 0 : _a.chips) == null ? void 0 : _b.find((chip) => chip.text === target_filter); + if (!filter) + throw new InnertubeError("Invalid filter", { available_filters: this.filters }); + cloud_chip = filter; + } else if (target_filter == null ? void 0 : target_filter.is(ChipCloudChip)) { + cloud_chip = target_filter; + } else { + throw new InnertubeError("Invalid cloud chip", target_filter); + } + if (cloud_chip.is_selected) + return this; + const response = await ((_c = cloud_chip.endpoint) == null ? void 0 : _c.call(this.actions, { parse: true })); + const data = (_d = response == null ? void 0 : response.on_response_received_endpoints) == null ? void 0 : _d.find((endpoint) => { + return endpoint.is(ReloadContinuationItemsCommand) && endpoint.target_id === "watch-next-feed"; + }); + this.watch_next_feed = data == null ? void 0 : data.contents; + return this; + } + /** + * Adds video to the watch history. + */ + async addToWatchHistory() { + return super.addToWatchHistory(); + } + /** + * Updates watch time for the video. + */ + async updateWatchTime(startTime) { + return super.updateWatchTime(startTime); + } + /** + * Retrieves watch next feed continuation. + */ + async getWatchNextContinuation() { + var _a, _b, _c, _d, _e; + if (!__privateGet(this, _watch_next_continuation)) + throw new InnertubeError("Watch next feed continuation not found"); + const response = await ((_a = __privateGet(this, _watch_next_continuation)) == null ? void 0 : _a.endpoint.call(this.actions, { parse: true })); + const data = (_b = response == null ? void 0 : response.on_response_received_endpoints) == null ? void 0 : _b.firstOfType(AppendContinuationItemsAction); + if (!data) + throw new InnertubeError("AppendContinuationItemsAction not found"); + this.watch_next_feed = data == null ? void 0 : data.contents; + if ((_d = (_c = this.watch_next_feed) == null ? void 0 : _c.at(-1)) == null ? void 0 : _d.is(ContinuationItem)) { + __privateSet(this, _watch_next_continuation, (_e = this.watch_next_feed.pop()) == null ? void 0 : _e.as(ContinuationItem)); + } else { + __privateSet(this, _watch_next_continuation, void 0); + } + return this; + } + /** + * Likes the video. + */ + async like() { + var _a, _b, _c, _d, _e; + const segmented_like_dislike_button_view = (_b = (_a = this.primary_info) == null ? void 0 : _a.menu) == null ? void 0 : _b.top_level_buttons.firstOfType(SegmentedLikeDislikeButtonView); + if (segmented_like_dislike_button_view) { + const button2 = (_c = segmented_like_dislike_button_view == null ? void 0 : segmented_like_dislike_button_view.like_button) == null ? void 0 : _c.toggle_button; + if (!button2 || !button2.default_button || !segmented_like_dislike_button_view.like_button) + throw new InnertubeError("Like button not found", { video_id: this.basic_info.id }); + const like_status = segmented_like_dislike_button_view.like_button.like_status_entity.like_status; + if (like_status === "LIKE") + throw new InnertubeError("This video is already liked", { video_id: this.basic_info.id }); + if (!button2.default_button.on_tap) + throw new InnertubeError("onTap command not found", { video_id: this.basic_info.id }); + const endpoint = new NavigationEndpoint(button2.default_button.on_tap.payload.commands.find((cmd) => cmd.innertubeCommand)); + return await endpoint.call(this.actions); + } + const segmented_like_dislike_button = (_e = (_d = this.primary_info) == null ? void 0 : _d.menu) == null ? void 0 : _e.top_level_buttons.firstOfType(SegmentedLikeDislikeButton); + const button = segmented_like_dislike_button == null ? void 0 : segmented_like_dislike_button.like_button; + if (!button) + throw new InnertubeError("Like button not found", { video_id: this.basic_info.id }); + if (!button.is(ToggleButton)) + throw new InnertubeError("Like button is not a toggle button. This action is likely disabled for this video.", { video_id: this.basic_info.id }); + if (button.is_toggled) + throw new InnertubeError("This video is already liked", { video_id: this.basic_info.id }); + return await button.endpoint.call(this.actions); + } + /** + * Dislikes the video. + */ + async dislike() { + var _a, _b, _c, _d, _e; + const segmented_like_dislike_button_view = (_b = (_a = this.primary_info) == null ? void 0 : _a.menu) == null ? void 0 : _b.top_level_buttons.firstOfType(SegmentedLikeDislikeButtonView); + if (segmented_like_dislike_button_view) { + const button2 = (_c = segmented_like_dislike_button_view == null ? void 0 : segmented_like_dislike_button_view.dislike_button) == null ? void 0 : _c.toggle_button; + if (!button2 || !button2.default_button || !segmented_like_dislike_button_view.dislike_button || !segmented_like_dislike_button_view.like_button) + throw new InnertubeError("Dislike button not found", { video_id: this.basic_info.id }); + const like_status = segmented_like_dislike_button_view.like_button.like_status_entity.like_status; + if (like_status === "DISLIKE") + throw new InnertubeError("This video is already disliked", { video_id: this.basic_info.id }); + if (!button2.default_button.on_tap) + throw new InnertubeError("onTap command not found", { video_id: this.basic_info.id }); + const endpoint = new NavigationEndpoint(button2.default_button.on_tap.payload.commands.find((cmd) => cmd.innertubeCommand)); + return await endpoint.call(this.actions); + } + const segmented_like_dislike_button = (_e = (_d = this.primary_info) == null ? void 0 : _d.menu) == null ? void 0 : _e.top_level_buttons.firstOfType(SegmentedLikeDislikeButton); + const button = segmented_like_dislike_button == null ? void 0 : segmented_like_dislike_button.dislike_button; + if (!button) + throw new InnertubeError("Dislike button not found", { video_id: this.basic_info.id }); + if (!button.is(ToggleButton)) + throw new InnertubeError("Dislike button is not a toggle button. This action is likely disabled for this video.", { video_id: this.basic_info.id }); + if (button.is_toggled) + throw new InnertubeError("This video is already disliked", { video_id: this.basic_info.id }); + return await button.endpoint.call(this.actions); + } + /** + * Removes like/dislike. + */ + async removeRating() { + var _a, _b, _c, _d, _e, _f, _g; + let button; + const segmented_like_dislike_button_view = (_b = (_a = this.primary_info) == null ? void 0 : _a.menu) == null ? void 0 : _b.top_level_buttons.firstOfType(SegmentedLikeDislikeButtonView); + if (segmented_like_dislike_button_view) { + const toggle_button = (_c = segmented_like_dislike_button_view == null ? void 0 : segmented_like_dislike_button_view.like_button) == null ? void 0 : _c.toggle_button; + if (!toggle_button || !toggle_button.default_button || !segmented_like_dislike_button_view.like_button) + throw new InnertubeError("Like button not found", { video_id: this.basic_info.id }); + const like_status = segmented_like_dislike_button_view.like_button.like_status_entity.like_status; + if (like_status === "LIKE") { + button = (_d = segmented_like_dislike_button_view == null ? void 0 : segmented_like_dislike_button_view.like_button) == null ? void 0 : _d.toggle_button; + } else if (like_status === "DISLIKE") { + button = (_e = segmented_like_dislike_button_view == null ? void 0 : segmented_like_dislike_button_view.dislike_button) == null ? void 0 : _e.toggle_button; + } else { + throw new InnertubeError("This video is not liked/disliked", { video_id: this.basic_info.id }); + } + if (!button || !button.toggled_button) + throw new InnertubeError("Like/Dislike button not found", { video_id: this.basic_info.id }); + if (!button.toggled_button.on_tap) + throw new InnertubeError("onTap command not found", { video_id: this.basic_info.id }); + const endpoint = new NavigationEndpoint(button.toggled_button.on_tap.payload.commands.find((cmd) => cmd.innertubeCommand)); + return await endpoint.call(this.actions); + } + const segmented_like_dislike_button = (_g = (_f = this.primary_info) == null ? void 0 : _f.menu) == null ? void 0 : _g.top_level_buttons.firstOfType(SegmentedLikeDislikeButton); + const like_button = segmented_like_dislike_button == null ? void 0 : segmented_like_dislike_button.like_button; + const dislike_button = segmented_like_dislike_button == null ? void 0 : segmented_like_dislike_button.dislike_button; + if (!(like_button == null ? void 0 : like_button.is(ToggleButton)) || !(dislike_button == null ? void 0 : dislike_button.is(ToggleButton))) + throw new InnertubeError("Like/Dislike button is not a toggle button. This action is likely disabled for this video.", { video_id: this.basic_info.id }); + if (like_button == null ? void 0 : like_button.is_toggled) { + button = like_button; + } else if (dislike_button == null ? void 0 : dislike_button.is_toggled) { + button = dislike_button; + } + if (!button) + throw new InnertubeError("This video is not liked/disliked", { video_id: this.basic_info.id }); + return await button.toggled_endpoint.call(this.actions); + } + /** + * Retrieves Live Chat if available. + */ + getLiveChat() { + if (!this.livechat) + throw new InnertubeError("Live Chat is not available", { video_id: this.basic_info.id }); + return new LiveChat2(this); + } + /** + * Retrieves trailer info if available (typically for non-purchased movies or films). + * @returns `VideoInfo` for the trailer, or `null` if none. + */ + getTrailerInfo() { + var _a, _b; + if (this.has_trailer && ((_a = this.playability_status) == null ? void 0 : _a.error_screen)) { + let player_response; + if (this.playability_status.error_screen.is(PlayerLegacyDesktopYpcTrailer)) { + player_response = (_b = this.playability_status.error_screen.trailer) == null ? void 0 : _b.player_response; + } else if (this.playability_status.error_screen.is(YpcTrailer)) { + player_response = this.playability_status.error_screen.player_response; + } + if (player_response) { + return new _VideoInfo([{ data: player_response }], this.actions, this.cpn); + } + } + return null; + } + /** + * Watch next feed filters. + */ + get filters() { + var _a, _b; + return ((_b = (_a = this.related_chip_cloud) == null ? void 0 : _a.chips) == null ? void 0 : _b.map((chip) => { + var _a2; + return (_a2 = chip.text) == null ? void 0 : _a2.toString(); + })) || []; + } + /** + * Checks if continuation is available for the watch next feed. + */ + get wn_has_continuation() { + return !!__privateGet(this, _watch_next_continuation); + } + /** + * Gets the endpoint of the autoplay video + */ + get autoplay_video_endpoint() { + var _a, _b, _c; + return ((_c = (_b = (_a = this.autoplay) == null ? void 0 : _a.sets) == null ? void 0 : _b[0]) == null ? void 0 : _c.autoplay_video) || null; + } + /** + * Checks if trailer is available. + */ + get has_trailer() { + var _a, _b; + return !!((_b = (_a = this.playability_status) == null ? void 0 : _a.error_screen) == null ? void 0 : _b.is(PlayerLegacyDesktopYpcTrailer, YpcTrailer)); + } + /** + * Get songs used in the video. + */ + get music_tracks() { + var _a, _b, _c, _d, _e, _f; + const description_content = (_b = (_a = this.page[1]) == null ? void 0 : _a.engagement_panels) == null ? void 0 : _b.filter((panel) => { + var _a2; + return (_a2 = panel.content) == null ? void 0 : _a2.is(StructuredDescriptionContent); + }); + if (description_content !== void 0 && description_content.length > 0) { + const music_section = (_e = (_d = (_c = description_content[0].content) == null ? void 0 : _c.as(StructuredDescriptionContent)) == null ? void 0 : _d.items) == null ? void 0 : _e.filterType(VideoDescriptionMusicSection); + if (music_section !== void 0 && music_section.length > 0) { + return (_f = music_section[0].carousel_lockups) == null ? void 0 : _f.map((lookup) => { + var _a2, _b2, _c2, _d2, _e2, _f2, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t; + let song; + let artist; + let album; + let license; + let videoId; + let channelId; + song = (_b2 = (_a2 = lookup.video_lockup) == null ? void 0 : _a2.title) == null ? void 0 : _b2.toString(); + videoId = (_d2 = (_c2 = lookup.video_lockup) == null ? void 0 : _c2.endpoint) == null ? void 0 : _d2.payload.videoId; + for (let i = 0; i < lookup.info_rows.length; i++) { + const info_row = lookup.info_rows[i]; + if (info_row.info_row_expand_status_key === void 0) { + if (song === void 0) { + song = ((_e2 = info_row.default_metadata) == null ? void 0 : _e2.toString()) || ((_f2 = info_row.expanded_metadata) == null ? void 0 : _f2.toString()); + if (videoId === void 0) { + const endpoint = ((_g = info_row.default_metadata) == null ? void 0 : _g.endpoint) || ((_h = info_row.expanded_metadata) == null ? void 0 : _h.endpoint); + videoId = (_i = endpoint == null ? void 0 : endpoint.payload) == null ? void 0 : _i.videoId; + } + } else { + album = ((_j = info_row.default_metadata) == null ? void 0 : _j.toString()) || ((_k = info_row.expanded_metadata) == null ? void 0 : _k.toString()); + } + } else { + if (((_l = info_row.info_row_expand_status_key) == null ? void 0 : _l.indexOf("structured-description-music-section-artists-row-state-id")) !== -1) { + artist = ((_m = info_row.default_metadata) == null ? void 0 : _m.toString()) || ((_n = info_row.expanded_metadata) == null ? void 0 : _n.toString()); + if (channelId === void 0) { + const endpoint = ((_o = info_row.default_metadata) == null ? void 0 : _o.endpoint) || ((_p = info_row.expanded_metadata) == null ? void 0 : _p.endpoint); + channelId = (_q = endpoint == null ? void 0 : endpoint.payload) == null ? void 0 : _q.browseId; + } + } + if (((_r = info_row.info_row_expand_status_key) == null ? void 0 : _r.indexOf("structured-description-music-section-licenses-row-state-id")) !== -1) { + license = ((_s = info_row.default_metadata) == null ? void 0 : _s.toString()) || ((_t = info_row.expanded_metadata) == null ? void 0 : _t.toString()); + } + } + } + return { song, artist, album, license, videoId, channelId }; + }); + } + } + return []; + } +}; +_watch_next_continuation = new WeakMap(); +__name(_VideoInfo, "VideoInfo"); +var VideoInfo = _VideoInfo; + +// dist/src/parser/youtube/TranscriptInfo.js +var _page9, _actions12; +var _TranscriptInfo = class _TranscriptInfo { + constructor(actions, response) { + __privateAdd(this, _page9); + __privateAdd(this, _actions12); + __publicField(this, "transcript"); + __privateSet(this, _page9, parser_exports.parseResponse(response.data)); + __privateSet(this, _actions12, actions); + if (!__privateGet(this, _page9).actions_memo) + throw new Error("Page actions not found"); + this.transcript = __privateGet(this, _page9).actions_memo.getType(Transcript)[0]; + } + /** + * Selects a language from the language menu and returns the updated transcript. + * @param language - Language to select. + */ + async selectLanguage(language) { + var _a, _b, _c, _d; + const target_menu_item = (_d = (_c = (_b = (_a = this.transcript.content) == null ? void 0 : _a.footer) == null ? void 0 : _b.language_menu) == null ? void 0 : _c.sub_menu_items) == null ? void 0 : _d.find((item) => item.title.toString() === language); + if (!target_menu_item) + throw new Error(`Language not found: ${language}`); + if (target_menu_item.selected) + return this; + const response = await __privateGet(this, _actions12).execute("/get_transcript", { + params: target_menu_item.continuation + }); + return new _TranscriptInfo(__privateGet(this, _actions12), response); + } + /** + * Returns available languages. + */ + get languages() { + var _a, _b, _c, _d; + return ((_d = (_c = (_b = (_a = this.transcript.content) == null ? void 0 : _a.footer) == null ? void 0 : _b.language_menu) == null ? void 0 : _c.sub_menu_items) == null ? void 0 : _d.map((item) => item.title.toString())) || []; + } + /** + * Returns the currently selected language. + */ + get selectedLanguage() { + var _a, _b, _c, _d, _e; + return ((_e = (_d = (_c = (_b = (_a = this.transcript.content) == null ? void 0 : _a.footer) == null ? void 0 : _b.language_menu) == null ? void 0 : _c.sub_menu_items) == null ? void 0 : _d.find((item) => item.selected)) == null ? void 0 : _e.title.toString()) || ""; + } + get page() { + return __privateGet(this, _page9); + } +}; +_page9 = new WeakMap(); +_actions12 = new WeakMap(); +__name(_TranscriptInfo, "TranscriptInfo"); +var TranscriptInfo = _TranscriptInfo; + +// dist/src/parser/ytmusic/index.js +var ytmusic_exports = {}; +__export(ytmusic_exports, { + Album: () => Album, + Artist: () => Artist, + Explore: () => Explore, + HomeFeed: () => HomeFeed2, + Library: () => Library2, + LibraryContinuation: () => LibraryContinuation, + Playlist: () => Playlist3, + Recap: () => Recap, + Search: () => Search2, + TrackInfo: () => TrackInfo_default +}); + +// dist/src/parser/ytmusic/Album.js +var _page10; +var _Album = class _Album { + constructor(response) { + __privateAdd(this, _page10); + __publicField(this, "header"); + __publicField(this, "contents"); + __publicField(this, "sections"); + __publicField(this, "background"); + __publicField(this, "url"); + var _a, _b, _c; + __privateSet(this, _page10, parser_exports.parseResponse(response.data)); + if (!__privateGet(this, _page10).contents_memo) + throw new Error("No contents found in the response"); + this.header = (_a = __privateGet(this, _page10).contents_memo.getType(MusicDetailHeader, MusicResponsiveHeader)) == null ? void 0 : _a[0]; + this.contents = ((_b = __privateGet(this, _page10).contents_memo.getType(MusicShelf)) == null ? void 0 : _b[0].contents) || observe([]); + this.sections = __privateGet(this, _page10).contents_memo.getType(MusicCarouselShelf) || observe([]); + this.background = __privateGet(this, _page10).background; + this.url = (_c = __privateGet(this, _page10).microformat) == null ? void 0 : _c.as(MicroformatData).url_canonical; + } + get page() { + return __privateGet(this, _page10); + } +}; +_page10 = new WeakMap(); +__name(_Album, "Album"); +var Album = _Album; + +// dist/src/parser/ytmusic/Artist.js +var _page11, _actions13; +var _Artist = class _Artist { + constructor(response, actions) { + __privateAdd(this, _page11); + __privateAdd(this, _actions13); + __publicField(this, "header"); + __publicField(this, "sections"); + var _a, _b, _c; + __privateSet(this, _page11, parser_exports.parseResponse(response.data)); + __privateSet(this, _actions13, actions); + this.header = (_a = this.page.header) == null ? void 0 : _a.item().as(MusicImmersiveHeader, MusicVisualHeader, MusicHeader); + const music_shelf = ((_b = __privateGet(this, _page11).contents_memo) == null ? void 0 : _b.getType(MusicShelf)) || []; + const music_carousel_shelf = ((_c = __privateGet(this, _page11).contents_memo) == null ? void 0 : _c.getType(MusicCarouselShelf)) || []; + this.sections = observe([...music_shelf, ...music_carousel_shelf]); + } + async getAllSongs() { + var _a, _b; + const music_shelves = this.sections.filter((section) => section.type === "MusicShelf"); + if (!music_shelves.length) + throw new InnertubeError("Could not find any node of type MusicShelf."); + const shelf = music_shelves.find((shelf2) => { + var _a2; + return ((_a2 = shelf2.title) == null ? void 0 : _a2.text) === "Top songs"; + }); + if (!shelf) + throw new InnertubeError("Could not find target shelf (Top songs)."); + if (!shelf.endpoint) + throw new InnertubeError("Target shelf (Top songs) did not have an endpoint."); + const page = await shelf.endpoint.call(__privateGet(this, _actions13), { client: "YTMUSIC", parse: true }); + return (_b = (_a = page.contents_memo) == null ? void 0 : _a.getType(MusicPlaylistShelf)) == null ? void 0 : _b[0]; + } + get page() { + return __privateGet(this, _page11); + } +}; +_page11 = new WeakMap(); +_actions13 = new WeakMap(); +__name(_Artist, "Artist"); +var Artist = _Artist; + +// dist/src/parser/ytmusic/Explore.js +var _page12; +var _Explore = class _Explore { + constructor(response) { + __privateAdd(this, _page12); + __publicField(this, "top_buttons"); + __publicField(this, "sections"); + var _a, _b, _c; + __privateSet(this, _page12, parser_exports.parseResponse(response.data)); + const tab = (_a = __privateGet(this, _page12).contents) == null ? void 0 : _a.item().as(SingleColumnBrowseResults).tabs.find((tab2) => tab2.selected); + if (!tab) + throw new InnertubeError("Could not find target tab."); + const section_list = (_b = tab.content) == null ? void 0 : _b.as(SectionList); + if (!section_list) + throw new InnertubeError("Target tab did not have any content."); + this.top_buttons = ((_c = section_list.contents.firstOfType(Grid)) == null ? void 0 : _c.items.as(MusicNavigationButton)) || []; + this.sections = section_list.contents.filterType(MusicCarouselShelf); + } + get page() { + return __privateGet(this, _page12); + } +}; +_page12 = new WeakMap(); +__name(_Explore, "Explore"); +var Explore = _Explore; + +// dist/src/parser/ytmusic/HomeFeed.js +var _page13, _actions14, _continuation5; +var _HomeFeed2 = class _HomeFeed2 { + constructor(response, actions) { + __privateAdd(this, _page13); + __privateAdd(this, _actions14); + __privateAdd(this, _continuation5); + __publicField(this, "sections"); + __publicField(this, "header"); + var _a, _b, _c, _d, _e, _f; + __privateSet(this, _actions14, actions); + __privateSet(this, _page13, parser_exports.parseResponse(response.data)); + const tab = (_a = __privateGet(this, _page13).contents) == null ? void 0 : _a.item().as(SingleColumnBrowseResults).tabs.find((tab2) => tab2.selected); + if (!tab) + throw new InnertubeError("Could not find Home tab."); + if (tab.content === null) { + if (!__privateGet(this, _page13).continuation_contents) + throw new InnertubeError("Continuation did not have any content."); + __privateSet(this, _continuation5, __privateGet(this, _page13).continuation_contents.as(SectionListContinuation).continuation); + this.sections = (_b = __privateGet(this, _page13).continuation_contents.as(SectionListContinuation).contents) == null ? void 0 : _b.as(MusicCarouselShelf); + return; + } + this.header = (_d = (_c = tab.content) == null ? void 0 : _c.as(SectionList).header) == null ? void 0 : _d.as(ChipCloud); + __privateSet(this, _continuation5, (_e = tab.content) == null ? void 0 : _e.as(SectionList).continuation); + this.sections = (_f = tab.content) == null ? void 0 : _f.as(SectionList).contents.as(MusicCarouselShelf, MusicTasteBuilderShelf); + } + /** + * Retrieves home feed continuation. + */ + async getContinuation() { + if (!__privateGet(this, _continuation5)) + throw new InnertubeError("Continuation not found."); + const response = await __privateGet(this, _actions14).execute("/browse", { + client: "YTMUSIC", + continuation: __privateGet(this, _continuation5) + }); + return new _HomeFeed2(response, __privateGet(this, _actions14)); + } + async applyFilter(target_filter) { + var _a, _b; + let cloud_chip; + if (typeof target_filter === "string") { + cloud_chip = (_b = (_a = this.header) == null ? void 0 : _a.chips) == null ? void 0 : _b.as(ChipCloudChip).find((chip) => chip.text === target_filter); + if (!cloud_chip) + throw new InnertubeError("Could not find filter with given name.", { available_filters: this.filters }); + } else if (target_filter == null ? void 0 : target_filter.is(ChipCloudChip)) { + cloud_chip = target_filter; + } + if (!cloud_chip) + throw new InnertubeError("Invalid filter", { available_filters: this.filters }); + if (cloud_chip == null ? void 0 : cloud_chip.is_selected) + return this; + if (!cloud_chip.endpoint) + throw new InnertubeError("Selected filter does not have an endpoint."); + const response = await cloud_chip.endpoint.call(__privateGet(this, _actions14), { client: "YTMUSIC" }); + return new _HomeFeed2(response, __privateGet(this, _actions14)); + } + get filters() { + var _a, _b; + return ((_b = (_a = this.header) == null ? void 0 : _a.chips) == null ? void 0 : _b.as(ChipCloudChip).map((chip) => chip.text)) || []; + } + get has_continuation() { + return !!__privateGet(this, _continuation5); + } + get page() { + return __privateGet(this, _page13); + } +}; +_page13 = new WeakMap(); +_actions14 = new WeakMap(); +_continuation5 = new WeakMap(); +__name(_HomeFeed2, "HomeFeed"); +var HomeFeed2 = _HomeFeed2; + +// dist/src/parser/ytmusic/Library.js +var _page14, _actions15, _continuation6; +var _Library2 = class _Library2 { + constructor(response, actions) { + __privateAdd(this, _page14); + __privateAdd(this, _actions15); + __privateAdd(this, _continuation6); + __publicField(this, "header"); + __publicField(this, "contents"); + var _a, _b, _c, _d, _e; + __privateSet(this, _page14, parser_exports.parseResponse(response.data)); + __privateSet(this, _actions15, actions); + const section_list = (_a = __privateGet(this, _page14).contents_memo) == null ? void 0 : _a.getType(SectionList)[0]; + this.header = (_b = section_list == null ? void 0 : section_list.header) == null ? void 0 : _b.as(MusicSideAlignedItem); + this.contents = (_c = section_list == null ? void 0 : section_list.contents) == null ? void 0 : _c.as(Grid, MusicShelf); + __privateSet(this, _continuation6, (_e = (_d = this.contents) == null ? void 0 : _d.find((list) => list.continuation)) == null ? void 0 : _e.continuation); + } + /** + * Applies given sort option to the library items. + */ + async applySort(sort_by) { + var _a, _b, _c, _d, _e, _f, _g, _h, _i; + let target_item; + if (typeof sort_by === "string") { + const button = (_a = __privateGet(this, _page14).contents_memo) == null ? void 0 : _a.getType(MusicSortFilterButton)[0]; + const options = (_b = button == null ? void 0 : button.menu) == null ? void 0 : _b.options.filter((item) => item instanceof MusicMultiSelectMenuItem); + target_item = options == null ? void 0 : options.find((item) => item.title === sort_by); + if (!target_item) + throw new InnertubeError(`Sort option "${sort_by}" not found`, { available_filters: options.map((item) => item.title) }); + } else { + target_item = sort_by; + } + if (!target_item.endpoint) + throw new InnertubeError("Invalid sort option"); + if (target_item.selected) + return this; + const cmd = (_e = (_d = (_c = target_item.endpoint.payload) == null ? void 0 : _c.commands) == null ? void 0 : _d.find((cmd2) => cmd2.browseSectionListReloadEndpoint)) == null ? void 0 : _e.browseSectionListReloadEndpoint; + if (!cmd) + throw new InnertubeError("Failed to find sort option command"); + const response = await __privateGet(this, _actions15).execute("/browse", { + client: "YTMUSIC", + continuation: cmd.continuation.reloadContinuationData.continuation, + parse: true + }); + const previously_selected_item = (_g = (_f = __privateGet(this, _page14).contents_memo) == null ? void 0 : _f.getType(MusicMultiSelectMenuItem)) == null ? void 0 : _g.find((item) => item.selected); + if (previously_selected_item) + previously_selected_item.selected = false; + target_item.selected = true; + this.contents = (_i = (_h = response.continuation_contents) == null ? void 0 : _h.as(SectionListContinuation).contents) == null ? void 0 : _i.as(Grid, MusicShelf); + return this; + } + /** + * Applies given filter to the library. + */ + async applyFilter(filter) { + var _a, _b, _c; + let target_chip; + const chip_cloud = (_a = __privateGet(this, _page14).contents_memo) == null ? void 0 : _a.getType(ChipCloud)[0]; + if (typeof filter === "string") { + target_chip = chip_cloud == null ? void 0 : chip_cloud.chips.find((chip) => chip.text === filter); + if (!target_chip) + throw new InnertubeError(`Filter "${filter}" not found`, { available_filters: this.filters }); + } else { + target_chip = filter; + } + if (!target_chip.endpoint) + throw new InnertubeError("Invalid filter", filter); + const target_cmd = new NavigationEndpoint((_c = (_b = target_chip.endpoint.payload) == null ? void 0 : _b.commands) == null ? void 0 : _c[0]); + const response = await target_cmd.call(__privateGet(this, _actions15), { client: "YTMUSIC" }); + return new _Library2(response, __privateGet(this, _actions15)); + } + /** + * Retrieves continuation of the library items. + */ + async getContinuation() { + if (!__privateGet(this, _continuation6)) + throw new InnertubeError("No continuation available"); + const page = await __privateGet(this, _actions15).execute("/browse", { + client: "YTMUSIC", + continuation: __privateGet(this, _continuation6) + }); + return new LibraryContinuation(page, __privateGet(this, _actions15)); + } + get has_continuation() { + return !!__privateGet(this, _continuation6); + } + get sort_options() { + var _a, _b; + const button = (_a = __privateGet(this, _page14).contents_memo) == null ? void 0 : _a.getType(MusicSortFilterButton)[0]; + const options = (_b = button == null ? void 0 : button.menu) == null ? void 0 : _b.options.filter((item) => item instanceof MusicMultiSelectMenuItem); + return options.map((item) => item.title); + } + get filters() { + var _a, _b; + return ((_b = (_a = __privateGet(this, _page14).contents_memo) == null ? void 0 : _a.getType(ChipCloud)) == null ? void 0 : _b[0].chips.map((chip) => chip.text)) || []; + } + get page() { + return __privateGet(this, _page14); + } +}; +_page14 = new WeakMap(); +_actions15 = new WeakMap(); +_continuation6 = new WeakMap(); +__name(_Library2, "Library"); +var Library2 = _Library2; +var _page15, _actions16, _continuation7; +var _LibraryContinuation = class _LibraryContinuation { + constructor(response, actions) { + __privateAdd(this, _page15); + __privateAdd(this, _actions16); + __privateAdd(this, _continuation7); + __publicField(this, "contents"); + __privateSet(this, _page15, parser_exports.parseResponse(response.data)); + __privateSet(this, _actions16, actions); + if (!__privateGet(this, _page15).continuation_contents) + throw new InnertubeError("No continuation contents found"); + this.contents = __privateGet(this, _page15).continuation_contents.as(MusicShelfContinuation, GridContinuation); + __privateSet(this, _continuation7, this.contents.continuation || null); + } + async getContinuation() { + if (!__privateGet(this, _continuation7)) + throw new InnertubeError("No continuation available"); + const response = await __privateGet(this, _actions16).execute("/browse", { + client: "YTMUSIC", + continuation: __privateGet(this, _continuation7) + }); + return new _LibraryContinuation(response, __privateGet(this, _actions16)); + } + get has_continuation() { + return !!__privateGet(this, _continuation7); + } + get page() { + return __privateGet(this, _page15); + } +}; +_page15 = new WeakMap(); +_actions16 = new WeakMap(); +_continuation7 = new WeakMap(); +__name(_LibraryContinuation, "LibraryContinuation"); +var LibraryContinuation = _LibraryContinuation; + +// dist/src/parser/ytmusic/Playlist.js +var _page16, _actions17, _continuation8, _last_fetched_suggestions, _suggestions_continuation, _Playlist_instances2, fetchSuggestions_fn; +var _Playlist3 = class _Playlist3 { + constructor(response, actions) { + __privateAdd(this, _Playlist_instances2); + __privateAdd(this, _page16); + __privateAdd(this, _actions17); + __privateAdd(this, _continuation8); + __publicField(this, "header"); + __publicField(this, "contents"); + __publicField(this, "background"); + __privateAdd(this, _last_fetched_suggestions); + __privateAdd(this, _suggestions_continuation); + var _a, _b, _c, _d, _e, _f, _g, _h; + __privateSet(this, _actions17, actions); + __privateSet(this, _page16, parser_exports.parseResponse(response.data)); + __privateSet(this, _last_fetched_suggestions, null); + __privateSet(this, _suggestions_continuation, null); + if (__privateGet(this, _page16).continuation_contents) { + const data = (_a = __privateGet(this, _page16).continuation_contents) == null ? void 0 : _a.as(MusicPlaylistShelfContinuation); + if (!data.contents) + throw new InnertubeError("No contents found in the response"); + this.contents = data.contents.as(MusicResponsiveListItem, ContinuationItem); + const continuation_item = this.contents.firstOfType(ContinuationItem); + __privateSet(this, _continuation8, data.continuation || continuation_item); + } else if (__privateGet(this, _page16).contents_memo) { + this.header = (_b = __privateGet(this, _page16).contents_memo.getType(MusicResponsiveHeader, MusicEditablePlaylistDetailHeader, MusicDetailHeader)) == null ? void 0 : _b[0]; + this.contents = ((_d = (_c = __privateGet(this, _page16).contents_memo.getType(MusicPlaylistShelf)) == null ? void 0 : _c[0]) == null ? void 0 : _d.contents.as(MusicResponsiveListItem, ContinuationItem)) || observe([]); + this.background = __privateGet(this, _page16).background; + const continuation_item = this.contents.firstOfType(ContinuationItem); + __privateSet(this, _continuation8, ((_f = (_e = __privateGet(this, _page16).contents_memo.getType(MusicPlaylistShelf)) == null ? void 0 : _e[0]) == null ? void 0 : _f.continuation) || continuation_item); + } else if (__privateGet(this, _page16).on_response_received_actions) { + const append_continuation_action = __privateGet(this, _page16).on_response_received_actions.firstOfType(AppendContinuationItemsAction); + this.contents = (_g = append_continuation_action == null ? void 0 : append_continuation_action.contents) == null ? void 0 : _g.as(MusicResponsiveListItem, ContinuationItem); + __privateSet(this, _continuation8, (_h = this.contents) == null ? void 0 : _h.firstOfType(ContinuationItem)); + } + } + /** + * Retrieves playlist items continuation. + */ + async getContinuation() { + if (!__privateGet(this, _continuation8)) + throw new InnertubeError("Continuation not found."); + let response; + if (typeof __privateGet(this, _continuation8) === "string") { + response = await __privateGet(this, _actions17).execute("/browse", { + client: "YTMUSIC", + continuation: __privateGet(this, _continuation8) + }); + } else { + response = await __privateGet(this, _continuation8).endpoint.call(__privateGet(this, _actions17), { client: "YTMUSIC" }); + } + return new _Playlist3(response, __privateGet(this, _actions17)); + } + /** + * Retrieves related playlists + */ + async getRelated() { + var _a, _b, _c, _d; + const target_section_list = (_a = __privateGet(this, _page16).contents_memo) == null ? void 0 : _a.getType(SectionList).find((section_list) => section_list.continuation); + if (!target_section_list) + throw new InnertubeError('Could not find "Related" section.'); + let section_continuation = target_section_list.continuation; + while (section_continuation) { + const data = await __privateGet(this, _actions17).execute("/browse", { + client: "YTMUSIC", + continuation: section_continuation, + parse: true + }); + const section_list = (_b = data.continuation_contents) == null ? void 0 : _b.as(SectionListContinuation); + const sections = (_c = section_list == null ? void 0 : section_list.contents) == null ? void 0 : _c.as(MusicCarouselShelf, MusicShelf); + const related = (_d = sections == null ? void 0 : sections.find((section) => section.is(MusicCarouselShelf))) == null ? void 0 : _d.as(MusicCarouselShelf); + if (related) + return related; + section_continuation = section_list == null ? void 0 : section_list.continuation; + } + throw new InnertubeError("Could not fetch related playlists."); + } + async getSuggestions(refresh = true) { + const require_fetch = refresh || !__privateGet(this, _last_fetched_suggestions); + const fetch_promise = require_fetch ? __privateMethod(this, _Playlist_instances2, fetchSuggestions_fn).call(this) : Promise.resolve(null); + const fetch_result = await fetch_promise; + if (fetch_result) { + __privateSet(this, _last_fetched_suggestions, fetch_result.items); + __privateSet(this, _suggestions_continuation, fetch_result.continuation); + } + return (fetch_result == null ? void 0 : fetch_result.items) || __privateGet(this, _last_fetched_suggestions) || observe([]); + } + get page() { + return __privateGet(this, _page16); + } + get items() { + return this.contents || observe([]); + } + get has_continuation() { + return !!__privateGet(this, _continuation8); + } +}; +_page16 = new WeakMap(); +_actions17 = new WeakMap(); +_continuation8 = new WeakMap(); +_last_fetched_suggestions = new WeakMap(); +_suggestions_continuation = new WeakMap(); +_Playlist_instances2 = new WeakSet(); +fetchSuggestions_fn = /* @__PURE__ */ __name(async function() { + var _a, _b, _c, _d; + const target_section_list = (_a = __privateGet(this, _page16).contents_memo) == null ? void 0 : _a.getType(SectionList).find((section_list) => section_list.continuation); + const continuation = __privateGet(this, _suggestions_continuation) || (target_section_list == null ? void 0 : target_section_list.continuation); + if (continuation) { + const page = await __privateGet(this, _actions17).execute("/browse", { + client: "YTMUSIC", + continuation, + parse: true + }); + const section_list = (_b = page.continuation_contents) == null ? void 0 : _b.as(SectionListContinuation); + const sections = (_c = section_list == null ? void 0 : section_list.contents) == null ? void 0 : _c.as(MusicCarouselShelf, MusicShelf); + const suggestions = (_d = sections == null ? void 0 : sections.find((section) => section.is(MusicShelf))) == null ? void 0 : _d.as(MusicShelf); + return { + items: (suggestions == null ? void 0 : suggestions.contents) || observe([]), + continuation: (suggestions == null ? void 0 : suggestions.continuation) || null + }; + } + return { + items: observe([]), + continuation: null + }; +}, "#fetchSuggestions"); +__name(_Playlist3, "Playlist"); +var Playlist3 = _Playlist3; + +// dist/src/parser/ytmusic/Recap.js +var _page17, _actions18; +var _Recap = class _Recap { + constructor(response, actions) { + __privateAdd(this, _page17); + __privateAdd(this, _actions18); + __publicField(this, "header"); + __publicField(this, "sections"); + var _a, _b, _c, _d, _e, _f, _g; + __privateSet(this, _page17, parser_exports.parseResponse(response.data)); + __privateSet(this, _actions18, actions); + const header = (_a = __privateGet(this, _page17).header) == null ? void 0 : _a.item(); + this.header = (header == null ? void 0 : header.is(MusicElementHeader)) ? (_d = (_c = (_b = __privateGet(this, _page17).header) == null ? void 0 : _b.item().as(MusicElementHeader).element) == null ? void 0 : _c.model) == null ? void 0 : _d.as(HighlightsCarousel) : (_e = __privateGet(this, _page17).header) == null ? void 0 : _e.item().as(MusicHeader); + const tab = (_f = __privateGet(this, _page17).contents) == null ? void 0 : _f.item().as(SingleColumnBrowseResults).tabs.firstOfType(Tab); + if (!tab) + throw new InnertubeError("Target tab not found"); + this.sections = (_g = tab.content) == null ? void 0 : _g.as(SectionList).contents.as(ItemSection, MusicCarouselShelf, Message); + } + /** + * Retrieves recap playlist. + */ + async getPlaylist() { + if (!this.header) + throw new InnertubeError("Header not found"); + if (!this.header.is(HighlightsCarousel)) + throw new InnertubeError("Recap playlist not available, check back later."); + const endpoint = this.header.panels[0].text_on_tap_endpoint; + const response = await endpoint.call(__privateGet(this, _actions18), { client: "YTMUSIC" }); + return new Playlist3(response, __privateGet(this, _actions18)); + } + get page() { + return __privateGet(this, _page17); + } +}; +_page17 = new WeakMap(); +_actions18 = new WeakMap(); +__name(_Recap, "Recap"); +var Recap = _Recap; + +// dist/src/parser/ytmusic/Search.js +var _page18, _actions19, _continuation9; +var _Search2 = class _Search2 { + constructor(response, actions, is_filtered) { + __privateAdd(this, _page18); + __privateAdd(this, _actions19); + __privateAdd(this, _continuation9); + __publicField(this, "header"); + __publicField(this, "contents"); + var _a, _b, _c; + __privateSet(this, _actions19, actions); + __privateSet(this, _page18, parser_exports.parseResponse(response.data)); + if (!__privateGet(this, _page18).contents || !__privateGet(this, _page18).contents_memo) + throw new InnertubeError("Response did not contain any contents."); + const tab = __privateGet(this, _page18).contents.item().as(TabbedSearchResults).tabs.find((tab2) => tab2.selected); + if (!tab) + throw new InnertubeError("Could not find target tab."); + const tab_content = (_a = tab.content) == null ? void 0 : _a.as(SectionList); + if (!tab_content) + throw new InnertubeError("Target tab did not have any content."); + this.header = (_b = tab_content.header) == null ? void 0 : _b.as(ChipCloud); + this.contents = tab_content.contents.as(MusicShelf, MusicCardShelf, ItemSection); + if (is_filtered) { + __privateSet(this, _continuation9, (_c = this.contents.firstOfType(MusicShelf)) == null ? void 0 : _c.continuation); + } + } + /** + * Loads more items for the given shelf. + */ + async getMore(shelf) { + if (!shelf || !shelf.endpoint) + throw new InnertubeError("Cannot retrieve more items for this shelf because it does not have an endpoint."); + const response = await shelf.endpoint.call(__privateGet(this, _actions19), { client: "YTMUSIC" }); + if (!response) + throw new InnertubeError("Endpoint did not return any data"); + return new _Search2(response, __privateGet(this, _actions19), true); + } + /** + * Retrieves search continuation. Only available for filtered searches and shelf continuations. + */ + async getContinuation() { + if (!__privateGet(this, _continuation9)) + throw new InnertubeError("Continuation not found."); + const response = await __privateGet(this, _actions19).execute("/search", { + continuation: __privateGet(this, _continuation9), + client: "YTMUSIC" + }); + return new SearchContinuation(__privateGet(this, _actions19), response); + } + /** + * Applies given filter to the search. + */ + async applyFilter(target_filter) { + var _a, _b; + let cloud_chip; + if (typeof target_filter === "string") { + cloud_chip = (_b = (_a = this.header) == null ? void 0 : _a.chips) == null ? void 0 : _b.as(ChipCloudChip).find((chip) => chip.text === target_filter); + if (!cloud_chip) + throw new InnertubeError("Could not find filter with given name.", { available_filters: this.filters }); + } else if (target_filter == null ? void 0 : target_filter.is(ChipCloudChip)) { + cloud_chip = target_filter; + } + if (!cloud_chip) + throw new InnertubeError("Invalid filter", { available_filters: this.filters }); + if (cloud_chip == null ? void 0 : cloud_chip.is_selected) + return this; + if (!cloud_chip.endpoint) + throw new InnertubeError("Selected filter does not have an endpoint."); + const response = await cloud_chip.endpoint.call(__privateGet(this, _actions19), { client: "YTMUSIC" }); + return new _Search2(response, __privateGet(this, _actions19), true); + } + get filters() { + var _a, _b; + return ((_b = (_a = this.header) == null ? void 0 : _a.chips) == null ? void 0 : _b.as(ChipCloudChip).map((chip) => chip.text)) || []; + } + get has_continuation() { + return !!__privateGet(this, _continuation9); + } + get did_you_mean() { + var _a; + return (_a = __privateGet(this, _page18).contents_memo) == null ? void 0 : _a.getType(DidYouMean)[0]; + } + get showing_results_for() { + var _a; + return (_a = __privateGet(this, _page18).contents_memo) == null ? void 0 : _a.getType(ShowingResultsFor)[0]; + } + get message() { + var _a; + return (_a = __privateGet(this, _page18).contents_memo) == null ? void 0 : _a.getType(Message)[0]; + } + get songs() { + var _a; + return (_a = this.contents) == null ? void 0 : _a.filterType(MusicShelf).find((section) => section.title.toString() === "Songs"); + } + get videos() { + var _a; + return (_a = this.contents) == null ? void 0 : _a.filterType(MusicShelf).find((section) => section.title.toString() === "Videos"); + } + get albums() { + var _a; + return (_a = this.contents) == null ? void 0 : _a.filterType(MusicShelf).find((section) => section.title.toString() === "Albums"); + } + get artists() { + var _a; + return (_a = this.contents) == null ? void 0 : _a.filterType(MusicShelf).find((section) => section.title.toString() === "Artists"); + } + get playlists() { + var _a; + return (_a = this.contents) == null ? void 0 : _a.filterType(MusicShelf).find((section) => section.title.toString() === "Community playlists"); + } + get page() { + return __privateGet(this, _page18); + } +}; +_page18 = new WeakMap(); +_actions19 = new WeakMap(); +_continuation9 = new WeakMap(); +__name(_Search2, "Search"); +var Search2 = _Search2; +var _actions20, _page19; +var _SearchContinuation = class _SearchContinuation { + constructor(actions, response) { + __privateAdd(this, _actions20); + __privateAdd(this, _page19); + __publicField(this, "header"); + __publicField(this, "contents"); + var _a, _b; + __privateSet(this, _actions20, actions); + __privateSet(this, _page19, parser_exports.parseResponse(response.data)); + this.header = (_a = __privateGet(this, _page19).header) == null ? void 0 : _a.item().as(MusicHeader); + this.contents = (_b = __privateGet(this, _page19).continuation_contents) == null ? void 0 : _b.as(MusicShelfContinuation); + } + async getContinuation() { + var _a; + if (!((_a = this.contents) == null ? void 0 : _a.continuation)) + throw new InnertubeError("Continuation not found."); + const response = await __privateGet(this, _actions20).execute("/search", { + continuation: this.contents.continuation, + client: "YTMUSIC" + }); + return new _SearchContinuation(__privateGet(this, _actions20), response); + } + get has_continuation() { + var _a; + return !!((_a = this.contents) == null ? void 0 : _a.continuation); + } + get page() { + return __privateGet(this, _page19); + } +}; +_actions20 = new WeakMap(); +_page19 = new WeakMap(); +__name(_SearchContinuation, "SearchContinuation"); +var SearchContinuation = _SearchContinuation; + +// dist/src/parser/ytmusic/TrackInfo.js +var _TrackInfo = class _TrackInfo extends MediaInfo { + constructor(data, actions, cpn) { + var _a, _b, _c; + super(data, actions, cpn); + __publicField(this, "tabs"); + __publicField(this, "current_video_endpoint"); + __publicField(this, "player_overlays"); + const next = this.page[1]; + if (next) { + const tabbed_results = (_b = (_a = next.contents_memo) == null ? void 0 : _a.getType(WatchNextTabbedResults)) == null ? void 0 : _b[0]; + this.tabs = tabbed_results == null ? void 0 : tabbed_results.tabs.as(Tab); + this.current_video_endpoint = next.current_video_endpoint; + this.player_overlays = (_c = next.player_overlays) == null ? void 0 : _c.item().as(PlayerOverlay); + } + } + /** + * Retrieves contents of the given tab. + */ + async getTab(title_or_page_type) { + var _a, _b; + if (!this.tabs) + throw new InnertubeError("Could not find any tab"); + const target_tab = this.tabs.find((tab) => tab.title === title_or_page_type) || this.tabs.find((tab) => { + var _a2, _b2; + return ((_b2 = (_a2 = tab.endpoint.payload.browseEndpointContextSupportedConfigs) == null ? void 0 : _a2.browseEndpointContextMusicConfig) == null ? void 0 : _b2.pageType) === title_or_page_type; + }) || ((_a = this.tabs) == null ? void 0 : _a[0]); + if (!target_tab) + throw new InnertubeError(`Tab "${title_or_page_type}" not found`, { available_tabs: this.available_tabs }); + if (target_tab.content) + return target_tab.content; + const page = await target_tab.endpoint.call(this.actions, { client: "YTMUSIC", parse: true }); + if (((_b = page.contents) == null ? void 0 : _b.item().type) === "Message") + return page.contents.item().as(Message); + if (!page.contents) + throw new InnertubeError("Page contents was empty", page); + return page.contents.item().as(SectionList).contents; + } + /** + * Retrieves up next. + */ + async getUpNext(automix = true) { + var _a, _b; + const music_queue = await this.getTab("Up next"); + if (!music_queue || !music_queue.content) + throw new InnertubeError("Music queue was empty, the video id is probably invalid.", music_queue); + const playlist_panel = music_queue.content.as(PlaylistPanel); + if (!playlist_panel.playlist_id && automix) { + const automix_preview_video = playlist_panel.contents.firstOfType(AutomixPreviewVideo); + if (!automix_preview_video) + throw new InnertubeError("Automix item not found"); + const page = await ((_a = automix_preview_video.playlist_video) == null ? void 0 : _a.endpoint.call(this.actions, { + videoId: this.basic_info.id, + client: "YTMUSIC", + parse: true + })); + if (!page || !page.contents_memo) + throw new InnertubeError("Could not fetch automix"); + return (_b = page.contents_memo.getType(PlaylistPanel)) == null ? void 0 : _b[0]; + } + return playlist_panel; + } + /** + * Retrieves up next continuation relative to current TrackInfo. + */ + async getUpNextContinuation(playlistPanel) { + var _a; + if (!this.current_video_endpoint) + throw new InnertubeError("Current Video Endpoint was not defined.", this.current_video_endpoint); + if (playlistPanel instanceof PlaylistPanel && playlistPanel.playlist_id !== this.current_video_endpoint.payload.playlistId) { + throw new InnertubeError("PlaylistId from TrackInfo does not match with PlaylistPanel"); + } + const watch_next_endpoint = new NavigationEndpoint({ watchNextEndpoint: { ...this.current_video_endpoint.payload, continuation: playlistPanel.continuation } }); + const response = await watch_next_endpoint.call(this.actions, { ...this.current_video_endpoint.payload, continuation: playlistPanel.continuation, client: "YTMUSIC", parse: true }); + const playlistCont = (_a = response.continuation_contents) == null ? void 0 : _a.as(PlaylistPanelContinuation); + if (!playlistCont) + throw new InnertubeError("No PlaylistPanel Continuation available.", response); + return playlistCont; + } + /** + * Retrieves related content. + */ + async getRelated() { + return await this.getTab("MUSIC_PAGE_TYPE_TRACK_RELATED"); + } + /** + * Retrieves lyrics. + */ + async getLyrics() { + const tab = await this.getTab("MUSIC_PAGE_TYPE_TRACK_LYRICS"); + return tab.firstOfType(MusicDescriptionShelf); + } + /** + * Adds the song to the watch history. + */ + async addToWatchHistory() { + return super.addToWatchHistory(Constants_exports.CLIENTS.YTMUSIC.NAME, Constants_exports.CLIENTS.YTMUSIC.VERSION, "https://music."); + } + /** + * Updates the watch time of the song. + */ + async updateWatchTime(startTime) { + return super.updateWatchTime(startTime, Constants_exports.CLIENTS.YTMUSIC.NAME, Constants_exports.CLIENTS.YTMUSIC.VERSION, "https://music."); + } + get available_tabs() { + return this.tabs ? this.tabs.map((tab) => tab.title) : []; + } +}; +__name(_TrackInfo, "TrackInfo"); +var TrackInfo = _TrackInfo; +var TrackInfo_default = TrackInfo; + +// dist/src/parser/ytkids/index.js +var ytkids_exports = {}; +__export(ytkids_exports, { + Channel: () => Channel3, + HomeFeed: () => HomeFeed3, + Search: () => Search3, + VideoInfo: () => VideoInfo2 +}); + +// dist/src/parser/ytkids/Channel.js +var _Channel3 = class _Channel3 extends Feed { + constructor(actions, data, already_parsed = false) { + var _a, _b; + super(actions, data, already_parsed); + __publicField(this, "header"); + __publicField(this, "contents"); + this.header = (_a = this.page.header) == null ? void 0 : _a.item().as(C4TabbedHeader); + this.contents = this.memo.getType(ItemSection)[0] || ((_b = this.page.continuation_contents) == null ? void 0 : _b.as(ItemSectionContinuation)); + } + /** + * Retrieves next batch of content. + */ + async getContinuation() { + if (!this.contents) + throw new Error("No continuation available."); + const continuation_request = new NavigationEndpoint({ + continuationCommand: { + token: this.contents.continuation, + request: "CONTINUATION_REQUEST_TYPE_BROWSE" + } + }); + const continuation_response = await continuation_request.call(this.actions, { client: "YTKIDS" }); + return new _Channel3(this.actions, continuation_response); + } + get has_continuation() { + var _a; + return !!((_a = this.contents) == null ? void 0 : _a.continuation); + } +}; +__name(_Channel3, "Channel"); +var Channel3 = _Channel3; + +// dist/src/parser/ytkids/HomeFeed.js +var _HomeFeed3 = class _HomeFeed3 extends Feed { + constructor(actions, data, already_parsed = false) { + var _a, _b; + super(actions, data, already_parsed); + __publicField(this, "header"); + __publicField(this, "contents"); + this.header = (_a = this.page.header) == null ? void 0 : _a.item().as(KidsCategoriesHeader); + this.contents = (_b = this.page.contents) == null ? void 0 : _b.item().as(KidsHomeScreen); + } + /** + * Retrieves the contents of the given category tab. Use {@link HomeFeed.categories} to get a list of available categories. + * @param tab - The tab to select + */ + async selectCategoryTab(tab) { + var _a; + let target_tab; + if (typeof tab === "string") { + target_tab = (_a = this.header) == null ? void 0 : _a.category_tabs.find((t) => t.title.toString() === tab); + } else if (tab == null ? void 0 : tab.is(KidsCategoryTab)) { + target_tab = tab; + } + if (!target_tab) + throw new InnertubeError(`Tab "${tab}" not found`); + const page = await target_tab.endpoint.call(this.actions, { client: "YTKIDS", parse: true }); + page.header = this.page.header; + page.header_memo = this.page.header_memo; + return new _HomeFeed3(this.actions, page, true); + } + get categories() { + var _a; + return ((_a = this.header) == null ? void 0 : _a.category_tabs.map((tab) => tab.title.toString())) || []; + } +}; +__name(_HomeFeed3, "HomeFeed"); +var HomeFeed3 = _HomeFeed3; + +// dist/src/parser/ytkids/Search.js +var _Search3 = class _Search3 extends Feed { + constructor(actions, data) { + super(actions, data); + __publicField(this, "estimated_results"); + __publicField(this, "contents"); + this.estimated_results = this.page.estimated_results; + const item_section = this.memo.getType(ItemSection)[0]; + if (!item_section) + throw new InnertubeError("No item section found in search response."); + this.contents = item_section.contents; + } +}; +__name(_Search3, "Search"); +var Search3 = _Search3; + +// dist/src/parser/ytkids/VideoInfo.js +var _VideoInfo2 = class _VideoInfo2 extends MediaInfo { + constructor(data, actions, cpn) { + var _a, _b, _c, _d, _e; + super(data, actions, cpn); + __publicField(this, "slim_video_metadata"); + __publicField(this, "watch_next_feed"); + __publicField(this, "current_video_endpoint"); + __publicField(this, "player_overlays"); + const next = this.page[1]; + const two_col = (_a = next == null ? void 0 : next.contents) == null ? void 0 : _a.item().as(TwoColumnWatchNextResults); + const results = two_col == null ? void 0 : two_col.results; + const secondary_results = two_col == null ? void 0 : two_col.secondary_results; + if (results && secondary_results) { + this.slim_video_metadata = (_c = (_b = results.firstOfType(ItemSection)) == null ? void 0 : _b.contents) == null ? void 0 : _c.firstOfType(SlimVideoMetadata); + this.watch_next_feed = ((_d = secondary_results.firstOfType(ItemSection)) == null ? void 0 : _d.contents) || secondary_results; + this.current_video_endpoint = next == null ? void 0 : next.current_video_endpoint; + this.player_overlays = (_e = next == null ? void 0 : next.player_overlays) == null ? void 0 : _e.item().as(PlayerOverlay); + } + } +}; +__name(_VideoInfo2, "VideoInfo"); +var VideoInfo2 = _VideoInfo2; + +// dist/src/parser/ytshorts/index.js +var ytshorts_exports = {}; +__export(ytshorts_exports, { + ShortFormVideoInfo: () => ShortFormVideoInfo +}); + +// dist/src/parser/ytshorts/ShortFormVideoInfo.js +var _watch_next_continuation2; +var _ShortFormVideoInfo = class _ShortFormVideoInfo extends MediaInfo { + constructor(data, actions, cpn, reel_watch_sequence_response) { + var _a; + super(data, actions, cpn); + __privateAdd(this, _watch_next_continuation2); + __publicField(this, "watch_next_feed"); + __publicField(this, "current_video_endpoint"); + __publicField(this, "player_overlays"); + if (reel_watch_sequence_response) { + const reel_watch_sequence = parser_exports.parseResponse(reel_watch_sequence_response.data); + if (reel_watch_sequence.entries) + this.watch_next_feed = reel_watch_sequence.entries; + if (reel_watch_sequence.continuation_endpoint) + __privateSet(this, _watch_next_continuation2, (_a = reel_watch_sequence.continuation_endpoint) == null ? void 0 : _a.as(ContinuationCommand2)); + } + } + async getWatchNextContinuation() { + var _a; + if (!__privateGet(this, _watch_next_continuation2)) + throw new InnertubeError("Continuation not found"); + const response = await this.actions.execute("/reel/reel_watch_sequence", { + sequenceParams: __privateGet(this, _watch_next_continuation2).token, + parse: true + }); + if (response.entries) + this.watch_next_feed = response.entries; + __privateSet(this, _watch_next_continuation2, (_a = response.continuation_endpoint) == null ? void 0 : _a.as(ContinuationCommand2)); + return this; + } + /** + * Checks if continuation is available for the watch next feed. + */ + get wn_has_continuation() { + return !!__privateGet(this, _watch_next_continuation2); + } +}; +_watch_next_continuation2 = new WeakMap(); +__name(_ShortFormVideoInfo, "ShortFormVideoInfo"); +var ShortFormVideoInfo = _ShortFormVideoInfo; + +// dist/src/parser/classes/misc/Author.js +var _Author = class _Author { + constructor(item, badges, thumbs, id) { + __publicField(this, "id"); + __publicField(this, "name"); + __publicField(this, "thumbnails"); + __publicField(this, "endpoint"); + __publicField(this, "badges"); + __publicField(this, "is_moderator"); + __publicField(this, "is_verified"); + __publicField(this, "is_verified_artist"); + __publicField(this, "url"); + var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A; + const nav_text = new Text2(item); + this.id = id || ((_d = (_c = (_b = (_a = nav_text == null ? void 0 : nav_text.runs) == null ? void 0 : _a[0]) == null ? void 0 : _b.endpoint) == null ? void 0 : _c.payload) == null ? void 0 : _d.browseId) || ((_f = (_e = nav_text == null ? void 0 : nav_text.endpoint) == null ? void 0 : _e.payload) == null ? void 0 : _f.browseId) || "N/A"; + this.name = (nav_text == null ? void 0 : nav_text.text) || "N/A"; + this.thumbnails = thumbs ? Thumbnail.fromResponse(thumbs) : []; + this.endpoint = ((_h = (_g = nav_text == null ? void 0 : nav_text.runs) == null ? void 0 : _g[0]) == null ? void 0 : _h.endpoint) || (nav_text == null ? void 0 : nav_text.endpoint); + if (badges) { + if (Array.isArray(badges)) { + this.badges = parser_exports.parseArray(badges); + this.is_moderator = (_i = this.badges) == null ? void 0 : _i.some((badge) => badge.icon_type == "MODERATOR"); + this.is_verified = (_j = this.badges) == null ? void 0 : _j.some((badge) => badge.style == "BADGE_STYLE_TYPE_VERIFIED"); + this.is_verified_artist = (_k = this.badges) == null ? void 0 : _k.some((badge) => badge.style == "BADGE_STYLE_TYPE_VERIFIED_ARTIST"); + } else { + this.badges = observe([]); + this.is_verified = !!badges.isVerified; + this.is_verified_artist = !!badges.isArtist; + } + } else { + this.badges = observe([]); + } + this.url = ((_o = (_n = (_m = (_l = nav_text == null ? void 0 : nav_text.runs) == null ? void 0 : _l[0]) == null ? void 0 : _m.endpoint) == null ? void 0 : _n.metadata) == null ? void 0 : _o.api_url) === "/browse" && `${URLS.YT_BASE}${((_s = (_r = (_q = (_p = nav_text == null ? void 0 : nav_text.runs) == null ? void 0 : _p[0]) == null ? void 0 : _q.endpoint) == null ? void 0 : _r.payload) == null ? void 0 : _s.canonicalBaseUrl) || `/u/${(_w = (_v = (_u = (_t = nav_text == null ? void 0 : nav_text.runs) == null ? void 0 : _t[0]) == null ? void 0 : _u.endpoint) == null ? void 0 : _v.payload) == null ? void 0 : _w.browseId}`}` || `${URLS.YT_BASE}${((_y = (_x = nav_text == null ? void 0 : nav_text.endpoint) == null ? void 0 : _x.payload) == null ? void 0 : _y.canonicalBaseUrl) || `/u/${(_A = (_z = nav_text == null ? void 0 : nav_text.endpoint) == null ? void 0 : _z.payload) == null ? void 0 : _A.browseId}`}`; + } + get best_thumbnail() { + return this.thumbnails[0]; + } +}; +__name(_Author, "Author"); +var Author = _Author; + +// dist/src/utils/user-agents.js +var user_agents_default = { + "desktop": [ + "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36 Edg/141.0.0.0", + "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36", + "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6.1 Safari/605.1.15", + "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36 Edg/141.0.0.0", + "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36 OPR/121.0.0.0", + "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36", + "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36", + "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36", + "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.6 Safari/605.1.15", + "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36", + "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36", + "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36", + "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36", + "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36", + "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36", + "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36", + "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36", + "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36", + "Mozilla/5.0 (X11; CrOS x86_64 14541.0.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36", + "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36 OPR/121.0.0.0", + "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0.1 Safari/605.1.15", + "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36 OPR/122.0.0.0", + "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36 Edg/141.0.0.0", + "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36", + "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36", + "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36" + ], + "mobile": [ + "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Mobile Safari/537.36", + "Mozilla/5.0 (iPhone; CPU iPhone OS 18_6_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.6 Mobile/15E148 Safari/604.1", + "Mozilla/5.0 (iPhone; CPU iPhone OS 15_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.6 Mobile/15E148 Safari/604.1", + "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Mobile Safari/537.36", + "Mozilla/5.0 (iPhone; CPU iPhone OS 18_6_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.6 Mobile/15E148 Safari/604.1", + "Mozilla/5.0 (iPhone; CPU iPhone OS 16_6_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6 Mobile/15E148 Safari/604.1", + "Mozilla/5.0 (iPhone; CPU iPhone OS 18_6_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.6 Mobile/15E148 Safari/604.1", + "Mozilla/5.0 (iPhone; CPU iPhone OS 18_6_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) GSA/388.0.811331708 Mobile/15E148 Safari/604.1", + "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Mobile Safari/537.36", + "Mozilla/5.0 (iPhone; CPU iPhone OS 18_6_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.6 Mobile/15E148 Safari/604.1", + "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) GSA/388.0.811331708 Mobile/15E148 Safari/604.1", + "Mozilla/5.0 (iPhone; CPU iPhone OS 18_6_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.6 Mobile/15E148 Safari/604.1", + "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Mobile Safari/537.36", + "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Mobile Safari/537.36", + "Mozilla/5.0 (iPhone; CPU iPhone OS 18_6_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.6 Mobile/15E148 Safari/604.1", + "Mozilla/5.0 (iPhone; CPU iPhone OS 18_6_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.6 Mobile/15E148 Safari/604.1", + "Mozilla/5.0 (iPhone; CPU iPhone OS 18_6_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.6 Mobile/15E148 Safari/604.1", + "Mozilla/5.0 (iPhone; CPU iPhone OS 18_6_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.6 Mobile/15E148 Safari/604.1", + "Mozilla/5.0 (iPhone; CPU iPhone OS 18_6_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) GSA/388.0.811331708 Mobile/15E148 Safari/604.1", + "Mozilla/5.0 (iPhone; CPU iPhone OS 18_6_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.6 Mobile/15E148 Safari/604.1", + "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0.1 Mobile/15E148 Safari/604.1", + "Mozilla/5.0 (iPhone; CPU iPhone OS 18_6_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.6 Mobile/15E148 Safari/604.1", + "Mozilla/5.0 (iPhone; CPU iPhone OS 18_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.5 Mobile/15E148 Safari/604.1", + "Mozilla/5.0 (iPhone; CPU iPhone OS 18_6_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.6 Mobile/15E148 Safari/604.1", + "Mozilla/5.0 (iPhone; CPU iPhone OS 18_6_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) GSA/388.0.811331708 Mobile/15E148 Safari/604.1", + "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0.1 Mobile/15E148 Safari/604.1" + ] +}; + +// dist/src/utils/Utils.js +var TAG_2 = "Utils"; +var shim; +var _Platform = class _Platform { + static load(platform) { + shim = platform; + } + static get shim() { + if (!shim) { + throw new Error("Platform is not loaded"); + } + return shim; + } +}; +__name(_Platform, "Platform"); +var Platform = _Platform; +var _InnertubeError = class _InnertubeError extends Error { + constructor(message, info2) { + super(message); + __publicField(this, "date"); + __publicField(this, "version"); + __publicField(this, "info"); + if (info2) { + this.info = info2; + } + this.date = /* @__PURE__ */ new Date(); + this.version = package_default.version; + } +}; +__name(_InnertubeError, "InnertubeError"); +var InnertubeError = _InnertubeError; +var _ParsingError = class _ParsingError extends InnertubeError { +}; +__name(_ParsingError, "ParsingError"); +var ParsingError = _ParsingError; +var _MissingParamError = class _MissingParamError extends InnertubeError { +}; +__name(_MissingParamError, "MissingParamError"); +var MissingParamError = _MissingParamError; +var _OAuth2Error = class _OAuth2Error extends InnertubeError { +}; +__name(_OAuth2Error, "OAuth2Error"); +var OAuth2Error = _OAuth2Error; +var _PlayerError = class _PlayerError extends Error { +}; +__name(_PlayerError, "PlayerError"); +var PlayerError = _PlayerError; +var _SessionError = class _SessionError extends Error { +}; +__name(_SessionError, "SessionError"); +var SessionError = _SessionError; +var _ChannelError = class _ChannelError extends Error { +}; +__name(_ChannelError, "ChannelError"); +var ChannelError = _ChannelError; +function deepCompare(obj1, obj2) { + const keys = Reflect.ownKeys(obj1); + return keys.some((key) => { + const is_text = obj2[key] instanceof Text2; + if (!is_text && typeof obj2[key] === "object") { + return JSON.stringify(obj1[key]) === JSON.stringify(obj2[key]); + } + return obj1[key] === (is_text ? obj2[key].toString() : obj2[key]); + }); +} +__name(deepCompare, "deepCompare"); +function getStringBetweenStrings(data, start_string, end_string) { + const regex = new RegExp(`${escapeStringRegexp(start_string)}(.*?)${escapeStringRegexp(end_string)}`, "s"); + const match = data.match(regex); + return match ? match[1] : void 0; +} +__name(getStringBetweenStrings, "getStringBetweenStrings"); +function escapeStringRegexp(input) { + return input.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d"); +} +__name(escapeStringRegexp, "escapeStringRegexp"); +function getRandomUserAgent(type) { + const available_agents = user_agents_default[type]; + const random_index = Math.floor(Math.random() * available_agents.length); + return available_agents[random_index]; +} +__name(getRandomUserAgent, "getRandomUserAgent"); +async function generateSidAuth(sid) { + const youtube = "https://www.youtube.com"; + const timestamp = Math.floor((/* @__PURE__ */ new Date()).getTime() / 1e3); + const input = [timestamp, sid, youtube].join(" "); + const gen_hash = await Platform.shim.sha1Hash(input); + return ["SAPISIDHASH", [timestamp, gen_hash].join("_")].join(" "); +} +__name(generateSidAuth, "generateSidAuth"); +function generateRandomString(length) { + const result = []; + const alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"; + for (let i = 0; i < length; i++) { + result.push(alphabet.charAt(Math.floor(Math.random() * alphabet.length))); + } + return result.join(""); +} +__name(generateRandomString, "generateRandomString"); +function timeToSeconds(time) { + const params = time.split(":").map((param) => parseInt(param.replace(/\D/g, ""))); + switch (params.length) { + case 1: + return params[0]; + case 2: + return params[0] * 60 + params[1]; + case 3: + return params[0] * 3600 + params[1] * 60 + params[2]; + default: + throw new Error("Invalid time string"); + } +} +__name(timeToSeconds, "timeToSeconds"); +function concatMemos(...iterables) { + const memo = new Memo(); + for (const iterable of iterables) { + if (!iterable) + continue; + for (const item of iterable) { + const memo_item = memo.get(item[0]); + if (memo_item) { + memo.set(item[0], [...memo_item, ...item[1]]); + continue; + } + memo.set(...item); + } + } + return memo; +} +__name(concatMemos, "concatMemos"); +function throwIfMissing(params) { + for (const [key, value] of Object.entries(params)) { + if (!value) + throw new MissingParamError(`${key} is missing`); + } +} +__name(throwIfMissing, "throwIfMissing"); +function hasKeys(params, ...keys) { + for (const key of keys) { + if (!Reflect.has(params, key) || params[key] === void 0) + return false; + } + return true; +} +__name(hasKeys, "hasKeys"); +async function* streamToIterable(stream) { + const reader = stream.getReader(); + try { + while (true) { + const { done, value } = await reader.read(); + if (done) { + return; + } + yield value; + } + } finally { + reader.releaseLock(); + } +} +__name(streamToIterable, "streamToIterable"); +var debugFetch = /* @__PURE__ */ __name((input, init) => { + const url = typeof input === "string" ? new URL(input) : input instanceof URL ? input : new URL(input.url); + const headers = (init == null ? void 0 : init.headers) ? new Headers(init.headers) : input instanceof Request ? input.headers : new Headers(); + const arr_headers = [...headers]; + const body_contents = (init == null ? void 0 : init.body) ? typeof init.body === "string" ? headers.get("content-type") === "application/json" ? JSON.stringify(JSON.parse(init.body), null, 2) : ( + // Body is string and json + init.body + ) : ( + // Body is string + " " + ) : ( + // Body is not string + " (none)" + ); + const headers_serialized = arr_headers.length > 0 ? `${arr_headers.map(([key, value]) => ` ${key}: ${value}`).join("\n")}` : " (none)"; + warn(TAG_2, `Fetch: + url: ${url.toString()} + method: ${(init == null ? void 0 : init.method) || "GET"} + headers: +${headers_serialized} +' + + ' body: +${body_contents}`); + return Platform.shim.fetch(input, init); +}, "debugFetch"); +function u8ToBase64(u8) { + return btoa(String.fromCharCode.apply(null, Array.from(u8))); +} +__name(u8ToBase64, "u8ToBase64"); +function base64ToU8(base64) { + const standard_base64 = base64.replace(/-/g, "+").replace(/_/g, "/"); + const padded_base64 = standard_base64.padEnd(standard_base64.length + (4 - standard_base64.length % 4) % 4, "="); + return new Uint8Array(atob(padded_base64).split("").map((char) => char.charCodeAt(0))); +} +__name(base64ToU8, "base64ToU8"); +function isTextRun(run) { + return !("emoji" in run); +} +__name(isTextRun, "isTextRun"); +function getCookie(cookies, name, matchWholeName = false) { + const regex = matchWholeName ? `(^|\\s?)\\b${name}\\b=([^;]+)` : `(^|s?)${name}=([^;]+)`; + const match = cookies.match(new RegExp(regex)); + return match ? match[2] : void 0; +} +__name(getCookie, "getCookie"); +function getNsigProcessorFn(n, sp, s) { + return `function process(n = "", sp = "", s = "") { + const mockStreamingURL = "https://ytjs.googlevideo.com/videoplayback?expire=1234567890&"+"n="+encodeURIComponent(n); + const urlCtorFunction = exportedVars.nsigFunction || (() => { throw new Error('No n/sig decipher function extracted') }); + const urlCtor = urlCtorFunction(mockStreamingURL, sp, s); + + const proto = Object.getPrototypeOf(urlCtor); + const properties = Object.getOwnPropertyNames(proto); + const methodBlacklist = ['constructor', 'clone', 'set', 'get']; + + for (const prop of properties) { + if (methodBlacklist.includes(prop)) + continue; + + if (typeof urlCtor[prop] === 'function') + urlCtor[prop](); + } + + const sigResult = urlCtor.get(sp); + const nResult = urlCtor.get('n'); + + return { + sig: sigResult ? decodeURIComponent(sigResult) : undefined, + n: nResult ? decodeURIComponent(nResult) : undefined + }; +} + +return process("${n || ""}", "${sp || ""}", "${s || ""}");`; +} +__name(getNsigProcessorFn, "getNsigProcessorFn"); + +// dist/src/platform/polyfills/web-crypto.js +async function sha1Hash(str) { + const byteToHex = [ + "00", + "01", + "02", + "03", + "04", + "05", + "06", + "07", + "08", + "09", + "0a", + "0b", + "0c", + "0d", + "0e", + "0f", + "10", + "11", + "12", + "13", + "14", + "15", + "16", + "17", + "18", + "19", + "1a", + "1b", + "1c", + "1d", + "1e", + "1f", + "20", + "21", + "22", + "23", + "24", + "25", + "26", + "27", + "28", + "29", + "2a", + "2b", + "2c", + "2d", + "2e", + "2f", + "30", + "31", + "32", + "33", + "34", + "35", + "36", + "37", + "38", + "39", + "3a", + "3b", + "3c", + "3d", + "3e", + "3f", + "40", + "41", + "42", + "43", + "44", + "45", + "46", + "47", + "48", + "49", + "4a", + "4b", + "4c", + "4d", + "4e", + "4f", + "50", + "51", + "52", + "53", + "54", + "55", + "56", + "57", + "58", + "59", + "5a", + "5b", + "5c", + "5d", + "5e", + "5f", + "60", + "61", + "62", + "63", + "64", + "65", + "66", + "67", + "68", + "69", + "6a", + "6b", + "6c", + "6d", + "6e", + "6f", + "70", + "71", + "72", + "73", + "74", + "75", + "76", + "77", + "78", + "79", + "7a", + "7b", + "7c", + "7d", + "7e", + "7f", + "80", + "81", + "82", + "83", + "84", + "85", + "86", + "87", + "88", + "89", + "8a", + "8b", + "8c", + "8d", + "8e", + "8f", + "90", + "91", + "92", + "93", + "94", + "95", + "96", + "97", + "98", + "99", + "9a", + "9b", + "9c", + "9d", + "9e", + "9f", + "a0", + "a1", + "a2", + "a3", + "a4", + "a5", + "a6", + "a7", + "a8", + "a9", + "aa", + "ab", + "ac", + "ad", + "ae", + "af", + "b0", + "b1", + "b2", + "b3", + "b4", + "b5", + "b6", + "b7", + "b8", + "b9", + "ba", + "bb", + "bc", + "bd", + "be", + "bf", + "c0", + "c1", + "c2", + "c3", + "c4", + "c5", + "c6", + "c7", + "c8", + "c9", + "ca", + "cb", + "cc", + "cd", + "ce", + "cf", + "d0", + "d1", + "d2", + "d3", + "d4", + "d5", + "d6", + "d7", + "d8", + "d9", + "da", + "db", + "dc", + "dd", + "de", + "df", + "e0", + "e1", + "e2", + "e3", + "e4", + "e5", + "e6", + "e7", + "e8", + "e9", + "ea", + "eb", + "ec", + "ed", + "ee", + "ef", + "f0", + "f1", + "f2", + "f3", + "f4", + "f5", + "f6", + "f7", + "f8", + "f9", + "fa", + "fb", + "fc", + "fd", + "fe", + "ff" + ]; + function hex(arrayBuffer) { + const buff = new Uint8Array(arrayBuffer); + const hexOctets = []; + for (let i = 0; i < buff.length; ++i) + hexOctets.push(byteToHex[buff[i]]); + return hexOctets.join(""); + } + __name(hex, "hex"); + return hex(await crypto.subtle.digest("SHA-1", new TextEncoder().encode(str))); +} +__name(sha1Hash, "sha1Hash"); + +// dist/src/platform/jsruntime/default.js +function evaluate(_data23, _env) { + throw new Error("To decipher URLs, you must provide your own JavaScript evaluator. See https://ytjs.dev/guide/getting-started.html#providing-a-custom-javascript-interpreter for more details."); +} +__name(evaluate, "evaluate"); + +// dist/src/core/Actions.js +var _Actions_instances, isBrowse_fn, needsLogin_fn; +var _Actions = class _Actions { + constructor(session) { + __privateAdd(this, _Actions_instances); + __publicField(this, "session"); + this.session = session; + } + /** + * Makes calls to the playback tracking API. + * @param url - The URL to call. + * @param client - The client to use. + * @param params - Call parameters. + */ + async stats(url, client, params) { + const s_url = new URL(url); + s_url.searchParams.set("ver", "2"); + s_url.searchParams.set("c", client.client_name.toLowerCase()); + s_url.searchParams.set("cbrver", client.client_version); + s_url.searchParams.set("cver", client.client_version); + for (const key of Object.keys(params)) { + s_url.searchParams.set(key, params[key]); + } + return await this.session.http.fetch(s_url); + } + async execute(endpoint, args) { + var _a, _b; + let data; + if (args && !args.protobuf) { + data = { ...args }; + if (Reflect.has(data, "browseId") && !args.skip_auth_check) { + if (__privateMethod(this, _Actions_instances, needsLogin_fn).call(this, data.browseId) && !this.session.logged_in) + throw new InnertubeError("You must be signed in to perform this operation."); + } + if (Reflect.has(data, "skip_auth_check")) + delete data.skip_auth_check; + if (Reflect.has(data, "override_endpoint")) + delete data.override_endpoint; + if (Reflect.has(data, "parse")) + delete data.parse; + if (Reflect.has(data, "request")) + delete data.request; + if (Reflect.has(data, "clientActions")) + delete data.clientActions; + if (Reflect.has(data, "settingItemIdForClient")) + delete data.settingItemIdForClient; + if (Reflect.has(data, "action")) { + data.actions = [data.action]; + delete data.action; + } + if (Reflect.has(data, "boolValue")) { + data.newValue = { boolValue: data.boolValue }; + delete data.boolValue; + } + if (Reflect.has(data, "token")) { + data.continuation = data.token; + delete data.token; + } + if ((data == null ? void 0 : data.client) === "YTMUSIC") { + data.isAudioOnly = true; + } + } else if (args) { + data = args.serialized_data; + } + const target_endpoint = Reflect.has(args || {}, "override_endpoint") ? args == null ? void 0 : args.override_endpoint : endpoint; + const response = await this.session.http.fetch(target_endpoint, { + method: "POST", + body: (args == null ? void 0 : args.protobuf) ? data : JSON.stringify(data || {}), + headers: { + "Content-Type": (args == null ? void 0 : args.protobuf) ? "application/x-protobuf" : "application/json" + } + }); + if (args == null ? void 0 : args.parse) { + let parsed_response = parser_exports.parseResponse(await response.json()); + if (__privateMethod(this, _Actions_instances, isBrowse_fn).call(this, parsed_response) && ((_b = (_a = parsed_response.on_response_received_actions) == null ? void 0 : _a[0]) == null ? void 0 : _b.type) === "navigateAction") { + const navigate_action = parsed_response.on_response_received_actions.firstOfType(NavigateAction); + if (navigate_action) { + parsed_response = await navigate_action.endpoint.call(this, { parse: true }); + } + } + return parsed_response; + } + return { + success: response.ok, + status_code: response.status, + data: await response.json() + }; + } +}; +_Actions_instances = new WeakSet(); +isBrowse_fn = /* @__PURE__ */ __name(function(response) { + return "on_response_received_actions" in response; +}, "#isBrowse"); +needsLogin_fn = /* @__PURE__ */ __name(function(id) { + return [ + "FElibrary", + "FEhistory", + "FEsubscriptions", + "FEchannels", + "FEplaylist_aggregation", + "FEmusic_listening_review", + "FEmusic_library_landing", + "SPaccount_overview", + "SPaccount_notifications", + "SPaccount_privacy", + "SPtime_watched" + ].includes(id); +}, "#needsLogin"); +__name(_Actions, "Actions"); +var Actions = _Actions; + +// dist/src/core/OAuth2.js +var TAG3 = "OAuth2"; +var _session2, _OAuth2_instances, loadFromCache_fn, http_get; +var _OAuth2 = class _OAuth2 { + constructor(session) { + __privateAdd(this, _OAuth2_instances); + __privateAdd(this, _session2); + __publicField(this, "YTTV_URL"); + __publicField(this, "AUTH_SERVER_CODE_URL"); + __publicField(this, "AUTH_SERVER_TOKEN_URL"); + __publicField(this, "AUTH_SERVER_REVOKE_TOKEN_URL"); + __publicField(this, "client_id"); + __publicField(this, "oauth2_tokens"); + __privateSet(this, _session2, session); + this.YTTV_URL = new URL("/tv", Constants_exports.URLS.YT_BASE); + this.AUTH_SERVER_CODE_URL = new URL("/o/oauth2/device/code", Constants_exports.URLS.YT_BASE); + this.AUTH_SERVER_TOKEN_URL = new URL("/o/oauth2/token", Constants_exports.URLS.YT_BASE); + this.AUTH_SERVER_REVOKE_TOKEN_URL = new URL("/o/oauth2/revoke", Constants_exports.URLS.YT_BASE); + } + async init(tokens) { + if (tokens) { + this.setTokens(tokens); + if (this.shouldRefreshToken()) { + await this.refreshAccessToken(); + } + __privateGet(this, _session2).emit("auth", { credentials: this.oauth2_tokens }); + return; + } + const loaded_from_cache = await __privateMethod(this, _OAuth2_instances, loadFromCache_fn).call(this); + if (loaded_from_cache) { + Log_exports.info(TAG3, "Loaded OAuth2 tokens from cache.", this.oauth2_tokens); + return; + } + if (!this.client_id) + this.client_id = await this.getClientID(); + const device_and_user_code = await this.getDeviceAndUserCode(); + __privateGet(this, _session2).emit("auth-pending", device_and_user_code); + this.pollForAccessToken(device_and_user_code); + } + setTokens(tokens) { + const tokensMod = tokens; + if (tokensMod.expires_in) { + tokensMod.expiry_date = new Date(Date.now() + tokensMod.expires_in * 1e3).toISOString(); + delete tokensMod.expires_in; + } + if (!this.validateTokens(tokensMod)) + throw new OAuth2Error("Invalid tokens provided."); + this.oauth2_tokens = tokensMod; + if (tokensMod.client) { + Log_exports.info(TAG3, "Using provided client id and secret."); + this.client_id = tokensMod.client; + } + } + async cacheCredentials() { + var _a; + const encoder = new TextEncoder(); + const data = encoder.encode(JSON.stringify(this.oauth2_tokens)); + await ((_a = __privateGet(this, _session2).cache) == null ? void 0 : _a.set("youtubei_oauth_credentials", data.buffer)); + } + async removeCache() { + var _a; + await ((_a = __privateGet(this, _session2).cache) == null ? void 0 : _a.remove("youtubei_oauth_credentials")); + } + pollForAccessToken(device_and_user_code) { + if (!this.client_id) + throw new OAuth2Error("Client ID is missing."); + const { device_code, interval } = device_and_user_code; + const { client_id, client_secret } = this.client_id; + const payload = { + client_id, + client_secret, + code: device_code, + grant_type: "http://oauth.net/grant_type/device/1.0" + }; + const connInterval = setInterval(async () => { + const response = await __privateGet(this, _OAuth2_instances, http_get).fetch_function(this.AUTH_SERVER_TOKEN_URL, { + body: JSON.stringify(payload), + method: "POST", + headers: { + "Content-Type": "application/json" + } + }); + const response_data = await response.json(); + if (response_data.error) { + switch (response_data.error) { + case "access_denied": + __privateGet(this, _session2).emit("auth-error", new OAuth2Error("Access was denied.", response_data)); + clearInterval(connInterval); + break; + case "expired_token": + __privateGet(this, _session2).emit("auth-error", new OAuth2Error("The device code has expired.", response_data)); + clearInterval(connInterval); + break; + case "authorization_pending": + case "slow_down": + Log_exports.info(TAG3, "Polling for access token..."); + break; + default: + __privateGet(this, _session2).emit("auth-error", new OAuth2Error("Server returned an unexpected error.", response_data)); + clearInterval(connInterval); + break; + } + return; + } + this.setTokens(response_data); + __privateGet(this, _session2).emit("auth", { credentials: this.oauth2_tokens }); + clearInterval(connInterval); + }, interval * 1e3); + } + async revokeCredentials() { + if (!this.oauth2_tokens) + throw new OAuth2Error("Access token not found"); + await this.removeCache(); + const url = this.AUTH_SERVER_REVOKE_TOKEN_URL; + url.searchParams.set("token", this.oauth2_tokens.access_token); + return __privateGet(this, _session2).http.fetch_function(url, { method: "POST" }); + } + async refreshAccessToken() { + if (!this.client_id) + this.client_id = await this.getClientID(); + if (!this.oauth2_tokens) + throw new OAuth2Error("No tokens available to refresh."); + const { client_id, client_secret } = this.client_id; + const { refresh_token } = this.oauth2_tokens; + const payload = { + client_id, + client_secret, + refresh_token, + grant_type: "refresh_token" + }; + const response = await __privateGet(this, _OAuth2_instances, http_get).fetch_function(this.AUTH_SERVER_TOKEN_URL, { + body: JSON.stringify(payload), + method: "POST", + headers: { + "Content-Type": "application/json" + } + }); + if (!response.ok) + throw new OAuth2Error(`Failed to refresh access token: ${response.status}`); + const response_data = await response.json(); + if (response_data.error_code) + throw new OAuth2Error("Authorization server returned an error", response_data); + this.oauth2_tokens.access_token = response_data.access_token; + this.oauth2_tokens.expiry_date = new Date(Date.now() + response_data.expires_in * 1e3).toISOString(); + __privateGet(this, _session2).emit("update-credentials", { credentials: this.oauth2_tokens }); + } + async getDeviceAndUserCode() { + if (!this.client_id) + throw new OAuth2Error("Client ID is missing."); + const { client_id } = this.client_id; + const payload = { + client_id, + scope: "http://gdata.youtube.com https://www.googleapis.com/auth/youtube-paid-content", + device_id: Platform.shim.uuidv4(), + device_model: "ytlr::" + }; + const response = await __privateGet(this, _OAuth2_instances, http_get).fetch_function(this.AUTH_SERVER_CODE_URL, { + body: JSON.stringify(payload), + method: "POST", + headers: { + "Content-Type": "application/json" + } + }); + if (!response.ok) + throw new OAuth2Error(`Failed to get device/user code: ${response.status}`); + const response_data = await response.json(); + if (response_data.error_code) + throw new OAuth2Error("Authorization server returned an error", response_data); + return response_data; + } + async getClientID() { + const yttv_response = await __privateGet(this, _OAuth2_instances, http_get).fetch_function(this.YTTV_URL, { + headers: { + "User-Agent": "Mozilla/5.0 (ChromiumStylePlatform) Cobalt/Version", + "Referer": "https://www.youtube.com/tv", + "Accept-Language": "en-US" + } + }); + if (!yttv_response.ok) + throw new OAuth2Error(`Failed to get client ID: ${yttv_response.status}`); + const yttv_response_data = await yttv_response.text(); + let script_url_body; + if ((script_url_body = Constants_exports.OAUTH.REGEX.TV_SCRIPT.exec(yttv_response_data)) !== null) { + Log_exports.info(TAG3, `Got YouTubeTV script URL (${script_url_body[1]})`); + const script_response = await __privateGet(this, _OAuth2_instances, http_get).fetch(script_url_body[1], { baseURL: Constants_exports.URLS.YT_BASE }); + if (!script_response.ok) + throw new OAuth2Error(`TV script request failed with status code ${script_response.status}`); + const script_response_data = await script_response.text(); + const client_identity = script_response_data.match(Constants_exports.OAUTH.REGEX.CLIENT_IDENTITY); + if (!client_identity || !client_identity.groups) + throw new OAuth2Error("Could not obtain client ID."); + const { client_id, client_secret } = client_identity.groups; + Log_exports.info(TAG3, `Client identity retrieved (clientId=${client_id}, clientSecret=${client_secret}).`); + return { + client_id, + client_secret + }; + } + throw new OAuth2Error("Could not obtain script URL."); + } + shouldRefreshToken() { + if (!this.oauth2_tokens) + return false; + return Date.now() > new Date(this.oauth2_tokens.expiry_date).getTime(); + } + validateTokens(tokens) { + return !(!tokens.access_token || !tokens.refresh_token || !tokens.expiry_date); + } +}; +_session2 = new WeakMap(); +_OAuth2_instances = new WeakSet(); +loadFromCache_fn = /* @__PURE__ */ __name(async function() { + var _a; + const data = await ((_a = __privateGet(this, _session2).cache) == null ? void 0 : _a.get("youtubei_oauth_credentials")); + if (!data) + return false; + const decoder = new TextDecoder(); + const credentials = JSON.parse(decoder.decode(data)); + this.setTokens(credentials); + __privateGet(this, _session2).emit("auth", { credentials }); + return true; +}, "#loadFromCache"); +http_get = /* @__PURE__ */ __name(function() { + return __privateGet(this, _session2).http; +}, "#http"); +__name(_OAuth2, "OAuth2"); +var OAuth2 = _OAuth2; + +// dist/src/core/Player.js +var TAG4 = "Player"; +var _Player = class _Player { + constructor(player_id, signature_timestamp, data) { + __publicField(this, "player_id"); + __publicField(this, "signature_timestamp"); + __publicField(this, "data"); + __publicField(this, "po_token"); + this.player_id = player_id; + this.signature_timestamp = signature_timestamp; + this.data = data; + } + static async create(cache, fetch = Platform.shim.fetch, po_token, player_id) { + var _a; + if (!player_id) { + const url = new URL("/iframe_api", Constants_exports.URLS.YT_BASE); + const res = await fetch(url); + if (!res.ok) + throw new PlayerError(`Failed to get player id: ${res.status} (${res.statusText})`); + const js = await res.text(); + player_id = getStringBetweenStrings(js, "player\\/", "\\/"); + } + Log_exports.info(TAG4, `Using player id (${player_id}). Checking for cached players..`); + if (!player_id) + throw new PlayerError("Failed to get player id"); + if (cache) { + const cached_player = await _Player.fromCache(cache, player_id); + if (cached_player) { + Log_exports.info(TAG4, "Found up-to-date player data in cache."); + cached_player.po_token = po_token; + return cached_player; + } + } + const player_url = new URL(`/s/player/${player_id}/player_es6.vflset/en_US/base.js`, Constants_exports.URLS.YT_BASE); + Log_exports.info(TAG4, `Could not find any cached player. Will download a new player from ${player_url}.`); + const player_res = await fetch(player_url, { + headers: { + "user-agent": getRandomUserAgent("desktop") + } + }); + if (!player_res.ok) { + throw new PlayerError(`Failed to get player data: ${player_res.status}`); + } + const player_js = await player_res.text(); + const nsigFunctionName = "nsigFunction"; + const timestampVarName = "signatureTimestampVar"; + const extractions = [ + { friendlyName: nsigFunctionName, match: nsigMatcher }, + { friendlyName: timestampVarName, match: timestampMatcher, collectDependencies: false } + ]; + const jsAnalyzer = new JsAnalyzer(player_js, { extractions }); + const jsExtractor = new JsExtractor(jsAnalyzer); + const result = jsExtractor.buildScript({ + disallowSideEffectInitializers: true, + exportRawValues: true, + rawValueOnly: [timestampVarName] + }); + if (result.exportedRawValues && !(timestampVarName in result.exportedRawValues)) { + Log_exports.warn(TAG4, "Failed to extract signature timestamp."); + } + if (!result.exported.includes(nsigFunctionName)) { + Log_exports.warn(TAG4, "Failed to extract n/sig decipher function."); + } + const signatureTimestamp = (_a = result.exportedRawValues) == null ? void 0 : _a[timestampVarName]; + const player = await _Player.fromSource(player_id, { + cache, + signature_timestamp: parseInt(signatureTimestamp) || 0, + data: result + }); + player.po_token = po_token; + return player; + } + async decipher(url, signature_cipher, cipher, this_response_nsig_cache) { + url = url || signature_cipher || cipher; + if (!url) + throw new PlayerError("No valid URL to decipher"); + const args = new URLSearchParams(url); + const url_components = new URL(args.get("url") || url); + const n = url_components.searchParams.get("n"); + const s = args.get("s"); + const sp = args.get("sp"); + if (this.data && (signature_cipher || cipher || n)) { + const eval_args = {}; + if (signature_cipher || cipher) { + eval_args.sig = s; + eval_args.sp = sp; + } + if (n) { + if (this_response_nsig_cache == null ? void 0 : this_response_nsig_cache.has(n)) { + const nsig = this_response_nsig_cache.get(n); + url_components.searchParams.set("n", nsig); + } else { + eval_args.n = n; + } + } + if (Object.keys(eval_args).length > 0) { + const data = { ...this.data }; + data.output = `${data.output} +${getNsigProcessorFn(eval_args.n, eval_args.sp, eval_args.sig)}`; + const result2 = await Platform.shim.eval(data, eval_args); + if (typeof result2 !== "object" || result2 === null) { + throw new PlayerError("Got invalid result from player script evaluation."); + } + if (typeof eval_args.sig === "string") { + const signatureResult = result2.sig; + Log_exports.info(TAG4, `Transformed signature from ${s} to ${signatureResult}.`); + if (typeof signatureResult !== "string") + throw new PlayerError("Got invalid signature from player script evaluation."); + if (sp) { + url_components.searchParams.set(sp, signatureResult); + } else { + url_components.searchParams.set("signature", signatureResult); + } + } + if (typeof eval_args.n === "string") { + const nResult = result2.n; + Log_exports.info(TAG4, `Transformed n from ${n} to ${nResult}.`); + if (typeof nResult !== "string") + throw new PlayerError("Failed to decipher nsig"); + if (nResult.startsWith("enhanced_except_")) { + Log_exports.warn(TAG4, `Decipher script returned an error (n=${n}):`, nResult); + } else if (this_response_nsig_cache) { + this_response_nsig_cache.set(n, nResult); + } + url_components.searchParams.set("n", nResult); + } + } + } + if (url_components.searchParams.get("sabr") !== "1" && this.po_token) + url_components.searchParams.set("pot", this.po_token); + const client = url_components.searchParams.get("c"); + switch (client) { + case "WEB": + url_components.searchParams.set("cver", Constants_exports.CLIENTS.WEB.VERSION); + break; + case "MWEB": + url_components.searchParams.set("cver", Constants_exports.CLIENTS.MWEB.VERSION); + break; + case "WEB_REMIX": + url_components.searchParams.set("cver", Constants_exports.CLIENTS.YTMUSIC.VERSION); + break; + case "WEB_KIDS": + url_components.searchParams.set("cver", Constants_exports.CLIENTS.WEB_KIDS.VERSION); + break; + case "TVHTML5": + url_components.searchParams.set("cver", Constants_exports.CLIENTS.TV.VERSION); + break; + case "TVHTML5_SIMPLY": + url_components.searchParams.set("cver", Constants_exports.CLIENTS.TV_SIMPLY.VERSION); + break; + case "TVHTML5_SIMPLY_EMBEDDED_PLAYER": + url_components.searchParams.set("cver", Constants_exports.CLIENTS.TV_EMBEDDED.VERSION); + break; + case "WEB_EMBEDDED_PLAYER": + url_components.searchParams.set("cver", Constants_exports.CLIENTS.WEB_EMBEDDED.VERSION); + break; + } + const result = url_components.toString(); + Log_exports.info(TAG4, `Deciphered URL: ${result}`); + return url_components.toString(); + } + static async fromCache(cache, player_id) { + const buffer = await cache.get(player_id); + if (!buffer) + return null; + try { + const deserializedCache = BinarySerializer_exports.deserialize(new Uint8Array(buffer)); + if (deserializedCache.libraryVersion !== package_default.version) { + Log_exports.warn(TAG4, `Cached player data is from a different library version (${deserializedCache.libraryVersion}). Ignoring it.`); + return null; + } + return new _Player(deserializedCache.playerId, deserializedCache.signatureTimestamp, deserializedCache.data); + } catch (e) { + Log_exports.error(TAG4, "Failed to deserialize player data from cache:", e); + return null; + } + } + static async fromSource(player_id, options) { + const player = new _Player(player_id, options.signature_timestamp, options.data); + await player.cache(options.cache); + return player; + } + async cache(cache) { + if (!cache || !this.data) + return; + const buffer = BinarySerializer_exports.serialize({ + playerId: this.player_id, + signatureTimestamp: this.signature_timestamp, + libraryVersion: package_default.version, + data: this.data + }); + await cache.set(this.player_id, buffer); + } + get url() { + return new URL(`/s/player/${this.player_id}/player_ias.vflset/en_US/base.js`, Constants_exports.URLS.YT_BASE).toString(); + } + static get LIBRARY_VERSION() { + return 14; + } +}; +__name(_Player, "Player"); +var Player = _Player; + +// dist/src/core/Session.js +var ClientType = { + WEB: "WEB", + MWEB: "MWEB", + KIDS: "WEB_KIDS", + MUSIC: "WEB_REMIX", + IOS: "iOS", + ANDROID: "ANDROID", + ANDROID_VR: "ANDROID_VR", + ANDROID_MUSIC: "ANDROID_MUSIC", + ANDROID_CREATOR: "ANDROID_CREATOR", + TV: "TVHTML5", + TV_SIMPLY: "TVHTML5_SIMPLY", + TV_EMBEDDED: "TVHTML5_SIMPLY_EMBEDDED_PLAYER", + WEB_EMBEDDED: "WEB_EMBEDDED_PLAYER", + WEB_CREATOR: "WEB_CREATOR" +}; +var TAG5 = "Session"; +var _Session_static, storeSession_fn, getSessionData_fn, buildContext_fn, getVisitorID_fn; +var _Session = class _Session extends EventEmitterLike { + constructor(context, api_key, api_version, account_index, config_data, player, cookie, fetch, cache, po_token) { + super(); + __publicField(this, "context"); + __publicField(this, "api_key"); + __publicField(this, "api_version"); + __publicField(this, "account_index"); + __publicField(this, "config_data"); + __publicField(this, "player"); + __publicField(this, "cookie"); + __publicField(this, "cache"); + __publicField(this, "po_token"); + __publicField(this, "oauth"); + __publicField(this, "http"); + __publicField(this, "logged_in"); + __publicField(this, "actions"); + __publicField(this, "user_agent"); + this.context = context; + this.api_key = api_key; + this.api_version = api_version; + this.account_index = account_index; + this.config_data = config_data; + this.player = player; + this.cookie = cookie; + this.cache = cache; + this.po_token = po_token; + this.http = new HTTPClient(this, cookie, fetch); + this.actions = new Actions(this); + this.oauth = new OAuth2(this); + this.logged_in = !!cookie; + this.user_agent = context.client.userAgent; + } + on(type, listener) { + super.on(type, listener); + } + once(type, listener) { + super.once(type, listener); + } + static async create(options = {}) { + const { context, api_key, api_version, account_index, config_data } = await _Session.getSessionData(options.lang, options.location, options.account_index, options.visitor_data, options.user_agent, options.enable_safety_mode, options.generate_session_locally, options.fail_fast, options.device_category, options.client_type, options.timezone, options.fetch, options.on_behalf_of_user, options.cache, options.enable_session_cache, options.po_token, options.retrieve_innertube_config); + return new _Session(context, api_key, api_version, account_index, config_data, options.retrieve_player === false ? void 0 : await Player.create(options.cache, options.fetch, options.po_token, options.player_id), options.cookie, options.fetch, options.cache, options.po_token); + } + /** + * Retrieves session data from cache. + * @param cache - A valid cache implementation. + * @param session_args - User provided session arguments. + */ + static async fromCache(cache, session_args) { + const buffer = await cache.get("innertube_session_data"); + if (!buffer) + return null; + try { + const session_data = BinarySerializer_exports.deserialize(new Uint8Array(buffer)); + if (session_data.library_version !== parseInt(package_default.version.split(".", 1)[0])) { + Log_exports.warn(TAG5, `Cached session data is from a different library version (${session_data.library_version}). Regenerating session data.`); + return null; + } + if (session_args.visitor_data) { + session_data.context.client.visitorData = session_args.visitor_data; + } + if (session_args.lang) + session_data.context.client.hl = session_args.lang; + if (session_args.location) + session_data.context.client.gl = session_args.location; + if (session_args.on_behalf_of_user) + session_data.context.user.onBehalfOfUser = session_args.on_behalf_of_user; + if (session_args.user_agent) + session_data.context.client.userAgent = session_args.user_agent; + if (session_args.client_name) { + const client = Object.values(CLIENTS).find((c) => c.NAME === session_args.client_name); + if (client) { + session_data.context.client.clientName = client.NAME; + session_data.context.client.clientVersion = client.VERSION; + } else + Log_exports.warn(TAG5, `Unknown client name: ${session_args.client_name}.`); + } + session_data.context.client.timeZone = session_args.time_zone; + session_data.context.client.platform = session_args.device_category.toUpperCase(); + session_data.context.user.enableSafetyMode = session_args.enable_safety_mode; + return session_data; + } catch (error2) { + Log_exports.error(TAG5, "Failed to deserialize session data from cache.", error2); + return null; + } + } + static async getSessionData(lang = "", location = "", account_index = 0, visitor_data = "", user_agent = getRandomUserAgent("desktop"), enable_safety_mode = false, generate_session_locally = false, fail_fast = false, device_category = "desktop", client_name = ClientType.WEB, tz = Intl.DateTimeFormat().resolvedOptions().timeZone, fetch = Platform.shim.fetch, on_behalf_of_user, cache, enable_session_cache = true, po_token, retrieve_innertube_config = true) { + var _a, _b, _c, _d, _e, _f, _g, _h, _i; + const session_args = { + lang, + location, + time_zone: tz, + user_agent, + device_category, + client_name, + enable_safety_mode, + visitor_data, + on_behalf_of_user, + po_token + }; + let session_data; + if (cache && enable_session_cache) { + const cached_session_data = await this.fromCache(cache, session_args); + if (cached_session_data) { + Log_exports.info(TAG5, "Found session data in cache."); + session_data = cached_session_data; + } + } + if (!session_data) { + Log_exports.info(TAG5, "Generating session data."); + let api_key = CLIENTS.WEB.API_KEY; + let api_version = CLIENTS.WEB.API_VERSION; + let context_data = { + hl: lang || "en", + gl: location || "US", + remote_host: "", + user_agent, + visitor_data: visitor_data || ProtoUtils_exports.encodeVisitorData(generateRandomString(11), Math.floor(Date.now() / 1e3)), + client_name, + client_version: (_b = (_a = Object.values(CLIENTS).find((v) => v.NAME === client_name)) == null ? void 0 : _a.VERSION) != null ? _b : CLIENTS.WEB.VERSION, + device_category: device_category.toUpperCase(), + os_name: "Windows", + os_version: "10.0", + time_zone: tz, + browser_name: "Chrome", + browser_version: "125.0.0.0", + device_make: "", + device_model: "", + enable_safety_mode + }; + if (!generate_session_locally) { + try { + const sw_session_data = await __privateMethod(this, _Session_static, getSessionData_fn).call(this, session_args, fetch); + api_key = sw_session_data.api_key; + api_version = sw_session_data.api_version; + context_data = sw_session_data.context_data; + } catch (error2) { + if (fail_fast) + throw error2; + Log_exports.error(TAG5, "Failed to retrieve session data from server. Session data generated locally will be used instead.", error2); + } + } + if (on_behalf_of_user) { + context_data.on_behalf_of_user = on_behalf_of_user; + } + session_data = { + api_key, + api_version, + context: __privateMethod(this, _Session_static, buildContext_fn).call(this, context_data) + }; + if (retrieve_innertube_config) { + try { + Log_exports.info(TAG5, "Retrieving InnerTube config data."); + const config_headers = { + "Accept-Language": lang, + "Accept": "*/*", + "Referer": URLS.YT_BASE, + "X-Goog-Visitor-Id": context_data.visitor_data, + "X-Origin": URLS.YT_BASE, + "X-Youtube-Client-Version": context_data.client_version + }; + if (Platform.shim.server) { + config_headers["User-Agent"] = user_agent; + config_headers["Origin"] = URLS.YT_BASE; + } + const config = await fetch(`${URLS.API.PRODUCTION_1}v1/config?prettyPrint=false`, { + headers: config_headers, + method: "POST", + body: JSON.stringify({ context: session_data.context }) + }); + const configJson = await config.json(); + const coldConfigData = (_e = (_d = (_c = configJson.responseContext) == null ? void 0 : _c.globalConfigGroup) == null ? void 0 : _d.rawColdConfigGroup) == null ? void 0 : _e.configData; + const coldHashData = (_g = (_f = configJson.responseContext) == null ? void 0 : _f.globalConfigGroup) == null ? void 0 : _g.coldHashData; + const hotHashData = (_i = (_h = configJson.responseContext) == null ? void 0 : _h.globalConfigGroup) == null ? void 0 : _i.hotHashData; + session_data.config_data = configJson.configData; + session_data.context.client.configInfo = { + ...session_data.context.client.configInfo, + coldConfigData, + coldHashData, + hotHashData + }; + } catch (error2) { + Log_exports.error(TAG5, "Failed to retrieve config data.", error2); + } + } + if (enable_session_cache) + await __privateMethod(this, _Session_static, storeSession_fn).call(this, session_data, cache); + } + Log_exports.debug(TAG5, "Session data:", session_data); + return { ...session_data, account_index }; + } + async signIn(credentials) { + return new Promise(async (resolve, reject) => { + const error_handler = /* @__PURE__ */ __name((err) => reject(err), "error_handler"); + this.once("auth-error", error_handler); + this.once("auth", () => { + this.off("auth-error", error_handler); + this.logged_in = true; + resolve(); + }); + try { + await this.oauth.init(credentials); + } catch (err) { + reject(err); + } + }); + } + /** + * Signs out of the current account and revokes the credentials. + */ + async signOut() { + if (!this.logged_in) + throw new InnertubeError("You must be signed in to perform this operation."); + const response = await this.oauth.revokeCredentials(); + this.logged_in = false; + return response; + } + get client_version() { + return this.context.client.clientVersion; + } + get client_name() { + return this.context.client.clientName; + } + get lang() { + return this.context.client.hl; + } +}; +_Session_static = new WeakSet(); +storeSession_fn = /* @__PURE__ */ __name(async function(session_data, cache) { + if (!cache) + return; + Log_exports.info(TAG5, "Compressing and caching session data."); + const buffer = BinarySerializer_exports.serialize({ + ...session_data, + library_version: parseInt(package_default.version) + }); + await cache.set("innertube_session_data", buffer); +}, "#storeSession"); +getSessionData_fn = /* @__PURE__ */ __name(async function(options, fetch = Platform.shim.fetch) { + var _a; + let visitor_id = generateRandomString(11); + if (options.visitor_data) + visitor_id = __privateMethod(this, _Session_static, getVisitorID_fn).call(this, options.visitor_data); + const url = new URL("/sw.js_data", URLS.YT_BASE); + const res = await fetch(url, { + headers: { + "Accept-Language": options.lang || "en-US", + "User-Agent": options.user_agent, + "Accept": "*/*", + "Referer": `${URLS.YT_BASE}/sw.js`, + "Cookie": `PREF=tz=${options.time_zone.replace("/", ".")};VISITOR_INFO1_LIVE=${visitor_id};` + } + }); + if (!res.ok) + throw new SessionError(`Failed to retrieve session data: ${res.status}`); + const text = await res.text(); + if (!text.startsWith(")]}'")) + throw new SessionError("Invalid JSPB response"); + const data = JSON.parse(text.replace(/^\)\]\}'/, "")); + const ytcfg = data[0][2]; + const api_version = CLIENTS.WEB.API_VERSION; + const [[device_info], api_key] = ytcfg; + const config_info = device_info[61]; + const app_install_data = config_info[config_info.length - 1]; + const context_info = { + hl: options.lang || device_info[0], + gl: options.location || device_info[1], + remote_host: device_info[3], + visitor_data: options.visitor_data || device_info[13], + user_agent: options.user_agent, + client_name: options.client_name, + client_version: options.client_name === "WEB" ? device_info[16] : ((_a = Object.values(CLIENTS).find((c) => c.NAME === options.client_name)) == null ? void 0 : _a.VERSION) || device_info[16], + os_name: device_info[17], + os_version: device_info[18], + time_zone: device_info[79] || options.time_zone, + device_category: options.device_category, + browser_name: device_info[86], + browser_version: device_info[87], + device_make: device_info[11], + device_model: device_info[12], + app_install_data, + device_experiment_id: device_info[103], + rollout_token: device_info[107], + enable_safety_mode: options.enable_safety_mode + }; + return { context_data: context_info, api_key, api_version }; +}, "#getSessionData"); +buildContext_fn = /* @__PURE__ */ __name(function(args) { + const context = { + client: { + hl: args.hl || "en", + gl: args.gl || "US", + remoteHost: args.remote_host, + screenDensityFloat: 1, + screenHeightPoints: 1440, + screenPixelDensity: 1, + screenWidthPoints: 2560, + visitorData: args.visitor_data, + clientName: args.client_name, + clientVersion: args.client_version, + osName: args.os_name, + osVersion: args.os_version, + userAgent: args.user_agent, + platform: args.device_category.toUpperCase(), + clientFormFactor: "UNKNOWN_FORM_FACTOR", + userInterfaceTheme: "USER_INTERFACE_THEME_LIGHT", + timeZone: args.time_zone, + originalUrl: URLS.YT_BASE, + deviceMake: args.device_make, + deviceModel: args.device_model, + browserName: args.browser_name, + browserVersion: args.browser_version, + utcOffsetMinutes: -Math.floor((/* @__PURE__ */ new Date()).getTimezoneOffset()), + memoryTotalKbytes: "8000000", + rolloutToken: args.rollout_token, + deviceExperimentId: args.device_experiment_id, + mainAppWebInfo: { + graftUrl: URLS.YT_BASE, + pwaInstallabilityStatus: "PWA_INSTALLABILITY_STATUS_UNKNOWN", + webDisplayMode: "WEB_DISPLAY_MODE_BROWSER", + isWebNativeShareAvailable: true + } + }, + user: { + enableSafetyMode: args.enable_safety_mode, + lockedSafetyMode: false + }, + request: { + useSsl: true, + internalExperimentFlags: [] + } + }; + if (args.app_install_data) + context.client.configInfo = { appInstallData: args.app_install_data }; + if (args.on_behalf_of_user) + context.user.onBehalfOfUser = args.on_behalf_of_user; + return context; +}, "#buildContext"); +getVisitorID_fn = /* @__PURE__ */ __name(function(visitor_data) { + const decoded_visitor_data = ProtoUtils_exports.decodeVisitorData(visitor_data); + return decoded_visitor_data.id; +}, "#getVisitorID"); +__privateAdd(_Session, _Session_static); +__name(_Session, "Session"); +var Session = _Session; + +// dist/src/core/clients/index.js +var clients_exports = {}; +__export(clients_exports, { + Kids: () => Kids, + Music: () => Music, + Studio: () => Studio +}); + +// dist/src/core/clients/Kids.js +var _session3; +var _Kids = class _Kids { + constructor(session) { + __privateAdd(this, _session3); + __privateSet(this, _session3, session); + } + async search(query) { + const search_endpoint = new NavigationEndpoint({ searchEndpoint: { query } }); + const response = await search_endpoint.call(__privateGet(this, _session3).actions, { client: "YTKIDS" }); + return new Search3(__privateGet(this, _session3).actions, response); + } + async getInfo(video_id, options) { + var _a; + const payload = { videoId: video_id }; + const watch_endpoint = new NavigationEndpoint({ watchEndpoint: payload }); + const watch_next_endpoint = new NavigationEndpoint({ watchNextEndpoint: payload }); + const session = __privateGet(this, _session3); + const extra_payload = { + playbackContext: { + contentPlaybackContext: { + vis: 0, + splay: false, + lactMilliseconds: "-1", + signatureTimestamp: (_a = session.player) == null ? void 0 : _a.signature_timestamp + } + }, + client: "YTKIDS" + }; + if (options == null ? void 0 : options.po_token) { + extra_payload.serviceIntegrityDimensions = { + poToken: options.po_token + }; + } else if (session.po_token) { + extra_payload.serviceIntegrityDimensions = { + poToken: session.po_token + }; + } + const watch_response = watch_endpoint.call(session.actions, extra_payload); + const watch_next_response = watch_next_endpoint.call(session.actions, { client: "YTKIDS" }); + const response = await Promise.all([watch_response, watch_next_response]); + const cpn = generateRandomString(16); + return new VideoInfo2(response, session.actions, cpn); + } + async getChannel(channel_id) { + const browse_endpoint = new NavigationEndpoint({ browseEndpoint: { browseId: channel_id } }); + const response = await browse_endpoint.call(__privateGet(this, _session3).actions, { client: "YTKIDS" }); + return new Channel3(__privateGet(this, _session3).actions, response); + } + async getHomeFeed() { + const browse_endpoint = new NavigationEndpoint({ browseEndpoint: { browseId: "FEkids_home" } }); + const response = await browse_endpoint.call(__privateGet(this, _session3).actions, { client: "YTKIDS" }); + return new HomeFeed3(__privateGet(this, _session3).actions, response); + } + /** + * Retrieves the list of supervised accounts that the signed-in user has + * access to, and blocks the given channel for each of them. + * @param channel_id - The channel id to block. + * @returns A list of API responses. + */ + async blockChannel(channel_id) { + var _a, _b; + const session = __privateGet(this, _session3); + if (!session.logged_in) + throw new InnertubeError("You must be signed in to perform this operation."); + const kids_blocklist_picker_command = new NavigationEndpoint({ + getKidsBlocklistPickerCommand: { + blockedForKidsContent: { + external_channel_id: channel_id + } + } + }); + const response = await kids_blocklist_picker_command.call(session.actions, { client: "YTKIDS" }); + const popup = response.data.command.confirmDialogEndpoint; + const popup_fragment = { contents: popup.content, engagementPanels: [] }; + const kid_picker = parser_exports.parseResponse(popup_fragment); + const kids = (_a = kid_picker.contents_memo) == null ? void 0 : _a.getType(KidsBlocklistPickerItem); + if (!kids) + throw new InnertubeError("Could not find any kids profiles or supervised accounts."); + const responses = []; + for (const kid of kids) { + if (!((_b = kid.block_button) == null ? void 0 : _b.is_toggled)) { + kid.setActions(session.actions); + responses.push(await kid.blockChannel()); + } + } + return responses; + } +}; +_session3 = new WeakMap(); +__name(_Kids, "Kids"); +var Kids = _Kids; + +// dist/src/core/clients/Music.js +var _session4, _actions21, _Music_instances, fetchInfoFromVideoId_fn, fetchInfoFromEndpoint_fn; +var _Music = class _Music { + constructor(session) { + __privateAdd(this, _Music_instances); + __privateAdd(this, _session4); + __privateAdd(this, _actions21); + __privateSet(this, _session4, session); + __privateSet(this, _actions21, session.actions); + } + /** + * Retrieves track info. Passing a list item of type MusicTwoRowItem automatically starts a radio. + * @param target - Video id or a list item. + * @param options - Options for fetching video info. + */ + getInfo(target, options) { + var _a, _b, _c; + if (target instanceof MusicTwoRowItem) { + return __privateMethod(this, _Music_instances, fetchInfoFromEndpoint_fn).call(this, target.endpoint, options); + } else if (target instanceof MusicResponsiveListItem) { + return __privateMethod(this, _Music_instances, fetchInfoFromEndpoint_fn).call(this, (_c = (_b = (_a = target.overlay) == null ? void 0 : _a.content) == null ? void 0 : _b.endpoint) != null ? _c : target.endpoint, options); + } else if (target instanceof NavigationEndpoint) { + return __privateMethod(this, _Music_instances, fetchInfoFromEndpoint_fn).call(this, target, options); + } + return __privateMethod(this, _Music_instances, fetchInfoFromVideoId_fn).call(this, target, options); + } + async search(query, filters = {}) { + throwIfMissing({ query }); + let params; + if (filters.type && filters.type !== "all") { + const writer = SearchFilter.encode({ + filters: { + musicSearchType: { + [filters.type]: true + } + } + }); + params = encodeURIComponent(u8ToBase64(writer.finish())); + } + const search_endpoint = new NavigationEndpoint({ searchEndpoint: { query, params } }); + const response = await search_endpoint.call(__privateGet(this, _actions21), { client: "YTMUSIC" }); + return new Search2(response, __privateGet(this, _actions21), Reflect.has(filters, "type") && filters.type !== "all"); + } + async getHomeFeed() { + const browse_endpoint = new NavigationEndpoint({ browseEndpoint: { browseId: "FEmusic_home" } }); + const response = await browse_endpoint.call(__privateGet(this, _actions21), { client: "YTMUSIC" }); + return new HomeFeed2(response, __privateGet(this, _actions21)); + } + async getExplore() { + const browse_endpoint = new NavigationEndpoint({ browseEndpoint: { browseId: "FEmusic_explore" } }); + const response = await browse_endpoint.call(__privateGet(this, _actions21), { client: "YTMUSIC" }); + return new Explore(response); + } + async getLibrary() { + const browse_endpoint = new NavigationEndpoint({ browseEndpoint: { browseId: "FEmusic_library_landing" } }); + const response = await browse_endpoint.call(__privateGet(this, _actions21), { client: "YTMUSIC" }); + return new Library2(response, __privateGet(this, _actions21)); + } + async getArtist(artist_id) { + if (!artist_id || !artist_id.startsWith("UC") && !artist_id.startsWith("FEmusic_library_privately_owned_artist")) + throw new InnertubeError("Invalid artist id", artist_id); + const browse_endpoint = new NavigationEndpoint({ browseEndpoint: { browseId: artist_id } }); + const response = await browse_endpoint.call(__privateGet(this, _actions21), { client: "YTMUSIC" }); + return new Artist(response, __privateGet(this, _actions21)); + } + async getAlbum(album_id) { + if (!album_id || !album_id.startsWith("MPR") && !album_id.startsWith("FEmusic_library_privately_owned_release")) + throw new InnertubeError("Invalid album id", album_id); + const browse_endpoint = new NavigationEndpoint({ browseEndpoint: { browseId: album_id } }); + const response = await browse_endpoint.call(__privateGet(this, _actions21), { client: "YTMUSIC" }); + return new Album(response); + } + async getPlaylist(playlist_id) { + if (!playlist_id.startsWith("VL")) + playlist_id = `VL${playlist_id}`; + const browse_endpoint = new NavigationEndpoint({ browseEndpoint: { browseId: playlist_id } }); + const response = await browse_endpoint.call(__privateGet(this, _actions21), { client: "YTMUSIC" }); + return new Playlist3(response, __privateGet(this, _actions21)); + } + async getUpNext(video_id, automix = true) { + var _a, _b, _c; + throwIfMissing({ video_id }); + const watch_next_endpoint = new NavigationEndpoint({ watchNextEndpoint: { videoId: video_id } }); + const response = await watch_next_endpoint.call(__privateGet(this, _actions21), { client: "YTMUSIC", parse: true }); + const tabs = (_a = response.contents_memo) == null ? void 0 : _a.getType(Tab); + const tab = tabs == null ? void 0 : tabs[0]; + if (!tab) + throw new InnertubeError("Could not find target tab."); + const music_queue = (_b = tab.content) == null ? void 0 : _b.as(MusicQueue); + if (!music_queue || !music_queue.content) + throw new InnertubeError("Music queue was empty, the given id is probably invalid.", music_queue); + const playlist_panel = music_queue.content.as(PlaylistPanel); + if (!playlist_panel.playlist_id && automix) { + const automix_preview_video = playlist_panel.contents.firstOfType(AutomixPreviewVideo); + if (!automix_preview_video) + throw new InnertubeError("Automix item not found"); + const page = await ((_c = automix_preview_video.playlist_video) == null ? void 0 : _c.endpoint.call(__privateGet(this, _actions21), { + videoId: video_id, + client: "YTMUSIC", + parse: true + })); + if (!page || !page.contents_memo) + throw new InnertubeError("Could not fetch automix"); + return page.contents_memo.getType(PlaylistPanel)[0]; + } + return playlist_panel; + } + async getRelated(video_id) { + var _a; + throwIfMissing({ video_id }); + const watch_next_endpoint = new NavigationEndpoint({ watchNextEndpoint: { videoId: video_id } }); + const response = await watch_next_endpoint.call(__privateGet(this, _actions21), { client: "YTMUSIC", parse: true }); + const tabs = (_a = response.contents_memo) == null ? void 0 : _a.getType(Tab); + const tab = tabs == null ? void 0 : tabs.find((tab2) => { + var _a2, _b; + return ((_b = (_a2 = tab2.endpoint.payload.browseEndpointContextSupportedConfigs) == null ? void 0 : _a2.browseEndpointContextMusicConfig) == null ? void 0 : _b.pageType) === "MUSIC_PAGE_TYPE_TRACK_RELATED"; + }); + if (!tab) + throw new InnertubeError("Could not find target tab."); + const page = await tab.endpoint.call(__privateGet(this, _actions21), { client: "YTMUSIC", parse: true }); + if (!page.contents) + throw new InnertubeError("Unexpected response", page); + return page.contents.item().as(SectionList, Message); + } + async getLyrics(video_id) { + var _a; + throwIfMissing({ video_id }); + const watch_next_endpoint = new NavigationEndpoint({ watchNextEndpoint: { videoId: video_id } }); + const response = await watch_next_endpoint.call(__privateGet(this, _actions21), { client: "YTMUSIC", parse: true }); + const tabs = (_a = response.contents_memo) == null ? void 0 : _a.getType(Tab); + const tab = tabs == null ? void 0 : tabs.find((tab2) => { + var _a2, _b; + return ((_b = (_a2 = tab2.endpoint.payload.browseEndpointContextSupportedConfigs) == null ? void 0 : _a2.browseEndpointContextMusicConfig) == null ? void 0 : _b.pageType) === "MUSIC_PAGE_TYPE_TRACK_LYRICS"; + }); + if (!tab) + throw new InnertubeError("Could not find target tab."); + const page = await tab.endpoint.call(__privateGet(this, _actions21), { client: "YTMUSIC", parse: true }); + if (!page.contents) + throw new InnertubeError("Unexpected response", page); + if (page.contents.item().type === "Message") + throw new InnertubeError(page.contents.item().as(Message).text.toString(), video_id); + const section_list = page.contents.item().as(SectionList).contents; + return section_list.firstOfType(MusicDescriptionShelf); + } + async getRecap() { + const browse_endpoint = new NavigationEndpoint({ browseEndpoint: { browseId: "FEmusic_listening_review" } }); + const response = await browse_endpoint.call(__privateGet(this, _actions21), { client: "YTMUSIC" }); + return new Recap(response, __privateGet(this, _actions21)); + } + async getSearchSuggestions(input) { + const response = await __privateGet(this, _actions21).execute("/music/get_search_suggestions", { + input, + client: "YTMUSIC", + parse: true + }); + if (!response.contents_memo) + return []; + return response.contents_memo.getType(SearchSuggestionsSection); + } +}; +_session4 = new WeakMap(); +_actions21 = new WeakMap(); +_Music_instances = new WeakSet(); +fetchInfoFromVideoId_fn = /* @__PURE__ */ __name(async function(video_id, options) { + var _a; + const payload = { videoId: video_id, racyCheckOk: true, contentCheckOk: true }; + const watch_endpoint = new NavigationEndpoint({ watchEndpoint: payload }); + const watch_next_endpoint = new NavigationEndpoint({ watchNextEndpoint: payload }); + const extra_payload = { + playbackContext: { + contentPlaybackContext: { + vis: 0, + splay: false, + lactMilliseconds: "-1", + signatureTimestamp: (_a = __privateGet(this, _session4).player) == null ? void 0 : _a.signature_timestamp + } + }, + client: "YTMUSIC" + }; + if (options == null ? void 0 : options.po_token) { + extra_payload.serviceIntegrityDimensions = { + poToken: options.po_token + }; + } else if (__privateGet(this, _session4).po_token) { + extra_payload.serviceIntegrityDimensions = { + poToken: __privateGet(this, _session4).po_token + }; + } + const watch_response = watch_endpoint.call(__privateGet(this, _actions21), extra_payload); + const watch_next_response = watch_next_endpoint.call(__privateGet(this, _actions21), { client: "YTMUSIC" }); + const response = await Promise.all([watch_response, watch_next_response]); + const cpn = generateRandomString(16); + return new TrackInfo_default(response, __privateGet(this, _actions21), cpn); +}, "#fetchInfoFromVideoId"); +fetchInfoFromEndpoint_fn = /* @__PURE__ */ __name(async function(endpoint, options) { + var _a; + if (!endpoint) + throw new Error("This item does not have an endpoint."); + const extra_payload = { + playbackContext: { + contentPlaybackContext: { + vis: 0, + splay: false, + lactMilliseconds: "-1", + signatureTimestamp: (_a = __privateGet(this, _session4).player) == null ? void 0 : _a.signature_timestamp + } + }, + client: "YTMUSIC" + }; + if (options == null ? void 0 : options.po_token) { + extra_payload.serviceIntegrityDimensions = { + poToken: options.po_token + }; + } else if (__privateGet(this, _session4).po_token) { + extra_payload.serviceIntegrityDimensions = { + poToken: __privateGet(this, _session4).po_token + }; + } + const player_response = endpoint.call(__privateGet(this, _actions21), extra_payload); + const next_response = endpoint.call(__privateGet(this, _actions21), { + client: "YTMUSIC", + enablePersistentPlaylistPanel: true, + override_endpoint: "/next" + }); + const cpn = generateRandomString(16); + const response = await Promise.all([player_response, next_response]); + return new TrackInfo_default(response, __privateGet(this, _actions21), cpn); +}, "#fetchInfoFromEndpoint"); +__name(_Music, "Music"); +var Music = _Music; + +// dist/protos/generated/youtube/api/pfiinnertube/capability_info.js +function createBaseCapabilityInfo() { + return { profile: void 0, supportedCapabilities: [], disabledCapabilities: [], snapshot: void 0 }; +} +__name(createBaseCapabilityInfo, "createBaseCapabilityInfo"); +var CapabilityInfo = { + encode(message, writer = new BinaryWriter()) { + if (message.profile !== void 0) { + writer.uint32(10).string(message.profile); + } + for (const v of message.supportedCapabilities) { + InnerTubeCapability.encode(v, writer.uint32(18).fork()).join(); + } + for (const v of message.disabledCapabilities) { + InnerTubeCapability.encode(v, writer.uint32(26).fork()).join(); + } + if (message.snapshot !== void 0) { + writer.uint32(42).string(message.snapshot); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === void 0 ? reader.len : reader.pos + length; + const message = createBaseCapabilityInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + message.profile = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + message.supportedCapabilities.push(InnerTubeCapability.decode(reader, reader.uint32())); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + message.disabledCapabilities.push(InnerTubeCapability.decode(reader, reader.uint32())); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + message.snapshot = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + } +}; +function createBaseInnerTubeCapability() { + return { capability: void 0, features: void 0, experimentFlags: void 0 }; +} +__name(createBaseInnerTubeCapability, "createBaseInnerTubeCapability"); +var InnerTubeCapability = { + encode(message, writer = new BinaryWriter()) { + if (message.capability !== void 0) { + writer.uint32(8).uint32(message.capability); + } + if (message.features !== void 0) { + writer.uint32(16).uint32(message.features); + } + if (message.experimentFlags !== void 0) { + writer.uint32(50).string(message.experimentFlags); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === void 0 ? reader.len : reader.pos + length; + const message = createBaseInnerTubeCapability(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + message.capability = reader.uint32(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + message.features = reader.uint32(); + continue; + } + case 6: { + if (tag !== 50) { + break; + } + message.experimentFlags = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + } +}; + +// dist/protos/generated/youtube/api/pfiinnertube/client_info.js +function createBaseClientInfo() { + return { + hl: void 0, + gl: void 0, + remoteHost: void 0, + deviceId: void 0, + debugDeviceIdOverride: void 0, + carrierGeo: void 0, + crackedHl: void 0, + deviceMake: void 0, + deviceModel: void 0, + visitorData: void 0, + userAgent: void 0, + clientName: void 0, + clientVersion: void 0, + osName: void 0, + osVersion: void 0, + projectId: void 0, + acceptLanguage: void 0, + acceptRegion: void 0, + originalUrl: void 0, + rawDeviceId: void 0, + configData: void 0, + spacecastToken: void 0, + internalGeo: void 0, + screenWidthPoints: void 0, + screenHeightPoints: void 0, + screenWidthInches: void 0, + screenHeightInches: void 0, + screenPixelDensity: void 0, + platform: void 0, + spacecastClientInfo: void 0, + clientFormFactor: void 0, + forwardedFor: void 0, + mobileDataPlanInfo: void 0, + gmscoreVersionCode: void 0, + webpSupport: void 0, + cameraType: void 0, + experimentsToken: void 0, + windowWidthPoints: void 0, + windowHeightPoints: void 0, + configInfo: void 0, + unpluggedLocationInfo: void 0, + androidSdkVersion: void 0, + screenDensityFloat: void 0, + firstTimeSignInExperimentIds: void 0, + utcOffsetMinutes: void 0, + animatedWebpSupport: void 0, + kidsAppInfo: void 0, + musicAppInfo: void 0, + tvAppInfo: void 0, + internalGeoIp: void 0, + unpluggedAppInfo: void 0, + locationInfo: void 0, + contentSizeCategory: void 0, + fontScale: void 0, + userInterfaceTheme: void 0, + timeZone: void 0, + homeGroupInfo: void 0, + emlTemplateContext: void 0, + coldAppBundleConfigData: void 0, + browserName: void 0, + browserVersion: void 0, + locationPlayabilityToken: void 0, + chipset: void 0, + firmwareVersion: void 0, + memoryTotalKbytes: void 0, + mainAppWebInfo: void 0, + notificationPermissionInfo: void 0, + deviceBrand: void 0, + glDeviceInfo: void 0 + }; +} +__name(createBaseClientInfo, "createBaseClientInfo"); +var ClientInfo = { + encode(message, writer = new BinaryWriter()) { + if (message.hl !== void 0) { + writer.uint32(10).string(message.hl); + } + if (message.gl !== void 0) { + writer.uint32(18).string(message.gl); + } + if (message.remoteHost !== void 0) { + writer.uint32(34).string(message.remoteHost); + } + if (message.deviceId !== void 0) { + writer.uint32(50).string(message.deviceId); + } + if (message.debugDeviceIdOverride !== void 0) { + writer.uint32(66).string(message.debugDeviceIdOverride); + } + if (message.carrierGeo !== void 0) { + writer.uint32(82).string(message.carrierGeo); + } + if (message.crackedHl !== void 0) { + writer.uint32(88).bool(message.crackedHl); + } + if (message.deviceMake !== void 0) { + writer.uint32(98).string(message.deviceMake); + } + if (message.deviceModel !== void 0) { + writer.uint32(106).string(message.deviceModel); + } + if (message.visitorData !== void 0) { + writer.uint32(114).string(message.visitorData); + } + if (message.userAgent !== void 0) { + writer.uint32(122).string(message.userAgent); + } + if (message.clientName !== void 0) { + writer.uint32(128).int32(message.clientName); + } + if (message.clientVersion !== void 0) { + writer.uint32(138).string(message.clientVersion); + } + if (message.osName !== void 0) { + writer.uint32(146).string(message.osName); + } + if (message.osVersion !== void 0) { + writer.uint32(154).string(message.osVersion); + } + if (message.projectId !== void 0) { + writer.uint32(162).string(message.projectId); + } + if (message.acceptLanguage !== void 0) { + writer.uint32(170).string(message.acceptLanguage); + } + if (message.acceptRegion !== void 0) { + writer.uint32(178).string(message.acceptRegion); + } + if (message.originalUrl !== void 0) { + writer.uint32(186).string(message.originalUrl); + } + if (message.rawDeviceId !== void 0) { + writer.uint32(202).string(message.rawDeviceId); + } + if (message.configData !== void 0) { + writer.uint32(218).string(message.configData); + } + if (message.spacecastToken !== void 0) { + writer.uint32(250).string(message.spacecastToken); + } + if (message.internalGeo !== void 0) { + writer.uint32(274).string(message.internalGeo); + } + if (message.screenWidthPoints !== void 0) { + writer.uint32(296).int32(message.screenWidthPoints); + } + if (message.screenHeightPoints !== void 0) { + writer.uint32(304).int32(message.screenHeightPoints); + } + if (message.screenWidthInches !== void 0) { + writer.uint32(317).float(message.screenWidthInches); + } + if (message.screenHeightInches !== void 0) { + writer.uint32(325).float(message.screenHeightInches); + } + if (message.screenPixelDensity !== void 0) { + writer.uint32(328).int32(message.screenPixelDensity); + } + if (message.platform !== void 0) { + writer.uint32(336).int32(message.platform); + } + if (message.spacecastClientInfo !== void 0) { + ClientInfo_SpacecastClientInfo.encode(message.spacecastClientInfo, writer.uint32(362).fork()).join(); + } + if (message.clientFormFactor !== void 0) { + writer.uint32(368).int32(message.clientFormFactor); + } + if (message.forwardedFor !== void 0) { + writer.uint32(386).string(message.forwardedFor); + } + if (message.mobileDataPlanInfo !== void 0) { + ClientInfo_MobileDataPlanInfo.encode(message.mobileDataPlanInfo, writer.uint32(394).fork()).join(); + } + if (message.gmscoreVersionCode !== void 0) { + writer.uint32(400).int32(message.gmscoreVersionCode); + } + if (message.webpSupport !== void 0) { + writer.uint32(408).bool(message.webpSupport); + } + if (message.cameraType !== void 0) { + writer.uint32(416).int32(message.cameraType); + } + if (message.experimentsToken !== void 0) { + writer.uint32(434).string(message.experimentsToken); + } + if (message.windowWidthPoints !== void 0) { + writer.uint32(440).int32(message.windowWidthPoints); + } + if (message.windowHeightPoints !== void 0) { + writer.uint32(448).int32(message.windowHeightPoints); + } + if (message.configInfo !== void 0) { + ClientInfo_ConfigGroupsClientInfo.encode(message.configInfo, writer.uint32(498).fork()).join(); + } + if (message.unpluggedLocationInfo !== void 0) { + ClientInfo_UnpluggedLocationInfo.encode(message.unpluggedLocationInfo, writer.uint32(506).fork()).join(); + } + if (message.androidSdkVersion !== void 0) { + writer.uint32(512).int32(message.androidSdkVersion); + } + if (message.screenDensityFloat !== void 0) { + writer.uint32(525).float(message.screenDensityFloat); + } + if (message.firstTimeSignInExperimentIds !== void 0) { + writer.uint32(528).int32(message.firstTimeSignInExperimentIds); + } + if (message.utcOffsetMinutes !== void 0) { + writer.uint32(536).int32(message.utcOffsetMinutes); + } + if (message.animatedWebpSupport !== void 0) { + writer.uint32(544).bool(message.animatedWebpSupport); + } + if (message.kidsAppInfo !== void 0) { + ClientInfo_KidsAppInfo.encode(message.kidsAppInfo, writer.uint32(554).fork()).join(); + } + if (message.musicAppInfo !== void 0) { + ClientInfo_MusicAppInfo.encode(message.musicAppInfo, writer.uint32(562).fork()).join(); + } + if (message.tvAppInfo !== void 0) { + ClientInfo_TvAppInfo.encode(message.tvAppInfo, writer.uint32(570).fork()).join(); + } + if (message.internalGeoIp !== void 0) { + writer.uint32(578).string(message.internalGeoIp); + } + if (message.unpluggedAppInfo !== void 0) { + ClientInfo_UnpluggedAppInfo.encode(message.unpluggedAppInfo, writer.uint32(586).fork()).join(); + } + if (message.locationInfo !== void 0) { + ClientInfo_LocationInfo.encode(message.locationInfo, writer.uint32(594).fork()).join(); + } + if (message.contentSizeCategory !== void 0) { + writer.uint32(610).string(message.contentSizeCategory); + } + if (message.fontScale !== void 0) { + writer.uint32(621).float(message.fontScale); + } + if (message.userInterfaceTheme !== void 0) { + writer.uint32(624).int32(message.userInterfaceTheme); + } + if (message.timeZone !== void 0) { + writer.uint32(642).string(message.timeZone); + } + if (message.homeGroupInfo !== void 0) { + ClientInfo_HomeGroupInfo.encode(message.homeGroupInfo, writer.uint32(650).fork()).join(); + } + if (message.emlTemplateContext !== void 0) { + writer.uint32(674).bytes(message.emlTemplateContext); + } + if (message.coldAppBundleConfigData !== void 0) { + writer.uint32(682).bytes(message.coldAppBundleConfigData); + } + if (message.browserName !== void 0) { + writer.uint32(698).string(message.browserName); + } + if (message.browserVersion !== void 0) { + writer.uint32(706).string(message.browserVersion); + } + if (message.locationPlayabilityToken !== void 0) { + writer.uint32(714).string(message.locationPlayabilityToken); + } + if (message.chipset !== void 0) { + writer.uint32(738).string(message.chipset); + } + if (message.firmwareVersion !== void 0) { + writer.uint32(746).string(message.firmwareVersion); + } + if (message.memoryTotalKbytes !== void 0) { + writer.uint32(760).int64(message.memoryTotalKbytes); + } + if (message.mainAppWebInfo !== void 0) { + ClientInfo_MainAppWebInfo.encode(message.mainAppWebInfo, writer.uint32(770).fork()).join(); + } + if (message.notificationPermissionInfo !== void 0) { + ClientInfo_NotificationPermissionInfo.encode(message.notificationPermissionInfo, writer.uint32(778).fork()).join(); + } + if (message.deviceBrand !== void 0) { + writer.uint32(786).string(message.deviceBrand); + } + if (message.glDeviceInfo !== void 0) { + ClientInfo_GLDeviceInfo.encode(message.glDeviceInfo, writer.uint32(818).fork()).join(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === void 0 ? reader.len : reader.pos + length; + const message = createBaseClientInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + message.hl = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + message.gl = reader.string(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + message.remoteHost = reader.string(); + continue; + } + case 6: { + if (tag !== 50) { + break; + } + message.deviceId = reader.string(); + continue; + } + case 8: { + if (tag !== 66) { + break; + } + message.debugDeviceIdOverride = reader.string(); + continue; + } + case 10: { + if (tag !== 82) { + break; + } + message.carrierGeo = reader.string(); + continue; + } + case 11: { + if (tag !== 88) { + break; + } + message.crackedHl = reader.bool(); + continue; + } + case 12: { + if (tag !== 98) { + break; + } + message.deviceMake = reader.string(); + continue; + } + case 13: { + if (tag !== 106) { + break; + } + message.deviceModel = reader.string(); + continue; + } + case 14: { + if (tag !== 114) { + break; + } + message.visitorData = reader.string(); + continue; + } + case 15: { + if (tag !== 122) { + break; + } + message.userAgent = reader.string(); + continue; + } + case 16: { + if (tag !== 128) { + break; + } + message.clientName = reader.int32(); + continue; + } + case 17: { + if (tag !== 138) { + break; + } + message.clientVersion = reader.string(); + continue; + } + case 18: { + if (tag !== 146) { + break; + } + message.osName = reader.string(); + continue; + } + case 19: { + if (tag !== 154) { + break; + } + message.osVersion = reader.string(); + continue; + } + case 20: { + if (tag !== 162) { + break; + } + message.projectId = reader.string(); + continue; + } + case 21: { + if (tag !== 170) { + break; + } + message.acceptLanguage = reader.string(); + continue; + } + case 22: { + if (tag !== 178) { + break; + } + message.acceptRegion = reader.string(); + continue; + } + case 23: { + if (tag !== 186) { + break; + } + message.originalUrl = reader.string(); + continue; + } + case 25: { + if (tag !== 202) { + break; + } + message.rawDeviceId = reader.string(); + continue; + } + case 27: { + if (tag !== 218) { + break; + } + message.configData = reader.string(); + continue; + } + case 31: { + if (tag !== 250) { + break; + } + message.spacecastToken = reader.string(); + continue; + } + case 34: { + if (tag !== 274) { + break; + } + message.internalGeo = reader.string(); + continue; + } + case 37: { + if (tag !== 296) { + break; + } + message.screenWidthPoints = reader.int32(); + continue; + } + case 38: { + if (tag !== 304) { + break; + } + message.screenHeightPoints = reader.int32(); + continue; + } + case 39: { + if (tag !== 317) { + break; + } + message.screenWidthInches = reader.float(); + continue; + } + case 40: { + if (tag !== 325) { + break; + } + message.screenHeightInches = reader.float(); + continue; + } + case 41: { + if (tag !== 328) { + break; + } + message.screenPixelDensity = reader.int32(); + continue; + } + case 42: { + if (tag !== 336) { + break; + } + message.platform = reader.int32(); + continue; + } + case 45: { + if (tag !== 362) { + break; + } + message.spacecastClientInfo = ClientInfo_SpacecastClientInfo.decode(reader, reader.uint32()); + continue; + } + case 46: { + if (tag !== 368) { + break; + } + message.clientFormFactor = reader.int32(); + continue; + } + case 48: { + if (tag !== 386) { + break; + } + message.forwardedFor = reader.string(); + continue; + } + case 49: { + if (tag !== 394) { + break; + } + message.mobileDataPlanInfo = ClientInfo_MobileDataPlanInfo.decode(reader, reader.uint32()); + continue; + } + case 50: { + if (tag !== 400) { + break; + } + message.gmscoreVersionCode = reader.int32(); + continue; + } + case 51: { + if (tag !== 408) { + break; + } + message.webpSupport = reader.bool(); + continue; + } + case 52: { + if (tag !== 416) { + break; + } + message.cameraType = reader.int32(); + continue; + } + case 54: { + if (tag !== 434) { + break; + } + message.experimentsToken = reader.string(); + continue; + } + case 55: { + if (tag !== 440) { + break; + } + message.windowWidthPoints = reader.int32(); + continue; + } + case 56: { + if (tag !== 448) { + break; + } + message.windowHeightPoints = reader.int32(); + continue; + } + case 62: { + if (tag !== 498) { + break; + } + message.configInfo = ClientInfo_ConfigGroupsClientInfo.decode(reader, reader.uint32()); + continue; + } + case 63: { + if (tag !== 506) { + break; + } + message.unpluggedLocationInfo = ClientInfo_UnpluggedLocationInfo.decode(reader, reader.uint32()); + continue; + } + case 64: { + if (tag !== 512) { + break; + } + message.androidSdkVersion = reader.int32(); + continue; + } + case 65: { + if (tag !== 525) { + break; + } + message.screenDensityFloat = reader.float(); + continue; + } + case 66: { + if (tag !== 528) { + break; + } + message.firstTimeSignInExperimentIds = reader.int32(); + continue; + } + case 67: { + if (tag !== 536) { + break; + } + message.utcOffsetMinutes = reader.int32(); + continue; + } + case 68: { + if (tag !== 544) { + break; + } + message.animatedWebpSupport = reader.bool(); + continue; + } + case 69: { + if (tag !== 554) { + break; + } + message.kidsAppInfo = ClientInfo_KidsAppInfo.decode(reader, reader.uint32()); + continue; + } + case 70: { + if (tag !== 562) { + break; + } + message.musicAppInfo = ClientInfo_MusicAppInfo.decode(reader, reader.uint32()); + continue; + } + case 71: { + if (tag !== 570) { + break; + } + message.tvAppInfo = ClientInfo_TvAppInfo.decode(reader, reader.uint32()); + continue; + } + case 72: { + if (tag !== 578) { + break; + } + message.internalGeoIp = reader.string(); + continue; + } + case 73: { + if (tag !== 586) { + break; + } + message.unpluggedAppInfo = ClientInfo_UnpluggedAppInfo.decode(reader, reader.uint32()); + continue; + } + case 74: { + if (tag !== 594) { + break; + } + message.locationInfo = ClientInfo_LocationInfo.decode(reader, reader.uint32()); + continue; + } + case 76: { + if (tag !== 610) { + break; + } + message.contentSizeCategory = reader.string(); + continue; + } + case 77: { + if (tag !== 621) { + break; + } + message.fontScale = reader.float(); + continue; + } + case 78: { + if (tag !== 624) { + break; + } + message.userInterfaceTheme = reader.int32(); + continue; + } + case 80: { + if (tag !== 642) { + break; + } + message.timeZone = reader.string(); + continue; + } + case 81: { + if (tag !== 650) { + break; + } + message.homeGroupInfo = ClientInfo_HomeGroupInfo.decode(reader, reader.uint32()); + continue; + } + case 84: { + if (tag !== 674) { + break; + } + message.emlTemplateContext = reader.bytes(); + continue; + } + case 85: { + if (tag !== 682) { + break; + } + message.coldAppBundleConfigData = reader.bytes(); + continue; + } + case 87: { + if (tag !== 698) { + break; + } + message.browserName = reader.string(); + continue; + } + case 88: { + if (tag !== 706) { + break; + } + message.browserVersion = reader.string(); + continue; + } + case 89: { + if (tag !== 714) { + break; + } + message.locationPlayabilityToken = reader.string(); + continue; + } + case 92: { + if (tag !== 738) { + break; + } + message.chipset = reader.string(); + continue; + } + case 93: { + if (tag !== 746) { + break; + } + message.firmwareVersion = reader.string(); + continue; + } + case 95: { + if (tag !== 760) { + break; + } + message.memoryTotalKbytes = longToNumber(reader.int64()); + continue; + } + case 96: { + if (tag !== 770) { + break; + } + message.mainAppWebInfo = ClientInfo_MainAppWebInfo.decode(reader, reader.uint32()); + continue; + } + case 97: { + if (tag !== 778) { + break; + } + message.notificationPermissionInfo = ClientInfo_NotificationPermissionInfo.decode(reader, reader.uint32()); + continue; + } + case 98: { + if (tag !== 786) { + break; + } + message.deviceBrand = reader.string(); + continue; + } + case 102: { + if (tag !== 818) { + break; + } + message.glDeviceInfo = ClientInfo_GLDeviceInfo.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + } +}; +function createBaseClientInfo_MainAppWebInfo() { + return { + graftUrl: void 0, + pwaInstallabilityStatus: void 0, + webDisplayMode: void 0, + isWebNativeShareAvailable: void 0, + storeDigitalGoodsApiSupportStatus: void 0 + }; +} +__name(createBaseClientInfo_MainAppWebInfo, "createBaseClientInfo_MainAppWebInfo"); +var ClientInfo_MainAppWebInfo = { + encode(message, writer = new BinaryWriter()) { + if (message.graftUrl !== void 0) { + writer.uint32(10).string(message.graftUrl); + } + if (message.pwaInstallabilityStatus !== void 0) { + writer.uint32(16).int32(message.pwaInstallabilityStatus); + } + if (message.webDisplayMode !== void 0) { + writer.uint32(24).int32(message.webDisplayMode); + } + if (message.isWebNativeShareAvailable !== void 0) { + writer.uint32(32).bool(message.isWebNativeShareAvailable); + } + if (message.storeDigitalGoodsApiSupportStatus !== void 0) { + writer.uint32(40).int32(message.storeDigitalGoodsApiSupportStatus); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === void 0 ? reader.len : reader.pos + length; + const message = createBaseClientInfo_MainAppWebInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + message.graftUrl = reader.string(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + message.pwaInstallabilityStatus = reader.int32(); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + message.webDisplayMode = reader.int32(); + continue; + } + case 4: { + if (tag !== 32) { + break; + } + message.isWebNativeShareAvailable = reader.bool(); + continue; + } + case 5: { + if (tag !== 40) { + break; + } + message.storeDigitalGoodsApiSupportStatus = reader.int32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + } +}; +function createBaseClientInfo_NotificationPermissionInfo() { + return { notificationsSetting: void 0, lastDeviceOptInChangeTimeAgoSec: void 0 }; +} +__name(createBaseClientInfo_NotificationPermissionInfo, "createBaseClientInfo_NotificationPermissionInfo"); +var ClientInfo_NotificationPermissionInfo = { + encode(message, writer = new BinaryWriter()) { + if (message.notificationsSetting !== void 0) { + writer.uint32(8).int32(message.notificationsSetting); + } + if (message.lastDeviceOptInChangeTimeAgoSec !== void 0) { + writer.uint32(16).int64(message.lastDeviceOptInChangeTimeAgoSec); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === void 0 ? reader.len : reader.pos + length; + const message = createBaseClientInfo_NotificationPermissionInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + message.notificationsSetting = reader.int32(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + message.lastDeviceOptInChangeTimeAgoSec = longToNumber(reader.int64()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + } +}; +function createBaseClientInfo_GLDeviceInfo() { + return { glRenderer: void 0, glEsVersionMajor: void 0, glEsVersionMinor: void 0 }; +} +__name(createBaseClientInfo_GLDeviceInfo, "createBaseClientInfo_GLDeviceInfo"); +var ClientInfo_GLDeviceInfo = { + encode(message, writer = new BinaryWriter()) { + if (message.glRenderer !== void 0) { + writer.uint32(10).string(message.glRenderer); + } + if (message.glEsVersionMajor !== void 0) { + writer.uint32(16).int32(message.glEsVersionMajor); + } + if (message.glEsVersionMinor !== void 0) { + writer.uint32(24).int32(message.glEsVersionMinor); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === void 0 ? reader.len : reader.pos + length; + const message = createBaseClientInfo_GLDeviceInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + message.glRenderer = reader.string(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + message.glEsVersionMajor = reader.int32(); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + message.glEsVersionMinor = reader.int32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + } +}; +function createBaseClientInfo_SpacecastClientInfo() { + return { appliances: void 0, interactionLevel: void 0 }; +} +__name(createBaseClientInfo_SpacecastClientInfo, "createBaseClientInfo_SpacecastClientInfo"); +var ClientInfo_SpacecastClientInfo = { + encode(message, writer = new BinaryWriter()) { + if (message.appliances !== void 0) { + ClientInfo_SpacecastClientInfo_SpacecastAppliance.encode(message.appliances, writer.uint32(10).fork()).join(); + } + if (message.interactionLevel !== void 0) { + writer.uint32(16).int32(message.interactionLevel); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === void 0 ? reader.len : reader.pos + length; + const message = createBaseClientInfo_SpacecastClientInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + message.appliances = ClientInfo_SpacecastClientInfo_SpacecastAppliance.decode(reader, reader.uint32()); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + message.interactionLevel = reader.int32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + } +}; +function createBaseClientInfo_SpacecastClientInfo_SpacecastAppliance() { + return { + contentProfileToken: void 0, + status: void 0, + hostname: void 0, + active: void 0, + deviceId: void 0 + }; +} +__name(createBaseClientInfo_SpacecastClientInfo_SpacecastAppliance, "createBaseClientInfo_SpacecastClientInfo_SpacecastAppliance"); +var ClientInfo_SpacecastClientInfo_SpacecastAppliance = { + encode(message, writer = new BinaryWriter()) { + if (message.contentProfileToken !== void 0) { + writer.uint32(10).bytes(message.contentProfileToken); + } + if (message.status !== void 0) { + writer.uint32(16).int32(message.status); + } + if (message.hostname !== void 0) { + writer.uint32(26).string(message.hostname); + } + if (message.active !== void 0) { + writer.uint32(32).bool(message.active); + } + if (message.deviceId !== void 0) { + writer.uint32(42).string(message.deviceId); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === void 0 ? reader.len : reader.pos + length; + const message = createBaseClientInfo_SpacecastClientInfo_SpacecastAppliance(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + message.contentProfileToken = reader.bytes(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + message.status = reader.int32(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + message.hostname = reader.string(); + continue; + } + case 4: { + if (tag !== 32) { + break; + } + message.active = reader.bool(); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + message.deviceId = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + } +}; +function createBaseClientInfo_MobileDataPlanInfo() { + return { + cpid: void 0, + serializedDataPlanStatus: void 0, + dataSavingQualityPickerEnabled: void 0, + mccmnc: void 0 + }; +} +__name(createBaseClientInfo_MobileDataPlanInfo, "createBaseClientInfo_MobileDataPlanInfo"); +var ClientInfo_MobileDataPlanInfo = { + encode(message, writer = new BinaryWriter()) { + if (message.cpid !== void 0) { + writer.uint32(394).string(message.cpid); + } + if (message.serializedDataPlanStatus !== void 0) { + writer.uint32(402).string(message.serializedDataPlanStatus); + } + if (message.dataSavingQualityPickerEnabled !== void 0) { + writer.uint32(416).bool(message.dataSavingQualityPickerEnabled); + } + if (message.mccmnc !== void 0) { + writer.uint32(426).string(message.mccmnc); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === void 0 ? reader.len : reader.pos + length; + const message = createBaseClientInfo_MobileDataPlanInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 49: { + if (tag !== 394) { + break; + } + message.cpid = reader.string(); + continue; + } + case 50: { + if (tag !== 402) { + break; + } + message.serializedDataPlanStatus = reader.string(); + continue; + } + case 52: { + if (tag !== 416) { + break; + } + message.dataSavingQualityPickerEnabled = reader.bool(); + continue; + } + case 53: { + if (tag !== 426) { + break; + } + message.mccmnc = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + } +}; +function createBaseClientInfo_ConfigGroupsClientInfo() { + return { coldConfigData: void 0, coldHashData: void 0, hotHashData: void 0, appInstallData: void 0 }; +} +__name(createBaseClientInfo_ConfigGroupsClientInfo, "createBaseClientInfo_ConfigGroupsClientInfo"); +var ClientInfo_ConfigGroupsClientInfo = { + encode(message, writer = new BinaryWriter()) { + if (message.coldConfigData !== void 0) { + writer.uint32(10).string(message.coldConfigData); + } + if (message.coldHashData !== void 0) { + writer.uint32(26).string(message.coldHashData); + } + if (message.hotHashData !== void 0) { + writer.uint32(42).string(message.hotHashData); + } + if (message.appInstallData !== void 0) { + writer.uint32(50).string(message.appInstallData); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === void 0 ? reader.len : reader.pos + length; + const message = createBaseClientInfo_ConfigGroupsClientInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + message.coldConfigData = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + message.coldHashData = reader.string(); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + message.hotHashData = reader.string(); + continue; + } + case 6: { + if (tag !== 50) { + break; + } + message.appInstallData = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + } +}; +function createBaseClientInfo_UnpluggedLocationInfo() { + return { + latitudeE7: void 0, + longitudeE7: void 0, + localTimestampMs: void 0, + ipAddress: void 0, + timezone: void 0, + prefer24HourTime: void 0, + locationRadiusMeters: void 0, + isInitialLoad: void 0, + browserPermissionGranted: void 0, + clientPermissionState: void 0, + locationOverrideToken: void 0 + }; +} +__name(createBaseClientInfo_UnpluggedLocationInfo, "createBaseClientInfo_UnpluggedLocationInfo"); +var ClientInfo_UnpluggedLocationInfo = { + encode(message, writer = new BinaryWriter()) { + if (message.latitudeE7 !== void 0) { + writer.uint32(8).int32(message.latitudeE7); + } + if (message.longitudeE7 !== void 0) { + writer.uint32(16).int32(message.longitudeE7); + } + if (message.localTimestampMs !== void 0) { + writer.uint32(24).int64(message.localTimestampMs); + } + if (message.ipAddress !== void 0) { + writer.uint32(34).string(message.ipAddress); + } + if (message.timezone !== void 0) { + writer.uint32(42).string(message.timezone); + } + if (message.prefer24HourTime !== void 0) { + writer.uint32(48).bool(message.prefer24HourTime); + } + if (message.locationRadiusMeters !== void 0) { + writer.uint32(56).int32(message.locationRadiusMeters); + } + if (message.isInitialLoad !== void 0) { + writer.uint32(64).bool(message.isInitialLoad); + } + if (message.browserPermissionGranted !== void 0) { + writer.uint32(72).bool(message.browserPermissionGranted); + } + if (message.clientPermissionState !== void 0) { + writer.uint32(80).int32(message.clientPermissionState); + } + if (message.locationOverrideToken !== void 0) { + writer.uint32(90).string(message.locationOverrideToken); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === void 0 ? reader.len : reader.pos + length; + const message = createBaseClientInfo_UnpluggedLocationInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + message.latitudeE7 = reader.int32(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + message.longitudeE7 = reader.int32(); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + message.localTimestampMs = longToNumber(reader.int64()); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + message.ipAddress = reader.string(); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + message.timezone = reader.string(); + continue; + } + case 6: { + if (tag !== 48) { + break; + } + message.prefer24HourTime = reader.bool(); + continue; + } + case 7: { + if (tag !== 56) { + break; + } + message.locationRadiusMeters = reader.int32(); + continue; + } + case 8: { + if (tag !== 64) { + break; + } + message.isInitialLoad = reader.bool(); + continue; + } + case 9: { + if (tag !== 72) { + break; + } + message.browserPermissionGranted = reader.bool(); + continue; + } + case 10: { + if (tag !== 80) { + break; + } + message.clientPermissionState = reader.int32(); + continue; + } + case 11: { + if (tag !== 90) { + break; + } + message.locationOverrideToken = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + } +}; +function createBaseClientInfo_KidsAppInfo() { + return { + contentSettings: void 0, + parentCurationMode: void 0, + categorySettings: void 0, + userEducationSettings: void 0 + }; +} +__name(createBaseClientInfo_KidsAppInfo, "createBaseClientInfo_KidsAppInfo"); +var ClientInfo_KidsAppInfo = { + encode(message, writer = new BinaryWriter()) { + if (message.contentSettings !== void 0) { + ClientInfo_KidsAppInfo_KidsContentSettings.encode(message.contentSettings, writer.uint32(10).fork()).join(); + } + if (message.parentCurationMode !== void 0) { + writer.uint32(16).int32(message.parentCurationMode); + } + if (message.categorySettings !== void 0) { + ClientInfo_KidsAppInfo_KidsCategorySettings.encode(message.categorySettings, writer.uint32(26).fork()).join(); + } + if (message.userEducationSettings !== void 0) { + ClientInfo_KidsAppInfo_KidsUserEducationSettings.encode(message.userEducationSettings, writer.uint32(34).fork()).join(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === void 0 ? reader.len : reader.pos + length; + const message = createBaseClientInfo_KidsAppInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + message.contentSettings = ClientInfo_KidsAppInfo_KidsContentSettings.decode(reader, reader.uint32()); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + message.parentCurationMode = reader.int32(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + message.categorySettings = ClientInfo_KidsAppInfo_KidsCategorySettings.decode(reader, reader.uint32()); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + message.userEducationSettings = ClientInfo_KidsAppInfo_KidsUserEducationSettings.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + } +}; +function createBaseClientInfo_KidsAppInfo_KidsContentSettings() { + return { kidsNoSearchMode: void 0, ageUpMode: void 0, contentDensity: void 0 }; +} +__name(createBaseClientInfo_KidsAppInfo_KidsContentSettings, "createBaseClientInfo_KidsAppInfo_KidsContentSettings"); +var ClientInfo_KidsAppInfo_KidsContentSettings = { + encode(message, writer = new BinaryWriter()) { + if (message.kidsNoSearchMode !== void 0) { + writer.uint32(8).int32(message.kidsNoSearchMode); + } + if (message.ageUpMode !== void 0) { + writer.uint32(16).int32(message.ageUpMode); + } + if (message.contentDensity !== void 0) { + writer.uint32(24).int32(message.contentDensity); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === void 0 ? reader.len : reader.pos + length; + const message = createBaseClientInfo_KidsAppInfo_KidsContentSettings(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + message.kidsNoSearchMode = reader.int32(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + message.ageUpMode = reader.int32(); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + message.contentDensity = reader.int32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + } +}; +function createBaseClientInfo_KidsAppInfo_KidsCategorySettings() { + return { enabledCategories: void 0 }; +} +__name(createBaseClientInfo_KidsAppInfo_KidsCategorySettings, "createBaseClientInfo_KidsAppInfo_KidsCategorySettings"); +var ClientInfo_KidsAppInfo_KidsCategorySettings = { + encode(message, writer = new BinaryWriter()) { + if (message.enabledCategories !== void 0) { + writer.uint32(10).string(message.enabledCategories); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === void 0 ? reader.len : reader.pos + length; + const message = createBaseClientInfo_KidsAppInfo_KidsCategorySettings(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + message.enabledCategories = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + } +}; +function createBaseClientInfo_KidsAppInfo_KidsUserEducationSettings() { + return { + hasSeenHomeChipBarUserEducation: void 0, + hasSeenHomePivotBarUserEducation: void 0, + hasSeenParentMuirUserEducation: void 0 + }; +} +__name(createBaseClientInfo_KidsAppInfo_KidsUserEducationSettings, "createBaseClientInfo_KidsAppInfo_KidsUserEducationSettings"); +var ClientInfo_KidsAppInfo_KidsUserEducationSettings = { + encode(message, writer = new BinaryWriter()) { + if (message.hasSeenHomeChipBarUserEducation !== void 0) { + writer.uint32(8).bool(message.hasSeenHomeChipBarUserEducation); + } + if (message.hasSeenHomePivotBarUserEducation !== void 0) { + writer.uint32(16).bool(message.hasSeenHomePivotBarUserEducation); + } + if (message.hasSeenParentMuirUserEducation !== void 0) { + writer.uint32(24).bool(message.hasSeenParentMuirUserEducation); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === void 0 ? reader.len : reader.pos + length; + const message = createBaseClientInfo_KidsAppInfo_KidsUserEducationSettings(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + message.hasSeenHomeChipBarUserEducation = reader.bool(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + message.hasSeenHomePivotBarUserEducation = reader.bool(); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + message.hasSeenParentMuirUserEducation = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + } +}; +function createBaseClientInfo_MusicAppInfo() { + return { + playBackMode: void 0, + musicLocationMasterSwitch: void 0, + musicActivityMasterSwitch: void 0, + offlineMixtapeEnabled: void 0, + autoOfflineEnabled: void 0, + iosBackgroundRefreshStatus: void 0, + smartDownloadsSongLimit: void 0, + transitionedFromMixtapeToSmartDownloads: void 0, + pwaInstallabilityStatus: void 0, + webDisplayMode: void 0, + musicTier: void 0, + storeDigitalGoodsApiSupportStatus: void 0, + smartDownloadsTimeSinceLastOptOutSec: void 0 + }; +} +__name(createBaseClientInfo_MusicAppInfo, "createBaseClientInfo_MusicAppInfo"); +var ClientInfo_MusicAppInfo = { + encode(message, writer = new BinaryWriter()) { + if (message.playBackMode !== void 0) { + writer.uint32(8).int32(message.playBackMode); + } + if (message.musicLocationMasterSwitch !== void 0) { + writer.uint32(16).int32(message.musicLocationMasterSwitch); + } + if (message.musicActivityMasterSwitch !== void 0) { + writer.uint32(24).int32(message.musicActivityMasterSwitch); + } + if (message.offlineMixtapeEnabled !== void 0) { + writer.uint32(32).bool(message.offlineMixtapeEnabled); + } + if (message.autoOfflineEnabled !== void 0) { + writer.uint32(40).bool(message.autoOfflineEnabled); + } + if (message.iosBackgroundRefreshStatus !== void 0) { + writer.uint32(48).int32(message.iosBackgroundRefreshStatus); + } + if (message.smartDownloadsSongLimit !== void 0) { + writer.uint32(56).int32(message.smartDownloadsSongLimit); + } + if (message.transitionedFromMixtapeToSmartDownloads !== void 0) { + writer.uint32(64).bool(message.transitionedFromMixtapeToSmartDownloads); + } + if (message.pwaInstallabilityStatus !== void 0) { + writer.uint32(72).int32(message.pwaInstallabilityStatus); + } + if (message.webDisplayMode !== void 0) { + writer.uint32(80).int32(message.webDisplayMode); + } + if (message.musicTier !== void 0) { + writer.uint32(88).int32(message.musicTier); + } + if (message.storeDigitalGoodsApiSupportStatus !== void 0) { + writer.uint32(96).int32(message.storeDigitalGoodsApiSupportStatus); + } + if (message.smartDownloadsTimeSinceLastOptOutSec !== void 0) { + writer.uint32(104).int64(message.smartDownloadsTimeSinceLastOptOutSec); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === void 0 ? reader.len : reader.pos + length; + const message = createBaseClientInfo_MusicAppInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + message.playBackMode = reader.int32(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + message.musicLocationMasterSwitch = reader.int32(); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + message.musicActivityMasterSwitch = reader.int32(); + continue; + } + case 4: { + if (tag !== 32) { + break; + } + message.offlineMixtapeEnabled = reader.bool(); + continue; + } + case 5: { + if (tag !== 40) { + break; + } + message.autoOfflineEnabled = reader.bool(); + continue; + } + case 6: { + if (tag !== 48) { + break; + } + message.iosBackgroundRefreshStatus = reader.int32(); + continue; + } + case 7: { + if (tag !== 56) { + break; + } + message.smartDownloadsSongLimit = reader.int32(); + continue; + } + case 8: { + if (tag !== 64) { + break; + } + message.transitionedFromMixtapeToSmartDownloads = reader.bool(); + continue; + } + case 9: { + if (tag !== 72) { + break; + } + message.pwaInstallabilityStatus = reader.int32(); + continue; + } + case 10: { + if (tag !== 80) { + break; + } + message.webDisplayMode = reader.int32(); + continue; + } + case 11: { + if (tag !== 88) { + break; + } + message.musicTier = reader.int32(); + continue; + } + case 12: { + if (tag !== 96) { + break; + } + message.storeDigitalGoodsApiSupportStatus = reader.int32(); + continue; + } + case 13: { + if (tag !== 104) { + break; + } + message.smartDownloadsTimeSinceLastOptOutSec = longToNumber(reader.int64()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + } +}; +function createBaseClientInfo_TvAppInfo() { + return { + mdxImpactedSessionsServerEvents: void 0, + enablePrivacyFilter: void 0, + zylonLeftNav: void 0, + certificationScope: void 0, + livingRoomPoTokenId: void 0, + jsEngineString: void 0, + voiceCapability: void 0, + systemIntegrator: void 0, + androidBuildFingerprint: void 0, + cobaltAppVersion: void 0, + cobaltStarboardVersion: void 0, + useStartPlaybackPreviewCommand: void 0, + shouldShowPersistentSigninOnHome: void 0, + androidPlayServicesVersion: void 0 + }; +} +__name(createBaseClientInfo_TvAppInfo, "createBaseClientInfo_TvAppInfo"); +var ClientInfo_TvAppInfo = { + encode(message, writer = new BinaryWriter()) { + if (message.mdxImpactedSessionsServerEvents !== void 0) { + writer.uint32(26).string(message.mdxImpactedSessionsServerEvents); + } + if (message.enablePrivacyFilter !== void 0) { + writer.uint32(48).bool(message.enablePrivacyFilter); + } + if (message.zylonLeftNav !== void 0) { + writer.uint32(56).bool(message.zylonLeftNav); + } + if (message.certificationScope !== void 0) { + writer.uint32(74).string(message.certificationScope); + } + if (message.livingRoomPoTokenId !== void 0) { + writer.uint32(82).string(message.livingRoomPoTokenId); + } + if (message.jsEngineString !== void 0) { + writer.uint32(98).string(message.jsEngineString); + } + if (message.voiceCapability !== void 0) { + ClientInfo_TvAppInfo_VoiceCapability.encode(message.voiceCapability, writer.uint32(106).fork()).join(); + } + if (message.systemIntegrator !== void 0) { + writer.uint32(114).string(message.systemIntegrator); + } + if (message.androidBuildFingerprint !== void 0) { + writer.uint32(146).string(message.androidBuildFingerprint); + } + if (message.cobaltAppVersion !== void 0) { + writer.uint32(154).string(message.cobaltAppVersion); + } + if (message.cobaltStarboardVersion !== void 0) { + writer.uint32(162).string(message.cobaltStarboardVersion); + } + if (message.useStartPlaybackPreviewCommand !== void 0) { + writer.uint32(176).bool(message.useStartPlaybackPreviewCommand); + } + if (message.shouldShowPersistentSigninOnHome !== void 0) { + writer.uint32(184).bool(message.shouldShowPersistentSigninOnHome); + } + if (message.androidPlayServicesVersion !== void 0) { + writer.uint32(194).string(message.androidPlayServicesVersion); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === void 0 ? reader.len : reader.pos + length; + const message = createBaseClientInfo_TvAppInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + if (tag !== 26) { + break; + } + message.mdxImpactedSessionsServerEvents = reader.string(); + continue; + } + case 6: { + if (tag !== 48) { + break; + } + message.enablePrivacyFilter = reader.bool(); + continue; + } + case 7: { + if (tag !== 56) { + break; + } + message.zylonLeftNav = reader.bool(); + continue; + } + case 9: { + if (tag !== 74) { + break; + } + message.certificationScope = reader.string(); + continue; + } + case 10: { + if (tag !== 82) { + break; + } + message.livingRoomPoTokenId = reader.string(); + continue; + } + case 12: { + if (tag !== 98) { + break; + } + message.jsEngineString = reader.string(); + continue; + } + case 13: { + if (tag !== 106) { + break; + } + message.voiceCapability = ClientInfo_TvAppInfo_VoiceCapability.decode(reader, reader.uint32()); + continue; + } + case 14: { + if (tag !== 114) { + break; + } + message.systemIntegrator = reader.string(); + continue; + } + case 18: { + if (tag !== 146) { + break; + } + message.androidBuildFingerprint = reader.string(); + continue; + } + case 19: { + if (tag !== 154) { + break; + } + message.cobaltAppVersion = reader.string(); + continue; + } + case 20: { + if (tag !== 162) { + break; + } + message.cobaltStarboardVersion = reader.string(); + continue; + } + case 22: { + if (tag !== 176) { + break; + } + message.useStartPlaybackPreviewCommand = reader.bool(); + continue; + } + case 23: { + if (tag !== 184) { + break; + } + message.shouldShowPersistentSigninOnHome = reader.bool(); + continue; + } + case 24: { + if (tag !== 194) { + break; + } + message.androidPlayServicesVersion = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + } +}; +function createBaseClientInfo_TvAppInfo_VoiceCapability() { + return { hasSoftMicSupport: void 0, hasHardMicSupport: void 0 }; +} +__name(createBaseClientInfo_TvAppInfo_VoiceCapability, "createBaseClientInfo_TvAppInfo_VoiceCapability"); +var ClientInfo_TvAppInfo_VoiceCapability = { + encode(message, writer = new BinaryWriter()) { + if (message.hasSoftMicSupport !== void 0) { + writer.uint32(8).bool(message.hasSoftMicSupport); + } + if (message.hasHardMicSupport !== void 0) { + writer.uint32(16).bool(message.hasHardMicSupport); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === void 0 ? reader.len : reader.pos + length; + const message = createBaseClientInfo_TvAppInfo_VoiceCapability(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + message.hasSoftMicSupport = reader.bool(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + message.hasHardMicSupport = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + } +}; +function createBaseClientInfo_UnpluggedAppInfo() { + return { enableFilterMode: void 0, iosNotificationPermission: void 0, forceEnableEpg3: void 0 }; +} +__name(createBaseClientInfo_UnpluggedAppInfo, "createBaseClientInfo_UnpluggedAppInfo"); +var ClientInfo_UnpluggedAppInfo = { + encode(message, writer = new BinaryWriter()) { + if (message.enableFilterMode !== void 0) { + writer.uint32(16).bool(message.enableFilterMode); + } + if (message.iosNotificationPermission !== void 0) { + writer.uint32(24).bool(message.iosNotificationPermission); + } + if (message.forceEnableEpg3 !== void 0) { + writer.uint32(56).bool(message.forceEnableEpg3); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === void 0 ? reader.len : reader.pos + length; + const message = createBaseClientInfo_UnpluggedAppInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + if (tag !== 16) { + break; + } + message.enableFilterMode = reader.bool(); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + message.iosNotificationPermission = reader.bool(); + continue; + } + case 7: { + if (tag !== 56) { + break; + } + message.forceEnableEpg3 = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + } +}; +function createBaseClientInfo_LocationInfo() { + return { + locationInfoStatus: void 0, + ulrStatus: void 0, + latitudeE7: void 0, + longitudeE7: void 0, + horizontalAccuracyMeters: void 0, + locationFreshnessMs: void 0, + locationPermissionAuthorizationStatus: void 0, + locationOverrideToken: void 0, + forceLocationPlayabilityTokenRefresh: void 0 + }; +} +__name(createBaseClientInfo_LocationInfo, "createBaseClientInfo_LocationInfo"); +var ClientInfo_LocationInfo = { + encode(message, writer = new BinaryWriter()) { + if (message.locationInfoStatus !== void 0) { + writer.uint32(8).int32(message.locationInfoStatus); + } + if (message.ulrStatus !== void 0) { + ClientInfo_LocationInfo_UrlStatus.encode(message.ulrStatus, writer.uint32(18).fork()).join(); + } + if (message.latitudeE7 !== void 0) { + writer.uint32(26).string(message.latitudeE7); + } + if (message.longitudeE7 !== void 0) { + writer.uint32(34).string(message.longitudeE7); + } + if (message.horizontalAccuracyMeters !== void 0) { + writer.uint32(42).string(message.horizontalAccuracyMeters); + } + if (message.locationFreshnessMs !== void 0) { + writer.uint32(50).string(message.locationFreshnessMs); + } + if (message.locationPermissionAuthorizationStatus !== void 0) { + writer.uint32(56).int32(message.locationPermissionAuthorizationStatus); + } + if (message.locationOverrideToken !== void 0) { + writer.uint32(66).string(message.locationOverrideToken); + } + if (message.forceLocationPlayabilityTokenRefresh !== void 0) { + writer.uint32(72).bool(message.forceLocationPlayabilityTokenRefresh); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === void 0 ? reader.len : reader.pos + length; + const message = createBaseClientInfo_LocationInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + message.locationInfoStatus = reader.int32(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + message.ulrStatus = ClientInfo_LocationInfo_UrlStatus.decode(reader, reader.uint32()); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + message.latitudeE7 = reader.string(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + message.longitudeE7 = reader.string(); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + message.horizontalAccuracyMeters = reader.string(); + continue; + } + case 6: { + if (tag !== 50) { + break; + } + message.locationFreshnessMs = reader.string(); + continue; + } + case 7: { + if (tag !== 56) { + break; + } + message.locationPermissionAuthorizationStatus = reader.int32(); + continue; + } + case 8: { + if (tag !== 66) { + break; + } + message.locationOverrideToken = reader.string(); + continue; + } + case 9: { + if (tag !== 72) { + break; + } + message.forceLocationPlayabilityTokenRefresh = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + } +}; +function createBaseClientInfo_LocationInfo_UrlStatus() { + return { + reportingEnabledSetting: void 0, + historyEnabledSetting: void 0, + isAllowed: void 0, + isActive: void 0 + }; +} +__name(createBaseClientInfo_LocationInfo_UrlStatus, "createBaseClientInfo_LocationInfo_UrlStatus"); +var ClientInfo_LocationInfo_UrlStatus = { + encode(message, writer = new BinaryWriter()) { + if (message.reportingEnabledSetting !== void 0) { + writer.uint32(8).int32(message.reportingEnabledSetting); + } + if (message.historyEnabledSetting !== void 0) { + writer.uint32(16).int32(message.historyEnabledSetting); + } + if (message.isAllowed !== void 0) { + writer.uint32(24).bool(message.isAllowed); + } + if (message.isActive !== void 0) { + writer.uint32(32).bool(message.isActive); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === void 0 ? reader.len : reader.pos + length; + const message = createBaseClientInfo_LocationInfo_UrlStatus(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + message.reportingEnabledSetting = reader.int32(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + message.historyEnabledSetting = reader.int32(); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + message.isAllowed = reader.bool(); + continue; + } + case 4: { + if (tag !== 32) { + break; + } + message.isActive = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + } +}; +function createBaseClientInfo_HomeGroupInfo() { + return { isPartOfGroup: void 0, isGroup: void 0 }; +} +__name(createBaseClientInfo_HomeGroupInfo, "createBaseClientInfo_HomeGroupInfo"); +var ClientInfo_HomeGroupInfo = { + encode(message, writer = new BinaryWriter()) { + if (message.isPartOfGroup !== void 0) { + writer.uint32(8).bool(message.isPartOfGroup); + } + if (message.isGroup !== void 0) { + writer.uint32(24).bool(message.isGroup); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === void 0 ? reader.len : reader.pos + length; + const message = createBaseClientInfo_HomeGroupInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + message.isPartOfGroup = reader.bool(); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + message.isGroup = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + } +}; +function longToNumber(int64) { + const num = globalThis.Number(int64.toString()); + if (num > globalThis.Number.MAX_SAFE_INTEGER) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + if (num < globalThis.Number.MIN_SAFE_INTEGER) { + throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER"); + } + return num; +} +__name(longToNumber, "longToNumber"); + +// dist/protos/generated/youtube/api/pfiinnertube/attestation_response_data.js +function createBaseAttestationResponseData() { + return { + challenge: void 0, + webResponse: void 0, + androidResponse: void 0, + iosResponse: void 0, + error: void 0, + adblockReporting: void 0 + }; +} +__name(createBaseAttestationResponseData, "createBaseAttestationResponseData"); +var AttestationResponseData = { + encode(message, writer = new BinaryWriter()) { + if (message.challenge !== void 0) { + writer.uint32(10).string(message.challenge); + } + if (message.webResponse !== void 0) { + writer.uint32(18).string(message.webResponse); + } + if (message.androidResponse !== void 0) { + writer.uint32(26).string(message.androidResponse); + } + if (message.iosResponse !== void 0) { + writer.uint32(34).bytes(message.iosResponse); + } + if (message.error !== void 0) { + writer.uint32(40).int32(message.error); + } + if (message.adblockReporting !== void 0) { + AttestationResponseData_AdblockReporting.encode(message.adblockReporting, writer.uint32(50).fork()).join(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === void 0 ? reader.len : reader.pos + length; + const message = createBaseAttestationResponseData(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + message.challenge = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + message.webResponse = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + message.androidResponse = reader.string(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + message.iosResponse = reader.bytes(); + continue; + } + case 5: { + if (tag !== 40) { + break; + } + message.error = reader.int32(); + continue; + } + case 6: { + if (tag !== 50) { + break; + } + message.adblockReporting = AttestationResponseData_AdblockReporting.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + } +}; +function createBaseAttestationResponseData_AdblockReporting() { + return { reportingStatus: void 0, broadSpectrumDetectionResult: void 0 }; +} +__name(createBaseAttestationResponseData_AdblockReporting, "createBaseAttestationResponseData_AdblockReporting"); +var AttestationResponseData_AdblockReporting = { + encode(message, writer = new BinaryWriter()) { + if (message.reportingStatus !== void 0) { + writer.uint32(8).uint64(message.reportingStatus); + } + if (message.broadSpectrumDetectionResult !== void 0) { + writer.uint32(16).uint64(message.broadSpectrumDetectionResult); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === void 0 ? reader.len : reader.pos + length; + const message = createBaseAttestationResponseData_AdblockReporting(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + message.reportingStatus = longToNumber2(reader.uint64()); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + message.broadSpectrumDetectionResult = longToNumber2(reader.uint64()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + } +}; +function longToNumber2(int64) { + const num = globalThis.Number(int64.toString()); + if (num > globalThis.Number.MAX_SAFE_INTEGER) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + if (num < globalThis.Number.MIN_SAFE_INTEGER) { + throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER"); + } + return num; +} +__name(longToNumber2, "longToNumber"); + +// dist/protos/generated/youtube/api/pfiinnertube/request_info.js +function createBaseRequestInfo() { + return { + thirdPartyDigest: void 0, + useSsl: void 0, + returnErrorDetail: void 0, + ifNoneMatch: void 0, + returnLogEntry: void 0, + isPrefetch: void 0, + internalExperimentFlags: [], + returnDebugData: void 0, + innertubez: void 0, + traceProto: void 0, + returnLogEntryJson: void 0, + sherlogUsername: void 0, + reauthRequestInfo: void 0, + sessionInfo: void 0, + returnLogEntryProto: void 0, + externalPrequestContext: void 0, + attestationResponseData: void 0, + eats: void 0, + requestQos: void 0 + }; +} +__name(createBaseRequestInfo, "createBaseRequestInfo"); +var RequestInfo = { + encode(message, writer = new BinaryWriter()) { + if (message.thirdPartyDigest !== void 0) { + writer.uint32(50).string(message.thirdPartyDigest); + } + if (message.useSsl !== void 0) { + writer.uint32(56).bool(message.useSsl); + } + if (message.returnErrorDetail !== void 0) { + writer.uint32(72).bool(message.returnErrorDetail); + } + if (message.ifNoneMatch !== void 0) { + writer.uint32(98).string(message.ifNoneMatch); + } + if (message.returnLogEntry !== void 0) { + writer.uint32(104).bool(message.returnLogEntry); + } + if (message.isPrefetch !== void 0) { + writer.uint32(112).bool(message.isPrefetch); + } + for (const v of message.internalExperimentFlags) { + KeyValuePair.encode(v, writer.uint32(122).fork()).join(); + } + if (message.returnDebugData !== void 0) { + writer.uint32(128).bool(message.returnDebugData); + } + if (message.innertubez !== void 0) { + writer.uint32(146).string(message.innertubez); + } + if (message.traceProto !== void 0) { + writer.uint32(184).bool(message.traceProto); + } + if (message.returnLogEntryJson !== void 0) { + writer.uint32(192).bool(message.returnLogEntryJson); + } + if (message.sherlogUsername !== void 0) { + writer.uint32(202).string(message.sherlogUsername); + } + if (message.reauthRequestInfo !== void 0) { + RequestInfo_ReauthRequestInfo.encode(message.reauthRequestInfo, writer.uint32(234).fork()).join(); + } + if (message.sessionInfo !== void 0) { + RequestInfo_SessionInfo.encode(message.sessionInfo, writer.uint32(242).fork()).join(); + } + if (message.returnLogEntryProto !== void 0) { + writer.uint32(248).bool(message.returnLogEntryProto); + } + if (message.externalPrequestContext !== void 0) { + writer.uint32(258).string(message.externalPrequestContext); + } + if (message.attestationResponseData !== void 0) { + AttestationResponseData.encode(message.attestationResponseData, writer.uint32(274).fork()).join(); + } + if (message.eats !== void 0) { + writer.uint32(282).bytes(message.eats); + } + if (message.requestQos !== void 0) { + RequestInfo_RequestQoS.encode(message.requestQos, writer.uint32(290).fork()).join(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === void 0 ? reader.len : reader.pos + length; + const message = createBaseRequestInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 6: { + if (tag !== 50) { + break; + } + message.thirdPartyDigest = reader.string(); + continue; + } + case 7: { + if (tag !== 56) { + break; + } + message.useSsl = reader.bool(); + continue; + } + case 9: { + if (tag !== 72) { + break; + } + message.returnErrorDetail = reader.bool(); + continue; + } + case 12: { + if (tag !== 98) { + break; + } + message.ifNoneMatch = reader.string(); + continue; + } + case 13: { + if (tag !== 104) { + break; + } + message.returnLogEntry = reader.bool(); + continue; + } + case 14: { + if (tag !== 112) { + break; + } + message.isPrefetch = reader.bool(); + continue; + } + case 15: { + if (tag !== 122) { + break; + } + message.internalExperimentFlags.push(KeyValuePair.decode(reader, reader.uint32())); + continue; + } + case 16: { + if (tag !== 128) { + break; + } + message.returnDebugData = reader.bool(); + continue; + } + case 18: { + if (tag !== 146) { + break; + } + message.innertubez = reader.string(); + continue; + } + case 23: { + if (tag !== 184) { + break; + } + message.traceProto = reader.bool(); + continue; + } + case 24: { + if (tag !== 192) { + break; + } + message.returnLogEntryJson = reader.bool(); + continue; + } + case 25: { + if (tag !== 202) { + break; + } + message.sherlogUsername = reader.string(); + continue; + } + case 29: { + if (tag !== 234) { + break; + } + message.reauthRequestInfo = RequestInfo_ReauthRequestInfo.decode(reader, reader.uint32()); + continue; + } + case 30: { + if (tag !== 242) { + break; + } + message.sessionInfo = RequestInfo_SessionInfo.decode(reader, reader.uint32()); + continue; + } + case 31: { + if (tag !== 248) { + break; + } + message.returnLogEntryProto = reader.bool(); + continue; + } + case 32: { + if (tag !== 258) { + break; + } + message.externalPrequestContext = reader.string(); + continue; + } + case 34: { + if (tag !== 274) { + break; + } + message.attestationResponseData = AttestationResponseData.decode(reader, reader.uint32()); + continue; + } + case 35: { + if (tag !== 282) { + break; + } + message.eats = reader.bytes(); + continue; + } + case 36: { + if (tag !== 290) { + break; + } + message.requestQos = RequestInfo_RequestQoS.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + } +}; +function createBaseRequestInfo_RequestQoS() { + return { criticality: void 0 }; +} +__name(createBaseRequestInfo_RequestQoS, "createBaseRequestInfo_RequestQoS"); +var RequestInfo_RequestQoS = { + encode(message, writer = new BinaryWriter()) { + if (message.criticality !== void 0) { + writer.uint32(8).int32(message.criticality); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === void 0 ? reader.len : reader.pos + length; + const message = createBaseRequestInfo_RequestQoS(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + message.criticality = reader.int32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + } +}; +function createBaseRequestInfo_SessionInfo() { + return { token: void 0 }; +} +__name(createBaseRequestInfo_SessionInfo, "createBaseRequestInfo_SessionInfo"); +var RequestInfo_SessionInfo = { + encode(message, writer = new BinaryWriter()) { + if (message.token !== void 0) { + writer.uint32(10).string(message.token); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === void 0 ? reader.len : reader.pos + length; + const message = createBaseRequestInfo_SessionInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + message.token = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + } +}; +function createBaseRequestInfo_ReauthRequestInfo() { + return { encodedReauthProofToken: void 0 }; +} +__name(createBaseRequestInfo_ReauthRequestInfo, "createBaseRequestInfo_ReauthRequestInfo"); +var RequestInfo_ReauthRequestInfo = { + encode(message, writer = new BinaryWriter()) { + if (message.encodedReauthProofToken !== void 0) { + writer.uint32(10).string(message.encodedReauthProofToken); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === void 0 ? reader.len : reader.pos + length; + const message = createBaseRequestInfo_ReauthRequestInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + message.encodedReauthProofToken = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + } +}; + +// dist/protos/generated/youtube/api/pfiinnertube/third_party_info.js +function createBaseThirdPartyInfo() { + return { + developerKey: void 0, + appName: void 0, + appPublisher: void 0, + embedUrl: void 0, + appVersion: void 0, + embeddedPlayerContext: void 0 + }; +} +__name(createBaseThirdPartyInfo, "createBaseThirdPartyInfo"); +var ThirdPartyInfo = { + encode(message, writer = new BinaryWriter()) { + if (message.developerKey !== void 0) { + writer.uint32(10).string(message.developerKey); + } + if (message.appName !== void 0) { + writer.uint32(18).string(message.appName); + } + if (message.appPublisher !== void 0) { + writer.uint32(26).string(message.appPublisher); + } + if (message.embedUrl !== void 0) { + writer.uint32(34).string(message.embedUrl); + } + if (message.appVersion !== void 0) { + writer.uint32(50).string(message.appVersion); + } + if (message.embeddedPlayerContext !== void 0) { + ThirdPartyInfo_EmbeddedPlayerContext.encode(message.embeddedPlayerContext, writer.uint32(58).fork()).join(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === void 0 ? reader.len : reader.pos + length; + const message = createBaseThirdPartyInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + message.developerKey = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + message.appName = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + message.appPublisher = reader.string(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + message.embedUrl = reader.string(); + continue; + } + case 6: { + if (tag !== 50) { + break; + } + message.appVersion = reader.string(); + continue; + } + case 7: { + if (tag !== 58) { + break; + } + message.embeddedPlayerContext = ThirdPartyInfo_EmbeddedPlayerContext.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + } +}; +function createBaseThirdPartyInfo_EmbeddedPlayerContext() { + return { ancestorOrigins: void 0, embeddedPlayerEncryptedContext: void 0, ancestorOriginsSupported: void 0 }; +} +__name(createBaseThirdPartyInfo_EmbeddedPlayerContext, "createBaseThirdPartyInfo_EmbeddedPlayerContext"); +var ThirdPartyInfo_EmbeddedPlayerContext = { + encode(message, writer = new BinaryWriter()) { + if (message.ancestorOrigins !== void 0) { + writer.uint32(10).string(message.ancestorOrigins); + } + if (message.embeddedPlayerEncryptedContext !== void 0) { + writer.uint32(18).string(message.embeddedPlayerEncryptedContext); + } + if (message.ancestorOriginsSupported !== void 0) { + writer.uint32(24).bool(message.ancestorOriginsSupported); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === void 0 ? reader.len : reader.pos + length; + const message = createBaseThirdPartyInfo_EmbeddedPlayerContext(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + message.ancestorOrigins = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + message.embeddedPlayerEncryptedContext = reader.string(); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + message.ancestorOriginsSupported = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + } +}; + +// dist/protos/generated/youtube/api/pfiinnertube/user_info.js +function createBaseUserInfo() { + return { + onBehalfOfUser: void 0, + enableSafetyMode: void 0, + credentialTransferTokens: [], + delegatePurchases: void 0, + kidsParent: void 0, + isIncognito: void 0, + lockedSafetyMode: void 0, + delegationContext: void 0, + serializedDelegationContext: void 0 + }; +} +__name(createBaseUserInfo, "createBaseUserInfo"); +var UserInfo = { + encode(message, writer = new BinaryWriter()) { + if (message.onBehalfOfUser !== void 0) { + writer.uint32(26).string(message.onBehalfOfUser); + } + if (message.enableSafetyMode !== void 0) { + writer.uint32(56).bool(message.enableSafetyMode); + } + for (const v of message.credentialTransferTokens) { + UserInfo_CredentialTransferToken.encode(v, writer.uint32(98).fork()).join(); + } + if (message.delegatePurchases !== void 0) { + UserInfo_DelegatePurchases.encode(message.delegatePurchases, writer.uint32(106).fork()).join(); + } + if (message.kidsParent !== void 0) { + UserInfo_KidsParent.encode(message.kidsParent, writer.uint32(114).fork()).join(); + } + if (message.isIncognito !== void 0) { + writer.uint32(120).bool(message.isIncognito); + } + if (message.lockedSafetyMode !== void 0) { + writer.uint32(128).bool(message.lockedSafetyMode); + } + if (message.delegationContext !== void 0) { + UserInfo_DelegationContext.encode(message.delegationContext, writer.uint32(138).fork()).join(); + } + if (message.serializedDelegationContext !== void 0) { + writer.uint32(146).string(message.serializedDelegationContext); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === void 0 ? reader.len : reader.pos + length; + const message = createBaseUserInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + if (tag !== 26) { + break; + } + message.onBehalfOfUser = reader.string(); + continue; + } + case 7: { + if (tag !== 56) { + break; + } + message.enableSafetyMode = reader.bool(); + continue; + } + case 12: { + if (tag !== 98) { + break; + } + message.credentialTransferTokens.push(UserInfo_CredentialTransferToken.decode(reader, reader.uint32())); + continue; + } + case 13: { + if (tag !== 106) { + break; + } + message.delegatePurchases = UserInfo_DelegatePurchases.decode(reader, reader.uint32()); + continue; + } + case 14: { + if (tag !== 114) { + break; + } + message.kidsParent = UserInfo_KidsParent.decode(reader, reader.uint32()); + continue; + } + case 15: { + if (tag !== 120) { + break; + } + message.isIncognito = reader.bool(); + continue; + } + case 16: { + if (tag !== 128) { + break; + } + message.lockedSafetyMode = reader.bool(); + continue; + } + case 17: { + if (tag !== 138) { + break; + } + message.delegationContext = UserInfo_DelegationContext.decode(reader, reader.uint32()); + continue; + } + case 18: { + if (tag !== 146) { + break; + } + message.serializedDelegationContext = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + } +}; +function createBaseUserInfo_KidsParent() { + return {}; +} +__name(createBaseUserInfo_KidsParent, "createBaseUserInfo_KidsParent"); +var UserInfo_KidsParent = { + encode(_, writer = new BinaryWriter()) { + return writer; + }, + decode(input, length) { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === void 0 ? reader.len : reader.pos + length; + const message = createBaseUserInfo_KidsParent(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + } +}; +function createBaseUserInfo_DelegatePurchases() { + return {}; +} +__name(createBaseUserInfo_DelegatePurchases, "createBaseUserInfo_DelegatePurchases"); +var UserInfo_DelegatePurchases = { + encode(_, writer = new BinaryWriter()) { + return writer; + }, + decode(input, length) { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === void 0 ? reader.len : reader.pos + length; + const message = createBaseUserInfo_DelegatePurchases(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + } +}; +function createBaseUserInfo_DelegationContext() { + return {}; +} +__name(createBaseUserInfo_DelegationContext, "createBaseUserInfo_DelegationContext"); +var UserInfo_DelegationContext = { + encode(_, writer = new BinaryWriter()) { + return writer; + }, + decode(input, length) { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === void 0 ? reader.len : reader.pos + length; + const message = createBaseUserInfo_DelegationContext(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + } +}; +function createBaseUserInfo_CredentialTransferToken() { + return {}; +} +__name(createBaseUserInfo_CredentialTransferToken, "createBaseUserInfo_CredentialTransferToken"); +var UserInfo_CredentialTransferToken = { + encode(_, writer = new BinaryWriter()) { + return writer; + }, + decode(input, length) { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === void 0 ? reader.len : reader.pos + length; + const message = createBaseUserInfo_CredentialTransferToken(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + } +}; + +// dist/protos/generated/youtube/api/pfiinnertube/innertube_context.js +function createBaseInnerTubeContext() { + return { + client: void 0, + user: void 0, + capabilities: void 0, + request: void 0, + clickTracking: void 0, + thirdParty: void 0, + remoteClient: void 0, + adSignalsInfo: void 0, + experimentalData: void 0, + clientScreenNonce: void 0, + activePlayers: [] + }; +} +__name(createBaseInnerTubeContext, "createBaseInnerTubeContext"); +var InnerTubeContext = { + encode(message, writer = new BinaryWriter()) { + if (message.client !== void 0) { + ClientInfo.encode(message.client, writer.uint32(10).fork()).join(); + } + if (message.user !== void 0) { + UserInfo.encode(message.user, writer.uint32(26).fork()).join(); + } + if (message.capabilities !== void 0) { + CapabilityInfo.encode(message.capabilities, writer.uint32(34).fork()).join(); + } + if (message.request !== void 0) { + RequestInfo.encode(message.request, writer.uint32(42).fork()).join(); + } + if (message.clickTracking !== void 0) { + InnerTubeContext_ClickTrackingInfo.encode(message.clickTracking, writer.uint32(50).fork()).join(); + } + if (message.thirdParty !== void 0) { + ThirdPartyInfo.encode(message.thirdParty, writer.uint32(58).fork()).join(); + } + if (message.remoteClient !== void 0) { + ClientInfo.encode(message.remoteClient, writer.uint32(66).fork()).join(); + } + if (message.adSignalsInfo !== void 0) { + InnerTubeContext_AdSignalsInfo.encode(message.adSignalsInfo, writer.uint32(74).fork()).join(); + } + if (message.experimentalData !== void 0) { + InnerTubeContext_ExperimentalData.encode(message.experimentalData, writer.uint32(82).fork()).join(); + } + if (message.clientScreenNonce !== void 0) { + writer.uint32(90).string(message.clientScreenNonce); + } + for (const v of message.activePlayers) { + InnerTubeContext_ActivePlayerInfo.encode(v, writer.uint32(98).fork()).join(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === void 0 ? reader.len : reader.pos + length; + const message = createBaseInnerTubeContext(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + message.client = ClientInfo.decode(reader, reader.uint32()); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + message.user = UserInfo.decode(reader, reader.uint32()); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + message.capabilities = CapabilityInfo.decode(reader, reader.uint32()); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + message.request = RequestInfo.decode(reader, reader.uint32()); + continue; + } + case 6: { + if (tag !== 50) { + break; + } + message.clickTracking = InnerTubeContext_ClickTrackingInfo.decode(reader, reader.uint32()); + continue; + } + case 7: { + if (tag !== 58) { + break; + } + message.thirdParty = ThirdPartyInfo.decode(reader, reader.uint32()); + continue; + } + case 8: { + if (tag !== 66) { + break; + } + message.remoteClient = ClientInfo.decode(reader, reader.uint32()); + continue; + } + case 9: { + if (tag !== 74) { + break; + } + message.adSignalsInfo = InnerTubeContext_AdSignalsInfo.decode(reader, reader.uint32()); + continue; + } + case 10: { + if (tag !== 82) { + break; + } + message.experimentalData = InnerTubeContext_ExperimentalData.decode(reader, reader.uint32()); + continue; + } + case 11: { + if (tag !== 90) { + break; + } + message.clientScreenNonce = reader.string(); + continue; + } + case 12: { + if (tag !== 98) { + break; + } + message.activePlayers.push(InnerTubeContext_ActivePlayerInfo.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + } +}; +function createBaseInnerTubeContext_ExperimentalData() { + return { params: [] }; +} +__name(createBaseInnerTubeContext_ExperimentalData, "createBaseInnerTubeContext_ExperimentalData"); +var InnerTubeContext_ExperimentalData = { + encode(message, writer = new BinaryWriter()) { + for (const v of message.params) { + KeyValuePair.encode(v, writer.uint32(10).fork()).join(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === void 0 ? reader.len : reader.pos + length; + const message = createBaseInnerTubeContext_ExperimentalData(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + message.params.push(KeyValuePair.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + } +}; +function createBaseInnerTubeContext_ActivePlayerInfo() { + return { playerContextParams: void 0 }; +} +__name(createBaseInnerTubeContext_ActivePlayerInfo, "createBaseInnerTubeContext_ActivePlayerInfo"); +var InnerTubeContext_ActivePlayerInfo = { + encode(message, writer = new BinaryWriter()) { + if (message.playerContextParams !== void 0) { + writer.uint32(10).bytes(message.playerContextParams); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === void 0 ? reader.len : reader.pos + length; + const message = createBaseInnerTubeContext_ActivePlayerInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + message.playerContextParams = reader.bytes(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + } +}; +function createBaseInnerTubeContext_ClickTrackingInfo() { + return { clickTrackingParams: void 0 }; +} +__name(createBaseInnerTubeContext_ClickTrackingInfo, "createBaseInnerTubeContext_ClickTrackingInfo"); +var InnerTubeContext_ClickTrackingInfo = { + encode(message, writer = new BinaryWriter()) { + if (message.clickTrackingParams !== void 0) { + writer.uint32(18).bytes(message.clickTrackingParams); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === void 0 ? reader.len : reader.pos + length; + const message = createBaseInnerTubeContext_ClickTrackingInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + if (tag !== 18) { + break; + } + message.clickTrackingParams = reader.bytes(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + } +}; +function createBaseInnerTubeContext_AdSignalsInfo() { + return { + params: [], + bid: void 0, + mutsuId: void 0, + consentBumpState: void 0, + advertisingId: void 0, + limitAdTracking: void 0, + attributionOsSupportedVersion: void 0 + }; +} +__name(createBaseInnerTubeContext_AdSignalsInfo, "createBaseInnerTubeContext_AdSignalsInfo"); +var InnerTubeContext_AdSignalsInfo = { + encode(message, writer = new BinaryWriter()) { + for (const v of message.params) { + KeyValuePair.encode(v, writer.uint32(10).fork()).join(); + } + if (message.bid !== void 0) { + writer.uint32(18).string(message.bid); + } + if (message.mutsuId !== void 0) { + writer.uint32(26).string(message.mutsuId); + } + if (message.consentBumpState !== void 0) { + writer.uint32(34).string(message.consentBumpState); + } + if (message.advertisingId !== void 0) { + writer.uint32(58).string(message.advertisingId); + } + if (message.limitAdTracking !== void 0) { + writer.uint32(72).bool(message.limitAdTracking); + } + if (message.attributionOsSupportedVersion !== void 0) { + writer.uint32(82).string(message.attributionOsSupportedVersion); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === void 0 ? reader.len : reader.pos + length; + const message = createBaseInnerTubeContext_AdSignalsInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + message.params.push(KeyValuePair.decode(reader, reader.uint32())); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + message.bid = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + message.mutsuId = reader.string(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + message.consentBumpState = reader.string(); + continue; + } + case 7: { + if (tag !== 58) { + break; + } + message.advertisingId = reader.string(); + continue; + } + case 9: { + if (tag !== 72) { + break; + } + message.limitAdTracking = reader.bool(); + continue; + } + case 10: { + if (tag !== 82) { + break; + } + message.attributionOsSupportedVersion = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + } +}; + +// dist/protos/generated/youtube/api/pfiinnertube/metadata_update_request.js +function createBaseMetadataUpdateRequest() { + return { + context: void 0, + encryptedVideoId: void 0, + title: void 0, + description: void 0, + privacy: void 0, + tags: void 0, + category: void 0, + license: void 0, + ageRestriction: void 0, + videoStill: void 0, + madeForKids: void 0, + racy: void 0 + }; +} +__name(createBaseMetadataUpdateRequest, "createBaseMetadataUpdateRequest"); +var MetadataUpdateRequest = { + encode(message, writer = new BinaryWriter()) { + if (message.context !== void 0) { + InnerTubeContext.encode(message.context, writer.uint32(10).fork()).join(); + } + if (message.encryptedVideoId !== void 0) { + writer.uint32(18).string(message.encryptedVideoId); + } + if (message.title !== void 0) { + MetadataUpdateRequest_MdeTitleUpdateRequest.encode(message.title, writer.uint32(26).fork()).join(); + } + if (message.description !== void 0) { + MetadataUpdateRequest_MdeDescriptionUpdateRequest.encode(message.description, writer.uint32(34).fork()).join(); + } + if (message.privacy !== void 0) { + MetadataUpdateRequest_MdePrivacyUpdateRequest.encode(message.privacy, writer.uint32(42).fork()).join(); + } + if (message.tags !== void 0) { + MetadataUpdateRequest_MdeTagsUpdateRequest.encode(message.tags, writer.uint32(50).fork()).join(); + } + if (message.category !== void 0) { + MetadataUpdateRequest_MdeCategoryUpdateRequest.encode(message.category, writer.uint32(58).fork()).join(); + } + if (message.license !== void 0) { + MetadataUpdateRequest_MdeLicenseUpdateRequest.encode(message.license, writer.uint32(66).fork()).join(); + } + if (message.ageRestriction !== void 0) { + MetadataUpdateRequest_MdeAgeRestrictionUpdateRequest.encode(message.ageRestriction, writer.uint32(90).fork()).join(); + } + if (message.videoStill !== void 0) { + MetadataUpdateRequest_MdeVideoStillRequestParams.encode(message.videoStill, writer.uint32(162).fork()).join(); + } + if (message.madeForKids !== void 0) { + MetadataUpdateRequest_MdeMadeForKidsUpdateRequestParams.encode(message.madeForKids, writer.uint32(546).fork()).join(); + } + if (message.racy !== void 0) { + MetadataUpdateRequest_MdeRacyRequestParams.encode(message.racy, writer.uint32(554).fork()).join(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === void 0 ? reader.len : reader.pos + length; + const message = createBaseMetadataUpdateRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + message.context = InnerTubeContext.decode(reader, reader.uint32()); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + message.encryptedVideoId = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + message.title = MetadataUpdateRequest_MdeTitleUpdateRequest.decode(reader, reader.uint32()); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + message.description = MetadataUpdateRequest_MdeDescriptionUpdateRequest.decode(reader, reader.uint32()); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + message.privacy = MetadataUpdateRequest_MdePrivacyUpdateRequest.decode(reader, reader.uint32()); + continue; + } + case 6: { + if (tag !== 50) { + break; + } + message.tags = MetadataUpdateRequest_MdeTagsUpdateRequest.decode(reader, reader.uint32()); + continue; + } + case 7: { + if (tag !== 58) { + break; + } + message.category = MetadataUpdateRequest_MdeCategoryUpdateRequest.decode(reader, reader.uint32()); + continue; + } + case 8: { + if (tag !== 66) { + break; + } + message.license = MetadataUpdateRequest_MdeLicenseUpdateRequest.decode(reader, reader.uint32()); + continue; + } + case 11: { + if (tag !== 90) { + break; + } + message.ageRestriction = MetadataUpdateRequest_MdeAgeRestrictionUpdateRequest.decode(reader, reader.uint32()); + continue; + } + case 20: { + if (tag !== 162) { + break; + } + message.videoStill = MetadataUpdateRequest_MdeVideoStillRequestParams.decode(reader, reader.uint32()); + continue; + } + case 68: { + if (tag !== 546) { + break; + } + message.madeForKids = MetadataUpdateRequest_MdeMadeForKidsUpdateRequestParams.decode(reader, reader.uint32()); + continue; + } + case 69: { + if (tag !== 554) { + break; + } + message.racy = MetadataUpdateRequest_MdeRacyRequestParams.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + } +}; +function createBaseMetadataUpdateRequest_MdeTitleUpdateRequest() { + return { newTitle: void 0 }; +} +__name(createBaseMetadataUpdateRequest_MdeTitleUpdateRequest, "createBaseMetadataUpdateRequest_MdeTitleUpdateRequest"); +var MetadataUpdateRequest_MdeTitleUpdateRequest = { + encode(message, writer = new BinaryWriter()) { + if (message.newTitle !== void 0) { + writer.uint32(10).string(message.newTitle); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === void 0 ? reader.len : reader.pos + length; + const message = createBaseMetadataUpdateRequest_MdeTitleUpdateRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + message.newTitle = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + } +}; +function createBaseMetadataUpdateRequest_MdeDescriptionUpdateRequest() { + return { newDescription: void 0 }; +} +__name(createBaseMetadataUpdateRequest_MdeDescriptionUpdateRequest, "createBaseMetadataUpdateRequest_MdeDescriptionUpdateRequest"); +var MetadataUpdateRequest_MdeDescriptionUpdateRequest = { + encode(message, writer = new BinaryWriter()) { + if (message.newDescription !== void 0) { + writer.uint32(10).string(message.newDescription); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === void 0 ? reader.len : reader.pos + length; + const message = createBaseMetadataUpdateRequest_MdeDescriptionUpdateRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + message.newDescription = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + } +}; +function createBaseMetadataUpdateRequest_MdePrivacyUpdateRequest() { + return { newPrivacy: void 0, clearPrivacyDraft: void 0 }; +} +__name(createBaseMetadataUpdateRequest_MdePrivacyUpdateRequest, "createBaseMetadataUpdateRequest_MdePrivacyUpdateRequest"); +var MetadataUpdateRequest_MdePrivacyUpdateRequest = { + encode(message, writer = new BinaryWriter()) { + if (message.newPrivacy !== void 0) { + writer.uint32(8).int32(message.newPrivacy); + } + if (message.clearPrivacyDraft !== void 0) { + writer.uint32(16).bool(message.clearPrivacyDraft); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === void 0 ? reader.len : reader.pos + length; + const message = createBaseMetadataUpdateRequest_MdePrivacyUpdateRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + message.newPrivacy = reader.int32(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + message.clearPrivacyDraft = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + } +}; +function createBaseMetadataUpdateRequest_MdeTagsUpdateRequest() { + return { newTags: [] }; +} +__name(createBaseMetadataUpdateRequest_MdeTagsUpdateRequest, "createBaseMetadataUpdateRequest_MdeTagsUpdateRequest"); +var MetadataUpdateRequest_MdeTagsUpdateRequest = { + encode(message, writer = new BinaryWriter()) { + for (const v of message.newTags) { + writer.uint32(10).string(v); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === void 0 ? reader.len : reader.pos + length; + const message = createBaseMetadataUpdateRequest_MdeTagsUpdateRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + message.newTags.push(reader.string()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + } +}; +function createBaseMetadataUpdateRequest_MdeCategoryUpdateRequest() { + return { newCategoryId: void 0 }; +} +__name(createBaseMetadataUpdateRequest_MdeCategoryUpdateRequest, "createBaseMetadataUpdateRequest_MdeCategoryUpdateRequest"); +var MetadataUpdateRequest_MdeCategoryUpdateRequest = { + encode(message, writer = new BinaryWriter()) { + if (message.newCategoryId !== void 0) { + writer.uint32(8).int32(message.newCategoryId); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === void 0 ? reader.len : reader.pos + length; + const message = createBaseMetadataUpdateRequest_MdeCategoryUpdateRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + message.newCategoryId = reader.int32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + } +}; +function createBaseMetadataUpdateRequest_MdeLicenseUpdateRequest() { + return { newLicenseId: void 0 }; +} +__name(createBaseMetadataUpdateRequest_MdeLicenseUpdateRequest, "createBaseMetadataUpdateRequest_MdeLicenseUpdateRequest"); +var MetadataUpdateRequest_MdeLicenseUpdateRequest = { + encode(message, writer = new BinaryWriter()) { + if (message.newLicenseId !== void 0) { + writer.uint32(10).string(message.newLicenseId); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === void 0 ? reader.len : reader.pos + length; + const message = createBaseMetadataUpdateRequest_MdeLicenseUpdateRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + message.newLicenseId = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + } +}; +function createBaseMetadataUpdateRequest_MdeMadeForKidsUpdateRequestParams() { + return { operation: void 0, newMfk: void 0 }; +} +__name(createBaseMetadataUpdateRequest_MdeMadeForKidsUpdateRequestParams, "createBaseMetadataUpdateRequest_MdeMadeForKidsUpdateRequestParams"); +var MetadataUpdateRequest_MdeMadeForKidsUpdateRequestParams = { + encode(message, writer = new BinaryWriter()) { + if (message.operation !== void 0) { + writer.uint32(8).int32(message.operation); + } + if (message.newMfk !== void 0) { + writer.uint32(16).int32(message.newMfk); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === void 0 ? reader.len : reader.pos + length; + const message = createBaseMetadataUpdateRequest_MdeMadeForKidsUpdateRequestParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + message.operation = reader.int32(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + message.newMfk = reader.int32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + } +}; +function createBaseMetadataUpdateRequest_MdeRacyRequestParams() { + return { operation: void 0, newRacy: void 0 }; +} +__name(createBaseMetadataUpdateRequest_MdeRacyRequestParams, "createBaseMetadataUpdateRequest_MdeRacyRequestParams"); +var MetadataUpdateRequest_MdeRacyRequestParams = { + encode(message, writer = new BinaryWriter()) { + if (message.operation !== void 0) { + writer.uint32(8).int32(message.operation); + } + if (message.newRacy !== void 0) { + writer.uint32(16).int32(message.newRacy); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === void 0 ? reader.len : reader.pos + length; + const message = createBaseMetadataUpdateRequest_MdeRacyRequestParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + message.operation = reader.int32(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + message.newRacy = reader.int32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + } +}; +function createBaseMetadataUpdateRequest_MdeAgeRestrictionUpdateRequest() { + return { newIsAgeRestricted: void 0 }; +} +__name(createBaseMetadataUpdateRequest_MdeAgeRestrictionUpdateRequest, "createBaseMetadataUpdateRequest_MdeAgeRestrictionUpdateRequest"); +var MetadataUpdateRequest_MdeAgeRestrictionUpdateRequest = { + encode(message, writer = new BinaryWriter()) { + if (message.newIsAgeRestricted !== void 0) { + writer.uint32(8).bool(message.newIsAgeRestricted); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === void 0 ? reader.len : reader.pos + length; + const message = createBaseMetadataUpdateRequest_MdeAgeRestrictionUpdateRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + message.newIsAgeRestricted = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + } +}; +function createBaseMetadataUpdateRequest_MdeVideoStillRequestParams() { + return { operation: void 0, newStillId: void 0, image: void 0, testImage: void 0, experimentImage: [] }; +} +__name(createBaseMetadataUpdateRequest_MdeVideoStillRequestParams, "createBaseMetadataUpdateRequest_MdeVideoStillRequestParams"); +var MetadataUpdateRequest_MdeVideoStillRequestParams = { + encode(message, writer = new BinaryWriter()) { + if (message.operation !== void 0) { + writer.uint32(8).int32(message.operation); + } + if (message.newStillId !== void 0) { + writer.uint32(16).int32(message.newStillId); + } + if (message.image !== void 0) { + MetadataUpdateRequest_MdeVideoStillRequestParams_CustomThumbnailImage.encode(message.image, writer.uint32(26).fork()).join(); + } + if (message.testImage !== void 0) { + MetadataUpdateRequest_MdeVideoStillRequestParams_CustomThumbnailImage.encode(message.testImage, writer.uint32(34).fork()).join(); + } + for (const v of message.experimentImage) { + MetadataUpdateRequest_MdeVideoStillRequestParams_ThumbnailExperimentImageData.encode(v, writer.uint32(50).fork()).join(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === void 0 ? reader.len : reader.pos + length; + const message = createBaseMetadataUpdateRequest_MdeVideoStillRequestParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + message.operation = reader.int32(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + message.newStillId = reader.int32(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + message.image = MetadataUpdateRequest_MdeVideoStillRequestParams_CustomThumbnailImage.decode(reader, reader.uint32()); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + message.testImage = MetadataUpdateRequest_MdeVideoStillRequestParams_CustomThumbnailImage.decode(reader, reader.uint32()); + continue; + } + case 6: { + if (tag !== 50) { + break; + } + message.experimentImage.push(MetadataUpdateRequest_MdeVideoStillRequestParams_ThumbnailExperimentImageData.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + } +}; +function createBaseMetadataUpdateRequest_MdeVideoStillRequestParams_ThumbnailExperimentImageData() { + return { image: void 0 }; +} +__name(createBaseMetadataUpdateRequest_MdeVideoStillRequestParams_ThumbnailExperimentImageData, "createBaseMetadataUpdateRequest_MdeVideoStillRequestParams_ThumbnailExperimentImageData"); +var MetadataUpdateRequest_MdeVideoStillRequestParams_ThumbnailExperimentImageData = { + encode(message, writer = new BinaryWriter()) { + if (message.image !== void 0) { + MetadataUpdateRequest_MdeVideoStillRequestParams_CustomThumbnailImage.encode(message.image, writer.uint32(10).fork()).join(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === void 0 ? reader.len : reader.pos + length; + const message = createBaseMetadataUpdateRequest_MdeVideoStillRequestParams_ThumbnailExperimentImageData(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + message.image = MetadataUpdateRequest_MdeVideoStillRequestParams_CustomThumbnailImage.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + } +}; +function createBaseMetadataUpdateRequest_MdeVideoStillRequestParams_CustomThumbnailImage() { + return { rawBytes: void 0, dataUri: void 0, frameTimestampUs: void 0, isVertical: void 0 }; +} +__name(createBaseMetadataUpdateRequest_MdeVideoStillRequestParams_CustomThumbnailImage, "createBaseMetadataUpdateRequest_MdeVideoStillRequestParams_CustomThumbnailImage"); +var MetadataUpdateRequest_MdeVideoStillRequestParams_CustomThumbnailImage = { + encode(message, writer = new BinaryWriter()) { + if (message.rawBytes !== void 0) { + writer.uint32(10).bytes(message.rawBytes); + } + if (message.dataUri !== void 0) { + writer.uint32(18).string(message.dataUri); + } + if (message.frameTimestampUs !== void 0) { + writer.uint32(32).int64(message.frameTimestampUs); + } + if (message.isVertical !== void 0) { + writer.uint32(40).bool(message.isVertical); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === void 0 ? reader.len : reader.pos + length; + const message = createBaseMetadataUpdateRequest_MdeVideoStillRequestParams_CustomThumbnailImage(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + message.rawBytes = reader.bytes(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + message.dataUri = reader.string(); + continue; + } + case 4: { + if (tag !== 32) { + break; + } + message.frameTimestampUs = longToNumber3(reader.int64()); + continue; + } + case 5: { + if (tag !== 40) { + break; + } + message.isVertical = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + } +}; +function longToNumber3(int64) { + const num = globalThis.Number(int64.toString()); + if (num > globalThis.Number.MAX_SAFE_INTEGER) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + if (num < globalThis.Number.MIN_SAFE_INTEGER) { + throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER"); + } + return num; +} +__name(longToNumber3, "longToNumber"); + +// dist/src/core/clients/Studio.js +var _session5, _Studio_instances, getInitialUploadData_fn, uploadVideo_fn, setVideoMetadata_fn; +var _Studio = class _Studio { + constructor(session) { + __privateAdd(this, _Studio_instances); + __privateAdd(this, _session5); + __privateSet(this, _session5, session); + } + /** + * Updates the metadata of a video. + * @example + * ```ts + * const videoId = 'abcdefg'; + * const thumbnail = fs.readFileSync('./my_awesome_thumbnail.jpg'); + * + * const response = await yt.studio.updateVideoMetadata(videoId, { + * tags: [ 'astronomy', 'NASA', 'APOD' ], + * title: 'Artemis Mission', + * description: 'A nicely written description...', + * category: 27, + * license: 'creative_commons', + * thumbnail, + * // ... + * }); + * ``` + */ + async updateVideoMetadata(video_id, metadata) { + var _a; + const session = __privateGet(this, _session5); + if (!session.logged_in) + throw new InnertubeError("You must be signed in to perform this operation."); + const payload = { + context: { + client: { + osName: "Android", + clientName: parseInt(Constants_exports.CLIENT_NAME_IDS.ANDROID), + clientVersion: Constants_exports.CLIENTS.ANDROID.VERSION, + androidSdkVersion: Constants_exports.CLIENTS.ANDROID.SDK_VERSION, + visitorData: session.context.client.visitorData, + osVersion: "13", + acceptLanguage: session.context.client.hl, + acceptRegion: session.context.client.gl, + deviceMake: "Google", + deviceModel: "sdk_gphone64_x86_64", + screenHeightPoints: 840, + screenWidthPoints: 432, + configInfo: { + appInstallData: (_a = session.context.client.configInfo) == null ? void 0 : _a.appInstallData + }, + timeZone: session.context.client.timeZone, + chipset: "qcom;taro" + }, + activePlayers: [] + }, + encryptedVideoId: video_id + }; + if (metadata.title) + payload.title = { newTitle: metadata.title }; + if (metadata.description) + payload.description = { newDescription: metadata.description }; + if (metadata.license) + payload.license = { newLicenseId: metadata.license }; + if (metadata.tags) + payload.tags = { newTags: metadata.tags }; + if (metadata.thumbnail) { + payload.videoStill = { + operation: 3, + image: { + rawBytes: metadata.thumbnail + }, + experimentImage: [] + }; + } + if (Reflect.has(metadata, "category")) + payload.category = { newCategoryId: metadata.category }; + if (Reflect.has(metadata, "privacy")) { + switch (metadata.privacy) { + case "PUBLIC": + payload.privacy = { newPrivacy: 1 }; + break; + case "UNLISTED": + payload.privacy = { newPrivacy: 2 }; + break; + case "PRIVATE": + payload.privacy = { newPrivacy: 3 }; + break; + default: + throw new Error("Invalid privacy setting"); + } + } + if (Reflect.has(metadata, "made_for_kids")) { + payload.madeForKids = { + operation: 1, + newMfk: metadata.made_for_kids ? 1 : 2 + }; + } + if (Reflect.has(metadata, "age_restricted")) { + payload.racy = { + operation: 1, + newRacy: metadata.age_restricted ? 1 : 2 + }; + } + const writer = MetadataUpdateRequest.encode(payload); + return await session.actions.execute("/video_manager/metadata_update", { + protobuf: true, + serialized_data: writer.finish() + }); + } + /** + * Uploads a video to YouTube. + * @example + * ```ts + * const file = fs.readFileSync('./my_awesome_video.mp4'); + * const response = await yt.studio.upload(file.buffer, { title: 'Wow!' }); + * ``` + */ + async upload(file, metadata = {}) { + if (!__privateGet(this, _session5).logged_in) + throw new InnertubeError("You must be signed in to perform this operation."); + const initial_data = await __privateMethod(this, _Studio_instances, getInitialUploadData_fn).call(this); + const upload_result = await __privateMethod(this, _Studio_instances, uploadVideo_fn).call(this, initial_data.upload_url, file); + if (upload_result.status !== "STATUS_SUCCESS") + throw new InnertubeError("Could not process video."); + return await __privateMethod(this, _Studio_instances, setVideoMetadata_fn).call(this, initial_data, upload_result, metadata); + } +}; +_session5 = new WeakMap(); +_Studio_instances = new WeakSet(); +getInitialUploadData_fn = /* @__PURE__ */ __name(async function() { + const frontend_upload_id = `innertube_android:${Platform.shim.uuidv4()}:0:v=3,api=1,cf=3`; + const payload = { + frontendUploadId: frontend_upload_id, + deviceDisplayName: "Pixel 6 Pro", + fileId: `goog-edited-video://generated?videoFileUri=content://media/external/video/media/${Platform.shim.uuidv4()}`, + mp4MoovAtomRelocationStatus: "UNSUPPORTED", + transcodeResult: "DISABLED", + connectionType: "WIFI" + }; + const response = await __privateGet(this, _session5).http.fetch("/upload/youtubei", { + baseURL: Constants_exports.URLS.YT_UPLOAD, + method: "POST", + headers: { + "Content-Type": "application/x-www-form-urlencoded", + "x-goog-upload-command": "start", + "x-goog-upload-protocol": "resumable" + }, + body: JSON.stringify(payload) + }); + if (!response.ok) + throw new InnertubeError("Could not get initial upload data"); + return { + frontend_upload_id, + upload_id: response.headers.get("x-guploader-uploadid"), + upload_url: response.headers.get("x-goog-upload-url"), + scotty_resource_id: response.headers.get("x-goog-upload-header-scotty-resource-id"), + chunk_granularity: response.headers.get("x-goog-upload-chunk-granularity") + }; +}, "#getInitialUploadData"); +uploadVideo_fn = /* @__PURE__ */ __name(async function(upload_url, file) { + const response = await __privateGet(this, _session5).http.fetch_function(upload_url, { + method: "POST", + headers: { + "Content-Type": "application/x-www-form-urlencoded", + "x-goog-upload-command": "upload, finalize", + "x-goog-upload-file-name": `file-${Date.now()}`, + "x-goog-upload-offset": "0" + }, + body: file + }); + if (!response.ok) + throw new InnertubeError("Could not upload video"); + return await response.json(); +}, "#uploadVideo"); +setVideoMetadata_fn = /* @__PURE__ */ __name(async function(initial_data, upload_result, metadata) { + return await __privateGet(this, _session5).actions.execute("/upload/createvideo", { + resourceId: { + scottyResourceId: { + id: upload_result.scottyResourceId + } + }, + frontendUploadId: initial_data.frontend_upload_id, + initialMetadata: { + title: { + newTitle: metadata.title + }, + description: { + newDescription: metadata.description, + shouldSegment: true + }, + privacy: { + newPrivacy: metadata.privacy || "PRIVATE" + }, + draftState: { + isDraft: !!metadata.is_draft + } + } + }); +}, "#setVideoMetadata"); +__name(_Studio, "Studio"); +var Studio = _Studio; + +// dist/src/core/managers/index.js +var managers_exports = {}; +__export(managers_exports, { + AccountManager: () => AccountManager, + InteractionManager: () => InteractionManager, + PlaylistManager: () => PlaylistManager +}); + +// dist/src/core/managers/AccountManager.js +var _actions22; +var _AccountManager = class _AccountManager { + constructor(actions) { + __privateAdd(this, _actions22); + __privateSet(this, _actions22, actions); + } + async getInfo(all = false) { + var _a; + if (!__privateGet(this, _actions22).session.logged_in) + throw new InnertubeError("You must be signed in to perform this operation."); + if (!all && !!__privateGet(this, _actions22).session.context.user.onBehalfOfUser) { + throw new InnertubeError('Boolean argument must be true when "on_behalf_of_user" is specified.'); + } + if (all) { + const get_accounts_list_endpoint2 = new NavigationEndpoint({ getAccountsListInnertubeEndpoint: { + requestType: "ACCOUNTS_LIST_REQUEST_TYPE_CHANNEL_SWITCHER", + callCircumstance: "SWITCHING_USERS_FULL" + } }); + const response2 = await get_accounts_list_endpoint2.call(__privateGet(this, _actions22), { client: "WEB", parse: true }); + return ((_a = response2.actions_memo) == null ? void 0 : _a.getType(AccountItem)) || []; + } + const get_accounts_list_endpoint = new NavigationEndpoint({ getAccountsListInnertubeEndpoint: {} }); + const response = await get_accounts_list_endpoint.call(__privateGet(this, _actions22), { client: "TV" }); + return new AccountInfo(response); + } + /** + * Gets YouTube settings. + */ + async getSettings() { + const browse_endpoint = new NavigationEndpoint({ browseEndpoint: { browseId: "SPaccount_overview" } }); + const response = await browse_endpoint.call(__privateGet(this, _actions22)); + return new Settings(__privateGet(this, _actions22), response); + } +}; +_actions22 = new WeakMap(); +__name(_AccountManager, "AccountManager"); +var AccountManager = _AccountManager; + +// dist/src/core/managers/PlaylistManager.js +var _actions23, _PlaylistManager_instances, getPlaylist_fn; +var _PlaylistManager = class _PlaylistManager { + constructor(actions) { + __privateAdd(this, _PlaylistManager_instances); + __privateAdd(this, _actions23); + __privateSet(this, _actions23, actions); + } + /** + * Creates a playlist. + * @param title - The title of the playlist. + * @param video_ids - An array of video IDs to add to the playlist. + */ + async create(title, video_ids) { + throwIfMissing({ title, video_ids }); + if (!__privateGet(this, _actions23).session.logged_in) + throw new InnertubeError("You must be signed in to perform this operation."); + const create_playlist_endpoint = new NavigationEndpoint({ + createPlaylistServiceEndpoint: { + title, + videoIds: video_ids + } + }); + const response = await create_playlist_endpoint.call(__privateGet(this, _actions23)); + return { + success: response.success, + status_code: response.status_code, + playlist_id: response.data.playlistId, + data: response.data + }; + } + /** + * Deletes a given playlist. + * @param playlist_id - The playlist ID. + */ + async delete(playlist_id) { + throwIfMissing({ playlist_id }); + if (!__privateGet(this, _actions23).session.logged_in) + throw new InnertubeError("You must be signed in to perform this operation."); + const delete_playlist_endpoint = new NavigationEndpoint({ + deletePlaylistServiceEndpoint: { + sourcePlaylistId: playlist_id + } + }); + const response = await delete_playlist_endpoint.call(__privateGet(this, _actions23)); + return { + playlist_id, + success: response.success, + status_code: response.status_code, + data: response.data + }; + } + /** + * Adds a given playlist to the library of a user. + * @param playlist_id - The playlist ID. + */ + async addToLibrary(playlist_id) { + throwIfMissing({ playlist_id }); + if (!__privateGet(this, _actions23).session.logged_in) + throw new InnertubeError("You must be signed in to perform this operation."); + const like_playlist_endpoint = new NavigationEndpoint({ + likeEndpoint: { + status: "LIKE", + target: playlist_id + } + }); + return await like_playlist_endpoint.call(__privateGet(this, _actions23)); + } + /** + * Remove a given playlist to the library of a user. + * @param playlist_id - The playlist ID. + */ + async removeFromLibrary(playlist_id) { + throwIfMissing({ playlist_id }); + if (!__privateGet(this, _actions23).session.logged_in) + throw new InnertubeError("You must be signed in to perform this operation."); + const remove_like_playlist_endpoint = new NavigationEndpoint({ + likeEndpoint: { + status: "INDIFFERENT", + target: playlist_id + } + }); + return await remove_like_playlist_endpoint.call(__privateGet(this, _actions23)); + } + /** + * Adds videos to a given playlist. + * @param playlist_id - The playlist ID. + * @param video_ids - An array of video IDs to add to the playlist. + */ + async addVideos(playlist_id, video_ids) { + throwIfMissing({ playlist_id, video_ids }); + if (!__privateGet(this, _actions23).session.logged_in) + throw new InnertubeError("You must be signed in to perform this operation."); + const playlist_edit_endpoint = new NavigationEndpoint({ + playlistEditEndpoint: { + playlistId: playlist_id, + actions: video_ids.map((id) => ({ + action: "ACTION_ADD_VIDEO", + addedVideoId: id + })) + } + }); + const response = await playlist_edit_endpoint.call(__privateGet(this, _actions23)); + return { + playlist_id, + action_result: response.data.actions + // TODO: implement actions in the parser + }; + } + /** + * Removes videos from a given playlist. + * @param playlist_id - The playlist ID. + * @param video_ids - An array of video IDs to remove from the playlist. + * @param use_set_video_ids - Option to remove videos using set video IDs. + */ + async removeVideos(playlist_id, video_ids, use_set_video_ids = false) { + throwIfMissing({ playlist_id, video_ids }); + if (!__privateGet(this, _actions23).session.logged_in) + throw new InnertubeError("You must be signed in to perform this operation."); + const playlist = await __privateMethod(this, _PlaylistManager_instances, getPlaylist_fn).call(this, playlist_id); + if (!playlist.info.is_editable) + throw new InnertubeError("This playlist cannot be edited.", playlist_id); + const payload = { playlistId: playlist_id, actions: [] }; + const getSetVideoIds = /* @__PURE__ */ __name(async (pl) => { + const key_id = use_set_video_ids ? "set_video_id" : "id"; + const videos = pl.videos.filter((video) => video_ids.includes(video.key(key_id).string())); + videos.forEach((video) => payload.actions.push({ + action: "ACTION_REMOVE_VIDEO", + setVideoId: video.key("set_video_id").string() + })); + if (payload.actions.length < video_ids.length) { + const next = await pl.getContinuation(); + return getSetVideoIds(next); + } + }, "getSetVideoIds"); + await getSetVideoIds(playlist); + if (!payload.actions.length) + throw new InnertubeError("Given video ids were not found in this playlist.", video_ids); + const playlist_edit_endpoint = new NavigationEndpoint({ playlistEditEndpoint: payload }); + const response = await playlist_edit_endpoint.call(__privateGet(this, _actions23)); + return { + playlist_id, + action_result: response.data.actions + // TODO: implement actions in the parser + }; + } + /** + * Moves a video to a new position within a given playlist. + * @param playlist_id - The playlist ID. + * @param moved_video_id - The video ID to move. + * @param predecessor_video_id - The video ID to move the moved video before. + */ + async moveVideo(playlist_id, moved_video_id, predecessor_video_id) { + throwIfMissing({ playlist_id, moved_video_id, predecessor_video_id }); + if (!__privateGet(this, _actions23).session.logged_in) + throw new InnertubeError("You must be signed in to perform this operation."); + const playlist = await __privateMethod(this, _PlaylistManager_instances, getPlaylist_fn).call(this, playlist_id); + if (!playlist.info.is_editable) + throw new InnertubeError("This playlist cannot be edited.", playlist_id); + const payload = { playlistId: playlist_id, actions: [] }; + let set_video_id_0, set_video_id_1; + const getSetVideoIds = /* @__PURE__ */ __name(async (pl) => { + const video_0 = pl.videos.find((video) => moved_video_id === video.key("id").string()); + const video_1 = pl.videos.find((video) => predecessor_video_id === video.key("id").string()); + set_video_id_0 = set_video_id_0 || (video_0 == null ? void 0 : video_0.key("set_video_id").string()); + set_video_id_1 = set_video_id_1 || (video_1 == null ? void 0 : video_1.key("set_video_id").string()); + if (!set_video_id_0 || !set_video_id_1) { + const next = await pl.getContinuation(); + return getSetVideoIds(next); + } + }, "getSetVideoIds"); + await getSetVideoIds(playlist); + payload.actions.push({ + action: "ACTION_MOVE_VIDEO_AFTER", + setVideoId: set_video_id_0, + movedSetVideoIdPredecessor: set_video_id_1 + }); + const playlist_edit_endpoint = new NavigationEndpoint({ playlistEditEndpoint: payload }); + const response = await playlist_edit_endpoint.call(__privateGet(this, _actions23)); + return { + playlist_id, + action_result: response.data.actions + // TODO: implement actions in the parser + }; + } + /** + * Sets the name for the given playlist. + * @param playlist_id - The playlist ID. + * @param name - The name / title to use for the playlist. + */ + async setName(playlist_id, name) { + throwIfMissing({ playlist_id, name }); + if (!__privateGet(this, _actions23).session.logged_in) + throw new InnertubeError("You must be signed in to perform this operation."); + const payload = { playlist_id, actions: [] }; + payload.actions.push({ + action: "ACTION_SET_PLAYLIST_NAME", + playlistName: name + }); + const playlist_edit_endpoint = new NavigationEndpoint({ playlistEditEndpoint: payload }); + const response = await playlist_edit_endpoint.call(__privateGet(this, _actions23)); + return { + playlist_id, + action_result: response.data.actions + }; + } + /** + * Sets the description for the given playlist. + * @param playlist_id - The playlist ID. + * @param description - The description to use for the playlist. + */ + async setDescription(playlist_id, description) { + throwIfMissing({ playlist_id, description }); + if (!__privateGet(this, _actions23).session.logged_in) + throw new InnertubeError("You must be signed in to perform this operation."); + const payload = { playlistId: playlist_id, actions: [] }; + payload.actions.push({ + action: "ACTION_SET_PLAYLIST_DESCRIPTION", + playlistDescription: description + }); + const playlist_edit_endpoint = new NavigationEndpoint({ playlistEditEndpoint: payload }); + const response = await playlist_edit_endpoint.call(__privateGet(this, _actions23)); + return { + playlist_id, + action_result: response.data.actions + }; + } +}; +_actions23 = new WeakMap(); +_PlaylistManager_instances = new WeakSet(); +getPlaylist_fn = /* @__PURE__ */ __name(async function(playlist_id) { + if (!playlist_id.startsWith("VL")) { + playlist_id = `VL${playlist_id}`; + } + const browse_endpoint = new NavigationEndpoint({ browseEndpoint: { browseId: playlist_id } }); + const browse_response = await browse_endpoint.call(__privateGet(this, _actions23), { parse: true }); + return new Playlist2(__privateGet(this, _actions23), browse_response, true); +}, "#getPlaylist"); +__name(_PlaylistManager, "PlaylistManager"); +var PlaylistManager = _PlaylistManager; + +// dist/src/core/managers/InteractionManager.js +var _actions24; +var _InteractionManager = class _InteractionManager { + constructor(actions) { + __privateAdd(this, _actions24); + __privateSet(this, _actions24, actions); + } + /** + * Likes a given video. + * @param video_id - The video ID + */ + async like(video_id) { + throwIfMissing({ video_id }); + if (!__privateGet(this, _actions24).session.logged_in) + throw new Error("You must be signed in to perform this operation."); + const like_endpoint = new NavigationEndpoint({ + likeEndpoint: { + status: "LIKE", + target: video_id + } + }); + return like_endpoint.call(__privateGet(this, _actions24), { client: "TV" }); + } + /** + * Dislikes a given video. + * @param video_id - The video ID + */ + async dislike(video_id) { + throwIfMissing({ video_id }); + if (!__privateGet(this, _actions24).session.logged_in) + throw new Error("You must be signed in to perform this operation."); + const dislike_endpoint = new NavigationEndpoint({ + likeEndpoint: { + status: "DISLIKE", + target: video_id + } + }); + return dislike_endpoint.call(__privateGet(this, _actions24), { client: "TV" }); + } + /** + * Removes a like/dislike. + * @param video_id - The video ID + */ + async removeRating(video_id) { + throwIfMissing({ video_id }); + if (!__privateGet(this, _actions24).session.logged_in) + throw new Error("You must be signed in to perform this operation."); + const remove_like_endpoint = new NavigationEndpoint({ + likeEndpoint: { + status: "INDIFFERENT", + target: video_id + } + }); + return remove_like_endpoint.call(__privateGet(this, _actions24), { client: "TV" }); + } + /** + * Subscribes to the given channel. + * @param channel_id - The channel ID + */ + async subscribe(channel_id) { + throwIfMissing({ channel_id }); + if (!__privateGet(this, _actions24).session.logged_in) + throw new Error("You must be signed in to perform this operation."); + const subscribe_endpoint = new NavigationEndpoint({ + subscribeEndpoint: { + channelIds: [channel_id], + params: "EgIIAhgA" + } + }); + return subscribe_endpoint.call(__privateGet(this, _actions24)); + } + /** + * Unsubscribes from the given channel. + * @param channel_id - The channel ID + */ + async unsubscribe(channel_id) { + throwIfMissing({ channel_id }); + if (!__privateGet(this, _actions24).session.logged_in) + throw new Error("You must be signed in to perform this operation."); + const unsubscribe_endpoint = new NavigationEndpoint({ + unsubscribeEndpoint: { + channelIds: [channel_id], + params: "CgIIAhgA" + } + }); + return unsubscribe_endpoint.call(__privateGet(this, _actions24)); + } + /** + * Posts a comment on a given video. + * @param video_id - The video ID + * @param text - The comment text + */ + async comment(video_id, text) { + throwIfMissing({ video_id, text }); + if (!__privateGet(this, _actions24).session.logged_in) + throw new Error("You must be signed in to perform this operation."); + const writer = CreateCommentParams.encode({ + videoId: video_id, + params: { + index: 0 + }, + number: 7 + }); + const params = encodeURIComponent(u8ToBase64(writer.finish())); + const create_comment_endpoint = new NavigationEndpoint({ + createCommentEndpoint: { + commentText: text, + createCommentParams: params + } + }); + return create_comment_endpoint.call(__privateGet(this, _actions24)); + } + /** + * Translates a given text using YouTube's comment translation feature. + * @param text - The text to translate + * @param target_language - an ISO language code + * @param args - optional arguments + */ + async translate(text, target_language, args = {}) { + throwIfMissing({ text, target_language }); + const action = encodeCommentActionParams(22, { text, target_language, ...args }); + const perform_comment_action_endpoint = new NavigationEndpoint({ performCommentActionEndpoint: { action } }); + const response = await perform_comment_action_endpoint.call(__privateGet(this, _actions24)); + const mutation = response.data.frameworkUpdates.entityBatchUpdate.mutations[0].payload.commentEntityPayload; + return { + success: response.success, + status_code: response.status_code, + translated_content: mutation.translatedContent.content, + data: response.data + }; + } + /** + * Changes notification preferences for a given channel. + * Only works with channels you are subscribed to. + * @param channel_id - The channel ID. + * @param type - The notification type. + */ + async setNotificationPreferences(channel_id, type) { + throwIfMissing({ channel_id, type }); + if (!__privateGet(this, _actions24).session.logged_in) + throw new Error("You must be signed in to perform this operation."); + const pref_types = { + PERSONALIZED: 1, + ALL: 2, + NONE: 3 + }; + if (!Object.keys(pref_types).includes(type.toUpperCase())) + throw new Error(`Invalid notification preference type: ${type}`); + const writer = NotificationPreferences.encode({ + channelId: channel_id, + prefId: { + index: pref_types[type.toUpperCase()] + }, + number0: 0, + number1: 4 + }); + const params = encodeURIComponent(u8ToBase64(writer.finish())); + const modify_channel_notification_preference_endpoint = new NavigationEndpoint({ modifyChannelNotificationPreferenceEndpoint: { params } }); + return modify_channel_notification_preference_endpoint.call(__privateGet(this, _actions24)); + } +}; +_actions24 = new WeakMap(); +__name(_InteractionManager, "InteractionManager"); +var InteractionManager = _InteractionManager; + +// dist/src/Innertube.js +var _session6; +var _Innertube = class _Innertube { + constructor(session) { + __privateAdd(this, _session6); + __privateSet(this, _session6, session); + } + static async create(config = {}) { + return new _Innertube(await Session.create(config)); + } + async getInfo(target, options) { + var _a, _b, _c, _d, _e; + throwIfMissing({ target }); + const payload = { + videoId: target instanceof NavigationEndpoint ? (_a = target.payload) == null ? void 0 : _a.videoId : target, + playlistId: target instanceof NavigationEndpoint ? (_b = target.payload) == null ? void 0 : _b.playlistId : void 0, + playlistIndex: target instanceof NavigationEndpoint ? (_c = target.payload) == null ? void 0 : _c.playlistIndex : void 0, + params: target instanceof NavigationEndpoint ? (_d = target.payload) == null ? void 0 : _d.params : void 0, + racyCheckOk: true, + contentCheckOk: true + }; + const watch_endpoint = new NavigationEndpoint({ watchEndpoint: payload }); + const watch_next_endpoint = new NavigationEndpoint({ watchNextEndpoint: payload }); + const session = __privateGet(this, _session6); + const extra_payload = { + playbackContext: { + contentPlaybackContext: { + vis: 0, + splay: false, + lactMilliseconds: "-1", + signatureTimestamp: (_e = session.player) == null ? void 0 : _e.signature_timestamp + } + }, + client: options == null ? void 0 : options.client + }; + if (options == null ? void 0 : options.po_token) { + extra_payload.serviceIntegrityDimensions = { + poToken: options.po_token + }; + } else if (session.po_token) { + extra_payload.serviceIntegrityDimensions = { + poToken: session.po_token + }; + } + const watch_response = watch_endpoint.call(session.actions, extra_payload); + const watch_next_response = watch_next_endpoint.call(session.actions); + const response = await Promise.all([watch_response, watch_next_response]); + const cpn = generateRandomString(16); + return new VideoInfo(response, session.actions, cpn); + } + async getBasicInfo(video_id, options) { + var _a; + throwIfMissing({ video_id }); + const watch_endpoint = new NavigationEndpoint({ + watchEndpoint: { + videoId: video_id, + racyCheckOk: true, + contentCheckOk: true + } + }); + const session = __privateGet(this, _session6); + const extra_payload = { + playbackContext: { + contentPlaybackContext: { + vis: 0, + splay: false, + lactMilliseconds: "-1", + signatureTimestamp: (_a = session.player) == null ? void 0 : _a.signature_timestamp + } + }, + client: options == null ? void 0 : options.client + }; + if (options == null ? void 0 : options.po_token) { + extra_payload.serviceIntegrityDimensions = { + poToken: options.po_token + }; + } else if (session.po_token) { + extra_payload.serviceIntegrityDimensions = { + poToken: session.po_token + }; + } + const watch_response = await watch_endpoint.call(session.actions, extra_payload); + const cpn = generateRandomString(16); + return new VideoInfo([watch_response], session.actions, cpn); + } + async getShortsVideoInfo(video_id, client) { + throwIfMissing({ video_id }); + const reel_watch_endpoint = new NavigationEndpoint({ + reelWatchEndpoint: { + disablePlayerResponse: false, + params: "CAUwAg%3D%3D", + videoId: video_id + } + }); + const actions = __privateGet(this, _session6).actions; + const reel_watch_response = reel_watch_endpoint.call(actions, { client }); + const writer = ReelSequence.encode({ + shortId: video_id, + params: { + number: 5 + }, + feature2: 25, + feature3: 0 + }); + const params = encodeURIComponent(u8ToBase64(writer.finish())); + const sequence_response = actions.execute("/reel/reel_watch_sequence", { sequenceParams: params }); + const response = await Promise.all([reel_watch_response, sequence_response]); + const cpn = generateRandomString(16); + return new ShortFormVideoInfo([response[0]], actions, cpn, response[1]); + } + async search(query, filters = {}) { + throwIfMissing({ query }); + const search_filter = {}; + search_filter.filters = {}; + if (filters.prioritize) { + search_filter.prioritize = SearchFilter_Prioritize[filters.prioritize.toUpperCase()]; + } + if (filters.upload_date) { + search_filter.filters.uploadDate = SearchFilter_Filters_UploadDate[filters.upload_date.toUpperCase()]; + } + if (filters.type) { + search_filter.filters.type = SearchFilter_Filters_SearchType[filters.type.toUpperCase()]; + } + if (filters.duration) { + search_filter.filters.duration = SearchFilter_Filters_Duration[filters.duration.toUpperCase()]; + } + if (filters.features) { + for (const feature of filters.features) { + switch (feature) { + case "360": + search_filter.filters.features360 = true; + break; + case "3d": + search_filter.filters.features3d = true; + break; + case "4k": + search_filter.filters.features4k = true; + break; + case "creative_commons": + search_filter.filters.featuresCreativeCommons = true; + break; + case "hd": + search_filter.filters.featuresHd = true; + break; + case "hdr": + search_filter.filters.featuresHdr = true; + break; + case "live": + search_filter.filters.featuresLive = true; + break; + case "location": + search_filter.filters.featuresLocation = true; + break; + case "purchased": + search_filter.filters.featuresPurchased = true; + break; + case "subtitles": + search_filter.filters.featuresSubtitles = true; + break; + case "vr180": + search_filter.filters.featuresVr180 = true; + break; + default: + break; + } + } + } + const search_endpoint = new NavigationEndpoint({ + searchEndpoint: { + query, + params: filters ? encodeURIComponent(u8ToBase64(SearchFilter.encode(search_filter).finish())) : void 0 + } + }); + const response = await search_endpoint.call(__privateGet(this, _session6).actions); + return new Search(this.actions, response); + } + async getSearchSuggestions(query, previous_query) { + const session = __privateGet(this, _session6); + const url = new URL(`${URLS.YT_SUGGESTIONS}/complete/search`); + url.searchParams.set("client", "youtube"); + url.searchParams.set("gs_ri", "youtube"); + url.searchParams.set("gs_id", "0"); + url.searchParams.set("cp", "0"); + url.searchParams.set("ds", "yt"); + url.searchParams.set("sugexp", CLIENTS.WEB.SUGG_EXP_ID); + url.searchParams.set("hl", session.context.client.hl); + url.searchParams.set("gl", session.context.client.gl); + url.searchParams.set("q", query); + if (previous_query) + url.searchParams.set("pq", previous_query); + const response = await session.http.fetch_function(url, { + headers: { + "Cookie": session.cookie || "" + } + }); + const text = await response.text(); + const data = JSON.parse(text.replace("window.google.ac.h(", "").slice(0, -1)); + return data[1].map((suggestion) => suggestion[0]); + } + async getComments(video_id, sort_by, comment_id) { + throwIfMissing({ video_id }); + const SORT_OPTIONS = { + TOP_COMMENTS: 0, + NEWEST_FIRST: 1 + }; + const token = GetCommentsSectionParams.encode({ + ctx: { + videoId: video_id + }, + unkParam: 6, + params: { + opts: { + videoId: video_id, + sortBy: SORT_OPTIONS[sort_by || "TOP_COMMENTS"], + type: 2, + commentId: comment_id || "" + }, + target: "comments-section" + } + }); + const continuation = encodeURIComponent(u8ToBase64(token.finish())); + const continuation_command = new NavigationEndpoint({ + continuationCommand: { + request: "CONTINUATION_REQUEST_TYPE_WATCH_NEXT", + token: continuation + } + }); + const response = await continuation_command.call(__privateGet(this, _session6).actions); + return new Comments(this.actions, response.data); + } + async getHomeFeed() { + const browse_endpoint = new NavigationEndpoint({ browseEndpoint: { browseId: "FEwhat_to_watch" } }); + const response = await browse_endpoint.call(__privateGet(this, _session6).actions); + return new HomeFeed(this.actions, response); + } + async getGuide() { + const response = await this.actions.execute("/guide"); + return new Guide(response.data); + } + async getLibrary() { + const browse_endpoint = new NavigationEndpoint({ browseEndpoint: { browseId: "FElibrary" } }); + const response = await browse_endpoint.call(__privateGet(this, _session6).actions); + return new Library(this.actions, response); + } + async getHistory() { + const browse_endpoint = new NavigationEndpoint({ browseEndpoint: { browseId: "FEhistory" } }); + const response = await browse_endpoint.call(__privateGet(this, _session6).actions); + return new History(this.actions, response); + } + async getCourses() { + const browse_endpoint = new NavigationEndpoint({ browseEndpoint: { browseId: "FEcourses_destination" } }); + const response = await browse_endpoint.call(__privateGet(this, _session6).actions, { parse: true }); + return new Feed(this.actions, response); + } + async getSubscriptionsFeed() { + const browse_endpoint = new NavigationEndpoint({ browseEndpoint: { browseId: "FEsubscriptions" } }); + const response = await browse_endpoint.call(__privateGet(this, _session6).actions, { parse: true }); + return new Feed(this.actions, response); + } + async getChannelsFeed() { + const browse_endpoint = new NavigationEndpoint({ browseEndpoint: { browseId: "FEchannels" } }); + const response = await browse_endpoint.call(__privateGet(this, _session6).actions, { parse: true }); + return new Feed(this.actions, response); + } + async getChannel(id) { + var _a, _b; + throwIfMissing({ id }); + const browse_endpoint = new NavigationEndpoint({ browseEndpoint: { browseId: id } }); + let response = await browse_endpoint.call(__privateGet(this, _session6).actions, { parse: true }); + if ((_b = (_a = response.on_response_received_actions) == null ? void 0 : _a[0]) == null ? void 0 : _b.is(NavigateAction)) { + response = await response.on_response_received_actions[0].endpoint.call(__privateGet(this, _session6).actions, { parse: true }); + } + return new Channel2(this.actions, response, true); + } + async getNotifications() { + const response = await this.actions.execute("/notification/get_notification_menu", { notificationsMenuRequestType: "NOTIFICATIONS_MENU_REQUEST_TYPE_INBOX" }); + return new NotificationsMenu(this.actions, response); + } + async getUnseenNotificationsCount() { + var _a, _b, _c, _d; + const response = await this.actions.execute("/notification/get_unseen_count"); + return ((_a = response.data) == null ? void 0 : _a.unseenCount) || ((_d = (_c = (_b = response.data) == null ? void 0 : _b.actions) == null ? void 0 : _c[0].updateNotificationsUnseenCountAction) == null ? void 0 : _d.unseenCount) || 0; + } + /** + * Retrieves the user's playlists. + */ + async getPlaylists() { + const browse_endpoint = new NavigationEndpoint({ browseEndpoint: { browseId: "FEplaylist_aggregation" } }); + const response = await browse_endpoint.call(__privateGet(this, _session6).actions, { parse: true }); + return new Feed(this.actions, response); + } + async getPlaylist(id) { + throwIfMissing({ id }); + if (!id.startsWith("VL")) { + id = `VL${id}`; + } + const browse_endpoint = new NavigationEndpoint({ browseEndpoint: { browseId: id } }); + const response = await browse_endpoint.call(__privateGet(this, _session6).actions); + return new Playlist2(this.actions, response); + } + async getHashtag(hashtag) { + throwIfMissing({ hashtag }); + const writer = Hashtag.encode({ + params: { + hashtag, + type: 1 + } + }); + const params = encodeURIComponent(u8ToBase64(writer.finish())); + const browse_endpoint = new NavigationEndpoint({ browseEndpoint: { browseId: "FEhashtag", params } }); + const response = await browse_endpoint.call(__privateGet(this, _session6).actions); + return new HashtagFeed(this.actions, response); + } + /** + * An alternative to {@link download}. + * Returns deciphered streaming data. + * + * If you wish to retrieve the video info too, have a look at {@link getBasicInfo} or {@link getInfo}. + * @param video_id - The video id. + * @param options - Format options. + */ + async getStreamingData(video_id, options = {}) { + const info2 = await this.getBasicInfo(video_id, options); + const format = info2.chooseFormat(options); + format.url = await format.decipher(__privateGet(this, _session6).player); + return format; + } + /** + * Downloads a given video. If all you need the direct download link, see {@link getStreamingData}. + * If you wish to retrieve the video info too, have a look at {@link getBasicInfo} or {@link getInfo}. + * @param video_id - The video id. + * @param options - Download options. + */ + async download(video_id, options) { + const info2 = await this.getBasicInfo(video_id, options); + return info2.download(options); + } + /** + * Resolves the given URL. + */ + async resolveURL(url) { + const response = await this.actions.execute("/navigation/resolve_url", { url, parse: true }); + if (!response.endpoint) + throw new InnertubeError("Failed to resolve URL. Expected a NavigationEndpoint but got undefined", response); + return response.endpoint; + } + /** + * Gets a post page given a post id and the channel id + */ + async getPost(post_id, channel_id) { + throwIfMissing({ post_id, channel_id }); + const writer = CommunityPostParams.encode({ + f1: { + ucid1: channel_id, + postId: post_id, + ucid2: channel_id + } + }); + const params = encodeURIComponent(u8ToBase64(writer.finish()).replace(/\+/g, "-").replace(/\//g, "_")); + const browse_endpoint = new NavigationEndpoint({ browseEndpoint: { browseId: "FEpost_detail", params } }); + const response = await browse_endpoint.call(__privateGet(this, _session6).actions, { parse: true }); + return new Feed(this.actions, response); + } + /** + * Gets the comments of a post. + */ + async getPostComments(post_id, channel_id, sort_by) { + throwIfMissing({ post_id, channel_id }); + const SORT_OPTIONS = { + TOP_COMMENTS: 0, + NEWEST_FIRST: 1 + }; + const writer1 = CommunityPostCommentsParam.encode({ + title: "posts", + commentDataContainer: { + title: "comments-section", + commentData: { + sortBy: SORT_OPTIONS[sort_by || "TOP_COMMENTS"], + f0: 2, + f1: 0, + channelId: channel_id, + postId: post_id + }, + f0: 0 + } + }); + const writer2 = CommunityPostCommentsParamContainer.encode({ + f0: { + location: "FEcomment_post_detail_page_web_top_level", + protoData: encodeURIComponent(u8ToBase64(writer1.finish()).replace(/\+/g, "-").replace(/\//g, "_")) + } + }); + const continuation = encodeURIComponent(u8ToBase64(writer2.finish())); + const continuation_command = new NavigationEndpoint({ + continuationCommand: { + request: "CONTINUATION_REQUEST_TYPE_BROWSE", + token: continuation + } + }); + const response = await continuation_command.call(__privateGet(this, _session6).actions); + return new Comments(this.actions, response.data); + } + /** + * Fetches an attestation challenge. + */ + async getAttestationChallenge(engagement_type, ids) { + const payload = { + engagementType: engagement_type + }; + if (ids) + payload.ids = ids; + return this.actions.execute("/att/get", { parse: true, ...payload }); + } + call(endpoint, args) { + return endpoint.call(this.actions, args); + } + /** + * An interface for interacting with YouTube Music. + */ + get music() { + return new Music(__privateGet(this, _session6)); + } + /** + * An interface for interacting with YouTube Studio. + */ + get studio() { + return new Studio(__privateGet(this, _session6)); + } + /** + * An interface for interacting with YouTube Kids. + */ + get kids() { + return new Kids(__privateGet(this, _session6)); + } + /** + * An interface for managing and retrieving account information. + */ + get account() { + return new AccountManager(__privateGet(this, _session6).actions); + } + /** + * An interface for managing playlists. + */ + get playlist() { + return new PlaylistManager(__privateGet(this, _session6).actions); + } + /** + * An interface for directly interacting with certain YouTube features. + */ + get interact() { + return new InteractionManager(__privateGet(this, _session6).actions); + } + /** + * An internal class used to dispatch requests. + */ + get actions() { + return __privateGet(this, _session6).actions; + } + /** + * The session used by this instance. + */ + get session() { + return __privateGet(this, _session6); + } +}; +_session6 = new WeakMap(); +__name(_Innertube, "Innertube"); +var Innertube = _Innertube; + +// dist/src/platform/lib.js +var lib_default = Innertube; + +// dist/src/platform/web.js +var CACHE_TAG = "Cache"; +var _persistent_directory, _persistent, _Cache_instances, getBrowserDB_fn; +var _Cache = class _Cache { + constructor(persistent = false, persistent_directory) { + __privateAdd(this, _Cache_instances); + __privateAdd(this, _persistent_directory); + __privateAdd(this, _persistent); + __privateSet(this, _persistent_directory, persistent_directory || ""); + __privateSet(this, _persistent, persistent); + } + get cache_dir() { + return __privateGet(this, _persistent) ? __privateGet(this, _persistent_directory) : ""; + } + async get(key) { + const db = await __privateMethod(this, _Cache_instances, getBrowserDB_fn).call(this); + if (!db) + return; + return new Promise((resolve, reject) => { + const request = db.transaction("kv-store", "readonly").objectStore("kv-store").get(key); + request.onerror = reject; + request.onsuccess = function() { + var _a; + const result = (_a = this.result) == null ? void 0 : _a.v; + if (result instanceof ArrayBuffer) { + resolve(result); + } else if (ArrayBuffer.isView(result)) { + resolve(result.buffer); + } else { + resolve(void 0); + } + }; + }); + } + async set(key, value) { + const db = await __privateMethod(this, _Cache_instances, getBrowserDB_fn).call(this); + if (!db) + return; + return new Promise((resolve, reject) => { + const request = db.transaction("kv-store", "readwrite").objectStore("kv-store").put({ k: key, v: value }); + request.onerror = reject; + request.onsuccess = () => resolve(); + }); + } + async remove(key) { + const db = await __privateMethod(this, _Cache_instances, getBrowserDB_fn).call(this); + if (!db) + return; + return new Promise((resolve, reject) => { + const request = db.transaction("kv-store", "readwrite").objectStore("kv-store").delete(key); + request.onerror = reject; + request.onsuccess = () => resolve(); + }); + } +}; +_persistent_directory = new WeakMap(); +_persistent = new WeakMap(); +_Cache_instances = new WeakSet(); +getBrowserDB_fn = /* @__PURE__ */ __name(function() { + const indexedDB = Reflect.get(globalThis, "indexedDB") || Reflect.get(globalThis, "webkitIndexedDB") || Reflect.get(globalThis, "mozIndexedDB") || Reflect.get(globalThis, "msIndexedDB"); + if (!indexedDB) + return warn(CACHE_TAG, "IndexedDB is not supported. No cache will be used."); + return new Promise((resolve, reject) => { + const request = indexedDB.open("youtubei.js", 1); + request.onsuccess = function() { + resolve(this.result); + }; + request.onerror = function(event) { + reject("indexedDB request error"); + console.error(event); + }; + request.onupgradeneeded = function() { + const store = this.result.createObjectStore("kv-store", { + keyPath: "k" + }); + store.transaction.oncomplete = function() { + resolve(this.db); + }; + }; + }); +}, "#getBrowserDB"); +__name(_Cache, "Cache"); +var Cache = _Cache; +Platform.load({ + runtime: "browser", + server: false, + Cache, + sha1Hash, + uuidv4() { + var _a; + if ((_a = globalThis.crypto) == null ? void 0 : _a.randomUUID()) { + return globalThis.crypto.randomUUID(); + } + return "10000000-1000-4000-8000-100000000000".replace(/[018]/g, (cc) => { + const c = parseInt(cc); + return (c ^ window.crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16); + }); + }, + eval: evaluate, + fetch: globalThis.fetch, + Request: globalThis.Request, + Response: globalThis.Response, + Headers: globalThis.Headers, + FormData: globalThis.FormData, + File: globalThis.File, + ReadableStream: globalThis.ReadableStream, + CustomEvent: globalThis.CustomEvent +}); +var web_default = lib_default; +export { + Actions, + AppendContinuationItemsAction, + BinarySerializer_exports as BinarySerializer, + ClientType, + clients_exports as Clients, + Constants_exports as Constants, + Continuation, + ContinuationCommand2 as ContinuationCommand, + EventEmitterLike as EventEmitter, + FormatUtils_exports as FormatUtils, + generator_exports as Generator, + GridContinuation, + HTTPClient, + helpers_exports as Helpers, + Innertube, + ItemSectionContinuation, + JsAnalyzer, + JsExtractor, + helpers_exports2 as JsHelpers, + matchers_exports as JsMatchers, + LZW_exports as LZW, + LiveChatContinuation, + Log_exports as Log, + managers_exports as Managers, + misc_exports as Misc, + mixins_exports as Mixins, + MusicPlaylistShelfContinuation, + MusicShelfContinuation, + NavigateAction, + OAuth2, + parser_exports as Parser, + Platform, + Player, + PlaylistPanelContinuation, + ProtoUtils_exports as ProtoUtils, + ReloadContinuationItemsCommand, + SectionListContinuation, + Session, + ShowMiniplayerCommand, + UniversalCache, + Utils_exports as Utils, + youtube_exports as YT, + ytkids_exports as YTKids, + ytmusic_exports as YTMusic, + nodes_exports as YTNodes, + ytshorts_exports as YTShorts, + web_default as default +}; +//# sourceMappingURL=browser.js.map diff --git a/node_modules/youtubei.js/bundle/browser.js.map b/node_modules/youtubei.js/bundle/browser.js.map new file mode 100644 index 0000000..e252e85 --- /dev/null +++ b/node_modules/youtubei.js/bundle/browser.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/utils/Utils.ts", "../src/parser/helpers.ts", "../src/utils/Log.ts", "../src/parser/misc.ts", "../src/parser/classes/misc/AccessibilityContext.ts", "../src/parser/classes/misc/AccessibilityData.ts", "../src/utils/Constants.ts", "../src/parser/parser.ts", "../src/parser/nodes.ts", "../src/utils/Cache.ts", "../src/utils/EventEmitterLike.ts", "../src/utils/FormatUtils.ts", "../src/utils/DashUtils.ts", "../src/parser/classes/PlayerStoryboardSpec.ts", "../dist/package.json", "../src/utils/StreamingInfo.ts", "../src/utils/DashManifest.tsx", "../src/utils/HTTPClient.ts", "../src/utils/LZW.ts", "../src/utils/BinarySerializer.ts", "../src/utils/ProtoUtils.ts", "../node_modules/@bufbuild/protobuf/dist/esm/wire/varint.js", "../node_modules/@bufbuild/protobuf/dist/esm/proto-int64.js", "../node_modules/@bufbuild/protobuf/dist/esm/wire/text-encoding.js", "../node_modules/@bufbuild/protobuf/dist/esm/wire/binary-encoding.js", "../protos/generated/misc/params.ts", "../src/utils/javascript/helpers.ts", "../src/utils/javascript/matchers.ts", "../node_modules/meriyah/dist/meriyah.mjs", "../src/utils/javascript/JsAnalyzer.ts", "../src/utils/javascript/JsExtractor.ts", "../src/parser/classes/actions/OpenPopupAction.ts", "../src/parser/classes/Button.ts", "../src/parser/classes/DropdownItem.ts", "../src/parser/classes/Dropdown.ts", "../src/parser/classes/CreatePlaylistDialog.ts", "../src/parser/classes/commands/CommandExecutorCommand.ts", "../src/parser/classes/NavigationEndpoint.ts", "../src/parser/classes/misc/Thumbnail.ts", "../src/parser/classes/misc/EmojiRun.ts", "../src/parser/classes/misc/TextRun.ts", "../src/parser/classes/misc/Text.ts", "../src/parser/classes/ChannelExternalLinkView.ts", "../src/parser/classes/AboutChannelView.ts", "../src/parser/classes/AboutChannel.ts", "../src/parser/classes/AccountChannel.ts", "../src/parser/classes/AccountItem.ts", "../src/parser/classes/AccountItemSectionHeader.ts", "../src/parser/classes/CompactLink.ts", "../src/parser/classes/AccountItemSection.ts", "../src/parser/classes/AccountSectionList.ts", "../src/parser/classes/actions/AppendContinuationItemsAction.ts", "../src/parser/classes/actions/ChangeEngagementPanelVisibilityAction.ts", "../src/parser/classes/menus/MultiPageMenu.ts", "../src/parser/classes/actions/GetMultiPageMenuAction.ts", "../src/parser/classes/actions/SendFeedbackAction.ts", "../src/parser/classes/actions/SignalAction.ts", "../src/parser/classes/ChannelSwitcherPage.ts", "../src/parser/classes/actions/UpdateChannelSwitcherPageAction.ts", "../src/parser/classes/SortFilterSubMenu.ts", "../src/parser/classes/TranscriptFooter.ts", "../src/parser/classes/TranscriptSearchBox.ts", "../src/parser/classes/TranscriptSectionHeader.ts", "../src/parser/classes/TranscriptSegment.ts", "../src/parser/classes/TranscriptSegmentList.ts", "../src/parser/classes/TranscriptSearchPanel.ts", "../src/parser/classes/Transcript.ts", "../src/parser/classes/actions/UpdateEngagementPanelAction.ts", "../src/parser/classes/actions/UpdateSubscribeButtonAction.ts", "../src/parser/classes/ActiveAccountHeader.ts", "../src/parser/classes/MenuTitle.ts", "../src/parser/classes/PlaylistAddToOption.ts", "../src/parser/classes/AddToPlaylist.ts", "../src/parser/classes/Alert.ts", "../src/parser/classes/AlertWithButton.ts", "../src/parser/classes/AnimatedThumbnailOverlayView.ts", "../src/parser/classes/AttributionView.ts", "../src/parser/classes/AudioOnlyPlayability.ts", "../src/parser/classes/AutomixPreviewVideo.ts", "../src/parser/classes/AvatarView.ts", "../src/parser/classes/misc/CommandContext.ts", "../src/parser/classes/misc/RendererContext.ts", "../src/parser/classes/AvatarStackView.ts", "../src/parser/classes/ButtonView.ts", "../src/parser/classes/BackgroundPromo.ts", "../src/parser/classes/BackstageImage.ts", "../src/parser/classes/ToggleButton.ts", "../src/parser/classes/comments/CreatorHeart.ts", "../src/parser/classes/comments/CommentActionButtons.ts", "../src/parser/classes/ToggleButtonView.ts", "../src/parser/classes/LikeButtonView.ts", "../src/parser/classes/DislikeButtonView.ts", "../src/parser/classes/SegmentedLikeDislikeButtonView.ts", "../src/parser/classes/menus/MenuServiceItem.ts", "../src/parser/classes/DownloadButton.ts", "../src/parser/classes/menus/MenuServiceItemDownload.ts", "../src/parser/classes/SubscribeButtonView.ts", "../src/parser/classes/ListItemView.ts", "../src/parser/classes/menus/MenuFlexibleItem.ts", "../src/parser/classes/LikeButton.ts", "../src/parser/classes/FlexibleActionsView.ts", "../src/parser/classes/menus/Menu.ts", "../src/parser/classes/BackstagePost.ts", "../src/parser/classes/BackstagePostThread.ts", "../src/parser/classes/BadgeView.ts", "../src/parser/classes/SubFeedOption.ts", "../src/parser/classes/SubFeedSelector.ts", "../src/parser/classes/EomSettingsDisclaimer.ts", "../src/parser/classes/SearchBox.ts", "../src/parser/classes/BrowseFeedActions.ts", "../src/parser/classes/BrowserMediaSession.ts", "../src/parser/classes/ButtonCardView.ts", "../src/parser/classes/ChannelHeaderLinks.ts", "../src/parser/classes/ChannelHeaderLinksView.ts", "../src/parser/classes/ClipCreationTextInput.ts", "../src/parser/classes/ClipCreationScrubber.ts", "../src/parser/classes/ClipAdState.ts", "../src/parser/classes/ClipCreation.ts", "../src/parser/classes/ClipSection.ts", "../src/parser/classes/ContinuationItem.ts", "../src/parser/classes/EngagementPanelTitleHeader.ts", "../src/parser/classes/MacroMarkersInfoItem.ts", "../src/parser/classes/MacroMarkersListItem.ts", "../src/parser/classes/MacroMarkersList.ts", "../src/parser/classes/ProductList.ts", "../src/parser/classes/SectionList.ts", "../src/parser/classes/ExpandableVideoDescriptionBody.ts", "../src/parser/classes/SearchRefinementCard.ts", "../src/parser/classes/GameCard.ts", "../src/parser/classes/HorizontalList.ts", "../src/parser/classes/VideoSummaryParagraphView.ts", "../src/parser/classes/VideoSummaryContentView.ts", "../src/parser/classes/ExpandableMetadata.ts", "../src/parser/classes/MetadataBadge.ts", "../src/parser/classes/ThumbnailOverlayTimeStatus.ts", "../src/parser/classes/Video.ts", "../src/parser/classes/VideoCard.ts", "../src/parser/classes/ContentPreviewImageView.ts", "../src/parser/classes/VideoAttributeView.ts", "../src/parser/classes/HorizontalCardList.ts", "../src/parser/classes/Factoid.ts", "../src/parser/classes/UploadTimeFactoid.ts", "../src/parser/classes/ViewCountFactoid.ts", "../src/parser/classes/HypePointsFactoid.ts", "../src/parser/classes/VideoDescriptionHeader.ts", "../src/parser/classes/VideoDescriptionInfocardsSection.ts", "../src/parser/classes/InfoRow.ts", "../src/parser/classes/CompactVideo.ts", "../src/parser/classes/CarouselLockup.ts", "../src/parser/classes/VideoDescriptionMusicSection.ts", "../src/parser/classes/VideoDescriptionTranscriptSection.ts", "../src/parser/classes/StructuredDescriptionPlaylistLockup.ts", "../src/parser/classes/VideoDescriptionCourseSection.ts", "../src/parser/classes/VideoAttributesSectionView.ts", "../src/parser/classes/HowThisWasMadeSectionView.ts", "../src/parser/classes/ReelShelf.ts", "../src/parser/classes/MerchandiseShelf.ts", "../src/parser/classes/StructuredDescriptionContent.ts", "../src/parser/classes/EngagementPanelSectionList.ts", "../src/parser/classes/ChannelTagline.ts", "../src/parser/classes/SubscriptionNotificationToggleButton.ts", "../src/parser/classes/SubscribeButton.ts", "../src/parser/classes/C4TabbedHeader.ts", "../src/parser/classes/CallToActionButton.ts", "../src/parser/classes/Card.ts", "../src/parser/classes/CardCollection.ts", "../src/parser/classes/CarouselHeader.ts", "../src/parser/classes/CarouselItem.ts", "../src/parser/classes/TextCarouselItemView.ts", "../src/parser/classes/CarouselItemView.ts", "../src/parser/classes/CarouselTitleView.ts", "../src/parser/classes/Channel.ts", "../src/parser/classes/ChannelAboutFullMetadata.ts", "../src/parser/classes/ChannelAgeGate.ts", "../src/parser/classes/ChannelFeaturedContent.ts", "../src/parser/classes/ChannelMetadata.ts", "../src/parser/classes/ChannelMobileHeader.ts", "../src/parser/classes/ChannelOptions.ts", "../src/parser/classes/ChannelOwnerEmptyState.ts", "../src/parser/classes/ChannelSubMenu.ts", "../src/parser/classes/ChannelSwitcherHeader.ts", "../src/parser/classes/ChannelThumbnailWithLink.ts", "../src/parser/classes/ChannelVideoPlayer.ts", "../src/parser/classes/Chapter.ts", "../src/parser/classes/ChildVideo.ts", "../src/parser/classes/ChipView.ts", "../src/parser/classes/ChipBarView.ts", "../src/parser/classes/ChipCloudChip.ts", "../src/parser/classes/ChipCloud.ts", "../src/parser/classes/ClientSideToggleMenuItem.ts", "../src/parser/classes/CollaboratorInfoCardContent.ts", "../src/parser/classes/CollageHeroImage.ts", "../src/parser/classes/ThumbnailHoverOverlayView.ts", "../src/parser/classes/ThumbnailBadgeView.ts", "../src/parser/classes/ThumbnailOverlayBadgeView.ts", "../src/parser/classes/ThumbnailHoverOverlayToggleActionsView.ts", "../src/parser/classes/ThumbnailOverlayProgressBarView.ts", "../src/parser/classes/ThumbnailBottomOverlayView.ts", "../src/parser/classes/ThumbnailView.ts", "../src/parser/classes/CollectionThumbnailView.ts", "../src/parser/classes/commands/AddToPlaylistCommand.ts", "../src/parser/classes/commands/ContinuationCommand.ts", "../src/parser/classes/commands/GetKidsBlocklistPickerCommand.ts", "../src/parser/classes/commands/RunAttestationCommand.ts", "../src/parser/classes/commands/ShowDialogCommand.ts", "../src/parser/classes/commands/UpdateEngagementPanelContentCommand.ts", "../src/parser/classes/comments/AuthorCommentBadge.ts", "../src/parser/classes/comments/EmojiPicker.ts", "../src/parser/classes/comments/CommentDialog.ts", "../src/parser/classes/comments/CommentReplies.ts", "../src/parser/classes/comments/CommentReplyDialog.ts", "../src/parser/classes/comments/CommentsSimplebox.ts", "../src/parser/classes/comments/CommentsEntryPointTeaser.ts", "../src/parser/classes/comments/CommentsEntryPointHeader.ts", "../src/parser/classes/comments/CommentsHeader.ts", "../src/parser/classes/comments/CommentSimplebox.ts", "../src/parser/classes/comments/VoiceReplyContainerView.ts", "../src/parser/classes/comments/CommentView.ts", "../src/parser/classes/comments/CommentThread.ts", "../src/parser/classes/comments/PdgCommentChip.ts", "../src/parser/classes/comments/SponsorCommentBadge.ts", "../src/parser/classes/CompactChannel.ts", "../src/parser/classes/PlaylistCustomThumbnail.ts", "../src/parser/classes/PlaylistVideoThumbnail.ts", "../src/parser/classes/Playlist.ts", "../src/parser/classes/CompactMix.ts", "../src/parser/classes/CompactMovie.ts", "../src/parser/classes/CompactPlaylist.ts", "../src/parser/classes/CompactStation.ts", "../src/parser/classes/CompositeVideoPrimaryInfo.ts", "../src/parser/classes/ConfirmDialog.ts", "../src/parser/classes/ContentMetadataView.ts", "../src/parser/classes/Message.ts", "../src/parser/classes/ConversationBar.ts", "../src/parser/classes/CopyLink.ts", "../src/parser/classes/DropdownView.ts", "../src/parser/classes/TextFieldView.ts", "../src/parser/classes/CreatePlaylistDialogFormView.ts", "../src/parser/classes/DecoratedAvatarView.ts", "../src/parser/classes/HeatMarker.ts", "../src/parser/classes/TimedMarkerDecoration.ts", "../src/parser/classes/Heatmap.ts", "../src/parser/classes/MultiMarkersPlayerBar.ts", "../src/parser/classes/DecoratedPlayerBar.ts", "../src/parser/classes/DefaultPromoPanel.ts", "../src/parser/classes/DescriptionPreviewView.ts", "../src/parser/classes/DialogHeaderView.ts", "../src/parser/classes/PanelFooterView.ts", "../src/parser/classes/FormFooterView.ts", "../src/parser/classes/ListView.ts", "../src/parser/classes/DialogView.ts", "../src/parser/classes/DidYouMean.ts", "../src/parser/classes/DismissableDialogContentSection.ts", "../src/parser/classes/DismissableDialog.ts", "../src/parser/classes/DynamicTextView.ts", "../src/parser/classes/misc/ChildElement.ts", "../src/parser/classes/Element.ts", "../src/parser/classes/EmergencyOnebox.ts", "../src/parser/classes/EmojiPickerCategory.ts", "../src/parser/classes/EmojiPickerCategoryButton.ts", "../src/parser/classes/EmojiPickerUpsellCategory.ts", "../src/parser/classes/endpoints/AddToPlaylistServiceEndpoint.ts", "../src/parser/classes/endpoints/AddToPlaylistEndpoint.ts", "../src/parser/classes/endpoints/BrowseEndpoint.ts", "../src/parser/classes/endpoints/CreateCommentEndpoint.ts", "../src/parser/classes/endpoints/CreatePlaylistServiceEndpoint.ts", "../src/parser/classes/endpoints/DeletePlaylistEndpoint.ts", "../src/parser/classes/endpoints/FeedbackEndpoint.ts", "../src/parser/classes/endpoints/GetAccountsListInnertubeEndpoint.ts", "../src/parser/classes/endpoints/HideEngagementPanelEndpoint.ts", "../src/parser/classes/endpoints/LikeEndpoint.ts", "../src/parser/classes/endpoints/LiveChatItemContextMenuEndpoint.ts", "../src/parser/classes/endpoints/ModifyChannelNotificationPreferenceEndpoint.ts", "../src/parser/classes/endpoints/PerformCommentActionEndpoint.ts", "../src/parser/classes/endpoints/PlaylistEditEndpoint.ts", "../src/parser/classes/endpoints/WatchEndpoint.ts", "../src/parser/classes/endpoints/PrefetchWatchCommand.ts", "../src/parser/classes/endpoints/ReelWatchEndpoint.ts", "../src/parser/classes/endpoints/SearchEndpoint.ts", "../src/parser/classes/endpoints/ShareEntityServiceEndpoint.ts", "../src/parser/classes/endpoints/ShareEndpoint.ts", "../src/parser/classes/endpoints/ShareEntityEndpoint.ts", "../src/parser/classes/endpoints/ShowEngagementPanelEndpoint.ts", "../src/parser/classes/endpoints/SignalServiceEndpoint.ts", "../src/parser/classes/endpoints/SubscribeEndpoint.ts", "../src/parser/classes/endpoints/UnsubscribeEndpoint.ts", "../src/parser/classes/endpoints/WatchNextEndpoint.ts", "../src/parser/classes/Endscreen.ts", "../src/parser/classes/EndscreenElement.ts", "../src/parser/classes/EndScreenPlaylist.ts", "../src/parser/classes/EndScreenVideo.ts", "../src/parser/classes/ExpandableTab.ts", "../src/parser/classes/ExpandedShelfContents.ts", "../src/parser/classes/FancyDismissibleDialog.ts", "../src/parser/classes/FeedFilterChipBar.ts", "../src/parser/classes/FeedNudge.ts", "../src/parser/classes/FeedTabbedHeader.ts", "../src/parser/classes/ToggleFormField.ts", "../src/parser/classes/Form.ts", "../src/parser/classes/FormPopup.ts", "../src/parser/classes/GameDetails.ts", "../src/parser/classes/Grid.ts", "../src/parser/classes/GridChannel.ts", "../src/parser/classes/GridHeader.ts", "../src/parser/classes/GridMix.ts", "../src/parser/classes/GridMovie.ts", "../src/parser/classes/GridPlaylist.ts", "../src/parser/classes/GridShelfView.ts", "../src/parser/classes/ShowCustomThumbnail.ts", "../src/parser/classes/ThumbnailOverlayBottomPanel.ts", "../src/parser/classes/GridShow.ts", "../src/parser/classes/GridVideo.ts", "../src/parser/classes/GuideEntry.ts", "../src/parser/classes/GuideCollapsibleEntry.ts", "../src/parser/classes/GuideCollapsibleSectionEntry.ts", "../src/parser/classes/GuideDownloadsEntry.ts", "../src/parser/classes/GuideSection.ts", "../src/parser/classes/GuideSubscriptionsSection.ts", "../src/parser/classes/HashtagHeader.ts", "../src/parser/classes/HashtagTile.ts", "../src/parser/classes/HeroPlaylistThumbnail.ts", "../src/parser/classes/HighlightsCarousel.ts", "../src/parser/classes/SearchSuggestion.ts", "../src/parser/classes/HistorySuggestion.ts", "../src/parser/classes/HorizontalMovieList.ts", "../src/parser/classes/IconLink.ts", "../src/parser/classes/ImageBannerView.ts", "../src/parser/classes/IncludingResultsFor.ts", "../src/parser/classes/InfoPanelContent.ts", "../src/parser/classes/InfoPanelContainer.ts", "../src/parser/classes/InteractiveTabbedHeader.ts", "../src/parser/classes/ItemSectionHeader.ts", "../src/parser/classes/ItemSectionTab.ts", "../src/parser/classes/ItemSectionTabbedHeader.ts", "../src/parser/classes/SortFilterHeader.ts", "../src/parser/classes/ItemSection.ts", "../src/parser/classes/LiveChat.ts", "../src/parser/classes/livechat/items/LiveChatBannerHeader.ts", "../src/parser/classes/livechat/items/LiveChatBanner.ts", "../src/parser/classes/livechat/AddBannerToLiveChatCommand.ts", "../src/parser/classes/livechat/AddChatItemAction.ts", "../src/parser/classes/livechat/AddLiveChatTickerItemAction.ts", "../src/parser/classes/livechat/DimChatItemAction.ts", "../src/parser/classes/livechat/items/BumperUserEduContentView.ts", "../src/parser/classes/livechat/items/CreatorHeartView.ts", "../src/parser/classes/livechat/items/LiveChatAutoModMessage.ts", "../src/parser/classes/livechat/items/LiveChatBannerChatSummary.ts", "../src/parser/classes/livechat/items/LiveChatBannerPoll.ts", "../src/parser/classes/livechat/items/LiveChatBannerRedirect.ts", "../src/parser/classes/livechat/items/LiveChatItemBumperView.ts", "../src/parser/classes/livechat/items/LiveChatMembershipItem.ts", "../src/parser/classes/livechat/items/LiveChatModeChangeMessage.ts", "../src/parser/classes/livechat/items/PdgReplyButtonView.ts", "../src/parser/classes/livechat/items/LiveChatPaidMessage.ts", "../src/parser/classes/livechat/items/LiveChatPaidSticker.ts", "../src/parser/classes/livechat/items/LiveChatPlaceholderItem.ts", "../src/parser/classes/livechat/items/LiveChatProductItem.ts", "../src/parser/classes/livechat/items/LiveChatRestrictedParticipation.ts", "../src/parser/classes/LiveChatAuthorBadge.ts", "../src/parser/classes/livechat/items/LiveChatSponsorshipsHeader.ts", "../src/parser/classes/livechat/items/LiveChatSponsorshipsGiftPurchaseAnnouncement.ts", "../src/parser/classes/livechat/items/LiveChatSponsorshipsGiftRedemptionAnnouncement.ts", "../src/parser/classes/livechat/items/LiveChatTextMessage.ts", "../src/parser/classes/livechat/items/LiveChatTickerPaidMessageItem.ts", "../src/parser/classes/livechat/items/LiveChatTickerPaidStickerItem.ts", "../src/parser/classes/livechat/items/LiveChatTickerSponsorItem.ts", "../src/parser/classes/livechat/items/LiveChatViewerEngagementMessage.ts", "../src/parser/classes/livechat/items/PollHeader.ts", "../src/parser/classes/livechat/LiveChatActionPanel.ts", "../src/parser/classes/livechat/MarkChatItemAsDeletedAction.ts", "../src/parser/classes/livechat/MarkChatItemsByAuthorAsDeletedAction.ts", "../src/parser/classes/livechat/RemoveBannerForLiveChatCommand.ts", "../src/parser/classes/livechat/RemoveChatItemAction.ts", "../src/parser/classes/livechat/RemoveChatItemByAuthorAction.ts", "../src/parser/classes/livechat/ReplaceChatItemAction.ts", "../src/parser/classes/livechat/ReplaceLiveChatAction.ts", "../src/parser/classes/livechat/ReplayChatItemAction.ts", "../src/parser/classes/livechat/ShowLiveChatActionPanelAction.ts", "../src/parser/classes/livechat/ShowLiveChatDialogAction.ts", "../src/parser/classes/livechat/ShowLiveChatTooltipCommand.ts", "../src/parser/classes/livechat/UpdateDateTextAction.ts", "../src/parser/classes/livechat/UpdateDescriptionAction.ts", "../src/parser/classes/livechat/UpdateLiveChatPollAction.ts", "../src/parser/classes/livechat/UpdateTitleAction.ts", "../src/parser/classes/livechat/UpdateToggleButtonTextAction.ts", "../src/parser/classes/VideoViewCount.ts", "../src/parser/classes/livechat/UpdateViewershipAction.ts", "../src/parser/classes/LiveChatDialog.ts", "../src/parser/classes/LiveChatHeader.ts", "../src/parser/classes/LiveChatItemList.ts", "../src/parser/classes/LiveChatMessageInput.ts", "../src/parser/classes/LiveChatParticipant.ts", "../src/parser/classes/LiveChatParticipantsList.ts", "../src/parser/classes/LockupMetadataView.ts", "../src/parser/classes/LockupView.ts", "../src/parser/classes/MacroMarkersListEntity.ts", "../src/parser/classes/menus/MenuNavigationItem.ts", "../src/parser/classes/menus/MenuPopup.ts", "../src/parser/classes/Notification.ts", "../src/parser/classes/menus/MultiPageMenuNotificationSection.ts", "../src/parser/classes/menus/MusicMenuItemDivider.ts", "../src/parser/classes/menus/MusicMultiSelectMenuItem.ts", "../src/parser/classes/menus/MusicMultiSelectMenu.ts", "../src/parser/classes/menus/SimpleMenuHeader.ts", "../src/parser/classes/MerchandiseItem.ts", "../src/parser/classes/MetadataRow.ts", "../src/parser/classes/MetadataRowContainer.ts", "../src/parser/classes/MetadataRowHeader.ts", "../src/parser/classes/MetadataScreen.ts", "../src/parser/classes/MicroformatData.ts", "../src/parser/classes/Mix.ts", "../src/parser/classes/ModalWithTitleAndButton.ts", "../src/parser/classes/Movie.ts", "../src/parser/classes/MovingThumbnail.ts", "../src/parser/classes/MusicCardShelfHeaderBasic.ts", "../src/parser/classes/MusicInlineBadge.ts", "../src/parser/classes/MusicPlayButton.ts", "../src/parser/classes/MusicItemThumbnailOverlay.ts", "../src/parser/classes/MusicThumbnail.ts", "../src/parser/classes/MusicCardShelf.ts", "../src/parser/classes/MusicCarouselShelfBasicHeader.ts", "../src/parser/classes/MusicMultiRowListItem.ts", "../src/parser/classes/MusicNavigationButton.ts", "../src/parser/classes/MusicResponsiveListItemFixedColumn.ts", "../src/parser/classes/MusicResponsiveListItemFlexColumn.ts", "../src/parser/classes/MusicResponsiveListItem.ts", "../src/parser/classes/MusicTwoRowItem.ts", "../src/parser/classes/MusicCarouselShelf.ts", "../src/parser/classes/MusicDescriptionShelf.ts", "../src/parser/classes/MusicDetailHeader.ts", "../src/parser/classes/MusicDownloadStateBadge.ts", "../src/parser/classes/MusicEditablePlaylistDetailHeader.ts", "../src/parser/classes/MusicElementHeader.ts", "../src/parser/classes/MusicHeader.ts", "../src/parser/classes/MusicImmersiveHeader.ts", "../src/parser/classes/MusicLargeCardItemCarousel.ts", "../src/parser/classes/MusicPlaylistEditHeader.ts", "../src/parser/classes/MusicPlaylistShelf.ts", "../src/parser/classes/PlaylistPanelVideo.ts", "../src/parser/classes/PlaylistPanelVideoWrapper.ts", "../src/parser/classes/PlaylistPanel.ts", "../src/parser/classes/MusicQueue.ts", "../src/parser/classes/MusicResponsiveHeader.ts", "../src/parser/classes/MusicShelf.ts", "../src/parser/classes/MusicSideAlignedItem.ts", "../src/parser/classes/MusicSortFilterButton.ts", "../src/parser/classes/MusicTastebuilderShelfThumbnail.ts", "../src/parser/classes/MusicTastebuilderShelf.ts", "../src/parser/classes/MusicVisualHeader.ts", "../src/parser/classes/mweb/MobileTopbar.ts", "../src/parser/classes/mweb/MultiPageMenuSection.ts", "../src/parser/classes/mweb/PivotBar.ts", "../src/parser/classes/mweb/PivotBarItem.ts", "../src/parser/classes/mweb/TopbarMenuButton.ts", "../src/parser/classes/NotificationAction.ts", "../src/parser/classes/OpenOnePickAddVideoModalCommand.ts", "../src/parser/classes/PageHeaderView.ts", "../src/parser/classes/PageHeader.ts", "../src/parser/classes/PageIntroduction.ts", "../src/parser/classes/PivotButton.ts", "../src/parser/classes/PlayerAnnotationsExpanded.ts", "../src/parser/classes/PlayerCaptchaView.ts", "../src/parser/classes/PlayerCaptionsTracklist.ts", "../src/parser/classes/PlayerOverflow.ts", "../src/parser/classes/PlayerControlsOverlay.ts", "../src/parser/classes/PlayerErrorMessage.ts", "../src/parser/classes/PlayerLegacyDesktopYpcOffer.ts", "../src/parser/classes/YpcTrailer.ts", "../src/parser/classes/PlayerLegacyDesktopYpcTrailer.ts", "../src/parser/classes/PlayerLiveStoryboardSpec.ts", "../src/parser/classes/PlayerMicroformat.ts", "../src/parser/classes/PlayerOverlayAutoplay.ts", "../src/parser/classes/PlayerOverlayVideoDetails.ts", "../src/parser/classes/WatchNextEndScreen.ts", "../src/parser/classes/PlayerOverlay.ts", "../src/parser/classes/PlaylistHeader.ts", "../src/parser/classes/PlaylistInfoCardContent.ts", "../src/parser/classes/PlaylistMetadata.ts", "../src/parser/classes/PlaylistSidebar.ts", "../src/parser/classes/PlaylistSidebarPrimaryInfo.ts", "../src/parser/classes/PlaylistSidebarSecondaryInfo.ts", "../src/parser/classes/PlaylistThumbnailOverlay.ts", "../src/parser/classes/PlaylistVideo.ts", "../src/parser/classes/PlaylistVideoList.ts", "../src/parser/classes/Poll.ts", "../src/parser/classes/Post.ts", "../src/parser/classes/PostMultiImage.ts", "../src/parser/classes/PremiereTrailerBadge.ts", "../src/parser/classes/ProductListHeader.ts", "../src/parser/classes/ProductListItem.ts", "../src/parser/classes/ProfileColumn.ts", "../src/parser/classes/ProfileColumnStats.ts", "../src/parser/classes/ProfileColumnStatsEntry.ts", "../src/parser/classes/ProfileColumnUserInfo.ts", "../src/parser/classes/Quiz.ts", "../src/parser/classes/RecognitionShelf.ts", "../src/parser/classes/ReelItem.ts", "../src/parser/classes/ReelPlayerHeader.ts", "../src/parser/classes/ReelPlayerOverlay.ts", "../src/parser/classes/RelatedChipCloud.ts", "../src/parser/classes/RichGrid.ts", "../src/parser/classes/RichItem.ts", "../src/parser/classes/RichListHeader.ts", "../src/parser/classes/RichMetadata.ts", "../src/parser/classes/RichMetadataRow.ts", "../src/parser/classes/RichSection.ts", "../src/parser/classes/RichShelf.ts", "../src/parser/classes/SearchFilter.ts", "../src/parser/classes/SearchFilterGroup.ts", "../src/parser/classes/SearchFilterOptionsDialog.ts", "../src/parser/classes/SearchHeader.ts", "../src/parser/classes/SearchSubMenu.ts", "../src/parser/classes/SearchSuggestionsSection.ts", "../src/parser/classes/UniversalWatchCard.ts", "../src/parser/classes/SecondarySearchContainer.ts", "../src/parser/classes/SectionHeaderView.ts", "../src/parser/classes/SegmentedLikeDislikeButton.ts", "../src/parser/classes/SettingBoolean.ts", "../src/parser/classes/SettingsCheckbox.ts", "../src/parser/classes/SettingsSwitch.ts", "../src/parser/classes/SettingsOptions.ts", "../src/parser/classes/SettingsSidebar.ts", "../src/parser/classes/SharedPost.ts", "../src/parser/classes/SharePanelHeader.ts", "../src/parser/classes/SharePanelTitleV15.ts", "../src/parser/classes/ShareTarget.ts", "../src/parser/classes/Shelf.ts", "../src/parser/classes/ShortsLockupView.ts", "../src/parser/classes/ShowingResultsFor.ts", "../src/parser/classes/SimpleCardContent.ts", "../src/parser/classes/SimpleCardTeaser.ts", "../src/parser/classes/SimpleTextSection.ts", "../src/parser/classes/SingleActionEmergencySupport.ts", "../src/parser/classes/Tab.ts", "../src/parser/classes/SingleColumnBrowseResults.ts", "../src/parser/classes/SingleColumnMusicWatchNextResults.ts", "../src/parser/classes/SingleHeroImage.ts", "../src/parser/classes/SlimOwner.ts", "../src/parser/classes/SlimVideoMetadata.ts", "../src/parser/classes/StartAt.ts", "../src/parser/classes/Tabbed.ts", "../src/parser/classes/TabbedSearchResults.ts", "../src/parser/classes/TextHeader.ts", "../src/parser/classes/ThirdPartyShareTargetSection.ts", "../src/parser/classes/ThumbnailLandscapePortrait.ts", "../src/parser/classes/ThumbnailOverlayEndorsement.ts", "../src/parser/classes/ThumbnailOverlayHoverText.ts", "../src/parser/classes/ThumbnailOverlayInlineUnplayable.ts", "../src/parser/classes/ThumbnailOverlayLoadingPreview.ts", "../src/parser/classes/ThumbnailOverlayNowPlaying.ts", "../src/parser/classes/ThumbnailOverlayPinking.ts", "../src/parser/classes/ThumbnailOverlayPlaybackStatus.ts", "../src/parser/classes/ThumbnailOverlayResumePlayback.ts", "../src/parser/classes/ThumbnailOverlaySidePanel.ts", "../src/parser/classes/ThumbnailOverlayToggleButton.ts", "../src/parser/classes/TitleAndButtonListHeader.ts", "../src/parser/classes/ToggleMenuServiceItem.ts", "../src/parser/classes/Tooltip.ts", "../src/parser/classes/TopicChannelDetails.ts", "../src/parser/classes/TwoColumnBrowseResults.ts", "../src/parser/classes/TwoColumnSearchResults.ts", "../src/parser/classes/TwoColumnWatchNextResults.ts", "../src/parser/classes/UnifiedSharePanel.ts", "../src/parser/classes/UpsellDialog.ts", "../src/parser/classes/VerticalList.ts", "../src/parser/classes/VerticalWatchCardList.ts", "../src/parser/classes/VideoInfoCardContent.ts", "../src/parser/classes/VideoMetadataCarouselView.ts", "../src/parser/classes/misc/SubscriptionButton.ts", "../src/parser/classes/VideoOwner.ts", "../src/parser/classes/VideoPrimaryInfo.ts", "../src/parser/classes/VideoSecondaryInfo.ts", "../src/parser/classes/WatchCardCompactVideo.ts", "../src/parser/classes/WatchCardHeroVideo.ts", "../src/parser/classes/WatchCardRichHeader.ts", "../src/parser/classes/WatchCardSectionSequence.ts", "../src/parser/classes/WatchNextTabbedResults.ts", "../src/parser/classes/ytkids/AnchoredSection.ts", "../src/parser/classes/ytkids/KidsBlocklistPickerItem.ts", "../src/parser/classes/ytkids/KidsBlocklistPicker.ts", "../src/parser/classes/ytkids/KidsCategoryTab.ts", "../src/parser/classes/ytkids/KidsCategoriesHeader.ts", "../src/parser/classes/ytkids/KidsHomeScreen.ts", "../src/parser/generator.ts", "../src/parser/continuations.ts", "../protos/generated/misc/common.ts", "../src/parser/classes/misc/Format.ts", "../src/parser/classes/misc/VideoDetails.ts", "../src/parser/youtube/index.ts", "../src/parser/youtube/AccountInfo.ts", "../src/core/mixins/Feed.ts", "../src/core/mixins/FilterableFeed.ts", "../src/core/mixins/index.ts", "../src/core/mixins/MediaInfo.ts", "../src/core/mixins/TabbedFeed.ts", "../src/parser/youtube/Channel.ts", "../src/parser/youtube/Comments.ts", "../src/parser/youtube/Guide.ts", "../src/parser/youtube/History.ts", "../src/parser/youtube/HomeFeed.ts", "../src/parser/youtube/HashtagFeed.ts", "../src/parser/youtube/ItemMenu.ts", "../src/parser/youtube/Playlist.ts", "../src/parser/youtube/Library.ts", "../src/parser/youtube/SmoothedQueue.ts", "../src/parser/youtube/LiveChat.ts", "../src/parser/youtube/NotificationsMenu.ts", "../src/parser/youtube/Search.ts", "../src/parser/youtube/Settings.ts", "../src/parser/youtube/VideoInfo.ts", "../src/parser/youtube/TranscriptInfo.ts", "../src/parser/ytmusic/index.ts", "../src/parser/ytmusic/Album.ts", "../src/parser/ytmusic/Artist.ts", "../src/parser/ytmusic/Explore.ts", "../src/parser/ytmusic/HomeFeed.ts", "../src/parser/ytmusic/Library.ts", "../src/parser/ytmusic/Playlist.ts", "../src/parser/ytmusic/Recap.ts", "../src/parser/ytmusic/Search.ts", "../src/parser/ytmusic/TrackInfo.ts", "../src/parser/ytkids/index.ts", "../src/parser/ytkids/Channel.ts", "../src/parser/ytkids/HomeFeed.ts", "../src/parser/ytkids/Search.ts", "../src/parser/ytkids/VideoInfo.ts", "../src/parser/ytshorts/index.ts", "../src/parser/ytshorts/ShortFormVideoInfo.ts", "../src/parser/classes/misc/Author.ts", "../src/utils/user-agents.ts", "../src/platform/polyfills/web-crypto.ts", "../src/platform/jsruntime/default.ts", "../src/core/Actions.ts", "../src/core/OAuth2.ts", "../src/core/Player.ts", "../src/core/Session.ts", "../src/core/clients/index.ts", "../src/core/clients/Kids.ts", "../src/core/clients/Music.ts", "../protos/generated/youtube/api/pfiinnertube/capability_info.ts", "../protos/generated/youtube/api/pfiinnertube/client_info.ts", "../protos/generated/youtube/api/pfiinnertube/attestation_response_data.ts", "../protos/generated/youtube/api/pfiinnertube/request_info.ts", "../protos/generated/youtube/api/pfiinnertube/third_party_info.ts", "../protos/generated/youtube/api/pfiinnertube/user_info.ts", "../protos/generated/youtube/api/pfiinnertube/innertube_context.ts", "../protos/generated/youtube/api/pfiinnertube/metadata_update_request.ts", "../src/core/clients/Studio.ts", "../src/core/managers/index.ts", "../src/core/managers/AccountManager.ts", "../src/core/managers/PlaylistManager.ts", "../src/core/managers/InteractionManager.ts", "../src/Innertube.ts", "../src/platform/lib.ts", "../src/platform/web.ts"], + "sourcesContent": ["import type { EmojiRun, TextRun } from '../parser/misc.js';\nimport type { FetchFunction } from '../types/index.js';\nimport type PlatformShim from '../types/PlatformShim.js';\n\nimport { Memo } from '../parser/helpers.js';\nimport { Text } from '../parser/misc.js';\nimport * as Log from './Log.js';\nimport userAgents from './user-agents.js';\nimport packageInfo from '../../package.json' with { type: 'json' };\n\nconst TAG_ = 'Utils';\n\nlet shim: PlatformShim | undefined;\n\nexport class Platform {\n static load(platform: PlatformShim): void {\n shim = platform;\n }\n\n static get shim(): PlatformShim {\n if (!shim) {\n throw new Error('Platform is not loaded');\n }\n return shim;\n }\n}\n\nexport class InnertubeError extends Error {\n date: Date;\n version: string;\n info?: any;\n\n constructor(message: string, info?: any) {\n super(message);\n\n if (info) {\n this.info = info;\n }\n\n this.date = new Date();\n this.version = packageInfo.version;\n }\n}\n\nexport class ParsingError extends InnertubeError {\n}\n\nexport class MissingParamError extends InnertubeError {\n}\n\nexport class OAuth2Error extends InnertubeError {\n}\n\nexport class PlayerError extends Error {\n}\n\nexport class SessionError extends Error {\n}\n\nexport class ChannelError extends Error {\n}\n\n/**\n * Compares given objects. May not work correctly for\n * objects with methods.\n */\nexport function deepCompare(obj1: any, obj2: any): boolean {\n const keys = Reflect.ownKeys(obj1);\n return keys.some((key) => {\n const is_text = obj2[key] instanceof Text;\n if (!is_text && typeof obj2[key] === 'object') {\n return JSON.stringify(obj1[key]) === JSON.stringify(obj2[key]);\n }\n return obj1[key] === (is_text ? obj2[key].toString() : obj2[key]);\n });\n}\n\n/**\n * Finds a string between two delimiters.\n * @param data - the data.\n * @param start_string - start string.\n * @param end_string - end string.\n */\nexport function getStringBetweenStrings(data: string, start_string: string, end_string: string): string | undefined {\n const regex = new RegExp(`${escapeStringRegexp(start_string)}(.*?)${escapeStringRegexp(end_string)}`, 's');\n const match = data.match(regex);\n return match ? match[1] : undefined;\n}\n\nexport function escapeStringRegexp(input: string): string {\n return input.replace(/[|\\\\{}()[\\]^$+*?.]/g, '\\\\$&').replace(/-/g, '\\\\x2d');\n}\n\nexport type DeviceCategory = 'mobile' | 'desktop';\n\n/**\n * Returns a random user agent.\n * @param type - mobile | desktop\n */\nexport function getRandomUserAgent(type: DeviceCategory): string {\n const available_agents = userAgents[type];\n const random_index = Math.floor(Math.random() * available_agents.length);\n return available_agents[random_index];\n}\n\n/**\n * Generates an authentication token from a cookies' sid.\n * @param sid - Sid extracted from cookies\n */\nexport async function generateSidAuth(sid: string): Promise {\n const youtube = 'https://www.youtube.com';\n\n const timestamp = Math.floor(new Date().getTime() / 1000);\n const input = [ timestamp, sid, youtube ].join(' ');\n const gen_hash = await Platform.shim.sha1Hash(input);\n\n return [ 'SAPISIDHASH', [ timestamp, gen_hash ].join('_') ].join(' ');\n}\n\n/**\n * Generates a random string with the given length.\n *\n */\nexport function generateRandomString(length: number): string {\n const result = [];\n\n const alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_';\n\n for (let i = 0; i < length; i++) {\n result.push(alphabet.charAt(Math.floor(Math.random() * alphabet.length)));\n }\n\n return result.join('');\n}\n\n/**\n * Converts time (h:m:s) to seconds.\n * @returns seconds\n */\nexport function timeToSeconds(time: string): number {\n const params = time.split(':').map((param) => parseInt(param.replace(/\\D/g, '')));\n switch (params.length) {\n case 1:\n return params[0];\n case 2:\n return params[0] * 60 + params[1];\n case 3:\n return params[0] * 3600 + params[1] * 60 + params[2];\n default:\n throw new Error('Invalid time string');\n }\n}\n\nexport function concatMemos(...iterables: Array): Memo {\n const memo = new Memo();\n\n for (const iterable of iterables) {\n if (!iterable) continue;\n for (const item of iterable) {\n // Update existing items.\n const memo_item = memo.get(item[0]);\n if (memo_item) {\n memo.set(item[0], [ ...memo_item, ...item[1] ]);\n continue;\n }\n\n memo.set(...item);\n }\n }\n\n return memo;\n}\n\nexport function throwIfMissing(params: object): void {\n for (const [ key, value ] of Object.entries(params)) {\n if (!value)\n throw new MissingParamError(`${key} is missing`);\n }\n}\n\nexport function hasKeys(params: T, ...keys: R): params is Exclude & Required> {\n for (const key of keys) {\n if (!Reflect.has(params, key) || (params[key] === undefined))\n return false;\n }\n return true;\n}\n\nexport async function* streamToIterable(stream: ReadableStream) {\n const reader = stream.getReader();\n\n try {\n while (true) {\n const { done, value } = await reader.read();\n if (done) {\n return;\n }\n yield value;\n }\n } finally {\n reader.releaseLock();\n }\n}\n\nexport const debugFetch: FetchFunction = (input, init) => {\n const url =\n typeof input === 'string' ?\n new URL(input) :\n input instanceof URL ?\n input : new URL(input.url);\n\n const headers =\n init?.headers ?\n new Headers(init.headers) :\n input instanceof Request ?\n input.headers :\n new Headers();\n\n const arr_headers = [ ...headers ];\n\n const body_contents =\n init?.body ?\n typeof init.body === 'string' ?\n headers.get('content-type') === 'application/json' ?\n JSON.stringify(JSON.parse(init.body), null, 2) : // Body is string and json\n init.body : // Body is string\n ' ' : // Body is not string\n ' (none)'; // No body provided\n\n const headers_serialized =\n arr_headers.length > 0 ?\n `${arr_headers.map(([ key, value ]) => ` ${key}: ${value}`).join('\\n')}` :\n ' (none)';\n\n Log.warn(TAG_,\n 'Fetch:\\n' +\n ` url: ${url.toString()}\\n` +\n ` method: ${init?.method || 'GET'}\\n` +\n ` headers:\\n${headers_serialized}\\n' + \n ' body:\\n${body_contents}`\n );\n\n return Platform.shim.fetch(input, init);\n};\n\nexport function u8ToBase64(u8: Uint8Array): string {\n return btoa(String.fromCharCode.apply(null, Array.from(u8)));\n}\n\nexport function base64ToU8(base64: string): Uint8Array {\n const standard_base64 = base64.replace(/-/g, '+').replace(/_/g, '/');\n const padded_base64 = standard_base64.padEnd(standard_base64.length + (4 - standard_base64.length % 4) % 4, '=');\n return new Uint8Array(atob(padded_base64).split('').map((char) => char.charCodeAt(0)));\n}\n\nexport function isTextRun(run: TextRun | EmojiRun): run is TextRun {\n return !('emoji' in run);\n}\n\nexport function getCookie(cookies: string, name: string, matchWholeName = false): string | undefined {\n const regex = matchWholeName ? `(^|\\\\s?)\\\\b${name}\\\\b=([^;]+)` : `(^|s?)${name}=([^;]+)`;\n const match = cookies.match(new RegExp(regex));\n return match ? match[2] : undefined;\n}\n\nexport function getNsigProcessorFn(n?: string | null, sp?: string | null, s?: string | null) {\n return `function process(n = \"\", sp = \"\", s = \"\") {\n const mockStreamingURL = \"https://ytjs.googlevideo.com/videoplayback?expire=1234567890&\"+\"n=\"+encodeURIComponent(n);\n const urlCtorFunction = exportedVars.nsigFunction || (() => { throw new Error('No n/sig decipher function extracted') });\n const urlCtor = urlCtorFunction(mockStreamingURL, sp, s);\n\n const proto = Object.getPrototypeOf(urlCtor);\n const properties = Object.getOwnPropertyNames(proto);\n const methodBlacklist = ['constructor', 'clone', 'set', 'get'];\n\n for (const prop of properties) {\n if (methodBlacklist.includes(prop))\n continue;\n\n if (typeof urlCtor[prop] === 'function')\n urlCtor[prop]();\n }\n\n const sigResult = urlCtor.get(sp);\n const nResult = urlCtor.get('n');\n\n return {\n sig: sigResult ? decodeURIComponent(sigResult) : undefined,\n n: nResult ? decodeURIComponent(nResult) : undefined\n };\n}\n\nreturn process(\"${n || ''}\", \"${sp || ''}\", \"${s || ''}\");`;\n}", "import * as Log from '../utils/Log.js';\nimport { deepCompare, ParsingError } from '../utils/Utils.js';\n\nconst isObserved = Symbol('ObservedArray.isObserved');\n\nexport class YTNode {\n static readonly type: string = 'YTNode';\n readonly type: string;\n\n constructor() {\n this.type = (this.constructor as YTNodeConstructor).type;\n }\n\n /**\n * Check if the node is of the given type.\n * @param types - The type to check\n * @returns whether the node is of the given type\n */\n is[]>(...types: K): this is InstanceType {\n return types.some((type) => this.type === type.type);\n }\n\n /**\n * Cast to one of the given types.\n * @param types - The types to cast to\n * @returns The node cast to one of the given types\n * @throws {ParsingError} If the node is not of the given type\n */\n as[]>(...types: K): InstanceType {\n if (!this.is(...types)) {\n throw new ParsingError(`Cannot cast ${this.type} to one of ${types.map((t) => t.type).join(', ')}`);\n }\n return this;\n }\n\n /**\n * Check for a key without asserting the type.\n * @param key - The key to check\n * @returns Whether the node has the key\n */\n hasKey(key: T): this is this & { [k in T]: R } {\n return Reflect.has(this, key);\n }\n\n /**\n * Assert that the node has the given key and return it.\n * @param key - The key to check\n * @returns The value of the key wrapped in a Maybe\n * @throws {ParsingError} If the node does not have the key\n */\n key(key: T) {\n if (!this.hasKey(key)) {\n throw new ParsingError(`Missing key ${key}`);\n }\n return new Maybe(this[key]);\n }\n}\n\nconst MAYBE_TAG = 'Maybe';\n\n/**\n * A wrapper class that provides type-safe access to a value.\n */\nexport class Maybe {\n readonly #value;\n\n constructor (value: any) {\n this.#value = value;\n }\n\n #checkPrimitive(type: 'string' | 'number' | 'bigint' | 'boolean' | 'symbol' | 'undefined' | 'object' | 'function') {\n return typeof this.#value === type;\n }\n\n #assertPrimitive(type: 'string' | 'number' | 'bigint' | 'boolean' | 'symbol' | 'undefined' | 'object' | 'function') {\n if (!this.#checkPrimitive(type)) {\n throw new TypeError(`Expected ${type}, got ${this.typeof}`);\n }\n return this.#value;\n }\n\n get typeof() {\n return typeof this.#value;\n }\n\n string(): string {\n return this.#assertPrimitive('string');\n }\n\n isString() {\n return this.#checkPrimitive('string');\n }\n\n number(): number {\n return this.#assertPrimitive('number');\n }\n\n isNumber() {\n return this.#checkPrimitive('number');\n }\n\n bigint(): bigint {\n return this.#assertPrimitive('bigint');\n }\n\n isBigint() {\n return this.#checkPrimitive('bigint');\n }\n\n boolean(): boolean {\n return this.#assertPrimitive('boolean');\n }\n\n isBoolean() {\n return this.#checkPrimitive('boolean');\n }\n\n symbol(): symbol {\n return this.#assertPrimitive('symbol');\n }\n\n isSymbol() {\n return this.#checkPrimitive('symbol');\n }\n\n undefined(): undefined {\n return this.#assertPrimitive('undefined');\n }\n\n isUndefined() {\n return this.#checkPrimitive('undefined');\n }\n\n null(): null {\n if (this.#value !== null)\n throw new TypeError(`Expected null, got ${typeof this.#value}`);\n return this.#value;\n }\n\n isNull() {\n return this.#value === null;\n }\n\n object(): object {\n return this.#assertPrimitive('object');\n }\n\n isObject() {\n return this.#checkPrimitive('object');\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type\n function(): Function {\n return this.#assertPrimitive('function');\n }\n\n isFunction() {\n return this.#checkPrimitive('function');\n }\n\n /**\n * Get the value as an array.\n * @returns the value as any[].\n * @throws If the value is not an array.\n */\n array(): any[] {\n if (!Array.isArray(this.#value)) {\n throw new TypeError(`Expected array, got ${typeof this.#value}`);\n }\n return this.#value;\n }\n\n /**\n * More typesafe variant of {@link Maybe#array}.\n * @returns a proxied array which returns all the values as {@link Maybe}.\n * @throws {TypeError} If the value is not an array\n */\n arrayOfMaybe(): Maybe[] {\n const arrayProps: any[] = [];\n return new Proxy(this.array(), {\n get(target, prop) {\n if (Reflect.has(arrayProps, prop)) {\n return Reflect.get(target, prop);\n }\n return new Maybe(Reflect.get(target, prop));\n }\n });\n }\n\n /**\n * Check whether the value is an array.\n * @returns whether the value is an array.\n */\n isArray() {\n return Array.isArray(this.#value);\n }\n\n /**\n * Get the value as a YTNode.\n * @returns the value as a YTNode.\n * @throws If the value is not a YTNode.\n */\n node() {\n if (!(this.#value instanceof YTNode)) {\n throw new TypeError(`Expected YTNode, got ${this.#value.constructor.name}`);\n }\n return this.#value;\n }\n\n /**\n * Check if the value is a YTNode.\n * @returns Whether the value is a YTNode.\n */\n isNode() {\n return this.#value instanceof YTNode;\n }\n\n /**\n * Get the value as a YTNode of the given type.\n * @param types - The type(s) to cast to.\n * @returns The node cast to the given type.\n * @throws If the node is not of the given type.\n */\n nodeOfType[]>(...types: K) {\n return this.node().as(...types);\n }\n\n /**\n * Check if the value is a YTNode of the given type.\n * @param types - the type(s) to check.\n * @returns Whether the value is a YTNode of the given type.\n */\n isNodeOfType[]>(...types: K) {\n return this.isNode() && this.node().is(...types);\n }\n\n /**\n * Get the value as an ObservedArray.\n * @returns the value of the Maybe as a ObservedArray.\n */\n observed(): ObservedArray {\n if (!this.isObserved()) {\n throw new TypeError(`Expected ObservedArray, got ${typeof this.#value}`);\n }\n return this.#value;\n }\n\n /**\n * Check if the value is an ObservedArray.\n */\n isObserved() {\n return this.#value?.[isObserved];\n }\n\n /**\n * Get the value of the Maybe as a SuperParsedResult.\n * @returns the value as a SuperParsedResult.\n * @throws If the value is not a SuperParsedResult.\n */\n parsed(): SuperParsedResult {\n if (!(this.#value instanceof SuperParsedResult)) {\n throw new TypeError(`Expected SuperParsedResult, got ${typeof this.#value}`);\n }\n return this.#value;\n }\n\n /**\n * Is the result a SuperParsedResult?\n */\n isParsed() {\n return this.#value instanceof SuperParsedResult;\n }\n\n /**\n * @deprecated\n * This call is not meant to be used outside of debugging. Please use the specific type getter instead.\n */\n any(): any {\n Log.warn(MAYBE_TAG, 'This call is not meant to be used outside of debugging. Please use the specific type getter instead.');\n return this.#value;\n }\n\n /**\n * Get the node as an instance of the given class.\n * @param type - The type to check.\n * @returns the value as the given type.\n * @throws If the node is not of the given type.\n */\n instanceof(type: Constructor): T {\n if (!this.isInstanceof(type)) {\n throw new TypeError(`Expected instance of ${type.name}, got ${this.#value.constructor.name}`);\n }\n return this.#value;\n }\n\n /**\n * Check if the node is an instance of the given class.\n * @param type - The type to check.\n * @returns Whether the node is an instance of the given type.\n */\n isInstanceof(type: Constructor): this is this & T {\n return this.#value instanceof type;\n }\n}\n\nexport interface Constructor {\n new (...args: any[]): T;\n}\n\nexport interface YTNodeConstructor {\n new(data: any): T;\n readonly type: string;\n}\n\n/**\n * Represents a parsed response in an unknown state. Either a YTNode or a YTNode[] or null.\n */\nexport class SuperParsedResult {\n readonly #result;\n\n constructor(result: T | ObservedArray | null) {\n this.#result = result;\n }\n\n get is_null() {\n return this.#result === null;\n }\n get is_array() {\n return !this.is_null && Array.isArray(this.#result);\n }\n get is_node() {\n return !this.is_array;\n }\n\n array() {\n if (!this.is_array) {\n throw new TypeError('Expected an array, got a node');\n }\n return this.#result as ObservedArray;\n }\n\n item() {\n if (!this.is_node) {\n throw new TypeError('Expected a node, got an array');\n }\n return this.#result as T;\n }\n}\n\n/**\n * An extended array type that includes additional utility methods for filtering and manipulating YTNode objects.\n */\nexport type ObservedArray = Array & {\n /**\n * Returns the first object that matches the specified rule object.\n * @param rule - An object containing properties to match against\n * @param del_item - Optional flag to remove the matched item from the array\n * @returns The first matching object or undefined if no match is found\n */\n get: (rule: object, del_item?: boolean) => T | undefined;\n\n /**\n * Returns all objects that match the specified rule object.\n * @param rule - An object containing properties to match against\n * @param del_items - Optional flag to remove all matched items from the array\n * @returns An array of all matching objects\n */\n getAll: (rule: object, del_items?: boolean) => T[];\n\n /**\n * Returns the first object that satisfies the provided condition function.\n * @param condition - A predicate function that tests each element\n * @returns The first element that satisfies the condition or undefined if none found\n */\n matchCondition: (condition: (node: T) => boolean) => T | undefined;\n\n /**\n * Removes the item at the specified index.\n * @param index - The index of the item to remove\n * @returns The modified array after removal\n */\n remove: (index: number) => T[];\n\n /**\n * Filters the array to only include items of the specified YTNode types.\n * @template R - Type extending YTNode\n * @template K - Array of types (YTNodes)\n * @param types - Rest parameter of YTNode constructor types to filter by\n * @returns A new ObservedArray containing only items of the specified types\n */\n filterType[]>(...types: K): ObservedArray>;\n\n /**\n * Returns the first item in the array that matches any of the specified YTNode types.\n * @template R - Type extending YTNode\n * @template K - Array of types (YTNodes)\n * @param types - Rest parameter of YTNode constructor types to match against\n * @returns The first matching item or undefined if none found\n */\n firstOfType[]>(...types: K): InstanceType | undefined;\n\n /**\n * Returns the first item in the array.\n * @returns The first item in the array\n */\n first: () => T;\n\n /**\n * Similar to `filter` but with strict type checking. Filters the array to include only items of the specified types.\n * @template R - Type extending YTNode\n * @template K - Array of types (YTNodes)\n * @param types - Rest parameter of YTNode constructor types to filter by\n * @returns A new ObservedArray containing only items of the specified types\n * @throws {ParsingError} If an item is not of the specified type\n */\n as[]>(...types: K): ObservedArray>;\n};\n\n/**\n * Creates an observed array that provides additional utility methods for array manipulation and filtering.\n * @template T - Type extending YTNode\n * @param obj - Array to be observed\n */\nexport function observe(obj: Array): ObservedArray {\n return new Proxy(obj, {\n get(target, prop) {\n if (prop == 'get') {\n return (rule: object, del_item?: boolean) => (\n target.find((obj, index) => {\n const match = deepCompare(rule, obj);\n if (match && del_item) {\n target.splice(index, 1);\n }\n return match;\n })\n );\n }\n\n if (prop == isObserved) {\n return true;\n }\n\n if (prop == 'getAll') {\n return (rule: object, del_items: boolean) => (\n target.filter((obj, index) => {\n const match = deepCompare(rule, obj);\n if (match && del_items) {\n target.splice(index, 1);\n }\n return match;\n })\n );\n }\n\n if (prop == 'matchCondition') {\n return (condition: (node: T) => boolean) => (\n target.find((obj) => {\n return condition(obj);\n })\n );\n }\n\n if (prop == 'filterType') {\n return (...types: YTNodeConstructor[]) => {\n return observe(target.filter((node: YTNode) => {\n return !!node.is(...types);\n }));\n };\n }\n\n if (prop == 'firstOfType') {\n return (...types: YTNodeConstructor[]) => {\n return target.find((node: YTNode) => {\n return !!node.is(...types);\n });\n };\n }\n\n if (prop == 'first') {\n return () => target[0];\n }\n\n if (prop == 'as') {\n return (...types: YTNodeConstructor[]) => {\n return observe(target.map((node: YTNode) => {\n if (node.is(...types))\n return node;\n throw new ParsingError(`Expected node of any type ${types.map((type) => type.type).join(', ')}, got ${(node as YTNode).type}`);\n }));\n };\n }\n\n if (prop == 'remove') {\n return (index: number): any => target.splice(index, 1);\n }\n\n return Reflect.get(target, prop);\n }\n }) as ObservedArray;\n}\n\nexport class Memo extends Map {\n getType[]>(types: K): ObservedArray>;\n getType[]>(...types: K): ObservedArray>\n getType(...types: YTNodeConstructor[] | YTNodeConstructor[][]) {\n types = types.flat();\n return observe(types.flatMap((type) => (this.get(type.type) || []) as YTNode[]));\n }\n}", "const YTJS_TAG = 'YOUTUBEJS';\n\nexport const Level = {\n NONE: 0,\n ERROR: 1,\n WARNING: 2,\n INFO: 3,\n DEBUG: 4\n};\n\nconst log_map = {\n [Level.ERROR]: (...args: any[]) => console.error(...args),\n [Level.WARNING]: (...args: any[]) => console.warn(...args),\n [Level.INFO]: (...args: any[]) => console.info(...args),\n [Level.DEBUG]: (...args: any[]) => console.debug(...args)\n};\n\nlet log_level = [ Level.WARNING ];\nconst one_time_warnings_issued = new Set();\n\nfunction doLog(level: number, tag?: string, args?: any[]) {\n if (!log_map[level] || !log_level.includes(level))\n return;\n\n const tags = [ `[${YTJS_TAG}]` ];\n\n if (tag)\n tags.push(`[${tag}]`);\n\n log_map[level](`${tags.join('')}:`, ...(args || []));\n}\n\nexport const warnOnce = (id: string, ...args: any[]) => {\n if (one_time_warnings_issued.has(id))\n return;\n \n doLog(Level.WARNING, id, args);\n one_time_warnings_issued.add(id);\n};\n\nexport const warn = (tag?: string, ...args: any[]) => doLog(Level.WARNING, tag, args);\nexport const error = (tag?: string, ...args: any[]) => doLog(Level.ERROR, tag, args);\nexport const info = (tag?: string, ...args: any[]) => doLog(Level.INFO, tag, args);\nexport const debug = (tag?: string, ...args: any[]) => doLog(Level.DEBUG, tag, args);\n\nexport function setLevel(...args: number[]) {\n log_level = args;\n}\n", "// This file was auto generated, do not edit.\n// See ./dev-scripts/gen-parser-map.mjs\n\nexport { default as AccessibilityContext } from './classes/misc/AccessibilityContext.js';\nexport { default as AccessibilityData } from './classes/misc/AccessibilityData.js';\nexport { default as Author } from './classes/misc/Author.js';\nexport { default as ChildElement } from './classes/misc/ChildElement.js';\nexport { default as CommandContext } from './classes/misc/CommandContext.js';\nexport { default as EmojiRun } from './classes/misc/EmojiRun.js';\nexport { default as Format } from './classes/misc/Format.js';\nexport { default as RendererContext } from './classes/misc/RendererContext.js';\nexport { default as SubscriptionButton } from './classes/misc/SubscriptionButton.js';\nexport { default as Text } from './classes/misc/Text.js';\nexport { default as TextRun } from './classes/misc/TextRun.js';\nexport { default as Thumbnail } from './classes/misc/Thumbnail.js';\nexport { default as VideoDetails } from './classes/misc/VideoDetails.js';\n", "import type { RawNode } from '../../types/index.js';\n\nexport default class AccessibilityContext {\n public label: string;\n\n constructor(data: RawNode) {\n this.label = data.label;\n }\n} ", "import type { RawNode } from '../../types/index.js';\n\nexport interface AccessibilitySupportedDatas {\n accessibility_data: AccessibilityData;\n}\n\nexport interface AccessibilityId {\n accessibility_id_type?:\n | 'UNKNOWN'\n | 'MENU_ADD_TO_WATCH_LATER'\n | 'MENU_REMOVE_FROM_WATCH_LATER'\n | 'MENU_ADD_TO_PLAYLIST'\n | 'MENU_REMOVE_FROM_PLAYLIST'\n | 'MENU_SHARE_VIDEO'\n | 'MENU_SHARE_PLAYLIST'\n | 'MENU_OFFLINE_VIDEO'\n | 'MENU_OFFLINE_PLAYLIST'\n | 'MENU_DELETE_VIDEO'\n | 'MENU_DELETE_PLAYLIST'\n | 'MENU_EDIT_VIDEO_METADATA'\n | 'MENU_HIDE'\n | 'MENU_REMOVE_FROM_HISTORY'\n | 'MENU_LIKE'\n | 'MENU_INFO'\n | 'MENU_ADD_TO_REMOTE_QUEUE'\n | 'MENU_REMOVE_FROM_REMOTE_QUEUE'\n | 'MENU_CREATE_PLAYLIST'\n | 'MENU_SETTINGS'\n | 'MENU_PRIVACY'\n | 'MENU_FEEDBACK'\n | 'MENU_HELP'\n | 'MENU_DELETE_CHANNEL_POST'\n | 'MENU_PLAYLIST_JOIN_COLLABORATION'\n | 'MENU_EDIT_PLAYLIST'\n | 'MENU_OFFLINE_REMOVE'\n | 'MENU_OFFLINE_PAUSE'\n | 'MENU_OFFLINE_RESUME'\n | 'MENU_UNSUBSCRIBE'\n | 'MENU_GET_ALL_UPDATES'\n | 'MENU_DISMISS'\n | 'MENU_CANCEL_UPLOAD'\n | 'MENU_TAKE_PHOTO'\n | 'MENU_CHOOSE_PHOTO'\n | 'MENU_CHOOSE_FROM_CHANNEL_ART_GALLERY'\n | 'MENU_FILTER_VIDEOS_ONLY'\n | 'MENU_FILTER_VIDEOS_AND_POSTS'\n | 'MENU_WATCH_ON_TV'\n | 'MENU_INSERT_IN_REMOTE_QUEUE'\n | 'MENU_ADD_UPCOMING_EVENT_REMINDER'\n | 'MENU_REMOVE_UPCOMING_EVENT_REMINDER'\n | 'MENU_TOGGLE_DENSITY_MODE'\n | 'MENU_OFFLINE_UPSELL'\n | 'MENU_MORE_LIKE_THIS'\n | 'MENU_CREATE_VIDEO'\n | 'MENU_CREATE_LIVE_STREAM'\n | 'MENU_CREATE_REEL_ITEM'\n | 'MENU_CREATE_POST'\n | 'MENU_LESS_LIKE_THIS'\n | 'MENU_REEL_OVERFLOW'\n | 'MENU_DELETE_REEL'\n | 'MENU_EDIT_REEL'\n | 'MENU_REMOVE_FROM_QUEUE'\n | 'MENU_REEL_SHELF_OVERFLOW'\n | 'MENU_REEL_SHELF_DISMISS'\n | 'MENU_SHARE_ARTIST'\n | 'MENU_ABOUT_RECOMMENDATION'\n | 'MENU_REPORT'\n | 'EXPLORE_DESTINATION_TRENDING'\n | 'EXPLORE_DESTINATION_MUSIC'\n | 'EXPLORE_DESTINATION_GAMING'\n | 'EXPLORE_DESTINATION_NEWS'\n | 'EXPLORE_DESTINATION_MOVIES'\n | 'EXPLORE_DESTINATION_FASHION'\n | 'EXPLORE_DESTINATION_LEARNING'\n | 'EXPLORE_DESTINATION_STAY_HOME'\n | 'MENU_ABOUT_GAMING_RECOMMENDATAION'\n | 'EXPLORE_DESTINATION_LIVE'\n | 'MENU_QUALITY'\n | 'MENU_CAPTIONS'\n | 'MENU_PLAYBACK_SPEED'\n | 'MENU_SHARE_PLAYLIST_UNAVAILABLE'\n | 'MENU_INFO_CARD'\n | 'EXPLORE_DESTINATION_SPORTS'\n | 'MENU_SINGLE_LOOP'\n | 'MENU_HIDE_VIDEO'\n | 'MENU_CLEAR_QUEUE'\n | 'EXPLORE_DESTINATION_SHOPPING'\n | 'MENU_PLAY_NEXT_IN_QUEUE'\n | 'MENU_PLAY_LAST_IN_QUEUE'\n | 'MENU_GO_TO_CHANNEL'\n | 'EXPLORE_DESTINATION_PODCASTS'\n | 'MEDIA_GENERATOR_PROMPT_INPUT'\n | 'MEDIA_GENERATOR_STYLE_SHELF'\n | 'MEDIA_GENERATOR_STYLE_ITEM'\n | 'MEDIA_GENERATOR_CREATE_BUTTON'\n | 'MEDIA_GENERATOR_T2V_ENTRYPOINT'\n | 'MEDIA_GENERATOR_T2I_ENTRYPOINT'\n | 'MEDIA_GENERATOR_T2M_ENTRYPOINT'\n | 'MEDIA_GENERATOR_BACK_BUTTON'\n | 'MEDIA_GENERATOR_HEADER'\n | 'MEDIA_GENERATOR_LOADING_PROGRESS'\n | 'MEDIA_GENERATOR_CANCEL_BUTTON'\n | 'MEDIA_GENERATOR_IMAGE_PREVIEW'\n | 'MEDIA_GENERATOR_VIDEO_PREVIEW'\n | 'MEDIA_GENERATOR_DONE_BUTTON'\n | 'MEDIA_GENERATOR_IMAGE_SELECTION'\n | 'MEDIA_GENERATOR_SOUND_METADATA'\n | 'MEDIA_GENERATOR_AUDIO_SELECT_BUTTON'\n | 'MEDIA_GENERATOR_T2I2V_ENTRYPOINT'\n | 'MENU_SAVE_QUEUE_TO_PLAYLIST'\n | 'MEDIA_GENERATOR_ANIMATE_BUTTON'\n | 'MEDIA_GENERATOR_SEGMENT_IMPORT_ENTRYPOINT';\n}\n\nexport default class AccessibilityData {\n public accessibility_identifier?: string;\n public identifier?: AccessibilityId;\n public label?: string;\n \n constructor(data: RawNode) {\n if ('accessibilityIdentifier' in data) {\n this.accessibility_identifier = data.accessibilityIdentifier;\n }\n \n if ('identifier' in data) {\n this.identifier = {\n accessibility_id_type: data.identifier.accessibilityIdType\n };\n }\n \n if ('label' in data) {\n this.label = data.label;\n }\n }\n}", "\nexport const URLS = {\n YT_BASE: 'https://www.youtube.com',\n YT_MUSIC_BASE: 'https://music.youtube.com',\n YT_SUGGESTIONS: 'https://suggestqueries-clients6.youtube.com',\n YT_UPLOAD: 'https://upload.youtube.com/',\n API: {\n BASE: 'https://youtubei.googleapis.com',\n PRODUCTION_1: 'https://www.youtube.com/youtubei/',\n PRODUCTION_2: 'https://youtubei.googleapis.com/youtubei/',\n STAGING: 'https://green-youtubei.sandbox.googleapis.com/youtubei/',\n RELEASE: 'https://release-youtubei.sandbox.googleapis.com/youtubei/',\n TEST: 'https://test-youtubei.sandbox.googleapis.com/youtubei/',\n CAMI: 'http://cami-youtubei.sandbox.googleapis.com/youtubei/',\n UYTFE: 'https://uytfe.sandbox.google.com/youtubei/'\n },\n GOOGLE_SEARCH_BASE: 'https://www.google.com/'\n} as const;\nexport const OAUTH = {\n REGEX: {\n TV_SCRIPT: new RegExp(']*><\\\\/script>'),\n CLIENT_IDENTITY: new RegExp('clientId:\"(?[^\"]+)\",[^\"]*?:\"(?[^\"]+)\"')\n }\n} as const;\nexport const CLIENTS = {\n IOS: {\n NAME: 'iOS',\n VERSION: '20.11.6',\n USER_AGENT: 'com.google.ios.youtube/20.11.6 (iPhone10,4; U; CPU iOS 16_7_7 like Mac OS X)',\n DEVICE_MODEL: 'iPhone10,4',\n OS_NAME: 'iOS',\n OS_VERSION: '16.7.7.20H330'\n },\n WEB: {\n NAME: 'WEB',\n VERSION: '2.20260206.01.00',\n API_KEY: 'AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8',\n API_VERSION: 'v1',\n STATIC_VISITOR_ID: '6zpwvWUNAco',\n SUGG_EXP_ID: 'ytzpb5_e2,ytpo.bo.lqp.elu=1,ytpo.bo.lqp.ecsc=1,ytpo.bo.lqp.mcsc=3,ytpo.bo.lqp.mec=1,ytpo.bo.lqp.rw=0.8,ytpo.bo.lqp.fw=0.2,ytpo.bo.lqp.szp=1,ytpo.bo.lqp.mz=3,ytpo.bo.lqp.al=en_us,ytpo.bo.lqp.zrm=1,ytpo.bo.lqp.er=1,ytpo.bo.ro.erl=1,ytpo.bo.ro.mlus=3,ytpo.bo.ro.erls=3,ytpo.bo.qfo.mlus=3,ytzprp.ppp.e=1,ytzprp.ppp.st=772,ytzprp.ppp.p=5'\n },\n MWEB: {\n NAME: 'MWEB',\n VERSION: '2.20260205.04.01',\n API_VERSION: 'v1'\n },\n WEB_KIDS: {\n NAME: 'WEB_KIDS',\n VERSION: '2.20260205.00.00'\n },\n YTMUSIC: {\n NAME: 'WEB_REMIX',\n VERSION: '1.20250219.01.00'\n },\n ANDROID: {\n NAME: 'ANDROID',\n VERSION: '21.03.36',\n SDK_VERSION: 36,\n USER_AGENT: 'com.google.android.youtube/21.03.36(Linux; U; Android 16; en_US; SM-S908E Build/TP1A.220624.014) gzip'\n },\n ANDROID_VR: {\n NAME: 'ANDROID_VR',\n VERSION: '1.65.10',\n SDK_VERSION: 32,\n DEVICE_MAKE: 'Oculus',\n DEVICE_MODEL: 'Quest 3',\n USER_AGENT: 'com.google.android.apps.youtube.vr.oculus/1.65.10 (Linux; U; Android 12L; eureka-user Build/SQ3A.220605.009.A1) gzip'\n },\n YTSTUDIO_ANDROID: {\n NAME: 'ANDROID_CREATOR',\n VERSION: '22.43.101'\n },\n YTMUSIC_ANDROID: {\n NAME: 'ANDROID_MUSIC',\n VERSION: '5.34.51'\n },\n TV: {\n NAME: 'TVHTML5',\n VERSION: '7.20260311.12.00',\n USER_AGENT: 'Mozilla/5.0 (ChromiumStylePlatform) Cobalt/Version'\n },\n TV_SIMPLY: {\n NAME: 'TVHTML5_SIMPLY',\n VERSION: '1.0'\n },\n TV_EMBEDDED: {\n NAME: 'TVHTML5_SIMPLY_EMBEDDED_PLAYER',\n VERSION: '2.0'\n },\n WEB_EMBEDDED: {\n NAME: 'WEB_EMBEDDED_PLAYER',\n VERSION: '1.20260206.01.00',\n API_KEY: 'AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8',\n API_VERSION: 'v1',\n STATIC_VISITOR_ID: '6zpwvWUNAco'\n },\n WEB_CREATOR: {\n NAME: 'WEB_CREATOR',\n VERSION: '1.20241203.01.00',\n API_KEY: 'AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8',\n API_VERSION: 'v1',\n STATIC_VISITOR_ID: '6zpwvWUNAco'\n }\n} as const;\n/**\n * The keys correspond to the `NAME` fields in {@linkcode CLIENTS} constant\n */\nexport const CLIENT_NAME_IDS = {\n iOS: '5',\n WEB: '1',\n MWEB: '2',\n WEB_KIDS: '76',\n WEB_REMIX: '67',\n ANDROID: '3',\n ANDROID_CREATOR: '14',\n ANDROID_MUSIC: '21',\n ANDROID_VR: '28',\n TVHTML5: '7',\n TVHTML5_SIMPLY: '74',\n TVHTML5_SIMPLY_EMBEDDED_PLAYER: '85',\n WEB_EMBEDDED_PLAYER: '56',\n WEB_CREATOR: '62'\n} as const;\nexport const STREAM_HEADERS = {\n 'accept': '*/*',\n 'origin': 'https://www.youtube.com',\n 'referer': 'https://www.youtube.com',\n 'DNT': '?1'\n} as const;\nexport const INNERTUBE_HEADERS_BASE = {\n 'accept': '*/*',\n 'accept-encoding': 'gzip, deflate',\n 'content-type': 'application/json'\n} as const;\n\nexport const SUPPORTED_CLIENTS = [ 'IOS', 'WEB', 'MWEB', 'YTKIDS', 'YTMUSIC', 'ANDROID', 'ANDROID_VR', 'YTSTUDIO_ANDROID', 'YTMUSIC_ANDROID', 'TV', 'TV_SIMPLY', 'TV_EMBEDDED', 'WEB_EMBEDDED', 'WEB_CREATOR' ];", "import * as YTNodes from './nodes.js';\nimport { InnertubeError, ParsingError } from '../utils/Utils.js';\nimport type { ObservedArray, YTNode, YTNodeConstructor } from './helpers.js';\nimport { Memo, observe, SuperParsedResult } from './helpers.js';\nimport type { KeyInfo } from './generator.js';\nimport { camelToSnake, generateRuntimeClass, generateTypescriptClass } from './generator.js';\nimport { Log } from '../utils/index.js';\nimport packageInfo from '../../package.json' with { type: 'json' };\n\nimport {\n Continuation,\n ContinuationCommand,\n GridContinuation,\n ItemSectionContinuation,\n LiveChatContinuation,\n MusicPlaylistShelfContinuation,\n MusicShelfContinuation,\n NavigateAction,\n PlaylistPanelContinuation,\n ReloadContinuationItemsCommand,\n SectionListContinuation,\n ShowMiniplayerCommand\n} from './continuations.js';\n\nimport AudioOnlyPlayability from './classes/AudioOnlyPlayability.js';\nimport CardCollection from './classes/CardCollection.js';\nimport Endscreen from './classes/Endscreen.js';\nimport PlayerAnnotationsExpanded from './classes/PlayerAnnotationsExpanded.js';\nimport PlayerCaptionsTracklist from './classes/PlayerCaptionsTracklist.js';\nimport PlayerLiveStoryboardSpec from './classes/PlayerLiveStoryboardSpec.js';\nimport PlayerStoryboardSpec from './classes/PlayerStoryboardSpec.js';\nimport Alert from './classes/Alert.js';\nimport AlertWithButton from './classes/AlertWithButton.js';\nimport EngagementPanelSectionList from './classes/EngagementPanelSectionList.js';\nimport MusicMultiSelectMenuItem from './classes/menus/MusicMultiSelectMenuItem.js';\nimport MacroMarkersListEntity from './classes/MacroMarkersListEntity.js';\nimport Format from './classes/misc/Format.js';\nimport VideoDetails from './classes/misc/VideoDetails.js';\nimport NavigationEndpoint from './classes/NavigationEndpoint.js';\nimport CommentView from './classes/comments/CommentView.js';\nimport MusicThumbnail from './classes/MusicThumbnail.js';\nimport OpenPopupAction from './classes/actions/OpenPopupAction.js';\nimport AppendContinuationItemsAction from './classes/actions/AppendContinuationItemsAction.js';\nimport type { IParsedResponse, IRawResponse, RawData, RawNode } from './types/index.js';\n\nconst TAG = 'Parser';\n\nexport type ParserError = {\n classname: string,\n} & ({\n error_type: 'typecheck',\n classdata: RawNode,\n expected: string | string[]\n} | {\n error_type: 'parse',\n classdata: RawNode,\n error: unknown\n} | {\n error_type: 'mutation_data_missing',\n classname: string\n} | {\n error_type: 'mutation_data_invalid',\n total: number,\n failed: number,\n titles: string[]\n} | {\n error_type: 'class_not_found',\n key_info: KeyInfo,\n} | {\n error_type: 'class_changed',\n key_info: KeyInfo,\n changed_keys: KeyInfo\n});\n\nexport type ParserErrorHandler = (error: ParserError) => void;\n\nconst IGNORED_LIST = new Set([\n 'AdSlot',\n 'DisplayAd',\n 'SearchPyv',\n 'MealbarPromo',\n 'PrimetimePromo',\n 'PromotedSparklesWeb',\n 'CompactPromotedVideo',\n 'BrandVideoShelf',\n 'BrandVideoSingleton',\n 'StatementBanner',\n 'GuideSigninPromo',\n 'AdsEngagementPanelContent',\n 'MiniGameCardView',\n 'GenAiFeedbackFormView'\n]);\n\nconst RUNTIME_NODES = new Map(Object.entries(YTNodes));\n\nconst DYNAMIC_NODES = new Map();\n\nlet MEMO: Memo | null = null;\n\nlet ERROR_HANDLER: ParserErrorHandler = ({ classname, ...context }: ParserError) => {\n switch (context.error_type) {\n case 'parse':\n if (context.error instanceof Error) {\n Log.warn(TAG,\n new InnertubeError(\n `Something went wrong at ${classname}!\\n` +\n `This is a bug, please report it at ${packageInfo.bugs.url}`, {\n stack: context.error.stack,\n classdata: JSON.stringify(context.classdata, null, 2)\n }\n )\n );\n }\n break;\n case 'typecheck':\n Log.warn(TAG,\n new ParsingError(\n `Type mismatch, got ${classname} expected ${Array.isArray(context.expected) ? context.expected.join(' | ') : context.expected}.`,\n context.classdata\n )\n );\n break;\n case 'mutation_data_missing':\n Log.warn(TAG,\n new InnertubeError(\n `Mutation data required for processing ${classname}, but none found.\\n` +\n `This is a bug, please report it at ${packageInfo.bugs.url}`\n )\n );\n break;\n case 'mutation_data_invalid':\n Log.warn(TAG,\n new InnertubeError(\n `Mutation data missing or invalid for ${context.failed} out of ${context.total} MusicMultiSelectMenuItems. ` +\n `The titles of the failed items are: ${context.titles.join(', ')}.\\n` +\n `This is a bug, please report it at ${packageInfo.bugs.url}`\n )\n );\n break;\n case 'class_not_found':\n Log.warn(TAG,\n new InnertubeError(\n `${classname} not found!\\n` +\n `This is a bug, want to help us fix it? Follow the instructions at ${packageInfo.homepage.split('#', 1)[0]}/blob/main/docs/updating-the-parser.md or report it at ${packageInfo.bugs.url}!\\n` +\n `Introspected and JIT generated this class in the meantime:\\n${generateTypescriptClass(classname, context.key_info)}`\n )\n );\n break;\n case 'class_changed':\n Log.warn(TAG,\n `${classname} changed!\\n` +\n `The following keys where altered: ${context.changed_keys.map(([ key ]) => camelToSnake(key)).join(', ')}\\n` +\n `The class has changed to:\\n${generateTypescriptClass(classname, context.key_info)}`\n );\n break;\n default:\n Log.warn(TAG,\n 'Unreachable code reached at ParserErrorHandler'\n );\n break;\n }\n};\n\nexport function setParserErrorHandler(handler: ParserErrorHandler) {\n ERROR_HANDLER = handler;\n}\n\nfunction _clearMemo() {\n MEMO = null;\n}\n\nfunction _createMemo() {\n MEMO = new Memo();\n}\n\nfunction _addToMemo(classname: string, result: YTNode) {\n if (!MEMO)\n return;\n\n const list = MEMO.get(classname);\n if (!list)\n return MEMO.set(classname, [ result ]);\n\n list.push(result);\n}\n\nfunction _getMemo() {\n if (!MEMO)\n throw new Error('Parser#getMemo() called before Parser#createMemo()');\n return MEMO;\n}\n\nexport function shouldIgnore(classname: string) {\n return IGNORED_LIST.has(classname);\n}\n\nexport function sanitizeClassName(input: string) {\n return (input.charAt(0).toUpperCase() + input.slice(1))\n .replace(/Renderer|Model/g, '')\n .replace(/Radio/g, 'Mix').trim();\n}\n\nexport function getParserByName(classname: string) {\n const ParserConstructor = RUNTIME_NODES.get(classname);\n\n if (!ParserConstructor) {\n const error = new Error(`Module not found: ${classname}`);\n (error as any).code = 'MODULE_NOT_FOUND';\n throw error;\n }\n\n return ParserConstructor;\n}\n\nexport function hasParser(classname: string) {\n return RUNTIME_NODES.has(classname);\n}\n\nexport function addRuntimeParser(classname: string, ParserConstructor: YTNodeConstructor) {\n RUNTIME_NODES.set(classname, ParserConstructor);\n DYNAMIC_NODES.set(classname, ParserConstructor);\n}\n\nexport function getDynamicParsers() {\n return Object.fromEntries(DYNAMIC_NODES);\n}\n\n/**\n * Parses a given InnerTube response.\n * @param data - Raw data.\n */\nexport function parseResponse(data: IRawResponse): T {\n const parsed_data = {} as T;\n\n _createMemo();\n const contents = parse(data.contents);\n const contents_memo = _getMemo();\n if (contents) {\n parsed_data.contents = contents;\n parsed_data.contents_memo = contents_memo;\n }\n _clearMemo();\n\n _createMemo();\n const on_response_received_actions = data.onResponseReceivedActions ? parseRR(data.onResponseReceivedActions) : null;\n const on_response_received_actions_memo = _getMemo();\n if (on_response_received_actions) {\n parsed_data.on_response_received_actions = on_response_received_actions;\n parsed_data.on_response_received_actions_memo = on_response_received_actions_memo;\n }\n _clearMemo();\n\n _createMemo();\n const on_response_received_endpoints = data.onResponseReceivedEndpoints ? parseRR(data.onResponseReceivedEndpoints) : null;\n const on_response_received_endpoints_memo = _getMemo();\n if (on_response_received_endpoints) {\n parsed_data.on_response_received_endpoints = on_response_received_endpoints;\n parsed_data.on_response_received_endpoints_memo = on_response_received_endpoints_memo;\n }\n _clearMemo();\n\n _createMemo();\n const on_response_received_commands = data.onResponseReceivedCommands ? parseRR(data.onResponseReceivedCommands) : null;\n const on_response_received_commands_memo = _getMemo();\n if (on_response_received_commands) {\n parsed_data.on_response_received_commands = on_response_received_commands;\n parsed_data.on_response_received_commands_memo = on_response_received_commands_memo;\n }\n _clearMemo();\n\n _createMemo();\n const continuation_contents = data.continuationContents ? parseLC(data.continuationContents) : null;\n const continuation_contents_memo = _getMemo();\n if (continuation_contents) {\n parsed_data.continuation_contents = continuation_contents;\n parsed_data.continuation_contents_memo = continuation_contents_memo;\n }\n _clearMemo();\n\n _createMemo();\n const actions = data.actions ? parseActions(data.actions) : null;\n const actions_memo = _getMemo();\n if (actions) {\n parsed_data.actions = actions;\n parsed_data.actions_memo = actions_memo;\n }\n _clearMemo();\n\n _createMemo();\n const live_chat_item_context_menu_supported_renderers = data.liveChatItemContextMenuSupportedRenderers ? parseItem(data.liveChatItemContextMenuSupportedRenderers) : null;\n const live_chat_item_context_menu_supported_renderers_memo = _getMemo();\n if (live_chat_item_context_menu_supported_renderers) {\n parsed_data.live_chat_item_context_menu_supported_renderers = live_chat_item_context_menu_supported_renderers;\n parsed_data.live_chat_item_context_menu_supported_renderers_memo = live_chat_item_context_menu_supported_renderers_memo;\n }\n _clearMemo();\n\n _createMemo();\n const header = data.header ? parse(data.header) : null;\n const header_memo = _getMemo();\n if (header) {\n parsed_data.header = header;\n parsed_data.header_memo = header_memo;\n }\n _clearMemo();\n\n _createMemo();\n const sidebar = data.sidebar ? parseItem(data.sidebar) : null;\n const sidebar_memo = _getMemo();\n if (sidebar) {\n parsed_data.sidebar = sidebar;\n parsed_data.sidebar_memo = sidebar_memo;\n }\n _clearMemo();\n\n _createMemo();\n const items = parse(data.items);\n if (items) {\n parsed_data.items = items;\n parsed_data.items_memo = _getMemo();\n }\n _clearMemo();\n\n applyMutations(contents_memo, data.frameworkUpdates?.entityBatchUpdate?.mutations);\n\n if (on_response_received_endpoints_memo) {\n applyCommentsMutations(on_response_received_endpoints_memo, data.frameworkUpdates?.entityBatchUpdate?.mutations);\n }\n\n const continuation = data.continuation ? parseC(data.continuation) : null;\n if (continuation) {\n parsed_data.continuation = continuation;\n }\n\n const continuation_endpoint = data.continuationEndpoint ? parseLC(data.continuationEndpoint) : null;\n if (continuation_endpoint) {\n parsed_data.continuation_endpoint = continuation_endpoint;\n }\n\n const metadata = parse(data.metadata);\n if (metadata) {\n parsed_data.metadata = metadata;\n }\n\n const microformat = parseItem(data.microformat);\n if (microformat) {\n parsed_data.microformat = microformat;\n }\n\n const overlay = parseItem(data.overlay);\n if (overlay) {\n parsed_data.overlay = overlay;\n }\n\n const alerts = parseArray(data.alerts, [ Alert, AlertWithButton ]);\n if (alerts.length) {\n parsed_data.alerts = alerts;\n }\n\n const refinements = data.refinements;\n if (refinements) {\n parsed_data.refinements = refinements;\n }\n\n const estimated_results = data.estimatedResults ? parseInt(data.estimatedResults) : null;\n if (estimated_results) {\n parsed_data.estimated_results = estimated_results;\n }\n\n const player_overlays = parse(data.playerOverlays);\n if (player_overlays) {\n parsed_data.player_overlays = player_overlays;\n }\n\n const background = parseItem(data.background, MusicThumbnail);\n if (background) {\n parsed_data.background = background;\n }\n\n const playback_tracking = data.playbackTracking ? {\n videostats_watchtime_url: data.playbackTracking.videostatsWatchtimeUrl.baseUrl,\n videostats_playback_url: data.playbackTracking.videostatsPlaybackUrl.baseUrl\n } : null;\n\n if (playback_tracking) {\n parsed_data.playback_tracking = playback_tracking;\n }\n\n const playability_status = data.playabilityStatus ? {\n status: data.playabilityStatus.status,\n reason: data.playabilityStatus.reason || '',\n embeddable: !!data.playabilityStatus.playableInEmbed || false,\n audio_only_playability: parseItem(data.playabilityStatus.audioOnlyPlayability, AudioOnlyPlayability),\n error_screen: parseItem(data.playabilityStatus.errorScreen)\n } : null;\n\n if (playability_status) {\n parsed_data.playability_status = playability_status;\n }\n\n if (data.streamingData) {\n // Currently each response with streaming data only has two n param values\n // One for the adaptive formats and another for the combined formats\n // As they are the same for a response, we only need to decipher them once\n // For all further deciphering calls on formats from that response, we can use the cached output, given the same input n param\n const this_response_nsig_cache = new Map();\n\n parsed_data.streaming_data = {\n expires: new Date(Date.now() + parseInt(data.streamingData.expiresInSeconds) * 1000),\n formats: parseFormats(data.streamingData.formats, this_response_nsig_cache),\n adaptive_formats: parseFormats(data.streamingData.adaptiveFormats, this_response_nsig_cache),\n dash_manifest_url: data.streamingData.dashManifestUrl,\n hls_manifest_url: data.streamingData.hlsManifestUrl,\n server_abr_streaming_url: data.streamingData.serverAbrStreamingUrl\n };\n }\n\n if (data.playerConfig) {\n parsed_data.player_config = {\n audio_config: {\n loudness_db: data.playerConfig.audioConfig?.loudnessDb,\n perceptual_loudness_db: data.playerConfig.audioConfig?.perceptualLoudnessDb,\n enable_per_format_loudness: data.playerConfig.audioConfig?.enablePerFormatLoudness\n },\n stream_selection_config: {\n max_bitrate: data.playerConfig.streamSelectionConfig?.maxBitrate || '0'\n },\n media_common_config: {\n dynamic_readahead_config: {\n max_read_ahead_media_time_ms: data.playerConfig.mediaCommonConfig?.dynamicReadaheadConfig?.maxReadAheadMediaTimeMs || 0,\n min_read_ahead_media_time_ms: data.playerConfig.mediaCommonConfig?.dynamicReadaheadConfig?.minReadAheadMediaTimeMs || 0,\n read_ahead_growth_rate_ms: data.playerConfig.mediaCommonConfig?.dynamicReadaheadConfig?.readAheadGrowthRateMs || 0\n },\n media_ustreamer_request_config: {\n video_playback_ustreamer_config: data.playerConfig.mediaCommonConfig?.mediaUstreamerRequestConfig?.videoPlaybackUstreamerConfig\n }\n }\n };\n }\n\n const current_video_endpoint = data.currentVideoEndpoint ? new NavigationEndpoint(data.currentVideoEndpoint) : null;\n if (current_video_endpoint) {\n parsed_data.current_video_endpoint = current_video_endpoint;\n }\n\n const endpoint = data.endpoint ? new NavigationEndpoint(data.endpoint) : null;\n if (endpoint) {\n parsed_data.endpoint = endpoint;\n }\n\n const captions = parseItem(data.captions, PlayerCaptionsTracklist);\n if (captions) {\n parsed_data.captions = captions;\n }\n\n const video_details = data.videoDetails ? new VideoDetails(data.videoDetails) : null;\n if (video_details) {\n parsed_data.video_details = video_details;\n }\n\n const annotations = parseArray(data.annotations, PlayerAnnotationsExpanded);\n if (annotations.length) {\n parsed_data.annotations = annotations;\n }\n\n const storyboards = parseItem(data.storyboards, [ PlayerStoryboardSpec, PlayerLiveStoryboardSpec ]);\n if (storyboards) {\n parsed_data.storyboards = storyboards;\n }\n\n const endscreen = parseItem(data.endscreen, Endscreen);\n if (endscreen) {\n parsed_data.endscreen = endscreen;\n }\n\n const cards = parseItem(data.cards, CardCollection);\n if (cards) {\n parsed_data.cards = cards;\n }\n\n const engagement_panels = parseArray(data.engagementPanels, EngagementPanelSectionList);\n if (engagement_panels.length) {\n parsed_data.engagement_panels = engagement_panels;\n }\n \n if (data.bgChallenge) {\n const interpreter_url = {\n private_do_not_access_or_else_trusted_resource_url_wrapped_value: data.bgChallenge.interpreterUrl.privateDoNotAccessOrElseTrustedResourceUrlWrappedValue,\n private_do_not_access_or_else_safe_script_wrapped_value: data.bgChallenge.interpreterUrl.privateDoNotAccessOrElseSafeScriptWrappedValue\n };\n \n parsed_data.bg_challenge = {\n interpreter_url,\n interpreter_hash: data.bgChallenge.interpreterHash,\n program: data.bgChallenge.program,\n global_name: data.bgChallenge.globalName,\n client_experiments_state_blob: data.bgChallenge.clientExperimentsStateBlob\n };\n }\n \n if (data.challenge) {\n parsed_data.challenge = data.challenge;\n }\n\n if (data.playerResponse) {\n parsed_data.player_response = parseResponse(data.playerResponse);\n }\n\n if (data.watchNextResponse) {\n parsed_data.watch_next_response = parseResponse(data.watchNextResponse);\n }\n\n if (data.cpnInfo) {\n parsed_data.cpn_info = {\n cpn: data.cpnInfo.cpn,\n cpn_source: data.cpnInfo.cpnSource\n };\n }\n\n if (data.entries) {\n parsed_data.entries = data.entries.map((entry) => new NavigationEndpoint(entry));\n }\n \n if (data.targetId) {\n parsed_data.target_id = data.targetId;\n }\n\n return parsed_data;\n}\n\n/**\n * Parses an item.\n * @param data - The data to parse.\n * @param validTypes - YTNode types that are allowed to be parsed.\n */\nexport function parseItem[]>(data: RawNode | undefined, validTypes: K): InstanceType | null;\nexport function parseItem(data: RawNode | undefined, validTypes: YTNodeConstructor): T | null;\nexport function parseItem(data?: RawNode): YTNode;\nexport function parseItem(data?: RawNode, validTypes?: YTNodeConstructor | YTNodeConstructor[]) {\n if (!data) return null;\n\n const keys = Object.keys(data);\n\n if (!keys.length)\n return null;\n\n const classname = sanitizeClassName(keys[0]);\n\n if (!shouldIgnore(classname)) {\n try {\n const has_target_class = hasParser(classname);\n\n const TargetClass = has_target_class ?\n getParserByName(classname) :\n generateRuntimeClass(classname, data[keys[0]], ERROR_HANDLER);\n\n if (validTypes) {\n if (Array.isArray(validTypes)) {\n if (!validTypes.some((type) => type.type === TargetClass.type)) {\n ERROR_HANDLER({\n classdata: data[keys[0]],\n classname,\n error_type: 'typecheck',\n expected: validTypes.map((type) => type.type)\n });\n return null;\n }\n } else if (TargetClass.type !== validTypes.type) {\n ERROR_HANDLER({\n classdata: data[keys[0]],\n classname,\n error_type: 'typecheck',\n expected: validTypes.type\n });\n return null;\n }\n }\n\n const result = new TargetClass(data[keys[0]]);\n _addToMemo(classname, result);\n\n return result;\n } catch (err) {\n ERROR_HANDLER({\n classname,\n classdata: data[keys[0]],\n error: err,\n error_type: 'parse'\n });\n return null;\n }\n }\n\n return null;\n}\n\n/**\n * Parses an array of items.\n * @param data - The data to parse.\n * @param validTypes - YTNode types that are allowed to be parsed.\n */\nexport function parseArray[]>(data: RawNode[] | undefined, validTypes: K): ObservedArray>;\nexport function parseArray(data: RawNode[] | undefined, validType: YTNodeConstructor): ObservedArray;\nexport function parseArray(data: RawNode[] | undefined): ObservedArray;\nexport function parseArray(data?: RawNode[], validTypes?: YTNodeConstructor | YTNodeConstructor[]) {\n if (Array.isArray(data)) {\n const results: YTNode[] = [];\n\n for (const item of data) {\n const result = parseItem(item, validTypes as YTNodeConstructor);\n if (result) {\n results.push(result);\n }\n }\n\n return observe(results);\n } else if (!data) {\n return observe([] as YTNode[]);\n }\n throw new ParsingError('Expected array but got a single item');\n}\n\n/**\n * Parses an item or an array of items.\n * @param data - The data to parse.\n * @param requireArray - Whether the data should be parsed as an array.\n * @param validTypes - YTNode types that are allowed to be parsed.\n */\nexport function parse[]>(data: RawData, requireArray: true, validTypes?: K): ObservedArray> | null;\nexport function parse>(data: RawData, requireArray: true, validTypes?: K): ObservedArray> | null;\nexport function parse(data?: RawData, requireArray?: false | undefined, validTypes?: YTNodeConstructor | YTNodeConstructor[]): SuperParsedResult;\nexport function parse(data?: RawData, requireArray?: boolean, validTypes?: YTNodeConstructor | YTNodeConstructor[]) {\n if (!data) return null;\n\n if (Array.isArray(data)) {\n const results: T[] = [];\n\n for (const item of data) {\n const result = parseItem(item, validTypes as YTNodeConstructor);\n if (result) {\n results.push(result);\n }\n }\n\n const res = observe(results);\n\n return requireArray ? res : new SuperParsedResult(res);\n } else if (requireArray) {\n throw new ParsingError('Expected array but got a single item');\n }\n\n return new SuperParsedResult(parseItem(data, validTypes as YTNodeConstructor));\n}\n\nconst command_regexp = /Command$/;\nconst endpoint_regexp = /Endpoint$/;\nconst action_regexp = /Action$/;\n\n/**\n * Parses an InnerTube command and returns a YTNode instance if applicable.\n * @param data - The raw node data to parse\n * @returns A YTNode instance if parsing is successful, undefined otherwise\n */\nexport function parseCommand(data: RawNode): YTNode | undefined {\n let keys: string[] = [];\n\n try {\n keys = Object.keys(data);\n } catch { /** NO-OP */ }\n\n for (const key of keys) {\n const value = data[key];\n if (command_regexp.test(key) || endpoint_regexp.test(key) || action_regexp.test(key)) {\n const classname = sanitizeClassName(key);\n\n if (shouldIgnore(classname))\n return undefined;\n\n try {\n const has_target_class = hasParser(classname);\n if (has_target_class)\n return new (getParserByName(classname))(value);\n } catch (error) {\n ERROR_HANDLER({\n error,\n classname,\n classdata: value,\n error_type: 'parse'\n });\n }\n }\n }\n}\n\n/**\n * Parses an array of InnerTube command nodes.\n * @param commands - Array of raw command nodes to parse\n * @returns An observed array of parsed YTNodes\n */\nexport function parseCommands(commands?: RawNode[]): ObservedArray {\n if (Array.isArray(commands)) {\n const results: YTNode[] = [];\n\n for (const item of commands) {\n const result = parseCommand(item);\n if (result) {\n results.push(result);\n }\n }\n\n return observe(results);\n } else if (!commands) return observe([]);\n throw new ParsingError('Expected array but got a single item');\n}\n\nexport function parseC(data: RawNode) {\n if (data.timedContinuationData)\n return new Continuation({ continuation: data.timedContinuationData, type: 'timed' });\n return null;\n}\n\nexport function parseLC(data: RawNode) {\n if (data.itemSectionContinuation)\n return new ItemSectionContinuation(data.itemSectionContinuation);\n if (data.sectionListContinuation)\n return new SectionListContinuation(data.sectionListContinuation);\n if (data.liveChatContinuation)\n return new LiveChatContinuation(data.liveChatContinuation);\n if (data.musicPlaylistShelfContinuation)\n return new MusicPlaylistShelfContinuation(data.musicPlaylistShelfContinuation);\n if (data.musicShelfContinuation)\n return new MusicShelfContinuation(data.musicShelfContinuation);\n if (data.gridContinuation)\n return new GridContinuation(data.gridContinuation);\n if (data.playlistPanelContinuation)\n return new PlaylistPanelContinuation(data.playlistPanelContinuation);\n if (data.continuationCommand)\n return new ContinuationCommand(data.continuationCommand);\n\n return null;\n}\n\nexport function parseRR(actions: RawNode[]) {\n return observe(actions.map((action: any) => {\n if (action.navigateAction)\n return new NavigateAction(action.navigateAction);\n else if (action.showMiniplayerCommand)\n return new ShowMiniplayerCommand(action.showMiniplayerCommand);\n else if (action.reloadContinuationItemsCommand)\n return new ReloadContinuationItemsCommand(action.reloadContinuationItemsCommand);\n else if (action.appendContinuationItemsAction)\n return new AppendContinuationItemsAction(action.appendContinuationItemsAction);\n else if (action.openPopupAction)\n return new OpenPopupAction(action.openPopupAction);\n }).filter((item) => item) as (AppendContinuationItemsAction | OpenPopupAction | NavigateAction | ShowMiniplayerCommand | ReloadContinuationItemsCommand)[]);\n}\n\nexport function parseActions(data: RawData) {\n if (Array.isArray(data)) {\n return parse(data.map((action) => {\n delete action.clickTrackingParams;\n return action;\n }));\n }\n return new SuperParsedResult(parseItem(data));\n}\n\nexport function parseFormats(formats: RawNode[], this_response_nsig_cache: Map): Format[] {\n return formats?.map((format) => new Format(format, this_response_nsig_cache)) || [];\n}\n\nexport function applyMutations(memo: Memo, mutations: RawNode[]) {\n // Apply mutations to MusicMultiSelectMenuItems\n const music_multi_select_menu_items = memo.getType(MusicMultiSelectMenuItem);\n\n if (music_multi_select_menu_items.length > 0 && !mutations) {\n ERROR_HANDLER({\n error_type: 'mutation_data_missing',\n classname: 'MusicMultiSelectMenuItem'\n });\n } else {\n const missing_or_invalid_mutations = [];\n\n for (const menu_item of music_multi_select_menu_items) {\n const mutation = mutations\n .find((mutation) => mutation.payload?.musicFormBooleanChoice?.id === menu_item.form_item_entity_key);\n\n const choice = mutation?.payload.musicFormBooleanChoice;\n\n if (choice?.selected !== undefined && choice?.opaqueToken) {\n menu_item.selected = choice.selected;\n } else {\n missing_or_invalid_mutations.push(`'${menu_item.title}'`);\n }\n }\n if (missing_or_invalid_mutations.length > 0) {\n ERROR_HANDLER({\n error_type: 'mutation_data_invalid',\n classname: 'MusicMultiSelectMenuItem',\n total: music_multi_select_menu_items.length,\n failed: missing_or_invalid_mutations.length,\n titles: missing_or_invalid_mutations\n });\n }\n }\n\n // Apply mutations to MacroMarkersListEntity\n if (mutations) {\n const heat_map_mutations = mutations.filter((mutation) =>\n mutation.payload?.macroMarkersListEntity &&\n mutation.payload.macroMarkersListEntity.markersList?.markerType === 'MARKER_TYPE_HEATMAP'\n );\n\n for (const mutation of heat_map_mutations) {\n const macro_markers_entity = new MacroMarkersListEntity(mutation.payload.macroMarkersListEntity);\n const list = memo.get('MacroMarkersListEntity');\n if (!list) {\n memo.set('MacroMarkersListEntity', [ macro_markers_entity ]);\n } else {\n list.push(macro_markers_entity);\n }\n }\n }\n}\n\nexport function applyCommentsMutations(memo: Memo, mutations: RawNode[]) {\n const comment_view_items = memo.getType(CommentView);\n\n if (comment_view_items.length > 0) {\n if (!mutations) {\n ERROR_HANDLER({\n error_type: 'mutation_data_missing',\n classname: 'CommentView'\n });\n }\n\n for (const comment_view of comment_view_items) {\n const comment_mutation = mutations\n .find((mutation) => mutation.payload?.commentEntityPayload?.key === comment_view.keys.comment)\n ?.payload?.commentEntityPayload;\n\n const toolbar_state_mutation = mutations\n .find((mutation) => mutation.payload?.engagementToolbarStateEntityPayload?.key === comment_view.keys.toolbar_state)\n ?.payload?.engagementToolbarStateEntityPayload;\n\n const engagement_toolbar = mutations.find((mutation) => mutation.entityKey === comment_view.keys.toolbar_surface)\n ?.payload?.engagementToolbarSurfaceEntityPayload;\n\n const comment_surface_mutation = mutations\n .find((mutation) => mutation.payload?.commentSurfaceEntityPayload?.key === comment_view.keys.comment_surface)\n ?.payload?.commentSurfaceEntityPayload;\n\n comment_view.applyMutations(comment_mutation, toolbar_state_mutation, engagement_toolbar, comment_surface_mutation);\n }\n }\n}\n", "// This file was auto generated, do not edit.\n// See ./dev-scripts/gen-parser-map.mjs\n\nexport { default as AboutChannel } from './classes/AboutChannel.js';\nexport { default as AboutChannelView } from './classes/AboutChannelView.js';\nexport { default as AccountChannel } from './classes/AccountChannel.js';\nexport { default as AccountItem } from './classes/AccountItem.js';\nexport { default as AccountItemSection } from './classes/AccountItemSection.js';\nexport { default as AccountItemSectionHeader } from './classes/AccountItemSectionHeader.js';\nexport { default as AccountSectionList } from './classes/AccountSectionList.js';\nexport { default as AppendContinuationItemsAction } from './classes/actions/AppendContinuationItemsAction.js';\nexport { default as ChangeEngagementPanelVisibilityAction } from './classes/actions/ChangeEngagementPanelVisibilityAction.js';\nexport { default as GetMultiPageMenuAction } from './classes/actions/GetMultiPageMenuAction.js';\nexport { default as OpenPopupAction } from './classes/actions/OpenPopupAction.js';\nexport { default as SendFeedbackAction } from './classes/actions/SendFeedbackAction.js';\nexport { default as SignalAction } from './classes/actions/SignalAction.js';\nexport { default as UpdateChannelSwitcherPageAction } from './classes/actions/UpdateChannelSwitcherPageAction.js';\nexport { default as UpdateEngagementPanelAction } from './classes/actions/UpdateEngagementPanelAction.js';\nexport { default as UpdateSubscribeButtonAction } from './classes/actions/UpdateSubscribeButtonAction.js';\nexport { default as ActiveAccountHeader } from './classes/ActiveAccountHeader.js';\nexport { default as AddToPlaylist } from './classes/AddToPlaylist.js';\nexport { default as Alert } from './classes/Alert.js';\nexport { default as AlertWithButton } from './classes/AlertWithButton.js';\nexport { default as AnimatedThumbnailOverlayView } from './classes/AnimatedThumbnailOverlayView.js';\nexport { default as AttributionView } from './classes/AttributionView.js';\nexport { default as AudioOnlyPlayability } from './classes/AudioOnlyPlayability.js';\nexport { default as AutomixPreviewVideo } from './classes/AutomixPreviewVideo.js';\nexport { default as AvatarStackView } from './classes/AvatarStackView.js';\nexport { default as AvatarView } from './classes/AvatarView.js';\nexport { default as BackgroundPromo } from './classes/BackgroundPromo.js';\nexport { default as BackstageImage } from './classes/BackstageImage.js';\nexport { default as BackstagePost } from './classes/BackstagePost.js';\nexport { default as BackstagePostThread } from './classes/BackstagePostThread.js';\nexport { default as BadgeView } from './classes/BadgeView.js';\nexport { default as BrowseFeedActions } from './classes/BrowseFeedActions.js';\nexport { default as BrowserMediaSession } from './classes/BrowserMediaSession.js';\nexport { default as Button } from './classes/Button.js';\nexport { default as ButtonCardView } from './classes/ButtonCardView.js';\nexport { default as ButtonView } from './classes/ButtonView.js';\nexport { default as C4TabbedHeader } from './classes/C4TabbedHeader.js';\nexport { default as CallToActionButton } from './classes/CallToActionButton.js';\nexport { default as Card } from './classes/Card.js';\nexport { default as CardCollection } from './classes/CardCollection.js';\nexport { default as CarouselHeader } from './classes/CarouselHeader.js';\nexport { default as CarouselItem } from './classes/CarouselItem.js';\nexport { default as CarouselItemView } from './classes/CarouselItemView.js';\nexport { default as CarouselLockup } from './classes/CarouselLockup.js';\nexport { default as CarouselTitleView } from './classes/CarouselTitleView.js';\nexport { default as Channel } from './classes/Channel.js';\nexport { default as ChannelAboutFullMetadata } from './classes/ChannelAboutFullMetadata.js';\nexport { default as ChannelAgeGate } from './classes/ChannelAgeGate.js';\nexport { default as ChannelExternalLinkView } from './classes/ChannelExternalLinkView.js';\nexport { default as ChannelFeaturedContent } from './classes/ChannelFeaturedContent.js';\nexport { default as ChannelHeaderLinks } from './classes/ChannelHeaderLinks.js';\nexport { default as ChannelHeaderLinksView } from './classes/ChannelHeaderLinksView.js';\nexport { default as ChannelMetadata } from './classes/ChannelMetadata.js';\nexport { default as ChannelMobileHeader } from './classes/ChannelMobileHeader.js';\nexport { default as ChannelOptions } from './classes/ChannelOptions.js';\nexport { default as ChannelOwnerEmptyState } from './classes/ChannelOwnerEmptyState.js';\nexport { default as ChannelSubMenu } from './classes/ChannelSubMenu.js';\nexport { default as ChannelSwitcherHeader } from './classes/ChannelSwitcherHeader.js';\nexport { default as ChannelSwitcherPage } from './classes/ChannelSwitcherPage.js';\nexport { default as ChannelTagline } from './classes/ChannelTagline.js';\nexport { default as ChannelThumbnailWithLink } from './classes/ChannelThumbnailWithLink.js';\nexport { default as ChannelVideoPlayer } from './classes/ChannelVideoPlayer.js';\nexport { default as Chapter } from './classes/Chapter.js';\nexport { default as ChildVideo } from './classes/ChildVideo.js';\nexport { default as ChipBarView } from './classes/ChipBarView.js';\nexport { default as ChipCloud } from './classes/ChipCloud.js';\nexport { default as ChipCloudChip } from './classes/ChipCloudChip.js';\nexport { default as ChipView } from './classes/ChipView.js';\nexport { default as ClientSideToggleMenuItem } from './classes/ClientSideToggleMenuItem.js';\nexport { default as ClipAdState } from './classes/ClipAdState.js';\nexport { default as ClipCreation } from './classes/ClipCreation.js';\nexport { default as ClipCreationScrubber } from './classes/ClipCreationScrubber.js';\nexport { default as ClipCreationTextInput } from './classes/ClipCreationTextInput.js';\nexport { default as ClipSection } from './classes/ClipSection.js';\nexport { default as CollaboratorInfoCardContent } from './classes/CollaboratorInfoCardContent.js';\nexport { default as CollageHeroImage } from './classes/CollageHeroImage.js';\nexport { default as CollectionThumbnailView } from './classes/CollectionThumbnailView.js';\nexport { default as AddToPlaylistCommand } from './classes/commands/AddToPlaylistCommand.js';\nexport { default as CommandExecutorCommand } from './classes/commands/CommandExecutorCommand.js';\nexport { default as ContinuationCommand } from './classes/commands/ContinuationCommand.js';\nexport { default as GetKidsBlocklistPickerCommand } from './classes/commands/GetKidsBlocklistPickerCommand.js';\nexport { default as RunAttestationCommand } from './classes/commands/RunAttestationCommand.js';\nexport { default as ShowDialogCommand } from './classes/commands/ShowDialogCommand.js';\nexport { default as UpdateEngagementPanelContentCommand } from './classes/commands/UpdateEngagementPanelContentCommand.js';\nexport { default as AuthorCommentBadge } from './classes/comments/AuthorCommentBadge.js';\nexport { default as CommentActionButtons } from './classes/comments/CommentActionButtons.js';\nexport { default as CommentDialog } from './classes/comments/CommentDialog.js';\nexport { default as CommentReplies } from './classes/comments/CommentReplies.js';\nexport { default as CommentReplyDialog } from './classes/comments/CommentReplyDialog.js';\nexport { default as CommentsEntryPointHeader } from './classes/comments/CommentsEntryPointHeader.js';\nexport { default as CommentsEntryPointTeaser } from './classes/comments/CommentsEntryPointTeaser.js';\nexport { default as CommentsHeader } from './classes/comments/CommentsHeader.js';\nexport { default as CommentSimplebox } from './classes/comments/CommentSimplebox.js';\nexport { default as CommentsSimplebox } from './classes/comments/CommentsSimplebox.js';\nexport { default as CommentThread } from './classes/comments/CommentThread.js';\nexport { default as CommentView } from './classes/comments/CommentView.js';\nexport { default as CreatorHeart } from './classes/comments/CreatorHeart.js';\nexport { default as EmojiPicker } from './classes/comments/EmojiPicker.js';\nexport { default as PdgCommentChip } from './classes/comments/PdgCommentChip.js';\nexport { default as SponsorCommentBadge } from './classes/comments/SponsorCommentBadge.js';\nexport { default as VoiceReplyContainerView } from './classes/comments/VoiceReplyContainerView.js';\nexport { default as CompactChannel } from './classes/CompactChannel.js';\nexport { default as CompactLink } from './classes/CompactLink.js';\nexport { default as CompactMix } from './classes/CompactMix.js';\nexport { default as CompactMovie } from './classes/CompactMovie.js';\nexport { default as CompactPlaylist } from './classes/CompactPlaylist.js';\nexport { default as CompactStation } from './classes/CompactStation.js';\nexport { default as CompactVideo } from './classes/CompactVideo.js';\nexport { default as CompositeVideoPrimaryInfo } from './classes/CompositeVideoPrimaryInfo.js';\nexport { default as ConfirmDialog } from './classes/ConfirmDialog.js';\nexport { default as ContentMetadataView } from './classes/ContentMetadataView.js';\nexport { default as ContentPreviewImageView } from './classes/ContentPreviewImageView.js';\nexport { default as ContinuationItem } from './classes/ContinuationItem.js';\nexport { default as ConversationBar } from './classes/ConversationBar.js';\nexport { default as CopyLink } from './classes/CopyLink.js';\nexport { default as CreatePlaylistDialog } from './classes/CreatePlaylistDialog.js';\nexport { default as CreatePlaylistDialogFormView } from './classes/CreatePlaylistDialogFormView.js';\nexport { default as DecoratedAvatarView } from './classes/DecoratedAvatarView.js';\nexport { default as DecoratedPlayerBar } from './classes/DecoratedPlayerBar.js';\nexport { default as DefaultPromoPanel } from './classes/DefaultPromoPanel.js';\nexport { default as DescriptionPreviewView } from './classes/DescriptionPreviewView.js';\nexport { default as DialogHeaderView } from './classes/DialogHeaderView.js';\nexport { default as DialogView } from './classes/DialogView.js';\nexport { default as DidYouMean } from './classes/DidYouMean.js';\nexport { default as DislikeButtonView } from './classes/DislikeButtonView.js';\nexport { default as DismissableDialog } from './classes/DismissableDialog.js';\nexport { default as DismissableDialogContentSection } from './classes/DismissableDialogContentSection.js';\nexport { default as DownloadButton } from './classes/DownloadButton.js';\nexport { default as Dropdown } from './classes/Dropdown.js';\nexport { default as DropdownItem } from './classes/DropdownItem.js';\nexport { default as DropdownView } from './classes/DropdownView.js';\nexport { default as DynamicTextView } from './classes/DynamicTextView.js';\nexport { default as Element } from './classes/Element.js';\nexport { default as EmergencyOnebox } from './classes/EmergencyOnebox.js';\nexport { default as EmojiPickerCategory } from './classes/EmojiPickerCategory.js';\nexport { default as EmojiPickerCategoryButton } from './classes/EmojiPickerCategoryButton.js';\nexport { default as EmojiPickerUpsellCategory } from './classes/EmojiPickerUpsellCategory.js';\nexport { default as AddToPlaylistEndpoint } from './classes/endpoints/AddToPlaylistEndpoint.js';\nexport { default as AddToPlaylistServiceEndpoint } from './classes/endpoints/AddToPlaylistServiceEndpoint.js';\nexport { default as BrowseEndpoint } from './classes/endpoints/BrowseEndpoint.js';\nexport { default as CreateCommentEndpoint } from './classes/endpoints/CreateCommentEndpoint.js';\nexport { default as CreatePlaylistServiceEndpoint } from './classes/endpoints/CreatePlaylistServiceEndpoint.js';\nexport { default as DeletePlaylistEndpoint } from './classes/endpoints/DeletePlaylistEndpoint.js';\nexport { default as FeedbackEndpoint } from './classes/endpoints/FeedbackEndpoint.js';\nexport { default as GetAccountsListInnertubeEndpoint } from './classes/endpoints/GetAccountsListInnertubeEndpoint.js';\nexport { default as HideEngagementPanelEndpoint } from './classes/endpoints/HideEngagementPanelEndpoint.js';\nexport { default as LikeEndpoint } from './classes/endpoints/LikeEndpoint.js';\nexport { default as LiveChatItemContextMenuEndpoint } from './classes/endpoints/LiveChatItemContextMenuEndpoint.js';\nexport { default as ModifyChannelNotificationPreferenceEndpoint } from './classes/endpoints/ModifyChannelNotificationPreferenceEndpoint.js';\nexport { default as PerformCommentActionEndpoint } from './classes/endpoints/PerformCommentActionEndpoint.js';\nexport { default as PlaylistEditEndpoint } from './classes/endpoints/PlaylistEditEndpoint.js';\nexport { default as PrefetchWatchCommand } from './classes/endpoints/PrefetchWatchCommand.js';\nexport { default as ReelWatchEndpoint } from './classes/endpoints/ReelWatchEndpoint.js';\nexport { default as SearchEndpoint } from './classes/endpoints/SearchEndpoint.js';\nexport { default as ShareEndpoint } from './classes/endpoints/ShareEndpoint.js';\nexport { default as ShareEntityEndpoint } from './classes/endpoints/ShareEntityEndpoint.js';\nexport { default as ShareEntityServiceEndpoint } from './classes/endpoints/ShareEntityServiceEndpoint.js';\nexport { default as ShowEngagementPanelEndpoint } from './classes/endpoints/ShowEngagementPanelEndpoint.js';\nexport { default as SignalServiceEndpoint } from './classes/endpoints/SignalServiceEndpoint.js';\nexport { default as SubscribeEndpoint } from './classes/endpoints/SubscribeEndpoint.js';\nexport { default as UnsubscribeEndpoint } from './classes/endpoints/UnsubscribeEndpoint.js';\nexport { default as WatchEndpoint } from './classes/endpoints/WatchEndpoint.js';\nexport { default as WatchNextEndpoint } from './classes/endpoints/WatchNextEndpoint.js';\nexport { default as Endscreen } from './classes/Endscreen.js';\nexport { default as EndscreenElement } from './classes/EndscreenElement.js';\nexport { default as EndScreenPlaylist } from './classes/EndScreenPlaylist.js';\nexport { default as EndScreenVideo } from './classes/EndScreenVideo.js';\nexport { default as EngagementPanelSectionList } from './classes/EngagementPanelSectionList.js';\nexport { default as EngagementPanelTitleHeader } from './classes/EngagementPanelTitleHeader.js';\nexport { default as EomSettingsDisclaimer } from './classes/EomSettingsDisclaimer.js';\nexport { default as ExpandableMetadata } from './classes/ExpandableMetadata.js';\nexport { default as ExpandableTab } from './classes/ExpandableTab.js';\nexport { default as ExpandableVideoDescriptionBody } from './classes/ExpandableVideoDescriptionBody.js';\nexport { default as ExpandedShelfContents } from './classes/ExpandedShelfContents.js';\nexport { default as Factoid } from './classes/Factoid.js';\nexport { default as FancyDismissibleDialog } from './classes/FancyDismissibleDialog.js';\nexport { default as FeedFilterChipBar } from './classes/FeedFilterChipBar.js';\nexport { default as FeedNudge } from './classes/FeedNudge.js';\nexport { default as FeedTabbedHeader } from './classes/FeedTabbedHeader.js';\nexport { default as FlexibleActionsView } from './classes/FlexibleActionsView.js';\nexport { default as Form } from './classes/Form.js';\nexport { default as FormFooterView } from './classes/FormFooterView.js';\nexport { default as FormPopup } from './classes/FormPopup.js';\nexport { default as GameCard } from './classes/GameCard.js';\nexport { default as GameDetails } from './classes/GameDetails.js';\nexport { default as Grid } from './classes/Grid.js';\nexport { default as GridChannel } from './classes/GridChannel.js';\nexport { default as GridHeader } from './classes/GridHeader.js';\nexport { default as GridMix } from './classes/GridMix.js';\nexport { default as GridMovie } from './classes/GridMovie.js';\nexport { default as GridPlaylist } from './classes/GridPlaylist.js';\nexport { default as GridShelfView } from './classes/GridShelfView.js';\nexport { default as GridShow } from './classes/GridShow.js';\nexport { default as GridVideo } from './classes/GridVideo.js';\nexport { default as GuideCollapsibleEntry } from './classes/GuideCollapsibleEntry.js';\nexport { default as GuideCollapsibleSectionEntry } from './classes/GuideCollapsibleSectionEntry.js';\nexport { default as GuideDownloadsEntry } from './classes/GuideDownloadsEntry.js';\nexport { default as GuideEntry } from './classes/GuideEntry.js';\nexport { default as GuideSection } from './classes/GuideSection.js';\nexport { default as GuideSubscriptionsSection } from './classes/GuideSubscriptionsSection.js';\nexport { default as HashtagHeader } from './classes/HashtagHeader.js';\nexport { default as HashtagTile } from './classes/HashtagTile.js';\nexport { default as Heatmap } from './classes/Heatmap.js';\nexport { default as HeatMarker } from './classes/HeatMarker.js';\nexport { default as HeroPlaylistThumbnail } from './classes/HeroPlaylistThumbnail.js';\nexport { default as HighlightsCarousel } from './classes/HighlightsCarousel.js';\nexport { default as HistorySuggestion } from './classes/HistorySuggestion.js';\nexport { default as HorizontalCardList } from './classes/HorizontalCardList.js';\nexport { default as HorizontalList } from './classes/HorizontalList.js';\nexport { default as HorizontalMovieList } from './classes/HorizontalMovieList.js';\nexport { default as HowThisWasMadeSectionView } from './classes/HowThisWasMadeSectionView.js';\nexport { default as HypePointsFactoid } from './classes/HypePointsFactoid.js';\nexport { default as IconLink } from './classes/IconLink.js';\nexport { default as ImageBannerView } from './classes/ImageBannerView.js';\nexport { default as IncludingResultsFor } from './classes/IncludingResultsFor.js';\nexport { default as InfoPanelContainer } from './classes/InfoPanelContainer.js';\nexport { default as InfoPanelContent } from './classes/InfoPanelContent.js';\nexport { default as InfoRow } from './classes/InfoRow.js';\nexport { default as InteractiveTabbedHeader } from './classes/InteractiveTabbedHeader.js';\nexport { default as ItemSection } from './classes/ItemSection.js';\nexport { default as ItemSectionHeader } from './classes/ItemSectionHeader.js';\nexport { default as ItemSectionTab } from './classes/ItemSectionTab.js';\nexport { default as ItemSectionTabbedHeader } from './classes/ItemSectionTabbedHeader.js';\nexport { default as LikeButton } from './classes/LikeButton.js';\nexport { default as LikeButtonView } from './classes/LikeButtonView.js';\nexport { default as ListItemView } from './classes/ListItemView.js';\nexport { default as ListView } from './classes/ListView.js';\nexport { default as LiveChat } from './classes/LiveChat.js';\nexport { default as AddBannerToLiveChatCommand } from './classes/livechat/AddBannerToLiveChatCommand.js';\nexport { default as AddChatItemAction } from './classes/livechat/AddChatItemAction.js';\nexport { default as AddLiveChatTickerItemAction } from './classes/livechat/AddLiveChatTickerItemAction.js';\nexport { default as DimChatItemAction } from './classes/livechat/DimChatItemAction.js';\nexport { default as BumperUserEduContentView } from './classes/livechat/items/BumperUserEduContentView.js';\nexport { default as CreatorHeartView } from './classes/livechat/items/CreatorHeartView.js';\nexport { default as LiveChatAutoModMessage } from './classes/livechat/items/LiveChatAutoModMessage.js';\nexport { default as LiveChatBanner } from './classes/livechat/items/LiveChatBanner.js';\nexport { default as LiveChatBannerChatSummary } from './classes/livechat/items/LiveChatBannerChatSummary.js';\nexport { default as LiveChatBannerHeader } from './classes/livechat/items/LiveChatBannerHeader.js';\nexport { default as LiveChatBannerPoll } from './classes/livechat/items/LiveChatBannerPoll.js';\nexport { default as LiveChatBannerRedirect } from './classes/livechat/items/LiveChatBannerRedirect.js';\nexport { default as LiveChatItemBumperView } from './classes/livechat/items/LiveChatItemBumperView.js';\nexport { default as LiveChatMembershipItem } from './classes/livechat/items/LiveChatMembershipItem.js';\nexport { default as LiveChatModeChangeMessage } from './classes/livechat/items/LiveChatModeChangeMessage.js';\nexport { default as LiveChatPaidMessage } from './classes/livechat/items/LiveChatPaidMessage.js';\nexport { default as LiveChatPaidSticker } from './classes/livechat/items/LiveChatPaidSticker.js';\nexport { default as LiveChatPlaceholderItem } from './classes/livechat/items/LiveChatPlaceholderItem.js';\nexport { default as LiveChatProductItem } from './classes/livechat/items/LiveChatProductItem.js';\nexport { default as LiveChatRestrictedParticipation } from './classes/livechat/items/LiveChatRestrictedParticipation.js';\nexport { default as LiveChatSponsorshipsGiftPurchaseAnnouncement } from './classes/livechat/items/LiveChatSponsorshipsGiftPurchaseAnnouncement.js';\nexport { default as LiveChatSponsorshipsGiftRedemptionAnnouncement } from './classes/livechat/items/LiveChatSponsorshipsGiftRedemptionAnnouncement.js';\nexport { default as LiveChatSponsorshipsHeader } from './classes/livechat/items/LiveChatSponsorshipsHeader.js';\nexport { default as LiveChatTextMessage } from './classes/livechat/items/LiveChatTextMessage.js';\nexport { default as LiveChatTickerPaidMessageItem } from './classes/livechat/items/LiveChatTickerPaidMessageItem.js';\nexport { default as LiveChatTickerPaidStickerItem } from './classes/livechat/items/LiveChatTickerPaidStickerItem.js';\nexport { default as LiveChatTickerSponsorItem } from './classes/livechat/items/LiveChatTickerSponsorItem.js';\nexport { default as LiveChatViewerEngagementMessage } from './classes/livechat/items/LiveChatViewerEngagementMessage.js';\nexport { default as PdgReplyButtonView } from './classes/livechat/items/PdgReplyButtonView.js';\nexport { default as PollHeader } from './classes/livechat/items/PollHeader.js';\nexport { default as LiveChatActionPanel } from './classes/livechat/LiveChatActionPanel.js';\nexport { default as MarkChatItemAsDeletedAction } from './classes/livechat/MarkChatItemAsDeletedAction.js';\nexport { default as MarkChatItemsByAuthorAsDeletedAction } from './classes/livechat/MarkChatItemsByAuthorAsDeletedAction.js';\nexport { default as RemoveBannerForLiveChatCommand } from './classes/livechat/RemoveBannerForLiveChatCommand.js';\nexport { default as RemoveChatItemAction } from './classes/livechat/RemoveChatItemAction.js';\nexport { default as RemoveChatItemByAuthorAction } from './classes/livechat/RemoveChatItemByAuthorAction.js';\nexport { default as ReplaceChatItemAction } from './classes/livechat/ReplaceChatItemAction.js';\nexport { default as ReplaceLiveChatAction } from './classes/livechat/ReplaceLiveChatAction.js';\nexport { default as ReplayChatItemAction } from './classes/livechat/ReplayChatItemAction.js';\nexport { default as ShowLiveChatActionPanelAction } from './classes/livechat/ShowLiveChatActionPanelAction.js';\nexport { default as ShowLiveChatDialogAction } from './classes/livechat/ShowLiveChatDialogAction.js';\nexport { default as ShowLiveChatTooltipCommand } from './classes/livechat/ShowLiveChatTooltipCommand.js';\nexport { default as UpdateDateTextAction } from './classes/livechat/UpdateDateTextAction.js';\nexport { default as UpdateDescriptionAction } from './classes/livechat/UpdateDescriptionAction.js';\nexport { default as UpdateLiveChatPollAction } from './classes/livechat/UpdateLiveChatPollAction.js';\nexport { default as UpdateTitleAction } from './classes/livechat/UpdateTitleAction.js';\nexport { default as UpdateToggleButtonTextAction } from './classes/livechat/UpdateToggleButtonTextAction.js';\nexport { default as UpdateViewershipAction } from './classes/livechat/UpdateViewershipAction.js';\nexport { default as LiveChatAuthorBadge } from './classes/LiveChatAuthorBadge.js';\nexport { default as LiveChatDialog } from './classes/LiveChatDialog.js';\nexport { default as LiveChatHeader } from './classes/LiveChatHeader.js';\nexport { default as LiveChatItemList } from './classes/LiveChatItemList.js';\nexport { default as LiveChatMessageInput } from './classes/LiveChatMessageInput.js';\nexport { default as LiveChatParticipant } from './classes/LiveChatParticipant.js';\nexport { default as LiveChatParticipantsList } from './classes/LiveChatParticipantsList.js';\nexport { default as LockupMetadataView } from './classes/LockupMetadataView.js';\nexport { default as LockupView } from './classes/LockupView.js';\nexport { default as MacroMarkersInfoItem } from './classes/MacroMarkersInfoItem.js';\nexport { default as MacroMarkersList } from './classes/MacroMarkersList.js';\nexport { default as MacroMarkersListEntity } from './classes/MacroMarkersListEntity.js';\nexport { default as MacroMarkersListItem } from './classes/MacroMarkersListItem.js';\nexport { default as Menu } from './classes/menus/Menu.js';\nexport { default as MenuFlexibleItem } from './classes/menus/MenuFlexibleItem.js';\nexport { default as MenuNavigationItem } from './classes/menus/MenuNavigationItem.js';\nexport { default as MenuPopup } from './classes/menus/MenuPopup.js';\nexport { default as MenuServiceItem } from './classes/menus/MenuServiceItem.js';\nexport { default as MenuServiceItemDownload } from './classes/menus/MenuServiceItemDownload.js';\nexport { default as MultiPageMenu } from './classes/menus/MultiPageMenu.js';\nexport { default as MultiPageMenuNotificationSection } from './classes/menus/MultiPageMenuNotificationSection.js';\nexport { default as MusicMenuItemDivider } from './classes/menus/MusicMenuItemDivider.js';\nexport { default as MusicMultiSelectMenu } from './classes/menus/MusicMultiSelectMenu.js';\nexport { default as MusicMultiSelectMenuItem } from './classes/menus/MusicMultiSelectMenuItem.js';\nexport { default as SimpleMenuHeader } from './classes/menus/SimpleMenuHeader.js';\nexport { default as MenuTitle } from './classes/MenuTitle.js';\nexport { default as MerchandiseItem } from './classes/MerchandiseItem.js';\nexport { default as MerchandiseShelf } from './classes/MerchandiseShelf.js';\nexport { default as Message } from './classes/Message.js';\nexport { default as MetadataBadge } from './classes/MetadataBadge.js';\nexport { default as MetadataRow } from './classes/MetadataRow.js';\nexport { default as MetadataRowContainer } from './classes/MetadataRowContainer.js';\nexport { default as MetadataRowHeader } from './classes/MetadataRowHeader.js';\nexport { default as MetadataScreen } from './classes/MetadataScreen.js';\nexport { default as MicroformatData } from './classes/MicroformatData.js';\nexport { default as Mix } from './classes/Mix.js';\nexport { default as ModalWithTitleAndButton } from './classes/ModalWithTitleAndButton.js';\nexport { default as Movie } from './classes/Movie.js';\nexport { default as MovingThumbnail } from './classes/MovingThumbnail.js';\nexport { default as MultiMarkersPlayerBar } from './classes/MultiMarkersPlayerBar.js';\nexport { default as MusicCardShelf } from './classes/MusicCardShelf.js';\nexport { default as MusicCardShelfHeaderBasic } from './classes/MusicCardShelfHeaderBasic.js';\nexport { default as MusicCarouselShelf } from './classes/MusicCarouselShelf.js';\nexport { default as MusicCarouselShelfBasicHeader } from './classes/MusicCarouselShelfBasicHeader.js';\nexport { default as MusicDescriptionShelf } from './classes/MusicDescriptionShelf.js';\nexport { default as MusicDetailHeader } from './classes/MusicDetailHeader.js';\nexport { default as MusicDownloadStateBadge } from './classes/MusicDownloadStateBadge.js';\nexport { default as MusicEditablePlaylistDetailHeader } from './classes/MusicEditablePlaylistDetailHeader.js';\nexport { default as MusicElementHeader } from './classes/MusicElementHeader.js';\nexport { default as MusicHeader } from './classes/MusicHeader.js';\nexport { default as MusicImmersiveHeader } from './classes/MusicImmersiveHeader.js';\nexport { default as MusicInlineBadge } from './classes/MusicInlineBadge.js';\nexport { default as MusicItemThumbnailOverlay } from './classes/MusicItemThumbnailOverlay.js';\nexport { default as MusicLargeCardItemCarousel } from './classes/MusicLargeCardItemCarousel.js';\nexport { default as MusicMultiRowListItem } from './classes/MusicMultiRowListItem.js';\nexport { default as MusicNavigationButton } from './classes/MusicNavigationButton.js';\nexport { default as MusicPlayButton } from './classes/MusicPlayButton.js';\nexport { default as MusicPlaylistEditHeader } from './classes/MusicPlaylistEditHeader.js';\nexport { default as MusicPlaylistShelf } from './classes/MusicPlaylistShelf.js';\nexport { default as MusicQueue } from './classes/MusicQueue.js';\nexport { default as MusicResponsiveHeader } from './classes/MusicResponsiveHeader.js';\nexport { default as MusicResponsiveListItem } from './classes/MusicResponsiveListItem.js';\nexport { default as MusicResponsiveListItemFixedColumn } from './classes/MusicResponsiveListItemFixedColumn.js';\nexport { default as MusicResponsiveListItemFlexColumn } from './classes/MusicResponsiveListItemFlexColumn.js';\nexport { default as MusicShelf } from './classes/MusicShelf.js';\nexport { default as MusicSideAlignedItem } from './classes/MusicSideAlignedItem.js';\nexport { default as MusicSortFilterButton } from './classes/MusicSortFilterButton.js';\nexport { default as MusicTastebuilderShelf } from './classes/MusicTastebuilderShelf.js';\nexport { default as MusicTastebuilderShelfThumbnail } from './classes/MusicTastebuilderShelfThumbnail.js';\nexport { default as MusicThumbnail } from './classes/MusicThumbnail.js';\nexport { default as MusicTwoRowItem } from './classes/MusicTwoRowItem.js';\nexport { default as MusicVisualHeader } from './classes/MusicVisualHeader.js';\nexport { default as MobileTopbar } from './classes/mweb/MobileTopbar.js';\nexport { default as MultiPageMenuSection } from './classes/mweb/MultiPageMenuSection.js';\nexport { default as PivotBar } from './classes/mweb/PivotBar.js';\nexport { default as PivotBarItem } from './classes/mweb/PivotBarItem.js';\nexport { default as TopbarMenuButton } from './classes/mweb/TopbarMenuButton.js';\nexport { default as NavigationEndpoint } from './classes/NavigationEndpoint.js';\nexport { default as Notification } from './classes/Notification.js';\nexport { default as NotificationAction } from './classes/NotificationAction.js';\nexport { default as OpenOnePickAddVideoModalCommand } from './classes/OpenOnePickAddVideoModalCommand.js';\nexport { default as PageHeader } from './classes/PageHeader.js';\nexport { default as PageHeaderView } from './classes/PageHeaderView.js';\nexport { default as PageIntroduction } from './classes/PageIntroduction.js';\nexport { default as PanelFooterView } from './classes/PanelFooterView.js';\nexport { default as PivotButton } from './classes/PivotButton.js';\nexport { default as PlayerAnnotationsExpanded } from './classes/PlayerAnnotationsExpanded.js';\nexport { default as PlayerCaptchaView } from './classes/PlayerCaptchaView.js';\nexport { default as PlayerCaptionsTracklist } from './classes/PlayerCaptionsTracklist.js';\nexport { default as PlayerControlsOverlay } from './classes/PlayerControlsOverlay.js';\nexport { default as PlayerErrorMessage } from './classes/PlayerErrorMessage.js';\nexport { default as PlayerLegacyDesktopYpcOffer } from './classes/PlayerLegacyDesktopYpcOffer.js';\nexport { default as PlayerLegacyDesktopYpcTrailer } from './classes/PlayerLegacyDesktopYpcTrailer.js';\nexport { default as PlayerLiveStoryboardSpec } from './classes/PlayerLiveStoryboardSpec.js';\nexport { default as PlayerMicroformat } from './classes/PlayerMicroformat.js';\nexport { default as PlayerOverflow } from './classes/PlayerOverflow.js';\nexport { default as PlayerOverlay } from './classes/PlayerOverlay.js';\nexport { default as PlayerOverlayAutoplay } from './classes/PlayerOverlayAutoplay.js';\nexport { default as PlayerOverlayVideoDetails } from './classes/PlayerOverlayVideoDetails.js';\nexport { default as PlayerStoryboardSpec } from './classes/PlayerStoryboardSpec.js';\nexport { default as Playlist } from './classes/Playlist.js';\nexport { default as PlaylistAddToOption } from './classes/PlaylistAddToOption.js';\nexport { default as PlaylistCustomThumbnail } from './classes/PlaylistCustomThumbnail.js';\nexport { default as PlaylistHeader } from './classes/PlaylistHeader.js';\nexport { default as PlaylistInfoCardContent } from './classes/PlaylistInfoCardContent.js';\nexport { default as PlaylistMetadata } from './classes/PlaylistMetadata.js';\nexport { default as PlaylistPanel } from './classes/PlaylistPanel.js';\nexport { default as PlaylistPanelVideo } from './classes/PlaylistPanelVideo.js';\nexport { default as PlaylistPanelVideoWrapper } from './classes/PlaylistPanelVideoWrapper.js';\nexport { default as PlaylistSidebar } from './classes/PlaylistSidebar.js';\nexport { default as PlaylistSidebarPrimaryInfo } from './classes/PlaylistSidebarPrimaryInfo.js';\nexport { default as PlaylistSidebarSecondaryInfo } from './classes/PlaylistSidebarSecondaryInfo.js';\nexport { default as PlaylistThumbnailOverlay } from './classes/PlaylistThumbnailOverlay.js';\nexport { default as PlaylistVideo } from './classes/PlaylistVideo.js';\nexport { default as PlaylistVideoList } from './classes/PlaylistVideoList.js';\nexport { default as PlaylistVideoThumbnail } from './classes/PlaylistVideoThumbnail.js';\nexport { default as Poll } from './classes/Poll.js';\nexport { default as Post } from './classes/Post.js';\nexport { default as PostMultiImage } from './classes/PostMultiImage.js';\nexport { default as PremiereTrailerBadge } from './classes/PremiereTrailerBadge.js';\nexport { default as ProductList } from './classes/ProductList.js';\nexport { default as ProductListHeader } from './classes/ProductListHeader.js';\nexport { default as ProductListItem } from './classes/ProductListItem.js';\nexport { default as ProfileColumn } from './classes/ProfileColumn.js';\nexport { default as ProfileColumnStats } from './classes/ProfileColumnStats.js';\nexport { default as ProfileColumnStatsEntry } from './classes/ProfileColumnStatsEntry.js';\nexport { default as ProfileColumnUserInfo } from './classes/ProfileColumnUserInfo.js';\nexport { default as Quiz } from './classes/Quiz.js';\nexport { default as RecognitionShelf } from './classes/RecognitionShelf.js';\nexport { default as ReelItem } from './classes/ReelItem.js';\nexport { default as ReelPlayerHeader } from './classes/ReelPlayerHeader.js';\nexport { default as ReelPlayerOverlay } from './classes/ReelPlayerOverlay.js';\nexport { default as ReelShelf } from './classes/ReelShelf.js';\nexport { default as RelatedChipCloud } from './classes/RelatedChipCloud.js';\nexport { default as RichGrid } from './classes/RichGrid.js';\nexport { default as RichItem } from './classes/RichItem.js';\nexport { default as RichListHeader } from './classes/RichListHeader.js';\nexport { default as RichMetadata } from './classes/RichMetadata.js';\nexport { default as RichMetadataRow } from './classes/RichMetadataRow.js';\nexport { default as RichSection } from './classes/RichSection.js';\nexport { default as RichShelf } from './classes/RichShelf.js';\nexport { default as SearchBox } from './classes/SearchBox.js';\nexport { default as SearchFilter } from './classes/SearchFilter.js';\nexport { default as SearchFilterGroup } from './classes/SearchFilterGroup.js';\nexport { default as SearchFilterOptionsDialog } from './classes/SearchFilterOptionsDialog.js';\nexport { default as SearchHeader } from './classes/SearchHeader.js';\nexport { default as SearchRefinementCard } from './classes/SearchRefinementCard.js';\nexport { default as SearchSubMenu } from './classes/SearchSubMenu.js';\nexport { default as SearchSuggestion } from './classes/SearchSuggestion.js';\nexport { default as SearchSuggestionsSection } from './classes/SearchSuggestionsSection.js';\nexport { default as SecondarySearchContainer } from './classes/SecondarySearchContainer.js';\nexport { default as SectionHeaderView } from './classes/SectionHeaderView.js';\nexport { default as SectionList } from './classes/SectionList.js';\nexport { default as SegmentedLikeDislikeButton } from './classes/SegmentedLikeDislikeButton.js';\nexport { default as SegmentedLikeDislikeButtonView } from './classes/SegmentedLikeDislikeButtonView.js';\nexport { default as SettingBoolean } from './classes/SettingBoolean.js';\nexport { default as SettingsCheckbox } from './classes/SettingsCheckbox.js';\nexport { default as SettingsOptions } from './classes/SettingsOptions.js';\nexport { default as SettingsSidebar } from './classes/SettingsSidebar.js';\nexport { default as SettingsSwitch } from './classes/SettingsSwitch.js';\nexport { default as SharedPost } from './classes/SharedPost.js';\nexport { default as SharePanelHeader } from './classes/SharePanelHeader.js';\nexport { default as SharePanelTitleV15 } from './classes/SharePanelTitleV15.js';\nexport { default as ShareTarget } from './classes/ShareTarget.js';\nexport { default as Shelf } from './classes/Shelf.js';\nexport { default as ShortsLockupView } from './classes/ShortsLockupView.js';\nexport { default as ShowCustomThumbnail } from './classes/ShowCustomThumbnail.js';\nexport { default as ShowingResultsFor } from './classes/ShowingResultsFor.js';\nexport { default as SimpleCardContent } from './classes/SimpleCardContent.js';\nexport { default as SimpleCardTeaser } from './classes/SimpleCardTeaser.js';\nexport { default as SimpleTextSection } from './classes/SimpleTextSection.js';\nexport { default as SingleActionEmergencySupport } from './classes/SingleActionEmergencySupport.js';\nexport { default as SingleColumnBrowseResults } from './classes/SingleColumnBrowseResults.js';\nexport { default as SingleColumnMusicWatchNextResults } from './classes/SingleColumnMusicWatchNextResults.js';\nexport { default as SingleHeroImage } from './classes/SingleHeroImage.js';\nexport { default as SlimOwner } from './classes/SlimOwner.js';\nexport { default as SlimVideoMetadata } from './classes/SlimVideoMetadata.js';\nexport { default as SortFilterHeader } from './classes/SortFilterHeader.js';\nexport { default as SortFilterSubMenu } from './classes/SortFilterSubMenu.js';\nexport { default as StartAt } from './classes/StartAt.js';\nexport { default as StructuredDescriptionContent } from './classes/StructuredDescriptionContent.js';\nexport { default as StructuredDescriptionPlaylistLockup } from './classes/StructuredDescriptionPlaylistLockup.js';\nexport { default as SubFeedOption } from './classes/SubFeedOption.js';\nexport { default as SubFeedSelector } from './classes/SubFeedSelector.js';\nexport { default as SubscribeButton } from './classes/SubscribeButton.js';\nexport { default as SubscribeButtonView } from './classes/SubscribeButtonView.js';\nexport { default as SubscriptionNotificationToggleButton } from './classes/SubscriptionNotificationToggleButton.js';\nexport { default as Tab } from './classes/Tab.js';\nexport { default as Tabbed } from './classes/Tabbed.js';\nexport { default as TabbedSearchResults } from './classes/TabbedSearchResults.js';\nexport { default as TextCarouselItemView } from './classes/TextCarouselItemView.js';\nexport { default as TextFieldView } from './classes/TextFieldView.js';\nexport { default as TextHeader } from './classes/TextHeader.js';\nexport { default as ThirdPartyShareTargetSection } from './classes/ThirdPartyShareTargetSection.js';\nexport { default as ThumbnailBadgeView } from './classes/ThumbnailBadgeView.js';\nexport { default as ThumbnailBottomOverlayView } from './classes/ThumbnailBottomOverlayView.js';\nexport { default as ThumbnailHoverOverlayToggleActionsView } from './classes/ThumbnailHoverOverlayToggleActionsView.js';\nexport { default as ThumbnailHoverOverlayView } from './classes/ThumbnailHoverOverlayView.js';\nexport { default as ThumbnailLandscapePortrait } from './classes/ThumbnailLandscapePortrait.js';\nexport { default as ThumbnailOverlayBadgeView } from './classes/ThumbnailOverlayBadgeView.js';\nexport { default as ThumbnailOverlayBottomPanel } from './classes/ThumbnailOverlayBottomPanel.js';\nexport { default as ThumbnailOverlayEndorsement } from './classes/ThumbnailOverlayEndorsement.js';\nexport { default as ThumbnailOverlayHoverText } from './classes/ThumbnailOverlayHoverText.js';\nexport { default as ThumbnailOverlayInlineUnplayable } from './classes/ThumbnailOverlayInlineUnplayable.js';\nexport { default as ThumbnailOverlayLoadingPreview } from './classes/ThumbnailOverlayLoadingPreview.js';\nexport { default as ThumbnailOverlayNowPlaying } from './classes/ThumbnailOverlayNowPlaying.js';\nexport { default as ThumbnailOverlayPinking } from './classes/ThumbnailOverlayPinking.js';\nexport { default as ThumbnailOverlayPlaybackStatus } from './classes/ThumbnailOverlayPlaybackStatus.js';\nexport { default as ThumbnailOverlayProgressBarView } from './classes/ThumbnailOverlayProgressBarView.js';\nexport { default as ThumbnailOverlayResumePlayback } from './classes/ThumbnailOverlayResumePlayback.js';\nexport { default as ThumbnailOverlaySidePanel } from './classes/ThumbnailOverlaySidePanel.js';\nexport { default as ThumbnailOverlayTimeStatus } from './classes/ThumbnailOverlayTimeStatus.js';\nexport { default as ThumbnailOverlayToggleButton } from './classes/ThumbnailOverlayToggleButton.js';\nexport { default as ThumbnailView } from './classes/ThumbnailView.js';\nexport { default as TimedMarkerDecoration } from './classes/TimedMarkerDecoration.js';\nexport { default as TitleAndButtonListHeader } from './classes/TitleAndButtonListHeader.js';\nexport { default as ToggleButton } from './classes/ToggleButton.js';\nexport { default as ToggleButtonView } from './classes/ToggleButtonView.js';\nexport { default as ToggleFormField } from './classes/ToggleFormField.js';\nexport { default as ToggleMenuServiceItem } from './classes/ToggleMenuServiceItem.js';\nexport { default as Tooltip } from './classes/Tooltip.js';\nexport { default as TopicChannelDetails } from './classes/TopicChannelDetails.js';\nexport { default as Transcript } from './classes/Transcript.js';\nexport { default as TranscriptFooter } from './classes/TranscriptFooter.js';\nexport { default as TranscriptSearchBox } from './classes/TranscriptSearchBox.js';\nexport { default as TranscriptSearchPanel } from './classes/TranscriptSearchPanel.js';\nexport { default as TranscriptSectionHeader } from './classes/TranscriptSectionHeader.js';\nexport { default as TranscriptSegment } from './classes/TranscriptSegment.js';\nexport { default as TranscriptSegmentList } from './classes/TranscriptSegmentList.js';\nexport { default as TwoColumnBrowseResults } from './classes/TwoColumnBrowseResults.js';\nexport { default as TwoColumnSearchResults } from './classes/TwoColumnSearchResults.js';\nexport { default as TwoColumnWatchNextResults } from './classes/TwoColumnWatchNextResults.js';\nexport { default as UnifiedSharePanel } from './classes/UnifiedSharePanel.js';\nexport { default as UniversalWatchCard } from './classes/UniversalWatchCard.js';\nexport { default as UploadTimeFactoid } from './classes/UploadTimeFactoid.js';\nexport { default as UpsellDialog } from './classes/UpsellDialog.js';\nexport { default as VerticalList } from './classes/VerticalList.js';\nexport { default as VerticalWatchCardList } from './classes/VerticalWatchCardList.js';\nexport { default as Video } from './classes/Video.js';\nexport { default as VideoAttributesSectionView } from './classes/VideoAttributesSectionView.js';\nexport { default as VideoAttributeView } from './classes/VideoAttributeView.js';\nexport { default as VideoCard } from './classes/VideoCard.js';\nexport { default as VideoDescriptionCourseSection } from './classes/VideoDescriptionCourseSection.js';\nexport { default as VideoDescriptionHeader } from './classes/VideoDescriptionHeader.js';\nexport { default as VideoDescriptionInfocardsSection } from './classes/VideoDescriptionInfocardsSection.js';\nexport { default as VideoDescriptionMusicSection } from './classes/VideoDescriptionMusicSection.js';\nexport { default as VideoDescriptionTranscriptSection } from './classes/VideoDescriptionTranscriptSection.js';\nexport { default as VideoInfoCardContent } from './classes/VideoInfoCardContent.js';\nexport { default as VideoMetadataCarouselView } from './classes/VideoMetadataCarouselView.js';\nexport { default as VideoOwner } from './classes/VideoOwner.js';\nexport { default as VideoPrimaryInfo } from './classes/VideoPrimaryInfo.js';\nexport { default as VideoSecondaryInfo } from './classes/VideoSecondaryInfo.js';\nexport { default as VideoSummaryContentView } from './classes/VideoSummaryContentView.js';\nexport { default as VideoSummaryParagraphView } from './classes/VideoSummaryParagraphView.js';\nexport { default as VideoViewCount } from './classes/VideoViewCount.js';\nexport { default as ViewCountFactoid } from './classes/ViewCountFactoid.js';\nexport { default as WatchCardCompactVideo } from './classes/WatchCardCompactVideo.js';\nexport { default as WatchCardHeroVideo } from './classes/WatchCardHeroVideo.js';\nexport { default as WatchCardRichHeader } from './classes/WatchCardRichHeader.js';\nexport { default as WatchCardSectionSequence } from './classes/WatchCardSectionSequence.js';\nexport { default as WatchNextEndScreen } from './classes/WatchNextEndScreen.js';\nexport { default as WatchNextTabbedResults } from './classes/WatchNextTabbedResults.js';\nexport { default as YpcTrailer } from './classes/YpcTrailer.js';\nexport { default as AnchoredSection } from './classes/ytkids/AnchoredSection.js';\nexport { default as KidsBlocklistPicker } from './classes/ytkids/KidsBlocklistPicker.js';\nexport { default as KidsBlocklistPickerItem } from './classes/ytkids/KidsBlocklistPickerItem.js';\nexport { default as KidsCategoriesHeader } from './classes/ytkids/KidsCategoriesHeader.js';\nexport { default as KidsCategoryTab } from './classes/ytkids/KidsCategoryTab.js';\nexport { default as KidsHomeScreen } from './classes/ytkids/KidsHomeScreen.js';\n", "import type { ICache } from '../types/Cache.js';\nimport { Platform } from './Utils.js';\n\nexport default class UniversalCache implements ICache {\n #cache: ICache;\n constructor(persistent: boolean, persistent_directory?: string) {\n this.#cache = new Platform.shim.Cache(persistent, persistent_directory);\n }\n get cache_dir() {\n return this.#cache.cache_dir;\n }\n get(key: string) {\n return this.#cache.get(key);\n }\n set(key: string, value: ArrayBuffer) {\n return this.#cache.set(key, value);\n }\n remove(key: string) {\n return this.#cache.remove(key);\n }\n}", "import { Platform } from './Utils.js';\n\nexport default class EventEmitterLike extends EventTarget {\n #legacy_listeners = new Map<(...args: any[]) => void, EventListener>();\n\n constructor() {\n super();\n }\n\n emit(type: string, ...args: any[]) {\n const event = new Platform.shim.CustomEvent(type, { detail: args });\n this.dispatchEvent(event);\n }\n\n on(type: string, listener: (...args: any[]) => void) {\n const wrapper: EventListener = (ev) => {\n if (ev instanceof Platform.shim.CustomEvent) {\n listener(...ev.detail);\n } else {\n listener(ev);\n }\n };\n this.#legacy_listeners.set(listener, wrapper);\n this.addEventListener(type, wrapper);\n }\n\n once(type: string, listener: (...args: any[]) => void) {\n const wrapper: EventListener = (ev) => {\n if (ev instanceof Platform.shim.CustomEvent) {\n listener(...ev.detail);\n } else {\n listener(ev);\n }\n this.off(type, listener);\n };\n this.#legacy_listeners.set(listener, wrapper);\n this.addEventListener(type, wrapper);\n }\n\n off(type: string, listener: (...args: any[]) => void) {\n const wrapper = this.#legacy_listeners.get(listener);\n if (wrapper) {\n this.removeEventListener(type, wrapper);\n this.#legacy_listeners.delete(listener);\n }\n }\n}", "import * as Constants from './Constants.js';\nimport { InnertubeError, Platform, streamToIterable } from './Utils.js';\n\nimport type Player from '../core/Player.js';\nimport type Actions from '../core/Actions.js';\nimport type Format from '../parser/classes/misc/Format.js';\nimport type { IPlayabilityStatus, IStreamingData } from '../parser/index.js';\nimport type { DownloadOptions, FormatOptions } from '../types/index.js';\n\nexport async function download(\n options: DownloadOptions,\n actions: Actions,\n playability_status?: IPlayabilityStatus,\n streaming_data?: IStreamingData,\n player?: Player,\n cpn?: string\n): Promise> {\n if (playability_status?.status === 'UNPLAYABLE')\n throw new InnertubeError('Video is unplayable', { error_type: 'UNPLAYABLE' });\n if (playability_status?.status === 'LOGIN_REQUIRED')\n throw new InnertubeError('Video is login required', { error_type: 'LOGIN_REQUIRED' });\n if (!streaming_data)\n throw new InnertubeError('Streaming data not available.', { error_type: 'NO_STREAMING_DATA' });\n\n const opts: DownloadOptions = {\n quality: '360p',\n type: 'video+audio',\n format: 'mp4',\n range: undefined,\n ...options\n };\n\n const format = chooseFormat(opts, streaming_data);\n const format_url = await format.decipher(player);\n\n // If we're not downloading the video in chunks, we just use fetch once.\n if (opts.type === 'video+audio' && !options.range) {\n const response = await actions.session.http.fetch_function(`${format_url}&cpn=${cpn}`, {\n method: 'GET',\n headers: Constants.STREAM_HEADERS,\n redirect: 'follow'\n });\n\n // Throw if the response is not 2xx\n if (!response.ok)\n throw new InnertubeError('The server responded with a non 2xx status code', { error_type: 'FETCH_FAILED', response });\n\n const body = response.body;\n\n if (!body)\n throw new InnertubeError('Could not get ReadableStream from fetch Response.', { error_type: 'FETCH_FAILED', response });\n\n return body;\n }\n\n // We need to download in chunks.\n\n const chunk_size = 1048576 * 10; // 10MB\n\n let chunk_start = (options.range ? options.range.start : 0);\n let chunk_end = (options.range ? options.range.end : chunk_size);\n let must_end = false;\n\n let cancel: AbortController;\n\n return new Platform.shim.ReadableStream({\n start() {\n },\n pull: async (controller) => {\n if (must_end) {\n controller.close();\n return;\n }\n\n if ((chunk_end >= (format.content_length ? format.content_length : 0)) || options.range) {\n must_end = true;\n }\n\n return new Promise(async (resolve, reject) => {\n try {\n cancel = new AbortController();\n\n const response = await actions.session.http.fetch_function(`${format_url}&cpn=${cpn}&range=${chunk_start}-${chunk_end || ''}`, {\n method: 'GET',\n headers: {\n ...Constants.STREAM_HEADERS\n // XXX: use YouTube's range parameter instead of a Range header.\n // Range: `bytes=${chunk_start}-${chunk_end}`\n },\n signal: cancel.signal\n });\n\n // Throw if the response is not 2xx\n if (!response.ok)\n throw new InnertubeError('The server responded with a non 2xx status code', {\n error_type: 'FETCH_FAILED',\n response\n });\n\n const body = response.body;\n\n if (!body)\n throw new InnertubeError('Could not get ReadableStream from fetch Response.', {\n error_type: 'FETCH_FAILED',\n response\n });\n\n for await (const chunk of streamToIterable(body)) {\n controller.enqueue(chunk);\n }\n\n chunk_start = chunk_end + 1;\n chunk_end += chunk_size;\n\n resolve();\n\n } catch (e: any) {\n reject(e);\n }\n });\n },\n async cancel(reason) {\n cancel.abort(reason);\n }\n }, {\n highWaterMark: 1, // TODO: better value?\n size(chunk) {\n return chunk.byteLength;\n }\n });\n}\n\n/**\n * Selects the format that best matches the given options.\n * @param options - Options\n * @param streaming_data - Streaming data\n */\nexport function chooseFormat(options: FormatOptions, streaming_data?: IStreamingData): Format {\n if (!streaming_data)\n throw new InnertubeError('Streaming data not available');\n\n const formats = [\n ...(streaming_data.formats || []),\n ...(streaming_data.adaptive_formats || [])\n ];\n \n if (options.itag) {\n const candidates = formats.filter((format) => format.itag === options.itag);\n if (!candidates.length)\n throw new InnertubeError('No matching formats found', { options });\n \n return candidates[0];\n }\n\n const requires_audio = options.type ? options.type.includes('audio') : true;\n const requires_video = options.type ? options.type.includes('video') : true;\n const language = options.language || 'original';\n const quality = options.quality || 'best';\n\n let best_width = -1;\n\n const is_best = [ 'best', 'bestefficiency' ].includes(quality);\n const use_most_efficient = quality !== 'best';\n\n let candidates = formats.filter((format) => {\n if (requires_audio && !format.has_audio)\n return false;\n if (requires_video && !format.has_video)\n return false;\n if (options.codec && !format.mime_type.includes(options.codec))\n return false;\n if (options.format !== 'any' && !format.mime_type.includes(options.format || 'mp4'))\n return false;\n if (!is_best && format.quality_label !== quality)\n return false;\n if (format.width && (best_width < format.width))\n best_width = format.width;\n return true;\n });\n\n if (!candidates.length)\n throw new InnertubeError('No matching formats found', { options });\n\n if (is_best && requires_video)\n candidates = candidates.filter((format) => format.width === best_width);\n\n if (requires_audio && !requires_video) {\n const audio_only = candidates.filter((format) => {\n if (language !== 'original') {\n return !format.has_video && !format.has_text && format.language === language;\n }\n return !format.has_video && !format.has_text && format.is_original;\n\n });\n if (audio_only.length > 0) {\n candidates = audio_only;\n }\n }\n\n if (use_most_efficient) {\n // Sort by bitrate (lower is better)\n candidates.sort((a, b) => a.bitrate - b.bitrate);\n } else {\n // Sort by bitrate (higher is better)\n candidates.sort((a, b) => b.bitrate - a.bitrate);\n }\n\n return candidates[0];\n}\n\nexport { toDash } from './DashManifest.js';\n", "/* eslint-disable @typescript-eslint/no-namespace */\ndeclare global {\n namespace JSX {\n interface IntrinsicElements {\n [key: string]: DashProps;\n }\n }\n}\n\nexport type DashChild = (DashNode | (DashNode | Promise) | Promise);\nexport interface DashProps {\n [key: string]: unknown,\n children?: DashChild[]\n}\n\nexport interface DashNode {\n type: string,\n props: DashProps,\n}\n\nconst XML_CHARACTER_MAP = {\n '&': '&',\n '\"': '"',\n '\\'': ''',\n '<': '<',\n '>': '>'\n} as const;\n\nfunction escapeXMLString(str: string) {\n return str.replace(/([&\"<>'])/g, (_, item: keyof typeof XML_CHARACTER_MAP) => {\n return XML_CHARACTER_MAP[item];\n });\n}\n\nfunction normalizeTag(tag: string) {\n return tag.charAt(0).toUpperCase() + tag.slice(1);\n}\n\nexport function createElement(\n tagNameOrFunction: string | ((props: DashProps) => DashNode | Promise),\n props: { [key: string] : unknown } | null | undefined,\n ...children: DashChild[]\n): DashNode | Promise {\n const normalizedChildren = children.flat();\n\n if (typeof tagNameOrFunction === 'function') {\n return tagNameOrFunction({ ...props, children: normalizedChildren });\n }\n\n return {\n type: normalizeTag(tagNameOrFunction),\n props: {\n ...props,\n children: normalizedChildren\n }\n };\n}\n\nexport async function renderElementToString(element: DashNode | string): Promise {\n if (typeof element === 'string')\n return escapeXMLString(element);\n\n let dom = `<${element.type}`;\n\n if (element.props) {\n for (const key of Object.keys(element.props)) {\n if (key !== 'children' && element.props[key] !== undefined) {\n dom += ` ${key}=\"${escapeXMLString(`${element.props[key]}`)}\"`;\n }\n }\n }\n\n if (element.props.children) {\n const children = await Promise.all((await Promise.all(element.props.children.flat())).flat().filter((child) => !!child).map((child) => renderElementToString(child)));\n if (children.length > 0) {\n dom += `>${children.join('')}`;\n return dom;\n }\n }\n\n return `${dom}/>`;\n}\n\nexport async function renderToString(root: DashNode | Promise) {\n const dom = await renderElementToString(await root);\n\n return `${dom}`;\n}\n\nexport function Fragment(props: DashProps) {\n return props.children;\n}\n", "import { YTNode } from '../helpers.js';\nimport type { RawNode } from '../index.js';\n\nexport interface StoryboardData {\n type: 'vod'\n template_url: string;\n thumbnail_width: number;\n thumbnail_height: number;\n thumbnail_count: number;\n interval: number;\n columns: number;\n rows: number;\n storyboard_count: number;\n}\n\nexport default class PlayerStoryboardSpec extends YTNode {\n static type = 'PlayerStoryboardSpec';\n\n boards: StoryboardData[];\n\n constructor(data: RawNode) {\n super();\n\n const parts = data.spec.split('|');\n const url = new URL(parts.shift());\n\n this.boards = parts.map((part: any, i: any) => {\n const [ thumbnail_width, thumbnail_height, thumbnail_count, columns, rows, interval, name, sigh ] = part.split('#');\n\n url.searchParams.set('sigh', sigh);\n\n const storyboard_count = Math.ceil(parseInt(thumbnail_count, 10) / (parseInt(columns, 10) * parseInt(rows, 10)));\n\n return {\n type: 'vod',\n template_url: url.toString().replace('$L', i).replace('$N', name),\n thumbnail_width: parseInt(thumbnail_width, 10),\n thumbnail_height: parseInt(thumbnail_height, 10),\n thumbnail_count: parseInt(thumbnail_count, 10),\n interval: parseInt(interval, 10),\n columns: parseInt(columns, 10),\n rows: parseInt(rows, 10),\n storyboard_count\n };\n });\n }\n}", "{\n \"name\": \"youtubei.js\",\n \"version\": \"17.0.1\",\n \"description\": \"A JavaScript client for YouTube's private API, known as InnerTube.\",\n \"type\": \"module\",\n \"types\": \"./dist/src/platform/lib.d.ts\",\n \"typesVersions\": {\n \"*\": {\n \"agnostic\": [\n \"./dist/src/platform/lib.d.ts\"\n ],\n \"web\": [\n \"./dist/src/platform/lib.d.ts\"\n ],\n \"react-native\": [\n \"./dist/src/platform/lib.d.ts\"\n ],\n \"web.bundle\": [\n \"./dist/src/platform/lib.d.ts\"\n ],\n \"web.bundle.min\": [\n \"./dist/src/platform/lib.d.ts\"\n ],\n \"cf-worker\": [\n \"./dist/src/platform/lib.d.ts\"\n ]\n }\n },\n \"exports\": {\n \".\": {\n \"deno\": \"./dist/src/platform/deno.js\",\n \"node\": {\n \"import\": \"./dist/src/platform/node.js\",\n \"default\": \"./dist/src/platform/node.js\"\n },\n \"types\": \"./dist/src/platform/lib.d.ts\",\n \"browser\": \"./dist/src/platform/web.js\",\n \"react-native\": \"./dist/src/platform/react-native.js\",\n \"default\": \"./dist/src/platform/web.js\"\n },\n \"./package.json\": \"./package.json\",\n \"./agnostic\": {\n \"types\": \"./dist/src/platform/lib.d.ts\",\n \"default\": \"./dist/src/platform/lib.js\"\n },\n \"./web\": {\n \"types\": \"./dist/src/platform/lib.d.ts\",\n \"default\": \"./dist/src/platform/web.js\"\n },\n \"./react-native\": {\n \"types\": \"./dist/src/platform/lib.d.ts\",\n \"default\": \"./dist/src/platform/react-native.js\"\n },\n \"./web.bundle\": {\n \"types\": \"./dist/src/platform/lib.d.ts\",\n \"default\": \"./bundle/browser.js\"\n },\n \"./cf-worker\": {\n \"types\": \"./dist/src/platform/lib.d.ts\",\n \"default\": \"./dist/src/platform/cf-worker.js\"\n }\n },\n \"author\": \"LuanRT (https://github.com/LuanRT)\",\n \"funding\": [\n \"https://github.com/sponsors/LuanRT\"\n ],\n \"contributors\": [\n \"Wykerd (https://github.com/wykerd/)\",\n \"MasterOfBob777 (https://github.com/MasterOfBob777)\",\n \"patrickkfkan (https://github.com/patrickkfkan)\",\n \"akkadaska (https://github.com/akkadaska)\",\n \"Absidue (https://github.com/absidue)\"\n ],\n \"scripts\": {\n \"test\": \"vitest run --reporter verbose\",\n \"lint\": \"eslint ./src\",\n \"lint:fix\": \"eslint --fix ./src\",\n \"clean:source-maps\": \"rimraf ./bundle/browser.js.map ./bundle/cf-worker.js.map ./bundle/react-native.js.map\",\n \"clean:build-output\": \"rimraf ./dist ./bundle/browser.js ./bundle/cf-worker.js ./bundle/react-native.js ./deno\",\n \"build\": \"npm run clean:build-output && npm run clean:source-maps && npm run build:parser-map && npm run build:esm && npm run bundle:browser && npm run bundle:cf-worker && npm run bundle:react-native\",\n \"build:esm\": \"tspc\",\n \"build:deno\": \"cpy ./src ./deno && cpy ./protos ./deno && esbuild ./src/utils/DashManifest.tsx --keep-names --format=esm --platform=neutral --target=es2020 --outfile=./deno/src/utils/DashManifest.js && cpy ./package.json ./deno && replace \\\".js';\\\" \\\".ts';\\\" ./deno -r && replace '.js\\\";' '.ts\\\";' ./deno -r && replace \\\"'./DashManifest.ts';\\\" \\\"'./DashManifest.js';\\\" ./deno -r && replace \\\"'jintr';\\\" \\\"'jsr:@luanrt/jintr';\\\" ./deno -r && replace \\\"@bufbuild/protobuf/wire\\\" \\\"https://esm.sh/@bufbuild/protobuf@2.0.0/wire\\\" ./deno -r\",\n \"build:proto\": \"rimraf ./protos/generated && node ./dev-scripts/generate-proto.mjs\",\n \"build:parser-map\": \"node ./dev-scripts/gen-parser-map.mjs\",\n \"bundle:browser\": \"esbuild ./dist/src/platform/web.js --banner:js=\\\"/* eslint-disable */\\\" --bundle --sourcemap --target=chrome70 --keep-names --format=esm --define:global=globalThis --conditions=module --outfile=./bundle/browser.js --platform=browser\",\n \"bundle:react-native\": \"esbuild ./dist/src/platform/react-native.js --bundle --sourcemap --target=es2020 --keep-names --format=esm --platform=neutral --define:global=globalThis --conditions=module --outfile=./bundle/react-native.js\",\n \"bundle:cf-worker\": \"esbuild ./dist/src/platform/cf-worker.js --banner:js=\\\"/* eslint-disable */\\\" --bundle --sourcemap --target=es2020 --keep-names --format=esm --define:global=globalThis --conditions=module --outfile=./bundle/cf-worker.js --platform=node\",\n \"build:docs\": \"typedoc\",\n \"prepare\": \"npm run build\",\n \"watch\": \"tspc --watch\"\n },\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+https://github.com/LuanRT/YouTube.js.git\"\n },\n \"files\": [\n \"dist/\",\n \"bundle/\",\n \"package.json\",\n \"README.md\",\n \"LICENSE\"\n ],\n \"license\": \"MIT\",\n \"dependencies\": {\n \"@bufbuild/protobuf\": \"^2.0.0\",\n \"meriyah\": \"^6.1.4\"\n },\n \"devDependencies\": {\n \"@eslint/js\": \"^9.37.0\",\n \"@types/estree\": \"^1.0.6\",\n \"@types/node\": \"^25.0.3\",\n \"@typescript-eslint/eslint-plugin\": \"^8.46.0\",\n \"@typescript-eslint/parser\": \"^8.46.0\",\n \"cpy-cli\": \"^6.0.0\",\n \"esbuild\": \"^0.25.6\",\n \"eslint\": \"^9.37.0\",\n \"globals\": \"^17.0.0\",\n \"replace\": \"^1.2.2\",\n \"rimraf\": \"^6.0.1\",\n \"ts-patch\": \"^3.0.2\",\n \"ts-proto\": \"^2.2.0\",\n \"typedoc\": \"^0.28.14\",\n \"typedoc-plugin-markdown\": \"^4.9.0\",\n \"typescript\": \"^5.9.3\",\n \"typescript-eslint\": \"^8.46.0\",\n \"vitest\": \"^3.2.4\"\n },\n \"bugs\": {\n \"url\": \"https://github.com/LuanRT/YouTube.js/issues\"\n },\n \"homepage\": \"https://github.com/LuanRT/YouTube.js#readme\",\n \"keywords\": [\n \"api\",\n \"youtube\",\n \"innertube\",\n \"livechat\",\n \"youtube-music\",\n \"ytdl\",\n \"youtube-studio\",\n \"downloader\",\n \"ytmusic\"\n ]\n}\n", "import type { StoryboardData } from '../parser/classes/PlayerStoryboardSpec.js';\nimport PlayerStoryboardSpec from '../parser/classes/PlayerStoryboardSpec.js';\nimport { getStringBetweenStrings, InnertubeError } from './Utils.js';\nimport * as Constants from './Constants.js';\nimport * as Log from './Log.js';\nimport packageInfo from '../../package.json' with { type: 'json' };\n\nimport type Actions from '../core/Actions.js';\nimport type Player from '../core/Player.js';\nimport type { LiveStoryboardData } from '../parser/classes/PlayerLiveStoryboardSpec.js';\nimport type { IStreamingData } from '../parser/index.js';\nimport type { Format } from '../parser/misc.js';\nimport type { PlayerLiveStoryboardSpec } from '../parser/nodes.js';\nimport type { FormatFilter, URLTransformer } from '../types/index.js';\nimport type { StreamingInfoOptions } from '../types/StreamingInfoOptions.js';\nimport type { CaptionTrackData } from '../parser/classes/PlayerCaptionsTracklist.js';\n\nconst TAG_ = 'StreamingInfo';\n\nexport interface StreamingInfo {\n getDuration(): Promise;\n audio_sets: AudioSet[];\n video_sets: VideoSet[];\n image_sets: ImageSet[];\n text_sets: TextSet[];\n}\n\nexport interface AudioSet {\n mime_type: string;\n language?: string;\n codecs?: string;\n audio_sample_rate?: number;\n track_name?: string;\n track_roles?: ('main' | 'dub' | 'description' | 'enhanced-audio-intelligibility' | 'alternate')[];\n channels?: number;\n drm_families?: string[];\n drm_track_type?: string;\n representations: AudioRepresentation[];\n}\n\nexport interface Range {\n start: number;\n end: number;\n}\n\nexport type SegmentInfo = {\n is_oft: false,\n is_post_live_dvr: false\n base_url: string;\n index_range: Range;\n init_range: Range;\n} | {\n is_oft: true,\n is_post_live_dvr: false\n getSegmentTemplate(): Promise\n} | {\n is_oft: false,\n is_post_live_dvr: true,\n getSegmentTemplate(): Promise\n}\n\nexport interface Segment {\n duration: number,\n repeat_count?: number\n}\n\nexport interface SegmentTemplate {\n init_url?: string,\n media_url: string,\n timeline: Segment[]\n}\n\nexport interface AudioRepresentation {\n uid: string;\n bitrate: number;\n codecs?: string;\n audio_sample_rate?: number;\n channels?: number;\n segment_info: SegmentInfo;\n}\n\nexport interface VideoSet {\n mime_type: string;\n color_info: ColorInfo;\n codecs?: string;\n fps?: number;\n drm_families?: string[];\n drm_track_type?: string;\n representations: VideoRepresentation[]\n}\n\nexport interface VideoRepresentation {\n uid: string;\n bitrate: number;\n width?: number;\n height?: number;\n fps?: number;\n codecs?: string;\n segment_info: SegmentInfo;\n}\n\nexport interface ColorInfo {\n primaries?: '1' | '9',\n transfer_characteristics?: '1' | '14' | '16' | '18',\n matrix_coefficients?: '1' | '14'\n}\n\nexport interface ImageSet {\n probable_mime_type: string;\n /**\n * Sometimes YouTube returns webp instead of jpg despite the file extension being jpg\n * So we need to update the mime type to reflect the actual mime type of the response\n */\n getMimeType(): Promise;\n representations: ImageRepresentation[]\n}\n\nexport interface ImageRepresentation {\n uid: string;\n getBitrate(): Promise;\n sheet_width: number;\n sheet_height: number;\n thumbnail_width: number;\n thumbnail_height: number;\n rows: number;\n columns: number;\n template_url: string;\n template_duration: number;\n getURL(n: number): string;\n}\n\nexport interface TextSet {\n mime_type: string;\n language: string;\n track_name: string;\n track_roles: ('caption' | 'dub')[];\n representation: TextRepresentation;\n}\n\nexport interface TextRepresentation {\n uid: string;\n base_url: string;\n}\n\ninterface PostLiveDvrInfo {\n duration: number,\n segment_count: number\n}\n\ninterface SharedPostLiveDvrInfo {\n item?: PostLiveDvrInfo\n}\n\ninterface DrcLabels {\n label_original: string;\n label_drc: string;\n label_drc_multiple: (audio_track_display_name: string) => string;\n}\n\ninterface VbLabels {\n label_original: string;\n label_vb: string;\n label_vb_multiple: (audio_track_display_name: string) => string;\n}\n\nfunction getFormatGroupings(formats: Format[], is_post_live_dvr: boolean) {\n const group_info = new Map();\n\n const has_multiple_audio_tracks = formats.some((fmt) => !!fmt.audio_track);\n\n for (const format of formats) {\n if (((!format.index_range || !format.init_range) && !format.is_type_otf && !is_post_live_dvr)) {\n continue;\n }\n\n const mime_type = format.mime_type.split(';')[0];\n\n // Codec without any profile or level information\n const just_codec = getStringBetweenStrings(format.mime_type, 'codecs=\"', '\"')?.split('.')[0];\n\n // HDR videos have both SDR and HDR vp9 formats, so we want to stick them in different groups\n const color_info = format.color_info ? Object.values(format.color_info).join('-') : '';\n\n const audio_track_id = format.audio_track?.id || '';\n\n const drc = format.is_drc ? 'drc' : '';\n const vb = format.is_vb ? 'vb' : '';\n\n const group_id = `${mime_type}-${just_codec}-${color_info}-${audio_track_id}-${drc}-${vb}`;\n\n if (!group_info.has(group_id)) {\n group_info.set(group_id, []);\n }\n group_info.get(group_id)?.push(format);\n }\n\n return {\n groups: Array.from(group_info.values()),\n has_multiple_audio_tracks\n };\n}\n\nfunction hoistCodecsIfPossible(formats: Format[], hoisted: string[]) {\n if (\n formats.length > 1 &&\n new Set(formats.map((format) => getStringBetweenStrings(format.mime_type, 'codecs=\"', '\"'))).size === 1\n ) {\n hoisted.push('codecs');\n return getStringBetweenStrings(formats[0].mime_type, 'codecs=\"', '\"');\n }\n}\n\nfunction hoistNumberAttributeIfPossible(\n formats: Format[],\n property: 'audio_sample_rate' | 'fps',\n hoisted: string[]\n) {\n if (formats.length > 1 && new Set(formats.map((format) => format.fps)).size === 1) {\n hoisted.push(property);\n return Number(formats[0][property]);\n }\n}\n\nfunction hoistAudioChannelsIfPossible(formats: Format[], hoisted: string[]) {\n if (formats.length > 1 && new Set(formats.map((format) => format.audio_channels || 2)).size === 1) {\n hoisted.push('AudioChannelConfiguration');\n return formats[0].audio_channels;\n }\n}\n\nasync function getOTFSegmentTemplate(url: string, actions: Actions): Promise {\n // Fetch the first segment as it contains the segment durations which we need to generate the manifest\n const response = await actions.session.http.fetch_function(`${url}&rn=0&sq=0`, {\n method: 'GET',\n headers: Constants.STREAM_HEADERS,\n redirect: 'follow'\n });\n\n // Example OTF video: https://www.youtube.com/watch?v=DJ8GQUNUXGM\n\n // There might have been redirects, if there were we want to write the resolved URL to the manifest\n // So that the player doesn't have to follow the redirects every time it requests a segment\n const resolved_url = response.url.replace('&rn=0', '').replace('&sq=0', '');\n\n // In this function we only need the segment durations and how often the durations are repeated\n // The segment count could be useful for other stuff though\n // The response body contains a lot of junk but the useful stuff looks like this:\n // Segment-Count: 922\\r\\n' +\n // 'Segment-Durations-Ms: 5120(r=920),3600,\\r\\n'\n const response_text = await response.text();\n\n const segment_duration_strings = getStringBetweenStrings(response_text, 'Segment-Durations-Ms:', '\\r\\n')?.split(',');\n\n if (!segment_duration_strings) {\n throw new InnertubeError('Failed to extract the segment durations from this OTF stream', { url });\n }\n\n const segment_durations = [];\n for (const segment_duration_string of segment_duration_strings) {\n const trimmed_segment_duration = segment_duration_string.trim();\n if (trimmed_segment_duration.length === 0) {\n continue;\n }\n\n let repeat_count;\n\n const repeat_count_string = getStringBetweenStrings(trimmed_segment_duration, '(r=', ')');\n if (repeat_count_string) {\n repeat_count = parseInt(repeat_count_string);\n }\n\n segment_durations.push({\n duration: parseInt(trimmed_segment_duration),\n repeat_count\n });\n }\n\n return {\n init_url: `${resolved_url}&sq=0`,\n media_url: `${resolved_url}&sq=$Number$`,\n timeline: segment_durations\n };\n}\n\nasync function getPostLiveDvrInfo(transformed_url: string, actions: Actions): Promise {\n const response = await actions.session.http.fetch_function(`${transformed_url}&rn=0&sq=0`, {\n method: 'HEAD',\n headers: Constants.STREAM_HEADERS,\n redirect: 'follow'\n });\n\n const duration_ms = parseInt(response.headers.get('X-Head-Time-Millis') || '');\n const segment_count = parseInt(response.headers.get('X-Head-Seqnum') || '');\n\n if (isNaN(duration_ms) || isNaN(segment_count)) {\n throw new InnertubeError('Failed to extract the duration or segment count for this Post Live DVR video');\n }\n\n return {\n duration: duration_ms / 1000,\n segment_count\n };\n}\n\nasync function getPostLiveDvrDuration(\n shared_post_live_dvr_info: SharedPostLiveDvrInfo,\n format: Format,\n url_transformer: URLTransformer,\n actions: Actions,\n player?: Player,\n cpn?: string\n) {\n if (!shared_post_live_dvr_info.item) {\n const url = new URL(await format.decipher(player));\n url.searchParams.set('cpn', cpn || '');\n\n const transformed_url = url_transformer(url).toString();\n\n shared_post_live_dvr_info.item = await getPostLiveDvrInfo(transformed_url, actions);\n }\n\n return shared_post_live_dvr_info.item.duration;\n}\n\nasync function getSegmentInfo(\n format: Format,\n url_transformer: URLTransformer,\n actions?: Actions,\n player?: Player,\n cpn?: string,\n shared_post_live_dvr_info?: SharedPostLiveDvrInfo,\n is_sabr?: boolean\n) {\n let transformed_url = '';\n\n if (is_sabr) {\n const formatKey = `${format.itag || ''}:${format.xtags || ''}`;\n transformed_url = `sabr://${format.has_video ? 'video' : 'audio'}?key=${formatKey}`;\n } else {\n const url = new URL(await format.decipher(player));\n url.searchParams.set('cpn', cpn || '');\n transformed_url = url_transformer(url).toString();\n }\n\n if (format.is_type_otf) {\n if (!actions)\n throw new InnertubeError('Unable to get segment durations for this OTF stream without an Actions instance', { format });\n\n const info: SegmentInfo = {\n is_oft: true,\n is_post_live_dvr: false,\n getSegmentTemplate() {\n return getOTFSegmentTemplate(transformed_url, actions);\n }\n };\n\n return info;\n }\n\n if (shared_post_live_dvr_info) {\n if (!actions) {\n throw new InnertubeError('Unable to get segment count for this Post Live DVR video without an Actions instance', { format });\n }\n\n const target_duration_dec = format.target_duration_dec;\n\n if (typeof target_duration_dec !== 'number') {\n throw new InnertubeError('Format is missing target_duration_dec', { format });\n }\n\n const info: SegmentInfo = {\n is_oft: false,\n is_post_live_dvr: true,\n async getSegmentTemplate(): Promise {\n if (!shared_post_live_dvr_info.item) {\n shared_post_live_dvr_info.item = await getPostLiveDvrInfo(transformed_url, actions);\n }\n\n return {\n media_url: `${transformed_url}&sq=$Number$`,\n timeline: [\n {\n duration: target_duration_dec * 1000,\n repeat_count: shared_post_live_dvr_info.item.segment_count\n }\n ]\n };\n }\n };\n\n return info;\n }\n\n if (!format.index_range || !format.init_range)\n throw new InnertubeError('Index and init ranges not available', { format });\n\n const info: SegmentInfo = {\n is_oft: false,\n is_post_live_dvr: false,\n base_url: transformed_url,\n index_range: format.index_range,\n init_range: format.init_range\n };\n\n return info;\n}\n\nasync function getAudioRepresentation(\n format: Format,\n hoisted: string[],\n url_transformer: URLTransformer,\n actions?: Actions,\n player?: Player,\n cpn?: string,\n shared_post_live_dvr_info?: SharedPostLiveDvrInfo,\n is_sabr?: boolean\n) {\n const uid_parts = [ format.itag.toString() ];\n\n if (format.audio_track) {\n uid_parts.push(format.audio_track.id);\n }\n\n if (format.is_drc) {\n uid_parts.push('drc');\n }\n\n if (format.is_vb) {\n uid_parts.push('vb');\n }\n\n const rep: AudioRepresentation = {\n uid: uid_parts.join('-'),\n bitrate: format.bitrate,\n codecs: !hoisted.includes('codecs') ? getStringBetweenStrings(format.mime_type, 'codecs=\"', '\"') : undefined,\n audio_sample_rate: !hoisted.includes('audio_sample_rate') ? format.audio_sample_rate : undefined,\n channels: !hoisted.includes('AudioChannelConfiguration') ? format.audio_channels || 2 : undefined,\n segment_info: await getSegmentInfo(format, url_transformer, actions, player, cpn, shared_post_live_dvr_info, is_sabr)\n };\n\n return rep;\n}\n\nfunction getTrackRoles(format: Format, has_drc_streams: boolean) {\n if (!format.audio_track && !has_drc_streams) {\n return;\n }\n\n const roles: ('main' | 'dub' | 'description' | 'enhanced-audio-intelligibility' | 'alternate')[] = [\n format.is_original ? 'main' : 'alternate'\n ];\n\n if (format.is_dubbed || format.is_auto_dubbed)\n roles.push('dub');\n\n if (format.is_descriptive)\n roles.push('description');\n\n if (format.is_drc || format.is_vb)\n roles.push('enhanced-audio-intelligibility');\n\n return roles;\n}\n\nasync function getAudioSet(\n formats: Format[],\n url_transformer: URLTransformer,\n actions?: Actions,\n player?: Player,\n cpn?: string,\n shared_post_live_dvr_info?: SharedPostLiveDvrInfo,\n drc_labels?: DrcLabels,\n vb_labels?: VbLabels,\n is_sabr?: boolean\n) {\n const first_format = formats[0];\n const { audio_track } = first_format;\n const hoisted: string[] = [];\n\n const has_drc_streams = !!drc_labels;\n const has_vb_streams = !!vb_labels;\n\n let track_name;\n\n if (audio_track) {\n if (has_drc_streams && first_format.is_drc) {\n track_name = drc_labels.label_drc_multiple(audio_track.display_name);\n } else if (has_vb_streams && first_format.is_vb) {\n track_name = vb_labels.label_vb_multiple(audio_track.display_name);\n } else {\n track_name = audio_track.display_name;\n }\n } else if (has_drc_streams || has_vb_streams) {\n if (has_drc_streams && first_format.is_drc) {\n track_name = drc_labels.label_drc;\n } else if (has_vb_streams && first_format.is_vb) {\n track_name = vb_labels.label_vb;\n } else {\n // Both use the same param, so it doesn't matter which one is defined here.\n track_name = (drc_labels || vb_labels)?.label_original;\n }\n }\n\n const set: AudioSet = {\n mime_type: first_format.mime_type.split(';')[0],\n language: first_format.language ?? undefined,\n codecs: hoistCodecsIfPossible(formats, hoisted),\n audio_sample_rate: hoistNumberAttributeIfPossible(formats, 'audio_sample_rate', hoisted),\n track_name,\n track_roles: getTrackRoles(first_format, has_drc_streams),\n channels: hoistAudioChannelsIfPossible(formats, hoisted),\n drm_families: first_format.drm_families,\n drm_track_type: first_format.drm_track_type,\n representations: await Promise.all(formats.map((format) => getAudioRepresentation(format, hoisted, url_transformer, actions, player, cpn, shared_post_live_dvr_info, is_sabr)))\n };\n\n return set;\n}\n\nconst COLOR_PRIMARIES: Record = {\n BT709: '1',\n BT2020: '9'\n};\n\nconst COLOR_TRANSFER_CHARACTERISTICS: Record = {\n BT709: '1',\n BT2020_10: '14',\n SMPTEST2084: '16',\n ARIB_STD_B67: '18'\n};\n\n// This list is incomplete, as the player.js doesn't currently have any code for matrix coefficients,\n// So it doesn't have a list like with the other two, so this is just based on what we've seen in responses\nconst COLOR_MATRIX_COEFFICIENTS: Record = {\n BT709: '1',\n BT2020_NCL: '14'\n};\n\nfunction getColorInfo(format: Format) {\n // Section 5.5 Video source metadata signalling https://dashif.org/docs/IOP-Guidelines/DASH-IF-IOP-Part7-v5.0.0.pdf\n // Section 8 Video code points https://www.itu.int/rec/T-REC-H.273-202107-I/en\n // The player.js file was also helpful\n\n const color_info = format.color_info;\n let primaries;\n let transfer_characteristics;\n let matrix_coefficients;\n\n if (color_info) {\n if (color_info.primaries) {\n primaries = COLOR_PRIMARIES[color_info.primaries];\n }\n\n if (color_info.transfer_characteristics) {\n transfer_characteristics = COLOR_TRANSFER_CHARACTERISTICS[color_info.transfer_characteristics];\n }\n\n if (color_info.matrix_coefficients) {\n matrix_coefficients = COLOR_MATRIX_COEFFICIENTS[color_info.matrix_coefficients];\n\n if (!matrix_coefficients) {\n const url = new URL(format.url as string);\n\n const anonymisedFormat = JSON.parse(JSON.stringify(format));\n anonymisedFormat.url = 'REDACTED';\n anonymisedFormat.signature_cipher = 'REDACTED';\n anonymisedFormat.cipher = 'REDACTED';\n\n Log.warn(TAG_, `Unknown matrix coefficients \"${color_info.matrix_coefficients}\". The DASH manifest is still usable without this.\\n`\n + `Please report it at ${packageInfo.bugs.url} so we can add support for it.\\n`\n + `InnerTube client: ${url.searchParams.get('c')}\\nformat:`, anonymisedFormat);\n }\n }\n } else if (getStringBetweenStrings(format.mime_type, 'codecs=\"', '\"')?.startsWith('avc1')) {\n // YouTube's h264 streams always seem to be SDR, so this is a pretty safe bet.\n transfer_characteristics = COLOR_TRANSFER_CHARACTERISTICS.BT709;\n }\n\n const info: ColorInfo = {\n primaries,\n transfer_characteristics,\n matrix_coefficients\n };\n\n return info;\n}\n\nasync function getVideoRepresentation(\n format: Format,\n url_transformer: URLTransformer,\n hoisted: string[],\n player?: Player,\n actions?: Actions,\n cpn?: string,\n shared_post_live_dvr_info?: SharedPostLiveDvrInfo,\n is_sabr?: boolean\n) {\n const rep: VideoRepresentation = {\n uid: format.itag.toString(),\n bitrate: format.bitrate,\n width: format.width,\n height: format.height,\n codecs: !hoisted.includes('codecs') ? getStringBetweenStrings(format.mime_type, 'codecs=\"', '\"') : undefined,\n fps: !hoisted.includes('fps') ? format.fps : undefined,\n segment_info: await getSegmentInfo(format, url_transformer, actions, player, cpn, shared_post_live_dvr_info, is_sabr)\n };\n\n return rep;\n}\n\nasync function getVideoSet(\n formats: Format[],\n url_transformer: URLTransformer,\n player?: Player,\n actions?: Actions,\n cpn?: string,\n shared_post_live_dvr_info?: SharedPostLiveDvrInfo,\n is_sabr?: boolean\n) {\n const first_format = formats[0];\n const color_info = getColorInfo(first_format);\n const hoisted: string[] = [];\n\n const set: VideoSet = {\n mime_type: first_format.mime_type.split(';')[0],\n color_info,\n codecs: hoistCodecsIfPossible(formats, hoisted),\n fps: hoistNumberAttributeIfPossible(formats, 'fps', hoisted),\n drm_families: first_format.drm_families,\n drm_track_type: first_format.drm_track_type,\n representations: await Promise.all(formats.map((format) => getVideoRepresentation(format, url_transformer, hoisted, player, actions, cpn, shared_post_live_dvr_info, is_sabr)))\n };\n\n return set;\n}\n\nfunction getStoryboardInfo(\n storyboards: PlayerStoryboardSpec | PlayerLiveStoryboardSpec\n) {\n // Can't seem to combine the types in the Map, so create an alias here\n type AnyStoryboardData = StoryboardData | LiveStoryboardData\n\n const mime_info = new Map();\n\n const boards = storyboards.is(PlayerStoryboardSpec) ? storyboards.boards : [ storyboards.board ];\n\n for (const storyboard of boards) {\n const extension = new URL(storyboard.template_url).pathname.split('.').pop();\n\n const mime_type = `image/${extension === 'jpg' ? 'jpeg' : extension}`;\n\n if (!mime_info.has(mime_type)) {\n mime_info.set(mime_type, []);\n }\n mime_info.get(mime_type)?.push(storyboard);\n }\n\n return mime_info;\n}\n\ninterface SharedStoryboardResponse {\n response?: Promise\n}\n\nasync function getStoryboardMimeType(\n actions: Actions,\n board: StoryboardData | LiveStoryboardData,\n transform_url: URLTransformer,\n probable_mime_type: string,\n shared_response: SharedStoryboardResponse\n) {\n const url = board.template_url;\n\n const req_url = transform_url(new URL(url.replace('$M', '0')));\n\n const res_promise = shared_response.response ? shared_response.response : actions.session.http.fetch_function(req_url, {\n method: 'HEAD',\n headers: Constants.STREAM_HEADERS\n });\n\n shared_response.response = res_promise;\n\n const res = await res_promise;\n\n return res.headers.get('Content-Type') || probable_mime_type;\n}\n\nasync function getStoryboardBitrate(\n actions: Actions,\n board: StoryboardData | LiveStoryboardData,\n shared_response: SharedStoryboardResponse\n) {\n const url = board.template_url;\n\n const response_promises: Promise[] = [];\n\n // Set a limit so we don't take forever for long videos\n const request_limit = Math.min(board.type === 'vod' ? board.storyboard_count : 5, 10);\n for (let i = 0; i < request_limit; i++) {\n const req_url = new URL(url.replace('$M', i.toString()));\n\n const response_promise =\n i === 0 && shared_response.response ?\n shared_response.response :\n actions.session.http.fetch_function(req_url, {\n method: 'HEAD',\n headers: Constants.STREAM_HEADERS\n });\n\n if (i === 0)\n shared_response.response = response_promise;\n\n response_promises.push(response_promise);\n }\n\n // Run the requests in parallel to avoid causing too much delay\n const responses = await Promise.all(response_promises);\n\n const content_lengths = [];\n\n for (const response of responses) {\n content_lengths.push(parseInt(response.headers.get('Content-Length') || '0'));\n }\n\n // This is a rough estimate, so it probably won't reflect that actual peak bitrate\n // Hopefully it's close enough, because figuring out the actual peak bitrate would require downloading and analysing all storyboard tiles\n return Math.ceil((Math.max(...content_lengths) / (board.rows * board.columns)) * 8);\n}\n\nfunction getImageRepresentation(\n duration: number,\n actions: Actions,\n board: StoryboardData | LiveStoryboardData,\n transform_url: URLTransformer,\n shared_response: SharedStoryboardResponse\n) {\n const url = board.template_url;\n const template_url = new URL(url.replace('$M', '$Number$'));\n\n let template_duration;\n\n if (board.type === 'vod') {\n // Here duration is the duration of the video\n template_duration = duration / board.storyboard_count;\n } else {\n // Here duration is the duration of one of the video/audio segments,\n // As there is one tile per segment, we need to multiply it by the number of tiles\n template_duration = duration * board.columns * board.rows;\n }\n\n const rep: ImageRepresentation = {\n uid: `thumbnails_${board.thumbnail_width}x${board.thumbnail_height}`,\n getBitrate() {\n return getStoryboardBitrate(actions, board, shared_response);\n },\n sheet_width: board.thumbnail_width * board.columns,\n sheet_height: board.thumbnail_height * board.rows,\n thumbnail_height: board.thumbnail_height,\n thumbnail_width: board.thumbnail_width,\n rows: board.rows,\n columns: board.columns,\n template_duration: Math.round(template_duration),\n template_url: transform_url(template_url).toString(),\n getURL(n) {\n return template_url.toString().replace('$Number$', n.toString());\n }\n };\n\n return rep;\n}\n\nfunction getImageSets(\n duration: number,\n actions: Actions,\n storyboards: PlayerStoryboardSpec | PlayerLiveStoryboardSpec,\n transform_url: URLTransformer\n) {\n const mime_info = getStoryboardInfo(storyboards);\n\n const shared_response: SharedStoryboardResponse = {};\n\n return Array.from(mime_info.entries()).map(([ type, boards ]) => ({\n probable_mime_type: type,\n getMimeType() {\n return getStoryboardMimeType(actions, boards[0], transform_url, type, shared_response);\n },\n representations: boards.map((board) => getImageRepresentation(duration, actions, board, transform_url, shared_response))\n }));\n}\n\nfunction getTextSets(\n caption_tracks: CaptionTrackData[],\n format: 'vtt' | 'ttml',\n transform_url: URLTransformer\n): TextSet[] {\n const mime_type = format === 'vtt' ? 'text/vtt' : 'application/ttml+xml';\n\n return caption_tracks.map((caption_track) => {\n const url = new URL(caption_track.base_url);\n url.searchParams.set('fmt', format);\n\n const track_roles: ('caption' | 'dub')[] = [ 'caption' ];\n\n if (url.searchParams.has('tlang')) {\n track_roles.push('dub');\n }\n\n return {\n mime_type,\n language: caption_track.language_code,\n track_name: caption_track.name.toString(),\n track_roles,\n representation: {\n uid: `text-${caption_track.vss_id}`,\n base_url: transform_url(url).toString()\n }\n };\n });\n}\n\nexport async function getStreamingInfo(\n streaming_data?: IStreamingData,\n is_post_live_dvr = false,\n url_transformer: URLTransformer = (url) => url,\n format_filter?: FormatFilter,\n cpn?: string,\n player?: Player,\n actions?: Actions,\n storyboards?: PlayerStoryboardSpec | PlayerLiveStoryboardSpec,\n caption_tracks?: CaptionTrackData[],\n options?: StreamingInfoOptions\n) {\n if (!streaming_data)\n throw new InnertubeError('Streaming data not available');\n\n const formats = format_filter ?\n streaming_data.adaptive_formats.filter((fmt) => !format_filter(fmt)) :\n streaming_data.adaptive_formats;\n\n let getDuration;\n let shared_post_live_dvr_info: SharedPostLiveDvrInfo | undefined;\n\n if (is_post_live_dvr) {\n shared_post_live_dvr_info = {};\n\n if (!actions) {\n throw new InnertubeError('Unable to get duration or segment count for this Post Live DVR video without an Actions instance');\n }\n\n getDuration = () => {\n // Should never happen, as we set it just a few lines above, but this stops TypeScript complaining\n if (!shared_post_live_dvr_info) {\n return Promise.resolve(0);\n }\n\n return getPostLiveDvrDuration(shared_post_live_dvr_info, formats[0], url_transformer, actions, player, cpn);\n };\n } else {\n const duration = formats[0].approx_duration_ms / 1000;\n\n getDuration = () => Promise.resolve(duration);\n }\n\n const {\n groups,\n has_multiple_audio_tracks\n } = getFormatGroupings(formats, is_post_live_dvr);\n\n const {\n video_groups,\n audio_groups\n } = groups.reduce((acc, formats) => {\n if (formats[0].has_audio) {\n // Some videos with multiple audio tracks, have a broken one, that doesn't have any audio track information\n // It seems to be the same as default audio track but broken\n // We want to ignore it, as it messes up audio track selection in players and YouTube ignores it too\n // At the time of writing, this video has a broken audio track: https://youtu.be/UJeSWbR6W04\n if (has_multiple_audio_tracks && !formats[0].audio_track)\n return acc;\n\n acc.audio_groups.push(formats);\n return acc;\n }\n\n acc.video_groups.push(formats);\n\n return acc;\n }, {\n video_groups: [] as Format[][],\n audio_groups: [] as Format[][]\n });\n\n let drc_labels: DrcLabels | undefined;\n let vb_labels: VbLabels | undefined;\n\n let hasDrc = false;\n let hasVb = false;\n\n for (const ag of audio_groups.flat()) {\n if (hasDrc === false && ag.is_drc) {\n hasDrc = true;\n }\n\n if (hasVb === false && ag.is_vb) {\n hasVb = true;\n }\n }\n\n // TODO: Put these audio fields in a shared object to reduce dups.\n if (hasDrc) {\n drc_labels = {\n label_original: options?.label_original || 'Original',\n label_drc: options?.label_drc || 'Stable Volume',\n label_drc_multiple: options?.label_drc_multiple || ((display_name) => `${display_name} (Stable Volume)`)\n };\n }\n\n if (hasVb) {\n vb_labels = {\n label_original: options?.label_original || 'Original',\n label_vb: options?.label_vb || 'Voice Boost',\n label_vb_multiple: options?.label_vb_multiple || ((display_name) => `${display_name} (Voice Boost)`)\n };\n }\n\n const audio_sets = await Promise.all(audio_groups.map((formats) => getAudioSet(formats, url_transformer, actions, player, cpn, shared_post_live_dvr_info, drc_labels, vb_labels, options?.is_sabr)));\n\n const video_sets = await Promise.all(video_groups.map((formats) => getVideoSet(formats, url_transformer, player, actions, cpn, shared_post_live_dvr_info, options?.is_sabr)));\n\n let image_sets: ImageSet[] = [];\n\n // XXX: We need to make requests to get the image sizes, so we'll skip the storyboards if we don't have an Actions instance\n if (storyboards && actions) {\n let duration;\n\n if (storyboards.is(PlayerStoryboardSpec)) {\n duration = formats[0].approx_duration_ms / 1000;\n } else {\n const target_duration_dec = formats[0].target_duration_dec;\n if (target_duration_dec === undefined)\n throw new InnertubeError('Format is missing target_duration_dec', { format: formats[0] });\n duration = target_duration_dec;\n }\n\n image_sets = getImageSets(duration, actions, storyboards, url_transformer);\n }\n\n let text_sets: TextSet[] = [];\n\n if (caption_tracks && options?.captions_format) {\n if ((options.captions_format as string) !== 'vtt' && (options.captions_format as string) !== 'ttml') {\n throw new InnertubeError('Invalid captions format', options.captions_format);\n }\n text_sets = getTextSets(caption_tracks, options.captions_format, url_transformer);\n }\n\n const info: StreamingInfo = {\n getDuration,\n audio_sets,\n video_sets,\n image_sets,\n text_sets\n };\n\n return info;\n}\n", "/** @jsxFactory DashUtils.createElement */\n/** @jsxFragmentFactory DashUtils.Fragment */\nimport * as DashUtils from './DashUtils.js';\nimport { getStreamingInfo } from './StreamingInfo.js';\nimport { InnertubeError } from './Utils.js';\n\nimport type Actions from '../core/Actions.js';\nimport type Player from '../core/Player.js';\nimport type { IStreamingData } from '../parser/index.js';\nimport type { PlayerStoryboardSpec } from '../parser/nodes.js';\nimport type { SegmentInfo as FSegmentInfo } from './StreamingInfo.js';\nimport type { FormatFilter, URLTransformer } from '../types/index.js';\nimport type PlayerLiveStoryboardSpec from '../parser/classes/PlayerLiveStoryboardSpec.js';\nimport type { StreamingInfoOptions } from '../types/StreamingInfoOptions.js';\nimport type { CaptionTrackData } from '../parser/classes/PlayerCaptionsTracklist.js';\n\ninterface DashManifestProps {\n streamingData: IStreamingData;\n isPostLiveDvr: boolean;\n transformURL?: URLTransformer;\n rejectFormat?: FormatFilter;\n options?: StreamingInfoOptions,\n cpn?: string;\n player?: Player;\n actions?: Actions;\n storyboards?: PlayerStoryboardSpec | PlayerLiveStoryboardSpec;\n captionTracks?: CaptionTrackData[];\n}\n\nasync function OTFPostLiveDvrSegmentInfo({ info }: { info: FSegmentInfo }) {\n if (!info.is_oft && !info.is_post_live_dvr) return null;\n\n const template = await info.getSegmentTemplate();\n\n return \n \n {\n template.timeline.map((segment_duration) => (\n \n ))\n }\n \n ;\n}\n\nfunction SegmentInfo({ info }: { info: FSegmentInfo }) {\n if (info.is_oft || info.is_post_live_dvr) {\n return ;\n }\n return <>\n \n {info.base_url}\n \n \n \n \n ;\n}\n\nfunction getDrmSystemId(drm_family?: string): string | null {\n switch (drm_family) {\n case 'WIDEVINE':\n return 'edef8ba9-79d6-4ace-a3c8-27dcd51d21ed';\n case 'PLAYREADY':\n return '9a04f079-9840-4286-ab92-e65be0885f95'; \n default:\n return null;\n }\n}\n\nasync function DashManifest({\n streamingData,\n isPostLiveDvr,\n transformURL,\n rejectFormat,\n cpn,\n player,\n actions,\n storyboards,\n captionTracks,\n options\n}: DashManifestProps) {\n const {\n getDuration,\n audio_sets,\n video_sets,\n image_sets,\n text_sets\n } = await getStreamingInfo(streamingData, isPostLiveDvr, transformURL, rejectFormat, cpn, player, actions, storyboards, captionTracks, options);\n\n // XXX: DASH spec: https://standards.iso.org/ittf/PubliclyAvailableStandards/c083314_ISO_IEC%2023009-1_2022(en).zip\n\n return \n \n {\n audio_sets.map((set, index) => (\n \n {\n set.drm_families && set.drm_families.map((drm_family) => (\n \n ))\n }\n {\n set.track_roles && set.track_roles.map((role) => (\n \n ))\n }\n {\n set.track_name &&\n \n }\n {\n set.channels &&\n \n }\n {\n set.representations.map((rep) => (\n \n {\n rep.channels &&\n \n }\n \n \n ))\n }\n \n ))\n }\n {\n video_sets.map((set, index) => (\n \n {\n set.drm_families && set.drm_families.map((drm_family) => (\n \n ))\n }\n {\n set.color_info.primaries &&\n \n }\n {\n set.color_info.transfer_characteristics &&\n \n }\n {\n set.color_info.matrix_coefficients &&\n \n }\n {\n set.representations.map((rep) => (\n \n \n \n ))\n }\n \n ))\n }\n {\n image_sets.map(async (set, index) => {\n return \n {\n set.representations.map(async (rep) => (\n \n \n \n \n ))\n }\n ;\n })\n }\n {\n text_sets.map((set, index) => {\n return \n {\n set.track_roles.map((role) => (\n \n ))\n }\n \n \n \n {set.representation.base_url}\n \n \n ;\n })\n }\n \n ;\n}\n\nexport function toDash(\n streaming_data?: IStreamingData,\n is_post_live_dvr = false,\n url_transformer: URLTransformer = (url) => url,\n format_filter?: FormatFilter,\n cpn?: string,\n player?: Player,\n actions?: Actions,\n storyboards?: PlayerStoryboardSpec | PlayerLiveStoryboardSpec,\n caption_tracks?: CaptionTrackData[],\n options?: StreamingInfoOptions\n) {\n if (!streaming_data)\n throw new InnertubeError('Streaming data not available');\n\n return DashUtils.renderToString(\n \n );\n}", "import * as Constants from './Constants.js';\n\nimport {\n Platform,\n generateSidAuth,\n InnertubeError,\n getCookie\n} from './Utils.js';\n\nimport type { Context, Session } from '../core/index.js';\nimport type { FetchFunction } from '../types/index.js';\n\nexport interface HTTPClientInit {\n baseURL?: string;\n}\n\ninterface ProcessedJsonPayload {\n newBody: string;\n isWebKids: boolean;\n clientVersion?: string;\n clientNameId?: string;\n adjustedClientName: string;\n}\n\nexport default class HTTPClient {\n #session: Session;\n readonly #cookie?: string;\n readonly #fetch: FetchFunction;\n\n constructor(session: Session, cookie?: string, fetch?: FetchFunction) {\n this.#session = session;\n this.#cookie = cookie;\n this.#fetch = fetch || Platform.shim.fetch;\n }\n\n get fetch_function(): FetchFunction {\n return this.#fetch;\n }\n\n async fetch(\n input: URL | Request | string,\n init?: RequestInit & HTTPClientInit\n ): Promise {\n const session = this.#session;\n\n const innertube_url = Constants.URLS.API.PRODUCTION_1 + session.api_version;\n const baseURL = init?.baseURL || innertube_url;\n\n const request_url = typeof input === 'string'\n ? new URL(`${baseURL}${baseURL.endsWith('/') || input.startsWith('/') ? '' : '/'}${input}`)\n : input instanceof URL ? input : new URL(input.url, baseURL);\n\n const headers =\n init?.headers ||\n (input instanceof Platform.shim.Request ? input.headers : new Platform.shim.Headers()) ||\n new Platform.shim.Headers();\n\n const body = init?.body || (input instanceof Platform.shim.Request ? input.body : undefined);\n\n const request_headers = new Platform.shim.Headers(headers);\n\n this.#setupCommonHeaders(request_headers, session, request_url);\n\n request_url.searchParams.set('prettyPrint', 'false');\n request_url.searchParams.set('alt', 'json');\n\n const content_type = request_headers.get('Content-Type');\n\n let request_body = body;\n let is_web_kids = false;\n\n const is_innertube_req =\n baseURL === innertube_url ||\n baseURL === Constants.URLS.YT_UPLOAD;\n\n // Copy context into payload when possible\n if (content_type === 'application/json' && is_innertube_req && (typeof body === 'string')) {\n const {\n newBody,\n isWebKids: processedIsWebKids,\n clientVersion: processedClientVersion,\n clientNameId: processedClientNameId,\n adjustedClientName\n } = this.#processJsonPayload(body, session);\n\n request_body = newBody;\n is_web_kids = processedIsWebKids;\n\n if (processedClientVersion) {\n request_headers.set('X-Youtube-Client-Version', processedClientVersion);\n }\n if (processedClientNameId) {\n request_headers.set('X-Youtube-Client-Name', processedClientNameId);\n }\n\n if (adjustedClientName === Constants.CLIENTS.ANDROID.NAME || adjustedClientName === Constants.CLIENTS.YTMUSIC_ANDROID.NAME) {\n request_headers.set('User-Agent', Constants.CLIENTS.ANDROID.USER_AGENT);\n request_headers.set('X-GOOG-API-FORMAT-VERSION', '2');\n } else if (adjustedClientName === Constants.CLIENTS.IOS.NAME) {\n request_headers.set('User-Agent', Constants.CLIENTS.IOS.USER_AGENT);\n }\n } else if (content_type === 'application/x-protobuf') {\n // Assume it is always an Android request.\n if (Platform.shim.server) {\n request_headers.set('User-Agent', Constants.CLIENTS.ANDROID.USER_AGENT);\n request_headers.set('X-GOOG-API-FORMAT-VERSION', '2');\n request_headers.delete('X-Youtube-Client-Version');\n }\n }\n\n // Authenticate (NOTE: YouTube Kids does not support regular bearer tokens)\n if (session.logged_in && is_innertube_req && !is_web_kids) {\n const oauth = session.oauth;\n\n if (oauth.oauth2_tokens) {\n if (oauth.shouldRefreshToken()) {\n await oauth.refreshAccessToken();\n }\n\n request_headers.set('Authorization', `Bearer ${oauth.oauth2_tokens.access_token}`);\n }\n\n const cookie = this.#cookie;\n\n if (cookie) {\n const sapisid = getCookie(cookie, 'SAPISID');\n\n if (sapisid) {\n request_headers.set('Authorization', await generateSidAuth(sapisid));\n request_headers.set('X-Goog-Authuser', session.account_index.toString());\n if (session.context.user.onBehalfOfUser)\n request_headers.set('X-Goog-PageId', session.context.user.onBehalfOfUser);\n }\n\n request_headers.set('Cookie', cookie);\n }\n }\n\n const request = new Platform.shim.Request(request_url, input instanceof Platform.shim.Request ? input : init);\n\n const response = await this.#fetch(request, {\n body: request_body,\n headers: request_headers,\n redirect: input instanceof Platform.shim.Request ? input.redirect : init?.redirect || 'follow',\n ...(Platform.shim.runtime !== 'cf-worker' ? { credentials: 'include' } : {})\n });\n\n // Check if 2xx\n if (response.ok) {\n return response;\n }\n\n throw new InnertubeError(`Request to ${response.url} failed with status code ${response.status}`, await response.text());\n }\n\n #processJsonPayload(json_body: string, session: Session): ProcessedJsonPayload {\n const parsed_payload = JSON.parse(json_body);\n\n // Deep copy since we're going to be modifying it.\n const adjusted_context = JSON.parse(JSON.stringify(session.context)) as Context;\n this.#adjustContext(adjusted_context, parsed_payload.client);\n\n const new_payload = {\n ...parsed_payload,\n context: adjusted_context\n };\n\n const clientVersion = new_payload.context.client.clientVersion;\n const clientNameFromAdjustedContext = new_payload.context.client.clientName as keyof typeof Constants.CLIENT_NAME_IDS;\n const clientNameId = Constants.CLIENT_NAME_IDS[clientNameFromAdjustedContext];\n\n delete new_payload.client;\n\n const isWebKids = new_payload.context.client.clientName === Constants.CLIENTS.WEB_KIDS.NAME;\n\n return {\n newBody: JSON.stringify(new_payload),\n isWebKids,\n clientVersion,\n clientNameId,\n adjustedClientName: new_payload.context.client.clientName\n };\n }\n\n #setupCommonHeaders(request_headers: Headers, session: Session, request_url: URL): void {\n request_headers.set('Accept', '*/*');\n request_headers.set('Accept-Language', '*');\n request_headers.set('X-Goog-Visitor-Id', session.context.client.visitorData || '');\n request_headers.set('X-Youtube-Client-Version', session.context.client.clientVersion || '');\n\n const client_name_id = Constants.CLIENT_NAME_IDS[session.context.client.clientName as keyof typeof Constants.CLIENT_NAME_IDS];\n if (client_name_id) {\n request_headers.set('X-Youtube-Client-Name', client_name_id);\n }\n\n if (Platform.shim.server) {\n request_headers.set('User-Agent', session.user_agent || '');\n request_headers.set('Origin', request_url.origin);\n }\n }\n\n #adjustContext(ctx: Context, client?: string): void {\n if (!client)\n return;\n\n const clientName = client.toUpperCase();\n \n if (!Constants.SUPPORTED_CLIENTS.includes(clientName)) {\n throw new InnertubeError(`Invalid client: ${client}`, {\n available_innertube_clients: Constants.SUPPORTED_CLIENTS\n });\n }\n\n if (clientName !== 'WEB') {\n delete ctx.client.configInfo;\n }\n \n if (\n clientName === 'ANDROID' ||\n clientName === 'YTMUSIC_ANDROID' ||\n clientName === 'YTSTUDIO_ANDROID'\n ) {\n ctx.client.androidSdkVersion = Constants.CLIENTS.ANDROID.SDK_VERSION;\n ctx.client.userAgent = Constants.CLIENTS.ANDROID.USER_AGENT;\n ctx.client.osName = 'Android';\n ctx.client.osVersion = '13';\n ctx.client.platform = 'MOBILE';\n }\n\n switch (clientName) {\n case 'MWEB':\n ctx.client.clientVersion = Constants.CLIENTS.MWEB.VERSION;\n ctx.client.clientName = Constants.CLIENTS.MWEB.NAME;\n ctx.client.clientFormFactor = 'SMALL_FORM_FACTOR';\n ctx.client.platform = 'MOBILE';\n break;\n case 'IOS':\n ctx.client.deviceMake = 'Apple';\n ctx.client.deviceModel = Constants.CLIENTS.IOS.DEVICE_MODEL;\n ctx.client.clientVersion = Constants.CLIENTS.IOS.VERSION;\n ctx.client.clientName = Constants.CLIENTS.IOS.NAME;\n ctx.client.platform = 'MOBILE';\n ctx.client.osName = Constants.CLIENTS.IOS.OS_NAME;\n ctx.client.osVersion = Constants.CLIENTS.IOS.OS_VERSION;\n delete ctx.client.browserName;\n delete ctx.client.browserVersion;\n break;\n case 'YTMUSIC':\n ctx.client.clientVersion = Constants.CLIENTS.YTMUSIC.VERSION;\n ctx.client.clientName = Constants.CLIENTS.YTMUSIC.NAME;\n break;\n case 'ANDROID':\n ctx.client.clientVersion = Constants.CLIENTS.ANDROID.VERSION;\n ctx.client.clientFormFactor = 'SMALL_FORM_FACTOR';\n ctx.client.clientName = Constants.CLIENTS.ANDROID.NAME;\n break;\n case 'ANDROID_VR':\n ctx.client.androidSdkVersion = 32;\n ctx.client.osName = 'Android';\n ctx.client.osVersion = '12L';\n ctx.client.platform = 'MOBILE';\n ctx.client.userAgent = Constants.CLIENTS.ANDROID_VR.USER_AGENT;\n ctx.client.deviceMake = Constants.CLIENTS.ANDROID_VR.DEVICE_MAKE;\n ctx.client.deviceModel = Constants.CLIENTS.ANDROID_VR.DEVICE_MODEL;\n ctx.client.clientVersion = Constants.CLIENTS.ANDROID_VR.VERSION;\n ctx.client.clientFormFactor = 'SMALL_FORM_FACTOR';\n ctx.client.clientName = Constants.CLIENTS.ANDROID_VR.NAME;\n break;\n case 'YTMUSIC_ANDROID':\n ctx.client.clientVersion = Constants.CLIENTS.YTMUSIC_ANDROID.VERSION;\n ctx.client.clientFormFactor = 'SMALL_FORM_FACTOR';\n ctx.client.clientName = Constants.CLIENTS.YTMUSIC_ANDROID.NAME;\n break;\n case 'YTSTUDIO_ANDROID':\n ctx.client.clientVersion = Constants.CLIENTS.YTSTUDIO_ANDROID.VERSION;\n ctx.client.clientFormFactor = 'SMALL_FORM_FACTOR';\n ctx.client.clientName = Constants.CLIENTS.YTSTUDIO_ANDROID.NAME;\n break;\n case 'TV':\n ctx.client.clientVersion = Constants.CLIENTS.TV.VERSION;\n ctx.client.clientName = Constants.CLIENTS.TV.NAME;\n ctx.client.userAgent = Constants.CLIENTS.TV.USER_AGENT;\n break;\n case 'TV_SIMPLY':\n ctx.client.clientVersion = Constants.CLIENTS.TV_SIMPLY.VERSION;\n ctx.client.clientName = Constants.CLIENTS.TV_SIMPLY.NAME;\n break;\n case 'TV_EMBEDDED':\n ctx.client.clientName = Constants.CLIENTS.TV_EMBEDDED.NAME;\n ctx.client.clientVersion = Constants.CLIENTS.TV_EMBEDDED.VERSION;\n ctx.client.clientScreen = 'EMBED';\n ctx.thirdParty = { embedUrl: Constants.URLS.YT_BASE };\n break;\n case 'YTKIDS':\n ctx.client.clientVersion = Constants.CLIENTS.WEB_KIDS.VERSION;\n ctx.client.clientName = Constants.CLIENTS.WEB_KIDS.NAME;\n ctx.client.kidsAppInfo = { // @TODO: Make this configurable.\n categorySettings: {\n enabledCategories: [\n 'approved_for_you', 'black_joy', 'camp', 'collections', 'earth', 'explore',\n 'favorites', 'gaming', 'halloween', 'hero', 'learning', 'move', 'music',\n 'reading', 'shared_by_parents', 'shows', 'soccer', 'sports', 'spotlight', 'winter'\n ]\n },\n contentSettings: {\n corpusPreference: 'KIDS_CORPUS_PREFERENCE_YOUNGER',\n kidsNoSearchMode: 'YT_KIDS_NO_SEARCH_MODE_OFF'\n }\n };\n break;\n case 'WEB_EMBEDDED':\n ctx.client.clientName = Constants.CLIENTS.WEB_EMBEDDED.NAME;\n ctx.client.clientVersion = Constants.CLIENTS.WEB_EMBEDDED.VERSION;\n ctx.client.clientScreen = 'EMBED';\n ctx.thirdParty = { embedUrl: Constants.URLS.GOOGLE_SEARCH_BASE };\n break;\n case 'WEB_CREATOR':\n ctx.client.clientName = Constants.CLIENTS.WEB_CREATOR.NAME;\n ctx.client.clientVersion = Constants.CLIENTS.WEB_CREATOR.VERSION;\n break;\n default:\n break;\n }\n }\n}\n", "/**\n * Compresses a string using the LZW compression algorithm.\n * @param input - The data to compress.\n */\nexport function compress(input: string): string {\n const output: number[] = [];\n const dictionary: Record = {};\n\n for (let i = 0; i < 256; i++) {\n dictionary[String.fromCharCode(i)] = i;\n }\n\n let current_string = '';\n let dictionary_size = 256;\n\n for (let i = 0; i < input.length; i++) {\n const current_char = input[i];\n const combined_string = current_string + current_char;\n\n if (dictionary.hasOwnProperty(combined_string)) {\n current_string = combined_string;\n } else {\n output.push(dictionary[current_string]);\n dictionary[combined_string] = dictionary_size++;\n current_string = current_char;\n }\n }\n\n if (current_string !== '') {\n output.push(dictionary[current_string]);\n }\n\n return output.map((code) => String.fromCharCode(code)).join('');\n}\n\n/**\n * Decompresses data that was compressed using the LZW compression algorithm.\n * @param input - The data to be decompressed.\n */\nexport function decompress(input: string): string {\n const dictionary: Record = {};\n const input_data = input.split('');\n const output: string[] = [ input_data.shift() as string ];\n const input_length = input_data.length >>> 0; // Convert to unsigned 32-bit integer\n\n let dictionary_code = 256;\n let current_char = output[0];\n let current_string = current_char;\n\n for (let i = 0; i < input_length; ++i) {\n const current_code = input_data[i].charCodeAt(0);\n const entry =\n current_code < 256 ? input_data[i] : (dictionary[current_code] ?\n dictionary[current_code] : (current_string + current_char));\n\n output.push(entry);\n\n current_char = entry.charAt(0);\n dictionary[dictionary_code++] = current_string + current_char;\n current_string = entry;\n }\n\n return output.join('');\n}", "import { compress, decompress } from './LZW.js';\n\nexport const MAGIC_HEADER = 0x594254; // 'YTB' in hex...\nexport const VERSION = 1;\n\nexport function serialize(data: any): ArrayBuffer {\n const json_str = JSON.stringify(data);\n const compressed = compress(json_str);\n const compressed_bytes = new TextEncoder().encode(compressed);\n\n const buffer = new ArrayBuffer(12 + compressed_bytes.byteLength);\n const view = new DataView(buffer);\n\n view.setUint32(0, MAGIC_HEADER, true);\n view.setUint32(4, VERSION, true);\n view.setUint32(8, compressed_bytes.byteLength, true);\n\n new Uint8Array(buffer).set(compressed_bytes, 12);\n\n return buffer;\n}\n\nexport function deserialize(buffer: Uint8Array): T {\n if (buffer.byteLength < 12)\n throw new Error('Invalid binary format: buffer too short');\n\n const view = new DataView(buffer.buffer, buffer.byteOffset);\n\n const magic = view.getUint32(0, true);\n if (magic !== MAGIC_HEADER) {\n throw new Error('Invalid binary format: magic header mismatch');\n }\n\n const version = view.getUint32(4, true);\n if (version !== VERSION) {\n throw new Error(`Unsupported binary format version: ${version}`);\n }\n\n const data_length = view.getUint32(8, true);\n const compressed_data = buffer.slice(12, 12 + data_length);\n\n const compressed = new TextDecoder().decode(compressed_data);\n const json_str = decompress(compressed);\n\n return JSON.parse(json_str);\n}\n", "import { base64ToU8, u8ToBase64 } from './Utils.js';\nimport { NextParams, PeformCommentActionParams, VisitorData } from '../../protos/generated/misc/params.js';\n\nexport type CommentActionParamsArgs = {\n comment_id?: string,\n video_id?: string,\n text?: string,\n target_language?: string\n}\n\nexport function encodeVisitorData(id: string, timestamp: number): string {\n const writer = VisitorData.encode({ id, timestamp });\n return encodeURIComponent(u8ToBase64(writer.finish()).replace(/\\+/g, '-').replace(/\\//g, '_'));\n}\n\nexport function decodeVisitorData(visitor_data: string): VisitorData {\n return VisitorData.decode(base64ToU8(decodeURIComponent(visitor_data).replace(/-/g, '+').replace(/_/g, '/')));\n}\n\nexport function encodeCommentActionParams(type: number, args: CommentActionParamsArgs = {}): string {\n const data: PeformCommentActionParams = {\n type,\n commentId: args.comment_id || ' ',\n videoId: args.video_id || ' ',\n channelId: ' ',\n unkNum: 2\n };\n\n if (args.hasOwnProperty('text')) {\n if (typeof args.target_language !== 'string')\n throw new Error('target_language must be a string');\n\n if (args.comment_id)\n delete data.unkNum;\n\n data.translateCommentParams = {\n params: {\n comment: {\n text: args.text as string\n }\n },\n commentId: args.comment_id || ' ',\n targetLanguage: args.target_language\n };\n }\n\n const writer = PeformCommentActionParams.encode(data);\n return encodeURIComponent(u8ToBase64(writer.finish()));\n}\n\nexport function encodeNextParams(video_ids: string[], playlist_title?: string): string {\n const writer = NextParams.encode({ videoId: video_ids, playlistTitle: playlist_title });\n return encodeURIComponent(u8ToBase64(writer.finish()).replace(/\\+/g, '-').replace(/\\//g, '_'));\n}", "// Copyright 2008 Google Inc. All rights reserved.\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n// * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n// * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n// * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n// Code generated by the Protocol Buffer compiler is owned by the owner\n// of the input file used when generating it. This code is not\n// standalone and requires a support library to be linked with it. This\n// support library is itself covered by the above license.\n/**\n * Read a 64 bit varint as two JS numbers.\n *\n * Returns tuple:\n * [0]: low bits\n * [1]: high bits\n *\n * Copyright 2008 Google Inc. All rights reserved.\n *\n * See https://github.com/protocolbuffers/protobuf/blob/8a71927d74a4ce34efe2d8769fda198f52d20d12/js/experimental/runtime/kernel/buffer_decoder.js#L175\n */\nexport function varint64read() {\n let lowBits = 0;\n let highBits = 0;\n for (let shift = 0; shift < 28; shift += 7) {\n let b = this.buf[this.pos++];\n lowBits |= (b & 0x7f) << shift;\n if ((b & 0x80) == 0) {\n this.assertBounds();\n return [lowBits, highBits];\n }\n }\n let middleByte = this.buf[this.pos++];\n // last four bits of the first 32 bit number\n lowBits |= (middleByte & 0x0f) << 28;\n // 3 upper bits are part of the next 32 bit number\n highBits = (middleByte & 0x70) >> 4;\n if ((middleByte & 0x80) == 0) {\n this.assertBounds();\n return [lowBits, highBits];\n }\n for (let shift = 3; shift <= 31; shift += 7) {\n let b = this.buf[this.pos++];\n highBits |= (b & 0x7f) << shift;\n if ((b & 0x80) == 0) {\n this.assertBounds();\n return [lowBits, highBits];\n }\n }\n throw new Error(\"invalid varint\");\n}\n/**\n * Write a 64 bit varint, given as two JS numbers, to the given bytes array.\n *\n * Copyright 2008 Google Inc. All rights reserved.\n *\n * See https://github.com/protocolbuffers/protobuf/blob/8a71927d74a4ce34efe2d8769fda198f52d20d12/js/experimental/runtime/kernel/writer.js#L344\n */\nexport function varint64write(lo, hi, bytes) {\n for (let i = 0; i < 28; i = i + 7) {\n const shift = lo >>> i;\n const hasNext = !(shift >>> 7 == 0 && hi == 0);\n const byte = (hasNext ? shift | 0x80 : shift) & 0xff;\n bytes.push(byte);\n if (!hasNext) {\n return;\n }\n }\n const splitBits = ((lo >>> 28) & 0x0f) | ((hi & 0x07) << 4);\n const hasMoreBits = !(hi >> 3 == 0);\n bytes.push((hasMoreBits ? splitBits | 0x80 : splitBits) & 0xff);\n if (!hasMoreBits) {\n return;\n }\n for (let i = 3; i < 31; i = i + 7) {\n const shift = hi >>> i;\n const hasNext = !(shift >>> 7 == 0);\n const byte = (hasNext ? shift | 0x80 : shift) & 0xff;\n bytes.push(byte);\n if (!hasNext) {\n return;\n }\n }\n bytes.push((hi >>> 31) & 0x01);\n}\n// constants for binary math\nconst TWO_PWR_32_DBL = 0x100000000;\n/**\n * Parse decimal string of 64 bit integer value as two JS numbers.\n *\n * Copyright 2008 Google Inc. All rights reserved.\n *\n * See https://github.com/protocolbuffers/protobuf-javascript/blob/a428c58273abad07c66071d9753bc4d1289de426/experimental/runtime/int64.js#L10\n */\nexport function int64FromString(dec) {\n // Check for minus sign.\n const minus = dec[0] === \"-\";\n if (minus) {\n dec = dec.slice(1);\n }\n // Work 6 decimal digits at a time, acting like we're converting base 1e6\n // digits to binary. This is safe to do with floating point math because\n // Number.isSafeInteger(ALL_32_BITS * 1e6) == true.\n const base = 1e6;\n let lowBits = 0;\n let highBits = 0;\n function add1e6digit(begin, end) {\n // Note: Number('') is 0.\n const digit1e6 = Number(dec.slice(begin, end));\n highBits *= base;\n lowBits = lowBits * base + digit1e6;\n // Carry bits from lowBits to\n if (lowBits >= TWO_PWR_32_DBL) {\n highBits = highBits + ((lowBits / TWO_PWR_32_DBL) | 0);\n lowBits = lowBits % TWO_PWR_32_DBL;\n }\n }\n add1e6digit(-24, -18);\n add1e6digit(-18, -12);\n add1e6digit(-12, -6);\n add1e6digit(-6);\n return minus ? negate(lowBits, highBits) : newBits(lowBits, highBits);\n}\n/**\n * Losslessly converts a 64-bit signed integer in 32:32 split representation\n * into a decimal string.\n *\n * Copyright 2008 Google Inc. All rights reserved.\n *\n * See https://github.com/protocolbuffers/protobuf-javascript/blob/a428c58273abad07c66071d9753bc4d1289de426/experimental/runtime/int64.js#L10\n */\nexport function int64ToString(lo, hi) {\n let bits = newBits(lo, hi);\n // If we're treating the input as a signed value and the high bit is set, do\n // a manual two's complement conversion before the decimal conversion.\n const negative = bits.hi & 0x80000000;\n if (negative) {\n bits = negate(bits.lo, bits.hi);\n }\n const result = uInt64ToString(bits.lo, bits.hi);\n return negative ? \"-\" + result : result;\n}\n/**\n * Losslessly converts a 64-bit unsigned integer in 32:32 split representation\n * into a decimal string.\n *\n * Copyright 2008 Google Inc. All rights reserved.\n *\n * See https://github.com/protocolbuffers/protobuf-javascript/blob/a428c58273abad07c66071d9753bc4d1289de426/experimental/runtime/int64.js#L10\n */\nexport function uInt64ToString(lo, hi) {\n ({ lo, hi } = toUnsigned(lo, hi));\n // Skip the expensive conversion if the number is small enough to use the\n // built-in conversions.\n // Number.MAX_SAFE_INTEGER = 0x001FFFFF FFFFFFFF, thus any number with\n // highBits <= 0x1FFFFF can be safely expressed with a double and retain\n // integer precision.\n // Proven by: Number.isSafeInteger(0x1FFFFF * 2**32 + 0xFFFFFFFF) == true.\n if (hi <= 0x1fffff) {\n return String(TWO_PWR_32_DBL * hi + lo);\n }\n // What this code is doing is essentially converting the input number from\n // base-2 to base-1e7, which allows us to represent the 64-bit range with\n // only 3 (very large) digits. Those digits are then trivial to convert to\n // a base-10 string.\n // The magic numbers used here are -\n // 2^24 = 16777216 = (1,6777216) in base-1e7.\n // 2^48 = 281474976710656 = (2,8147497,6710656) in base-1e7.\n // Split 32:32 representation into 16:24:24 representation so our\n // intermediate digits don't overflow.\n const low = lo & 0xffffff;\n const mid = ((lo >>> 24) | (hi << 8)) & 0xffffff;\n const high = (hi >> 16) & 0xffff;\n // Assemble our three base-1e7 digits, ignoring carries. The maximum\n // value in a digit at this step is representable as a 48-bit integer, which\n // can be stored in a 64-bit floating point number.\n let digitA = low + mid * 6777216 + high * 6710656;\n let digitB = mid + high * 8147497;\n let digitC = high * 2;\n // Apply carries from A to B and from B to C.\n const base = 10000000;\n if (digitA >= base) {\n digitB += Math.floor(digitA / base);\n digitA %= base;\n }\n if (digitB >= base) {\n digitC += Math.floor(digitB / base);\n digitB %= base;\n }\n // If digitC is 0, then we should have returned in the trivial code path\n // at the top for non-safe integers. Given this, we can assume both digitB\n // and digitA need leading zeros.\n return (digitC.toString() +\n decimalFrom1e7WithLeadingZeros(digitB) +\n decimalFrom1e7WithLeadingZeros(digitA));\n}\nfunction toUnsigned(lo, hi) {\n return { lo: lo >>> 0, hi: hi >>> 0 };\n}\nfunction newBits(lo, hi) {\n return { lo: lo | 0, hi: hi | 0 };\n}\n/**\n * Returns two's compliment negation of input.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Bitwise_Operators#Signed_32-bit_integers\n */\nfunction negate(lowBits, highBits) {\n highBits = ~highBits;\n if (lowBits) {\n lowBits = ~lowBits + 1;\n }\n else {\n // If lowBits is 0, then bitwise-not is 0xFFFFFFFF,\n // adding 1 to that, results in 0x100000000, which leaves\n // the low bits 0x0 and simply adds one to the high bits.\n highBits += 1;\n }\n return newBits(lowBits, highBits);\n}\n/**\n * Returns decimal representation of digit1e7 with leading zeros.\n */\nconst decimalFrom1e7WithLeadingZeros = (digit1e7) => {\n const partial = String(digit1e7);\n return \"0000000\".slice(partial.length) + partial;\n};\n/**\n * Write a 32 bit varint, signed or unsigned. Same as `varint64write(0, value, bytes)`\n *\n * Copyright 2008 Google Inc. All rights reserved.\n *\n * See https://github.com/protocolbuffers/protobuf/blob/1b18833f4f2a2f681f4e4a25cdf3b0a43115ec26/js/binary/encoder.js#L144\n */\nexport function varint32write(value, bytes) {\n if (value >= 0) {\n // write value as varint 32\n while (value > 0x7f) {\n bytes.push((value & 0x7f) | 0x80);\n value = value >>> 7;\n }\n bytes.push(value);\n }\n else {\n for (let i = 0; i < 9; i++) {\n bytes.push((value & 127) | 128);\n value = value >> 7;\n }\n bytes.push(1);\n }\n}\n/**\n * Read an unsigned 32 bit varint.\n *\n * See https://github.com/protocolbuffers/protobuf/blob/8a71927d74a4ce34efe2d8769fda198f52d20d12/js/experimental/runtime/kernel/buffer_decoder.js#L220\n */\nexport function varint32read() {\n let b = this.buf[this.pos++];\n let result = b & 0x7f;\n if ((b & 0x80) == 0) {\n this.assertBounds();\n return result;\n }\n b = this.buf[this.pos++];\n result |= (b & 0x7f) << 7;\n if ((b & 0x80) == 0) {\n this.assertBounds();\n return result;\n }\n b = this.buf[this.pos++];\n result |= (b & 0x7f) << 14;\n if ((b & 0x80) == 0) {\n this.assertBounds();\n return result;\n }\n b = this.buf[this.pos++];\n result |= (b & 0x7f) << 21;\n if ((b & 0x80) == 0) {\n this.assertBounds();\n return result;\n }\n // Extract only last 4 bits\n b = this.buf[this.pos++];\n result |= (b & 0x0f) << 28;\n for (let readBytes = 5; (b & 0x80) !== 0 && readBytes < 10; readBytes++)\n b = this.buf[this.pos++];\n if ((b & 0x80) != 0)\n throw new Error(\"invalid varint\");\n this.assertBounds();\n // Result can have 32 bits, convert it to unsigned\n return result >>> 0;\n}\n", "// Copyright 2021-2026 Buf Technologies, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport { int64FromString, int64ToString, uInt64ToString, } from \"./wire/varint.js\";\n/**\n * Int64Support for the current environment.\n */\nexport const protoInt64 = /*@__PURE__*/ makeInt64Support();\nfunction makeInt64Support() {\n const dv = new DataView(new ArrayBuffer(8));\n // note that Safari 14 implements BigInt, but not the DataView methods\n const ok = typeof BigInt === \"function\" &&\n typeof dv.getBigInt64 === \"function\" &&\n typeof dv.getBigUint64 === \"function\" &&\n typeof dv.setBigInt64 === \"function\" &&\n typeof dv.setBigUint64 === \"function\" &&\n (!!globalThis.Deno ||\n typeof process != \"object\" ||\n typeof process.env != \"object\" ||\n process.env.BUF_BIGINT_DISABLE !== \"1\");\n if (ok) {\n const MIN = BigInt(\"-9223372036854775808\");\n const MAX = BigInt(\"9223372036854775807\");\n const UMIN = BigInt(\"0\");\n const UMAX = BigInt(\"18446744073709551615\");\n return {\n zero: BigInt(0),\n supported: true,\n parse(value) {\n const bi = typeof value == \"bigint\" ? value : BigInt(value);\n if (bi > MAX || bi < MIN) {\n throw new Error(`invalid int64: ${value}`);\n }\n return bi;\n },\n uParse(value) {\n const bi = typeof value == \"bigint\" ? value : BigInt(value);\n if (bi > UMAX || bi < UMIN) {\n throw new Error(`invalid uint64: ${value}`);\n }\n return bi;\n },\n enc(value) {\n dv.setBigInt64(0, this.parse(value), true);\n return {\n lo: dv.getInt32(0, true),\n hi: dv.getInt32(4, true),\n };\n },\n uEnc(value) {\n dv.setBigInt64(0, this.uParse(value), true);\n return {\n lo: dv.getInt32(0, true),\n hi: dv.getInt32(4, true),\n };\n },\n dec(lo, hi) {\n dv.setInt32(0, lo, true);\n dv.setInt32(4, hi, true);\n return dv.getBigInt64(0, true);\n },\n uDec(lo, hi) {\n dv.setInt32(0, lo, true);\n dv.setInt32(4, hi, true);\n return dv.getBigUint64(0, true);\n },\n };\n }\n return {\n zero: \"0\",\n supported: false,\n parse(value) {\n if (typeof value != \"string\") {\n value = value.toString();\n }\n assertInt64String(value);\n return value;\n },\n uParse(value) {\n if (typeof value != \"string\") {\n value = value.toString();\n }\n assertUInt64String(value);\n return value;\n },\n enc(value) {\n if (typeof value != \"string\") {\n value = value.toString();\n }\n assertInt64String(value);\n return int64FromString(value);\n },\n uEnc(value) {\n if (typeof value != \"string\") {\n value = value.toString();\n }\n assertUInt64String(value);\n return int64FromString(value);\n },\n dec(lo, hi) {\n return int64ToString(lo, hi);\n },\n uDec(lo, hi) {\n return uInt64ToString(lo, hi);\n },\n };\n}\nfunction assertInt64String(value) {\n if (!/^-?[0-9]+$/.test(value)) {\n throw new Error(\"invalid int64: \" + value);\n }\n}\nfunction assertUInt64String(value) {\n if (!/^[0-9]+$/.test(value)) {\n throw new Error(\"invalid uint64: \" + value);\n }\n}\n", "// Copyright 2021-2026 Buf Technologies, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nconst symbol = Symbol.for(\"@bufbuild/protobuf/text-encoding\");\n/**\n * Protobuf-ES requires the Text Encoding API to convert UTF-8 from and to\n * binary. This WHATWG API is widely available, but it is not part of the\n * ECMAScript standard. On runtimes where it is not available, use this\n * function to provide your own implementation.\n *\n * Note that the Text Encoding API does not provide a way to validate UTF-8.\n * Our implementation falls back to use encodeURIComponent().\n */\nexport function configureTextEncoding(textEncoding) {\n globalThis[symbol] = textEncoding;\n}\nexport function getTextEncoding() {\n if (globalThis[symbol] == undefined) {\n const te = new globalThis.TextEncoder();\n const td = new globalThis.TextDecoder();\n globalThis[symbol] = {\n encodeUtf8(text) {\n return te.encode(text);\n },\n decodeUtf8(bytes) {\n return td.decode(bytes);\n },\n checkUtf8(text) {\n try {\n encodeURIComponent(text);\n return true;\n }\n catch (_) {\n return false;\n }\n },\n };\n }\n return globalThis[symbol];\n}\n", "// Copyright 2021-2026 Buf Technologies, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport { varint32read, varint32write, varint64read, varint64write, } from \"./varint.js\";\nimport { protoInt64 } from \"../proto-int64.js\";\nimport { getTextEncoding } from \"./text-encoding.js\";\n/**\n * Protobuf binary format wire types.\n *\n * A wire type provides just enough information to find the length of the\n * following value.\n *\n * See https://developers.google.com/protocol-buffers/docs/encoding#structure\n */\nexport var WireType;\n(function (WireType) {\n /**\n * Used for int32, int64, uint32, uint64, sint32, sint64, bool, enum\n */\n WireType[WireType[\"Varint\"] = 0] = \"Varint\";\n /**\n * Used for fixed64, sfixed64, double.\n * Always 8 bytes with little-endian byte order.\n */\n WireType[WireType[\"Bit64\"] = 1] = \"Bit64\";\n /**\n * Used for string, bytes, embedded messages, packed repeated fields\n *\n * Only repeated numeric types (types which use the varint, 32-bit,\n * or 64-bit wire types) can be packed. In proto3, such fields are\n * packed by default.\n */\n WireType[WireType[\"LengthDelimited\"] = 2] = \"LengthDelimited\";\n /**\n * Start of a tag-delimited aggregate, such as a proto2 group, or a message\n * in editions with message_encoding = DELIMITED.\n */\n WireType[WireType[\"StartGroup\"] = 3] = \"StartGroup\";\n /**\n * End of a tag-delimited aggregate.\n */\n WireType[WireType[\"EndGroup\"] = 4] = \"EndGroup\";\n /**\n * Used for fixed32, sfixed32, float.\n * Always 4 bytes with little-endian byte order.\n */\n WireType[WireType[\"Bit32\"] = 5] = \"Bit32\";\n})(WireType || (WireType = {}));\n/**\n * Maximum value for a 32-bit floating point value (Protobuf FLOAT).\n */\nexport const FLOAT32_MAX = 3.4028234663852886e38;\n/**\n * Minimum value for a 32-bit floating point value (Protobuf FLOAT).\n */\nexport const FLOAT32_MIN = -3.4028234663852886e38;\n/**\n * Maximum value for an unsigned 32-bit integer (Protobuf UINT32, FIXED32).\n */\nexport const UINT32_MAX = 0xffffffff;\n/**\n * Maximum value for a signed 32-bit integer (Protobuf INT32, SFIXED32, SINT32).\n */\nexport const INT32_MAX = 0x7fffffff;\n/**\n * Minimum value for a signed 32-bit integer (Protobuf INT32, SFIXED32, SINT32).\n */\nexport const INT32_MIN = -0x80000000;\nexport class BinaryWriter {\n constructor(encodeUtf8 = getTextEncoding().encodeUtf8) {\n this.encodeUtf8 = encodeUtf8;\n /**\n * Previous fork states.\n */\n this.stack = [];\n this.chunks = [];\n this.buf = [];\n }\n /**\n * Return all bytes written and reset this writer.\n */\n finish() {\n if (this.buf.length) {\n this.chunks.push(new Uint8Array(this.buf)); // flush the buffer\n this.buf = [];\n }\n let len = 0;\n for (let i = 0; i < this.chunks.length; i++)\n len += this.chunks[i].length;\n let bytes = new Uint8Array(len);\n let offset = 0;\n for (let i = 0; i < this.chunks.length; i++) {\n bytes.set(this.chunks[i], offset);\n offset += this.chunks[i].length;\n }\n this.chunks = [];\n return bytes;\n }\n /**\n * Start a new fork for length-delimited data like a message\n * or a packed repeated field.\n *\n * Must be joined later with `join()`.\n */\n fork() {\n this.stack.push({ chunks: this.chunks, buf: this.buf });\n this.chunks = [];\n this.buf = [];\n return this;\n }\n /**\n * Join the last fork. Write its length and bytes, then\n * return to the previous state.\n */\n join() {\n // get chunk of fork\n let chunk = this.finish();\n // restore previous state\n let prev = this.stack.pop();\n if (!prev)\n throw new Error(\"invalid state, fork stack empty\");\n this.chunks = prev.chunks;\n this.buf = prev.buf;\n // write length of chunk as varint\n this.uint32(chunk.byteLength);\n return this.raw(chunk);\n }\n /**\n * Writes a tag (field number and wire type).\n *\n * Equivalent to `uint32( (fieldNo << 3 | type) >>> 0 )`.\n *\n * Generated code should compute the tag ahead of time and call `uint32()`.\n */\n tag(fieldNo, type) {\n return this.uint32(((fieldNo << 3) | type) >>> 0);\n }\n /**\n * Write a chunk of raw bytes.\n */\n raw(chunk) {\n if (this.buf.length) {\n this.chunks.push(new Uint8Array(this.buf));\n this.buf = [];\n }\n this.chunks.push(chunk);\n return this;\n }\n /**\n * Write a `uint32` value, an unsigned 32 bit varint.\n */\n uint32(value) {\n assertUInt32(value);\n // write value as varint 32, inlined for speed\n while (value > 0x7f) {\n this.buf.push((value & 0x7f) | 0x80);\n value = value >>> 7;\n }\n this.buf.push(value);\n return this;\n }\n /**\n * Write a `int32` value, a signed 32 bit varint.\n */\n int32(value) {\n assertInt32(value);\n varint32write(value, this.buf);\n return this;\n }\n /**\n * Write a `bool` value, a variant.\n */\n bool(value) {\n this.buf.push(value ? 1 : 0);\n return this;\n }\n /**\n * Write a `bytes` value, length-delimited arbitrary data.\n */\n bytes(value) {\n this.uint32(value.byteLength); // write length of chunk as varint\n return this.raw(value);\n }\n /**\n * Write a `string` value, length-delimited data converted to UTF-8 text.\n */\n string(value) {\n let chunk = this.encodeUtf8(value);\n this.uint32(chunk.byteLength); // write length of chunk as varint\n return this.raw(chunk);\n }\n /**\n * Write a `float` value, 32-bit floating point number.\n */\n float(value) {\n assertFloat32(value);\n let chunk = new Uint8Array(4);\n new DataView(chunk.buffer).setFloat32(0, value, true);\n return this.raw(chunk);\n }\n /**\n * Write a `double` value, a 64-bit floating point number.\n */\n double(value) {\n let chunk = new Uint8Array(8);\n new DataView(chunk.buffer).setFloat64(0, value, true);\n return this.raw(chunk);\n }\n /**\n * Write a `fixed32` value, an unsigned, fixed-length 32-bit integer.\n */\n fixed32(value) {\n assertUInt32(value);\n let chunk = new Uint8Array(4);\n new DataView(chunk.buffer).setUint32(0, value, true);\n return this.raw(chunk);\n }\n /**\n * Write a `sfixed32` value, a signed, fixed-length 32-bit integer.\n */\n sfixed32(value) {\n assertInt32(value);\n let chunk = new Uint8Array(4);\n new DataView(chunk.buffer).setInt32(0, value, true);\n return this.raw(chunk);\n }\n /**\n * Write a `sint32` value, a signed, zigzag-encoded 32-bit varint.\n */\n sint32(value) {\n assertInt32(value);\n // zigzag encode\n value = ((value << 1) ^ (value >> 31)) >>> 0;\n varint32write(value, this.buf);\n return this;\n }\n /**\n * Write a `fixed64` value, a signed, fixed-length 64-bit integer.\n */\n sfixed64(value) {\n let chunk = new Uint8Array(8), view = new DataView(chunk.buffer), tc = protoInt64.enc(value);\n view.setInt32(0, tc.lo, true);\n view.setInt32(4, tc.hi, true);\n return this.raw(chunk);\n }\n /**\n * Write a `fixed64` value, an unsigned, fixed-length 64 bit integer.\n */\n fixed64(value) {\n let chunk = new Uint8Array(8), view = new DataView(chunk.buffer), tc = protoInt64.uEnc(value);\n view.setInt32(0, tc.lo, true);\n view.setInt32(4, tc.hi, true);\n return this.raw(chunk);\n }\n /**\n * Write a `int64` value, a signed 64-bit varint.\n */\n int64(value) {\n let tc = protoInt64.enc(value);\n varint64write(tc.lo, tc.hi, this.buf);\n return this;\n }\n /**\n * Write a `sint64` value, a signed, zig-zag-encoded 64-bit varint.\n */\n sint64(value) {\n const tc = protoInt64.enc(value), \n // zigzag encode\n sign = tc.hi >> 31, lo = (tc.lo << 1) ^ sign, hi = ((tc.hi << 1) | (tc.lo >>> 31)) ^ sign;\n varint64write(lo, hi, this.buf);\n return this;\n }\n /**\n * Write a `uint64` value, an unsigned 64-bit varint.\n */\n uint64(value) {\n const tc = protoInt64.uEnc(value);\n varint64write(tc.lo, tc.hi, this.buf);\n return this;\n }\n}\nexport class BinaryReader {\n constructor(buf, decodeUtf8 = getTextEncoding().decodeUtf8) {\n this.decodeUtf8 = decodeUtf8;\n this.varint64 = varint64read; // dirty cast for `this`\n /**\n * Read a `uint32` field, an unsigned 32 bit varint.\n */\n this.uint32 = varint32read;\n this.buf = buf;\n this.len = buf.length;\n this.pos = 0;\n this.view = new DataView(buf.buffer, buf.byteOffset, buf.byteLength);\n }\n /**\n * Reads a tag - field number and wire type.\n */\n tag() {\n let tag = this.uint32(), fieldNo = tag >>> 3, wireType = tag & 7;\n if (fieldNo <= 0 || wireType < 0 || wireType > 5)\n throw new Error(\"illegal tag: field no \" + fieldNo + \" wire type \" + wireType);\n return [fieldNo, wireType];\n }\n /**\n * Skip one element and return the skipped data.\n *\n * When skipping StartGroup, provide the tags field number to check for\n * matching field number in the EndGroup tag.\n */\n skip(wireType, fieldNo) {\n let start = this.pos;\n switch (wireType) {\n case WireType.Varint:\n while (this.buf[this.pos++] & 0x80) {\n // ignore\n }\n break;\n // @ts-ignore TS7029: Fallthrough case in switch -- ignore instead of expect-error for compiler settings without noFallthroughCasesInSwitch: true\n case WireType.Bit64:\n this.pos += 4;\n case WireType.Bit32:\n this.pos += 4;\n break;\n case WireType.LengthDelimited:\n let len = this.uint32();\n this.pos += len;\n break;\n case WireType.StartGroup:\n for (;;) {\n const [fn, wt] = this.tag();\n if (wt === WireType.EndGroup) {\n if (fieldNo !== undefined && fn !== fieldNo) {\n throw new Error(\"invalid end group tag\");\n }\n break;\n }\n this.skip(wt, fn);\n }\n break;\n default:\n throw new Error(\"cant skip wire type \" + wireType);\n }\n this.assertBounds();\n return this.buf.subarray(start, this.pos);\n }\n /**\n * Throws error if position in byte array is out of range.\n */\n assertBounds() {\n if (this.pos > this.len)\n throw new RangeError(\"premature EOF\");\n }\n /**\n * Read a `int32` field, a signed 32 bit varint.\n */\n int32() {\n return this.uint32() | 0;\n }\n /**\n * Read a `sint32` field, a signed, zigzag-encoded 32-bit varint.\n */\n sint32() {\n let zze = this.uint32();\n // decode zigzag\n return (zze >>> 1) ^ -(zze & 1);\n }\n /**\n * Read a `int64` field, a signed 64-bit varint.\n */\n int64() {\n return protoInt64.dec(...this.varint64());\n }\n /**\n * Read a `uint64` field, an unsigned 64-bit varint.\n */\n uint64() {\n return protoInt64.uDec(...this.varint64());\n }\n /**\n * Read a `sint64` field, a signed, zig-zag-encoded 64-bit varint.\n */\n sint64() {\n let [lo, hi] = this.varint64();\n // decode zig zag\n let s = -(lo & 1);\n lo = ((lo >>> 1) | ((hi & 1) << 31)) ^ s;\n hi = (hi >>> 1) ^ s;\n return protoInt64.dec(lo, hi);\n }\n /**\n * Read a `bool` field, a variant.\n */\n bool() {\n let [lo, hi] = this.varint64();\n return lo !== 0 || hi !== 0;\n }\n /**\n * Read a `fixed32` field, an unsigned, fixed-length 32-bit integer.\n */\n fixed32() {\n // biome-ignore lint/suspicious/noAssignInExpressions: no\n return this.view.getUint32((this.pos += 4) - 4, true);\n }\n /**\n * Read a `sfixed32` field, a signed, fixed-length 32-bit integer.\n */\n sfixed32() {\n // biome-ignore lint/suspicious/noAssignInExpressions: no\n return this.view.getInt32((this.pos += 4) - 4, true);\n }\n /**\n * Read a `fixed64` field, an unsigned, fixed-length 64 bit integer.\n */\n fixed64() {\n return protoInt64.uDec(this.sfixed32(), this.sfixed32());\n }\n /**\n * Read a `fixed64` field, a signed, fixed-length 64-bit integer.\n */\n sfixed64() {\n return protoInt64.dec(this.sfixed32(), this.sfixed32());\n }\n /**\n * Read a `float` field, 32-bit floating point number.\n */\n float() {\n // biome-ignore lint/suspicious/noAssignInExpressions: no\n return this.view.getFloat32((this.pos += 4) - 4, true);\n }\n /**\n * Read a `double` field, a 64-bit floating point number.\n */\n double() {\n // biome-ignore lint/suspicious/noAssignInExpressions: no\n return this.view.getFloat64((this.pos += 8) - 8, true);\n }\n /**\n * Read a `bytes` field, length-delimited arbitrary data.\n */\n bytes() {\n let len = this.uint32(), start = this.pos;\n this.pos += len;\n this.assertBounds();\n return this.buf.subarray(start, start + len);\n }\n /**\n * Read a `string` field, length-delimited data converted to UTF-8 text.\n */\n string() {\n return this.decodeUtf8(this.bytes());\n }\n}\n/**\n * Assert a valid signed protobuf 32-bit integer as a number or string.\n */\nfunction assertInt32(arg) {\n if (typeof arg == \"string\") {\n arg = Number(arg);\n }\n else if (typeof arg != \"number\") {\n throw new Error(\"invalid int32: \" + typeof arg);\n }\n if (!Number.isInteger(arg) ||\n arg > INT32_MAX ||\n arg < INT32_MIN)\n throw new Error(\"invalid int32: \" + arg);\n}\n/**\n * Assert a valid unsigned protobuf 32-bit integer as a number or string.\n */\nfunction assertUInt32(arg) {\n if (typeof arg == \"string\") {\n arg = Number(arg);\n }\n else if (typeof arg != \"number\") {\n throw new Error(\"invalid uint32: \" + typeof arg);\n }\n if (!Number.isInteger(arg) ||\n arg > UINT32_MAX ||\n arg < 0)\n throw new Error(\"invalid uint32: \" + arg);\n}\n/**\n * Assert a valid protobuf float value as a number or string.\n */\nfunction assertFloat32(arg) {\n if (typeof arg == \"string\") {\n const o = arg;\n arg = Number(arg);\n if (Number.isNaN(arg) && o !== \"NaN\") {\n throw new Error(\"invalid float32: \" + o);\n }\n }\n else if (typeof arg != \"number\") {\n throw new Error(\"invalid float32: \" + typeof arg);\n }\n if (Number.isFinite(arg) &&\n (arg > FLOAT32_MAX || arg < FLOAT32_MIN))\n throw new Error(\"invalid float32: \" + arg);\n}\n", "// Code generated by protoc-gen-ts_proto. DO NOT EDIT.\n// versions:\n// protoc-gen-ts_proto v2.7.7\n// protoc v6.33.5\n// source: misc/params.proto\n\n/* eslint-disable */\nimport { BinaryReader, BinaryWriter } from \"@bufbuild/protobuf/wire\";\n\nexport const protobufPackage = \"misc\";\n\nexport interface VisitorData {\n id: string;\n timestamp: number;\n}\n\nexport interface SearchFilter {\n prioritize?: SearchFilter_Prioritize | undefined;\n filters?: SearchFilter_Filters | undefined;\n}\n\nexport enum SearchFilter_Prioritize {\n RELEVANCE = 0,\n POPULARITY = 3,\n UNRECOGNIZED = -1,\n}\n\nexport interface SearchFilter_Filters {\n uploadDate?: SearchFilter_Filters_UploadDate | undefined;\n type?: SearchFilter_Filters_SearchType | undefined;\n duration?: SearchFilter_Filters_Duration | undefined;\n musicSearchType?: SearchFilter_Filters_MusicSearchType | undefined;\n featuresHd?: boolean | undefined;\n featuresSubtitles?: boolean | undefined;\n featuresCreativeCommons?: boolean | undefined;\n features3d?: boolean | undefined;\n featuresLive?: boolean | undefined;\n featuresPurchased?: boolean | undefined;\n features4k?: boolean | undefined;\n features360?: boolean | undefined;\n featuresLocation?: boolean | undefined;\n featuresHdr?: boolean | undefined;\n featuresVr180?: boolean | undefined;\n}\n\nexport enum SearchFilter_Filters_UploadDate {\n ANY_DATE = 0,\n TODAY = 2,\n WEEK = 3,\n MONTH = 4,\n YEAR = 5,\n UNRECOGNIZED = -1,\n}\n\nexport enum SearchFilter_Filters_SearchType {\n ANY_TYPE = 0,\n VIDEO = 1,\n CHANNEL = 2,\n PLAYLIST = 3,\n MOVIE = 4,\n SHORTS = 9,\n UNRECOGNIZED = -1,\n}\n\nexport enum SearchFilter_Filters_Duration {\n ANY_DURATION = 0,\n OVER_TWENTY_MINS = 2,\n UNDER_THREE_MINS = 4,\n THREE_TO_TWENTY_MINS = 5,\n UNRECOGNIZED = -1,\n}\n\nexport interface SearchFilter_Filters_MusicSearchType {\n song?: boolean | undefined;\n video?: boolean | undefined;\n album?: boolean | undefined;\n artist?: boolean | undefined;\n playlist?: boolean | undefined;\n}\n\nexport interface ChannelAnalytics {\n params: ChannelAnalytics_Params | undefined;\n}\n\nexport interface ChannelAnalytics_Params {\n channelId: string;\n}\n\nexport interface SoundInfoParams {\n sound: SoundInfoParams_Sound | undefined;\n}\n\nexport interface SoundInfoParams_Sound {\n params: SoundInfoParams_Sound_Params | undefined;\n}\n\nexport interface SoundInfoParams_Sound_Params {\n ids: SoundInfoParams_Sound_Params_Ids | undefined;\n}\n\nexport interface SoundInfoParams_Sound_Params_Ids {\n id1: string;\n id2: string;\n id3: string;\n}\n\nexport interface NotificationPreferences {\n channelId: string;\n prefId: NotificationPreferences_Preference | undefined;\n number0?: number | undefined;\n number1?: number | undefined;\n}\n\nexport interface NotificationPreferences_Preference {\n index: number;\n}\n\nexport interface LiveMessageParams {\n params: LiveMessageParams_Params | undefined;\n number0?: number | undefined;\n number1?: number | undefined;\n}\n\nexport interface LiveMessageParams_Params {\n ids: LiveMessageParams_Params_Ids | undefined;\n}\n\nexport interface LiveMessageParams_Params_Ids {\n channelId: string;\n videoId: string;\n}\n\nexport interface GetCommentsSectionParams {\n ctx: GetCommentsSectionParams_Context | undefined;\n unkParam: number;\n params: GetCommentsSectionParams_Params | undefined;\n}\n\nexport interface GetCommentsSectionParams_Context {\n videoId: string;\n}\n\nexport interface GetCommentsSectionParams_Params {\n unkToken?: string | undefined;\n opts?: GetCommentsSectionParams_Params_Options | undefined;\n repliesOpts?: GetCommentsSectionParams_Params_RepliesOptions | undefined;\n page?: number | undefined;\n target: string;\n}\n\nexport interface GetCommentsSectionParams_Params_Options {\n videoId: string;\n sortBy: number;\n type: number;\n commentId?: string | undefined;\n}\n\nexport interface GetCommentsSectionParams_Params_RepliesOptions {\n commentId: string;\n unkopts: GetCommentsSectionParams_Params_RepliesOptions_UnkOpts | undefined;\n channelId?: string | undefined;\n videoId: string;\n unkParam1: number;\n unkParam2: number;\n}\n\nexport interface GetCommentsSectionParams_Params_RepliesOptions_UnkOpts {\n unkParam: number;\n}\n\nexport interface CreateCommentParams {\n videoId: string;\n params: CreateCommentParams_Params | undefined;\n number: number;\n}\n\nexport interface CreateCommentParams_Params {\n index: number;\n}\n\nexport interface PeformCommentActionParams {\n type: number;\n commentId: string;\n videoId: string;\n unkNum?: number | undefined;\n channelId?: string | undefined;\n translateCommentParams?: PeformCommentActionParams_TranslateCommentParams | undefined;\n}\n\nexport interface PeformCommentActionParams_TranslateCommentParams {\n params: PeformCommentActionParams_TranslateCommentParams_Params | undefined;\n commentId: string;\n targetLanguage: string;\n}\n\nexport interface PeformCommentActionParams_TranslateCommentParams_Params {\n comment: PeformCommentActionParams_TranslateCommentParams_Params_Comment | undefined;\n}\n\nexport interface PeformCommentActionParams_TranslateCommentParams_Params_Comment {\n text: string;\n}\n\nexport interface Hashtag {\n params: Hashtag_Params | undefined;\n}\n\nexport interface Hashtag_Params {\n hashtag: string;\n type: number;\n}\n\nexport interface ReelSequence {\n shortId: string;\n params: ReelSequence_Params | undefined;\n feature2: number;\n feature3: number;\n}\n\nexport interface ReelSequence_Params {\n number: number;\n}\n\nexport interface ShortsParam {\n f1?: ShortsParam_Field1 | undefined;\n p59?: number | undefined;\n}\n\nexport interface ShortsParam_Field1 {\n p1?: number | undefined;\n}\n\nexport interface NextParams {\n videoId: string[];\n playlistTitle?: string | undefined;\n}\n\nexport interface CommunityPostParams {\n f1: CommunityPostParams_Field1 | undefined;\n}\n\nexport interface CommunityPostParams_Field1 {\n ucid1: string;\n postId: string;\n ucid2: string;\n}\n\nexport interface CommunityPostCommentsParamContainer {\n f0: CommunityPostCommentsParamContainer_Container | undefined;\n}\n\nexport interface CommunityPostCommentsParamContainer_Container {\n location: string;\n protoData: string;\n}\n\nexport interface CommunityPostCommentsParam {\n title: string;\n commentDataContainer: CommunityPostCommentsParam_CommentDataContainer | undefined;\n}\n\nexport interface CommunityPostCommentsParam_CommentDataContainer {\n commentData: CommunityPostCommentsParam_CommentDataContainer_CommentData | undefined;\n f0: number;\n title: string;\n}\n\nexport interface CommunityPostCommentsParam_CommentDataContainer_CommentData {\n sortBy: number;\n f0: number;\n f1: number;\n postId: string;\n channelId: string;\n}\n\nfunction createBaseVisitorData(): VisitorData {\n return { id: \"\", timestamp: 0 };\n}\n\nexport const VisitorData: MessageFns = {\n encode(message: VisitorData, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {\n if (message.id !== \"\") {\n writer.uint32(10).string(message.id);\n }\n if (message.timestamp !== 0) {\n writer.uint32(40).int32(message.timestamp);\n }\n return writer;\n },\n\n decode(input: BinaryReader | Uint8Array, length?: number): VisitorData {\n const reader = input instanceof BinaryReader ? input : new BinaryReader(input);\n const end = length === undefined ? reader.len : reader.pos + length;\n const message = createBaseVisitorData();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (tag !== 10) {\n break;\n }\n\n message.id = reader.string();\n continue;\n }\n case 5: {\n if (tag !== 40) {\n break;\n }\n\n message.timestamp = reader.int32();\n continue;\n }\n }\n if ((tag & 7) === 4 || tag === 0) {\n break;\n }\n reader.skip(tag & 7);\n }\n return message;\n },\n};\n\nfunction createBaseSearchFilter(): SearchFilter {\n return { prioritize: undefined, filters: undefined };\n}\n\nexport const SearchFilter: MessageFns = {\n encode(message: SearchFilter, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {\n if (message.prioritize !== undefined) {\n writer.uint32(8).int32(message.prioritize);\n }\n if (message.filters !== undefined) {\n SearchFilter_Filters.encode(message.filters, writer.uint32(18).fork()).join();\n }\n return writer;\n },\n\n decode(input: BinaryReader | Uint8Array, length?: number): SearchFilter {\n const reader = input instanceof BinaryReader ? input : new BinaryReader(input);\n const end = length === undefined ? reader.len : reader.pos + length;\n const message = createBaseSearchFilter();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (tag !== 8) {\n break;\n }\n\n message.prioritize = reader.int32() as any;\n continue;\n }\n case 2: {\n if (tag !== 18) {\n break;\n }\n\n message.filters = SearchFilter_Filters.decode(reader, reader.uint32());\n continue;\n }\n }\n if ((tag & 7) === 4 || tag === 0) {\n break;\n }\n reader.skip(tag & 7);\n }\n return message;\n },\n};\n\nfunction createBaseSearchFilter_Filters(): SearchFilter_Filters {\n return {\n uploadDate: undefined,\n type: undefined,\n duration: undefined,\n musicSearchType: undefined,\n featuresHd: undefined,\n featuresSubtitles: undefined,\n featuresCreativeCommons: undefined,\n features3d: undefined,\n featuresLive: undefined,\n featuresPurchased: undefined,\n features4k: undefined,\n features360: undefined,\n featuresLocation: undefined,\n featuresHdr: undefined,\n featuresVr180: undefined,\n };\n}\n\nexport const SearchFilter_Filters: MessageFns = {\n encode(message: SearchFilter_Filters, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {\n if (message.uploadDate !== undefined) {\n writer.uint32(8).int32(message.uploadDate);\n }\n if (message.type !== undefined) {\n writer.uint32(16).int32(message.type);\n }\n if (message.duration !== undefined) {\n writer.uint32(24).int32(message.duration);\n }\n if (message.musicSearchType !== undefined) {\n SearchFilter_Filters_MusicSearchType.encode(message.musicSearchType, writer.uint32(138).fork()).join();\n }\n if (message.featuresHd !== undefined) {\n writer.uint32(32).bool(message.featuresHd);\n }\n if (message.featuresSubtitles !== undefined) {\n writer.uint32(40).bool(message.featuresSubtitles);\n }\n if (message.featuresCreativeCommons !== undefined) {\n writer.uint32(48).bool(message.featuresCreativeCommons);\n }\n if (message.features3d !== undefined) {\n writer.uint32(56).bool(message.features3d);\n }\n if (message.featuresLive !== undefined) {\n writer.uint32(64).bool(message.featuresLive);\n }\n if (message.featuresPurchased !== undefined) {\n writer.uint32(72).bool(message.featuresPurchased);\n }\n if (message.features4k !== undefined) {\n writer.uint32(112).bool(message.features4k);\n }\n if (message.features360 !== undefined) {\n writer.uint32(120).bool(message.features360);\n }\n if (message.featuresLocation !== undefined) {\n writer.uint32(184).bool(message.featuresLocation);\n }\n if (message.featuresHdr !== undefined) {\n writer.uint32(200).bool(message.featuresHdr);\n }\n if (message.featuresVr180 !== undefined) {\n writer.uint32(208).bool(message.featuresVr180);\n }\n return writer;\n },\n\n decode(input: BinaryReader | Uint8Array, length?: number): SearchFilter_Filters {\n const reader = input instanceof BinaryReader ? input : new BinaryReader(input);\n const end = length === undefined ? reader.len : reader.pos + length;\n const message = createBaseSearchFilter_Filters();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (tag !== 8) {\n break;\n }\n\n message.uploadDate = reader.int32() as any;\n continue;\n }\n case 2: {\n if (tag !== 16) {\n break;\n }\n\n message.type = reader.int32() as any;\n continue;\n }\n case 3: {\n if (tag !== 24) {\n break;\n }\n\n message.duration = reader.int32() as any;\n continue;\n }\n case 17: {\n if (tag !== 138) {\n break;\n }\n\n message.musicSearchType = SearchFilter_Filters_MusicSearchType.decode(reader, reader.uint32());\n continue;\n }\n case 4: {\n if (tag !== 32) {\n break;\n }\n\n message.featuresHd = reader.bool();\n continue;\n }\n case 5: {\n if (tag !== 40) {\n break;\n }\n\n message.featuresSubtitles = reader.bool();\n continue;\n }\n case 6: {\n if (tag !== 48) {\n break;\n }\n\n message.featuresCreativeCommons = reader.bool();\n continue;\n }\n case 7: {\n if (tag !== 56) {\n break;\n }\n\n message.features3d = reader.bool();\n continue;\n }\n case 8: {\n if (tag !== 64) {\n break;\n }\n\n message.featuresLive = reader.bool();\n continue;\n }\n case 9: {\n if (tag !== 72) {\n break;\n }\n\n message.featuresPurchased = reader.bool();\n continue;\n }\n case 14: {\n if (tag !== 112) {\n break;\n }\n\n message.features4k = reader.bool();\n continue;\n }\n case 15: {\n if (tag !== 120) {\n break;\n }\n\n message.features360 = reader.bool();\n continue;\n }\n case 23: {\n if (tag !== 184) {\n break;\n }\n\n message.featuresLocation = reader.bool();\n continue;\n }\n case 25: {\n if (tag !== 200) {\n break;\n }\n\n message.featuresHdr = reader.bool();\n continue;\n }\n case 26: {\n if (tag !== 208) {\n break;\n }\n\n message.featuresVr180 = reader.bool();\n continue;\n }\n }\n if ((tag & 7) === 4 || tag === 0) {\n break;\n }\n reader.skip(tag & 7);\n }\n return message;\n },\n};\n\nfunction createBaseSearchFilter_Filters_MusicSearchType(): SearchFilter_Filters_MusicSearchType {\n return { song: undefined, video: undefined, album: undefined, artist: undefined, playlist: undefined };\n}\n\nexport const SearchFilter_Filters_MusicSearchType: MessageFns = {\n encode(message: SearchFilter_Filters_MusicSearchType, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {\n if (message.song !== undefined) {\n writer.uint32(8).bool(message.song);\n }\n if (message.video !== undefined) {\n writer.uint32(16).bool(message.video);\n }\n if (message.album !== undefined) {\n writer.uint32(24).bool(message.album);\n }\n if (message.artist !== undefined) {\n writer.uint32(32).bool(message.artist);\n }\n if (message.playlist !== undefined) {\n writer.uint32(40).bool(message.playlist);\n }\n return writer;\n },\n\n decode(input: BinaryReader | Uint8Array, length?: number): SearchFilter_Filters_MusicSearchType {\n const reader = input instanceof BinaryReader ? input : new BinaryReader(input);\n const end = length === undefined ? reader.len : reader.pos + length;\n const message = createBaseSearchFilter_Filters_MusicSearchType();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (tag !== 8) {\n break;\n }\n\n message.song = reader.bool();\n continue;\n }\n case 2: {\n if (tag !== 16) {\n break;\n }\n\n message.video = reader.bool();\n continue;\n }\n case 3: {\n if (tag !== 24) {\n break;\n }\n\n message.album = reader.bool();\n continue;\n }\n case 4: {\n if (tag !== 32) {\n break;\n }\n\n message.artist = reader.bool();\n continue;\n }\n case 5: {\n if (tag !== 40) {\n break;\n }\n\n message.playlist = reader.bool();\n continue;\n }\n }\n if ((tag & 7) === 4 || tag === 0) {\n break;\n }\n reader.skip(tag & 7);\n }\n return message;\n },\n};\n\nfunction createBaseChannelAnalytics(): ChannelAnalytics {\n return { params: undefined };\n}\n\nexport const ChannelAnalytics: MessageFns = {\n encode(message: ChannelAnalytics, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {\n if (message.params !== undefined) {\n ChannelAnalytics_Params.encode(message.params, writer.uint32(258).fork()).join();\n }\n return writer;\n },\n\n decode(input: BinaryReader | Uint8Array, length?: number): ChannelAnalytics {\n const reader = input instanceof BinaryReader ? input : new BinaryReader(input);\n const end = length === undefined ? reader.len : reader.pos + length;\n const message = createBaseChannelAnalytics();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 32: {\n if (tag !== 258) {\n break;\n }\n\n message.params = ChannelAnalytics_Params.decode(reader, reader.uint32());\n continue;\n }\n }\n if ((tag & 7) === 4 || tag === 0) {\n break;\n }\n reader.skip(tag & 7);\n }\n return message;\n },\n};\n\nfunction createBaseChannelAnalytics_Params(): ChannelAnalytics_Params {\n return { channelId: \"\" };\n}\n\nexport const ChannelAnalytics_Params: MessageFns = {\n encode(message: ChannelAnalytics_Params, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {\n if (message.channelId !== \"\") {\n writer.uint32(8010).string(message.channelId);\n }\n return writer;\n },\n\n decode(input: BinaryReader | Uint8Array, length?: number): ChannelAnalytics_Params {\n const reader = input instanceof BinaryReader ? input : new BinaryReader(input);\n const end = length === undefined ? reader.len : reader.pos + length;\n const message = createBaseChannelAnalytics_Params();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1001: {\n if (tag !== 8010) {\n break;\n }\n\n message.channelId = reader.string();\n continue;\n }\n }\n if ((tag & 7) === 4 || tag === 0) {\n break;\n }\n reader.skip(tag & 7);\n }\n return message;\n },\n};\n\nfunction createBaseSoundInfoParams(): SoundInfoParams {\n return { sound: undefined };\n}\n\nexport const SoundInfoParams: MessageFns = {\n encode(message: SoundInfoParams, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {\n if (message.sound !== undefined) {\n SoundInfoParams_Sound.encode(message.sound, writer.uint32(754).fork()).join();\n }\n return writer;\n },\n\n decode(input: BinaryReader | Uint8Array, length?: number): SoundInfoParams {\n const reader = input instanceof BinaryReader ? input : new BinaryReader(input);\n const end = length === undefined ? reader.len : reader.pos + length;\n const message = createBaseSoundInfoParams();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 94: {\n if (tag !== 754) {\n break;\n }\n\n message.sound = SoundInfoParams_Sound.decode(reader, reader.uint32());\n continue;\n }\n }\n if ((tag & 7) === 4 || tag === 0) {\n break;\n }\n reader.skip(tag & 7);\n }\n return message;\n },\n};\n\nfunction createBaseSoundInfoParams_Sound(): SoundInfoParams_Sound {\n return { params: undefined };\n}\n\nexport const SoundInfoParams_Sound: MessageFns = {\n encode(message: SoundInfoParams_Sound, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {\n if (message.params !== undefined) {\n SoundInfoParams_Sound_Params.encode(message.params, writer.uint32(10).fork()).join();\n }\n return writer;\n },\n\n decode(input: BinaryReader | Uint8Array, length?: number): SoundInfoParams_Sound {\n const reader = input instanceof BinaryReader ? input : new BinaryReader(input);\n const end = length === undefined ? reader.len : reader.pos + length;\n const message = createBaseSoundInfoParams_Sound();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (tag !== 10) {\n break;\n }\n\n message.params = SoundInfoParams_Sound_Params.decode(reader, reader.uint32());\n continue;\n }\n }\n if ((tag & 7) === 4 || tag === 0) {\n break;\n }\n reader.skip(tag & 7);\n }\n return message;\n },\n};\n\nfunction createBaseSoundInfoParams_Sound_Params(): SoundInfoParams_Sound_Params {\n return { ids: undefined };\n}\n\nexport const SoundInfoParams_Sound_Params: MessageFns = {\n encode(message: SoundInfoParams_Sound_Params, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {\n if (message.ids !== undefined) {\n SoundInfoParams_Sound_Params_Ids.encode(message.ids, writer.uint32(18).fork()).join();\n }\n return writer;\n },\n\n decode(input: BinaryReader | Uint8Array, length?: number): SoundInfoParams_Sound_Params {\n const reader = input instanceof BinaryReader ? input : new BinaryReader(input);\n const end = length === undefined ? reader.len : reader.pos + length;\n const message = createBaseSoundInfoParams_Sound_Params();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 2: {\n if (tag !== 18) {\n break;\n }\n\n message.ids = SoundInfoParams_Sound_Params_Ids.decode(reader, reader.uint32());\n continue;\n }\n }\n if ((tag & 7) === 4 || tag === 0) {\n break;\n }\n reader.skip(tag & 7);\n }\n return message;\n },\n};\n\nfunction createBaseSoundInfoParams_Sound_Params_Ids(): SoundInfoParams_Sound_Params_Ids {\n return { id1: \"\", id2: \"\", id3: \"\" };\n}\n\nexport const SoundInfoParams_Sound_Params_Ids: MessageFns = {\n encode(message: SoundInfoParams_Sound_Params_Ids, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {\n if (message.id1 !== \"\") {\n writer.uint32(10).string(message.id1);\n }\n if (message.id2 !== \"\") {\n writer.uint32(18).string(message.id2);\n }\n if (message.id3 !== \"\") {\n writer.uint32(26).string(message.id3);\n }\n return writer;\n },\n\n decode(input: BinaryReader | Uint8Array, length?: number): SoundInfoParams_Sound_Params_Ids {\n const reader = input instanceof BinaryReader ? input : new BinaryReader(input);\n const end = length === undefined ? reader.len : reader.pos + length;\n const message = createBaseSoundInfoParams_Sound_Params_Ids();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (tag !== 10) {\n break;\n }\n\n message.id1 = reader.string();\n continue;\n }\n case 2: {\n if (tag !== 18) {\n break;\n }\n\n message.id2 = reader.string();\n continue;\n }\n case 3: {\n if (tag !== 26) {\n break;\n }\n\n message.id3 = reader.string();\n continue;\n }\n }\n if ((tag & 7) === 4 || tag === 0) {\n break;\n }\n reader.skip(tag & 7);\n }\n return message;\n },\n};\n\nfunction createBaseNotificationPreferences(): NotificationPreferences {\n return { channelId: \"\", prefId: undefined, number0: undefined, number1: undefined };\n}\n\nexport const NotificationPreferences: MessageFns = {\n encode(message: NotificationPreferences, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {\n if (message.channelId !== \"\") {\n writer.uint32(10).string(message.channelId);\n }\n if (message.prefId !== undefined) {\n NotificationPreferences_Preference.encode(message.prefId, writer.uint32(18).fork()).join();\n }\n if (message.number0 !== undefined) {\n writer.uint32(24).int32(message.number0);\n }\n if (message.number1 !== undefined) {\n writer.uint32(32).int32(message.number1);\n }\n return writer;\n },\n\n decode(input: BinaryReader | Uint8Array, length?: number): NotificationPreferences {\n const reader = input instanceof BinaryReader ? input : new BinaryReader(input);\n const end = length === undefined ? reader.len : reader.pos + length;\n const message = createBaseNotificationPreferences();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (tag !== 10) {\n break;\n }\n\n message.channelId = reader.string();\n continue;\n }\n case 2: {\n if (tag !== 18) {\n break;\n }\n\n message.prefId = NotificationPreferences_Preference.decode(reader, reader.uint32());\n continue;\n }\n case 3: {\n if (tag !== 24) {\n break;\n }\n\n message.number0 = reader.int32();\n continue;\n }\n case 4: {\n if (tag !== 32) {\n break;\n }\n\n message.number1 = reader.int32();\n continue;\n }\n }\n if ((tag & 7) === 4 || tag === 0) {\n break;\n }\n reader.skip(tag & 7);\n }\n return message;\n },\n};\n\nfunction createBaseNotificationPreferences_Preference(): NotificationPreferences_Preference {\n return { index: 0 };\n}\n\nexport const NotificationPreferences_Preference: MessageFns = {\n encode(message: NotificationPreferences_Preference, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {\n if (message.index !== 0) {\n writer.uint32(8).int32(message.index);\n }\n return writer;\n },\n\n decode(input: BinaryReader | Uint8Array, length?: number): NotificationPreferences_Preference {\n const reader = input instanceof BinaryReader ? input : new BinaryReader(input);\n const end = length === undefined ? reader.len : reader.pos + length;\n const message = createBaseNotificationPreferences_Preference();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (tag !== 8) {\n break;\n }\n\n message.index = reader.int32();\n continue;\n }\n }\n if ((tag & 7) === 4 || tag === 0) {\n break;\n }\n reader.skip(tag & 7);\n }\n return message;\n },\n};\n\nfunction createBaseLiveMessageParams(): LiveMessageParams {\n return { params: undefined, number0: undefined, number1: undefined };\n}\n\nexport const LiveMessageParams: MessageFns = {\n encode(message: LiveMessageParams, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {\n if (message.params !== undefined) {\n LiveMessageParams_Params.encode(message.params, writer.uint32(10).fork()).join();\n }\n if (message.number0 !== undefined) {\n writer.uint32(16).int32(message.number0);\n }\n if (message.number1 !== undefined) {\n writer.uint32(24).int32(message.number1);\n }\n return writer;\n },\n\n decode(input: BinaryReader | Uint8Array, length?: number): LiveMessageParams {\n const reader = input instanceof BinaryReader ? input : new BinaryReader(input);\n const end = length === undefined ? reader.len : reader.pos + length;\n const message = createBaseLiveMessageParams();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (tag !== 10) {\n break;\n }\n\n message.params = LiveMessageParams_Params.decode(reader, reader.uint32());\n continue;\n }\n case 2: {\n if (tag !== 16) {\n break;\n }\n\n message.number0 = reader.int32();\n continue;\n }\n case 3: {\n if (tag !== 24) {\n break;\n }\n\n message.number1 = reader.int32();\n continue;\n }\n }\n if ((tag & 7) === 4 || tag === 0) {\n break;\n }\n reader.skip(tag & 7);\n }\n return message;\n },\n};\n\nfunction createBaseLiveMessageParams_Params(): LiveMessageParams_Params {\n return { ids: undefined };\n}\n\nexport const LiveMessageParams_Params: MessageFns = {\n encode(message: LiveMessageParams_Params, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {\n if (message.ids !== undefined) {\n LiveMessageParams_Params_Ids.encode(message.ids, writer.uint32(42).fork()).join();\n }\n return writer;\n },\n\n decode(input: BinaryReader | Uint8Array, length?: number): LiveMessageParams_Params {\n const reader = input instanceof BinaryReader ? input : new BinaryReader(input);\n const end = length === undefined ? reader.len : reader.pos + length;\n const message = createBaseLiveMessageParams_Params();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 5: {\n if (tag !== 42) {\n break;\n }\n\n message.ids = LiveMessageParams_Params_Ids.decode(reader, reader.uint32());\n continue;\n }\n }\n if ((tag & 7) === 4 || tag === 0) {\n break;\n }\n reader.skip(tag & 7);\n }\n return message;\n },\n};\n\nfunction createBaseLiveMessageParams_Params_Ids(): LiveMessageParams_Params_Ids {\n return { channelId: \"\", videoId: \"\" };\n}\n\nexport const LiveMessageParams_Params_Ids: MessageFns = {\n encode(message: LiveMessageParams_Params_Ids, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {\n if (message.channelId !== \"\") {\n writer.uint32(10).string(message.channelId);\n }\n if (message.videoId !== \"\") {\n writer.uint32(18).string(message.videoId);\n }\n return writer;\n },\n\n decode(input: BinaryReader | Uint8Array, length?: number): LiveMessageParams_Params_Ids {\n const reader = input instanceof BinaryReader ? input : new BinaryReader(input);\n const end = length === undefined ? reader.len : reader.pos + length;\n const message = createBaseLiveMessageParams_Params_Ids();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (tag !== 10) {\n break;\n }\n\n message.channelId = reader.string();\n continue;\n }\n case 2: {\n if (tag !== 18) {\n break;\n }\n\n message.videoId = reader.string();\n continue;\n }\n }\n if ((tag & 7) === 4 || tag === 0) {\n break;\n }\n reader.skip(tag & 7);\n }\n return message;\n },\n};\n\nfunction createBaseGetCommentsSectionParams(): GetCommentsSectionParams {\n return { ctx: undefined, unkParam: 0, params: undefined };\n}\n\nexport const GetCommentsSectionParams: MessageFns = {\n encode(message: GetCommentsSectionParams, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {\n if (message.ctx !== undefined) {\n GetCommentsSectionParams_Context.encode(message.ctx, writer.uint32(18).fork()).join();\n }\n if (message.unkParam !== 0) {\n writer.uint32(24).int32(message.unkParam);\n }\n if (message.params !== undefined) {\n GetCommentsSectionParams_Params.encode(message.params, writer.uint32(50).fork()).join();\n }\n return writer;\n },\n\n decode(input: BinaryReader | Uint8Array, length?: number): GetCommentsSectionParams {\n const reader = input instanceof BinaryReader ? input : new BinaryReader(input);\n const end = length === undefined ? reader.len : reader.pos + length;\n const message = createBaseGetCommentsSectionParams();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 2: {\n if (tag !== 18) {\n break;\n }\n\n message.ctx = GetCommentsSectionParams_Context.decode(reader, reader.uint32());\n continue;\n }\n case 3: {\n if (tag !== 24) {\n break;\n }\n\n message.unkParam = reader.int32();\n continue;\n }\n case 6: {\n if (tag !== 50) {\n break;\n }\n\n message.params = GetCommentsSectionParams_Params.decode(reader, reader.uint32());\n continue;\n }\n }\n if ((tag & 7) === 4 || tag === 0) {\n break;\n }\n reader.skip(tag & 7);\n }\n return message;\n },\n};\n\nfunction createBaseGetCommentsSectionParams_Context(): GetCommentsSectionParams_Context {\n return { videoId: \"\" };\n}\n\nexport const GetCommentsSectionParams_Context: MessageFns = {\n encode(message: GetCommentsSectionParams_Context, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {\n if (message.videoId !== \"\") {\n writer.uint32(18).string(message.videoId);\n }\n return writer;\n },\n\n decode(input: BinaryReader | Uint8Array, length?: number): GetCommentsSectionParams_Context {\n const reader = input instanceof BinaryReader ? input : new BinaryReader(input);\n const end = length === undefined ? reader.len : reader.pos + length;\n const message = createBaseGetCommentsSectionParams_Context();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 2: {\n if (tag !== 18) {\n break;\n }\n\n message.videoId = reader.string();\n continue;\n }\n }\n if ((tag & 7) === 4 || tag === 0) {\n break;\n }\n reader.skip(tag & 7);\n }\n return message;\n },\n};\n\nfunction createBaseGetCommentsSectionParams_Params(): GetCommentsSectionParams_Params {\n return { unkToken: undefined, opts: undefined, repliesOpts: undefined, page: undefined, target: \"\" };\n}\n\nexport const GetCommentsSectionParams_Params: MessageFns = {\n encode(message: GetCommentsSectionParams_Params, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {\n if (message.unkToken !== undefined) {\n writer.uint32(10).string(message.unkToken);\n }\n if (message.opts !== undefined) {\n GetCommentsSectionParams_Params_Options.encode(message.opts, writer.uint32(34).fork()).join();\n }\n if (message.repliesOpts !== undefined) {\n GetCommentsSectionParams_Params_RepliesOptions.encode(message.repliesOpts, writer.uint32(26).fork()).join();\n }\n if (message.page !== undefined) {\n writer.uint32(40).int32(message.page);\n }\n if (message.target !== \"\") {\n writer.uint32(66).string(message.target);\n }\n return writer;\n },\n\n decode(input: BinaryReader | Uint8Array, length?: number): GetCommentsSectionParams_Params {\n const reader = input instanceof BinaryReader ? input : new BinaryReader(input);\n const end = length === undefined ? reader.len : reader.pos + length;\n const message = createBaseGetCommentsSectionParams_Params();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (tag !== 10) {\n break;\n }\n\n message.unkToken = reader.string();\n continue;\n }\n case 4: {\n if (tag !== 34) {\n break;\n }\n\n message.opts = GetCommentsSectionParams_Params_Options.decode(reader, reader.uint32());\n continue;\n }\n case 3: {\n if (tag !== 26) {\n break;\n }\n\n message.repliesOpts = GetCommentsSectionParams_Params_RepliesOptions.decode(reader, reader.uint32());\n continue;\n }\n case 5: {\n if (tag !== 40) {\n break;\n }\n\n message.page = reader.int32();\n continue;\n }\n case 8: {\n if (tag !== 66) {\n break;\n }\n\n message.target = reader.string();\n continue;\n }\n }\n if ((tag & 7) === 4 || tag === 0) {\n break;\n }\n reader.skip(tag & 7);\n }\n return message;\n },\n};\n\nfunction createBaseGetCommentsSectionParams_Params_Options(): GetCommentsSectionParams_Params_Options {\n return { videoId: \"\", sortBy: 0, type: 0, commentId: undefined };\n}\n\nexport const GetCommentsSectionParams_Params_Options: MessageFns = {\n encode(message: GetCommentsSectionParams_Params_Options, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {\n if (message.videoId !== \"\") {\n writer.uint32(34).string(message.videoId);\n }\n if (message.sortBy !== 0) {\n writer.uint32(48).int32(message.sortBy);\n }\n if (message.type !== 0) {\n writer.uint32(120).int32(message.type);\n }\n if (message.commentId !== undefined) {\n writer.uint32(130).string(message.commentId);\n }\n return writer;\n },\n\n decode(input: BinaryReader | Uint8Array, length?: number): GetCommentsSectionParams_Params_Options {\n const reader = input instanceof BinaryReader ? input : new BinaryReader(input);\n const end = length === undefined ? reader.len : reader.pos + length;\n const message = createBaseGetCommentsSectionParams_Params_Options();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 4: {\n if (tag !== 34) {\n break;\n }\n\n message.videoId = reader.string();\n continue;\n }\n case 6: {\n if (tag !== 48) {\n break;\n }\n\n message.sortBy = reader.int32();\n continue;\n }\n case 15: {\n if (tag !== 120) {\n break;\n }\n\n message.type = reader.int32();\n continue;\n }\n case 16: {\n if (tag !== 130) {\n break;\n }\n\n message.commentId = reader.string();\n continue;\n }\n }\n if ((tag & 7) === 4 || tag === 0) {\n break;\n }\n reader.skip(tag & 7);\n }\n return message;\n },\n};\n\nfunction createBaseGetCommentsSectionParams_Params_RepliesOptions(): GetCommentsSectionParams_Params_RepliesOptions {\n return { commentId: \"\", unkopts: undefined, channelId: undefined, videoId: \"\", unkParam1: 0, unkParam2: 0 };\n}\n\nexport const GetCommentsSectionParams_Params_RepliesOptions: MessageFns<\n GetCommentsSectionParams_Params_RepliesOptions\n> = {\n encode(\n message: GetCommentsSectionParams_Params_RepliesOptions,\n writer: BinaryWriter = new BinaryWriter(),\n ): BinaryWriter {\n if (message.commentId !== \"\") {\n writer.uint32(18).string(message.commentId);\n }\n if (message.unkopts !== undefined) {\n GetCommentsSectionParams_Params_RepliesOptions_UnkOpts.encode(message.unkopts, writer.uint32(34).fork()).join();\n }\n if (message.channelId !== undefined) {\n writer.uint32(42).string(message.channelId);\n }\n if (message.videoId !== \"\") {\n writer.uint32(50).string(message.videoId);\n }\n if (message.unkParam1 !== 0) {\n writer.uint32(64).int32(message.unkParam1);\n }\n if (message.unkParam2 !== 0) {\n writer.uint32(72).int32(message.unkParam2);\n }\n return writer;\n },\n\n decode(input: BinaryReader | Uint8Array, length?: number): GetCommentsSectionParams_Params_RepliesOptions {\n const reader = input instanceof BinaryReader ? input : new BinaryReader(input);\n const end = length === undefined ? reader.len : reader.pos + length;\n const message = createBaseGetCommentsSectionParams_Params_RepliesOptions();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 2: {\n if (tag !== 18) {\n break;\n }\n\n message.commentId = reader.string();\n continue;\n }\n case 4: {\n if (tag !== 34) {\n break;\n }\n\n message.unkopts = GetCommentsSectionParams_Params_RepliesOptions_UnkOpts.decode(reader, reader.uint32());\n continue;\n }\n case 5: {\n if (tag !== 42) {\n break;\n }\n\n message.channelId = reader.string();\n continue;\n }\n case 6: {\n if (tag !== 50) {\n break;\n }\n\n message.videoId = reader.string();\n continue;\n }\n case 8: {\n if (tag !== 64) {\n break;\n }\n\n message.unkParam1 = reader.int32();\n continue;\n }\n case 9: {\n if (tag !== 72) {\n break;\n }\n\n message.unkParam2 = reader.int32();\n continue;\n }\n }\n if ((tag & 7) === 4 || tag === 0) {\n break;\n }\n reader.skip(tag & 7);\n }\n return message;\n },\n};\n\nfunction createBaseGetCommentsSectionParams_Params_RepliesOptions_UnkOpts(): GetCommentsSectionParams_Params_RepliesOptions_UnkOpts {\n return { unkParam: 0 };\n}\n\nexport const GetCommentsSectionParams_Params_RepliesOptions_UnkOpts: MessageFns<\n GetCommentsSectionParams_Params_RepliesOptions_UnkOpts\n> = {\n encode(\n message: GetCommentsSectionParams_Params_RepliesOptions_UnkOpts,\n writer: BinaryWriter = new BinaryWriter(),\n ): BinaryWriter {\n if (message.unkParam !== 0) {\n writer.uint32(8).int32(message.unkParam);\n }\n return writer;\n },\n\n decode(input: BinaryReader | Uint8Array, length?: number): GetCommentsSectionParams_Params_RepliesOptions_UnkOpts {\n const reader = input instanceof BinaryReader ? input : new BinaryReader(input);\n const end = length === undefined ? reader.len : reader.pos + length;\n const message = createBaseGetCommentsSectionParams_Params_RepliesOptions_UnkOpts();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (tag !== 8) {\n break;\n }\n\n message.unkParam = reader.int32();\n continue;\n }\n }\n if ((tag & 7) === 4 || tag === 0) {\n break;\n }\n reader.skip(tag & 7);\n }\n return message;\n },\n};\n\nfunction createBaseCreateCommentParams(): CreateCommentParams {\n return { videoId: \"\", params: undefined, number: 0 };\n}\n\nexport const CreateCommentParams: MessageFns = {\n encode(message: CreateCommentParams, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {\n if (message.videoId !== \"\") {\n writer.uint32(18).string(message.videoId);\n }\n if (message.params !== undefined) {\n CreateCommentParams_Params.encode(message.params, writer.uint32(42).fork()).join();\n }\n if (message.number !== 0) {\n writer.uint32(80).int32(message.number);\n }\n return writer;\n },\n\n decode(input: BinaryReader | Uint8Array, length?: number): CreateCommentParams {\n const reader = input instanceof BinaryReader ? input : new BinaryReader(input);\n const end = length === undefined ? reader.len : reader.pos + length;\n const message = createBaseCreateCommentParams();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 2: {\n if (tag !== 18) {\n break;\n }\n\n message.videoId = reader.string();\n continue;\n }\n case 5: {\n if (tag !== 42) {\n break;\n }\n\n message.params = CreateCommentParams_Params.decode(reader, reader.uint32());\n continue;\n }\n case 10: {\n if (tag !== 80) {\n break;\n }\n\n message.number = reader.int32();\n continue;\n }\n }\n if ((tag & 7) === 4 || tag === 0) {\n break;\n }\n reader.skip(tag & 7);\n }\n return message;\n },\n};\n\nfunction createBaseCreateCommentParams_Params(): CreateCommentParams_Params {\n return { index: 0 };\n}\n\nexport const CreateCommentParams_Params: MessageFns = {\n encode(message: CreateCommentParams_Params, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {\n if (message.index !== 0) {\n writer.uint32(8).int32(message.index);\n }\n return writer;\n },\n\n decode(input: BinaryReader | Uint8Array, length?: number): CreateCommentParams_Params {\n const reader = input instanceof BinaryReader ? input : new BinaryReader(input);\n const end = length === undefined ? reader.len : reader.pos + length;\n const message = createBaseCreateCommentParams_Params();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (tag !== 8) {\n break;\n }\n\n message.index = reader.int32();\n continue;\n }\n }\n if ((tag & 7) === 4 || tag === 0) {\n break;\n }\n reader.skip(tag & 7);\n }\n return message;\n },\n};\n\nfunction createBasePeformCommentActionParams(): PeformCommentActionParams {\n return {\n type: 0,\n commentId: \"\",\n videoId: \"\",\n unkNum: undefined,\n channelId: undefined,\n translateCommentParams: undefined,\n };\n}\n\nexport const PeformCommentActionParams: MessageFns = {\n encode(message: PeformCommentActionParams, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {\n if (message.type !== 0) {\n writer.uint32(8).int32(message.type);\n }\n if (message.commentId !== \"\") {\n writer.uint32(26).string(message.commentId);\n }\n if (message.videoId !== \"\") {\n writer.uint32(42).string(message.videoId);\n }\n if (message.unkNum !== undefined) {\n writer.uint32(16).int32(message.unkNum);\n }\n if (message.channelId !== undefined) {\n writer.uint32(186).string(message.channelId);\n }\n if (message.translateCommentParams !== undefined) {\n PeformCommentActionParams_TranslateCommentParams.encode(message.translateCommentParams, writer.uint32(250).fork())\n .join();\n }\n return writer;\n },\n\n decode(input: BinaryReader | Uint8Array, length?: number): PeformCommentActionParams {\n const reader = input instanceof BinaryReader ? input : new BinaryReader(input);\n const end = length === undefined ? reader.len : reader.pos + length;\n const message = createBasePeformCommentActionParams();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (tag !== 8) {\n break;\n }\n\n message.type = reader.int32();\n continue;\n }\n case 3: {\n if (tag !== 26) {\n break;\n }\n\n message.commentId = reader.string();\n continue;\n }\n case 5: {\n if (tag !== 42) {\n break;\n }\n\n message.videoId = reader.string();\n continue;\n }\n case 2: {\n if (tag !== 16) {\n break;\n }\n\n message.unkNum = reader.int32();\n continue;\n }\n case 23: {\n if (tag !== 186) {\n break;\n }\n\n message.channelId = reader.string();\n continue;\n }\n case 31: {\n if (tag !== 250) {\n break;\n }\n\n message.translateCommentParams = PeformCommentActionParams_TranslateCommentParams.decode(\n reader,\n reader.uint32(),\n );\n continue;\n }\n }\n if ((tag & 7) === 4 || tag === 0) {\n break;\n }\n reader.skip(tag & 7);\n }\n return message;\n },\n};\n\nfunction createBasePeformCommentActionParams_TranslateCommentParams(): PeformCommentActionParams_TranslateCommentParams {\n return { params: undefined, commentId: \"\", targetLanguage: \"\" };\n}\n\nexport const PeformCommentActionParams_TranslateCommentParams: MessageFns<\n PeformCommentActionParams_TranslateCommentParams\n> = {\n encode(\n message: PeformCommentActionParams_TranslateCommentParams,\n writer: BinaryWriter = new BinaryWriter(),\n ): BinaryWriter {\n if (message.params !== undefined) {\n PeformCommentActionParams_TranslateCommentParams_Params.encode(message.params, writer.uint32(26).fork()).join();\n }\n if (message.commentId !== \"\") {\n writer.uint32(18).string(message.commentId);\n }\n if (message.targetLanguage !== \"\") {\n writer.uint32(34).string(message.targetLanguage);\n }\n return writer;\n },\n\n decode(input: BinaryReader | Uint8Array, length?: number): PeformCommentActionParams_TranslateCommentParams {\n const reader = input instanceof BinaryReader ? input : new BinaryReader(input);\n const end = length === undefined ? reader.len : reader.pos + length;\n const message = createBasePeformCommentActionParams_TranslateCommentParams();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 3: {\n if (tag !== 26) {\n break;\n }\n\n message.params = PeformCommentActionParams_TranslateCommentParams_Params.decode(reader, reader.uint32());\n continue;\n }\n case 2: {\n if (tag !== 18) {\n break;\n }\n\n message.commentId = reader.string();\n continue;\n }\n case 4: {\n if (tag !== 34) {\n break;\n }\n\n message.targetLanguage = reader.string();\n continue;\n }\n }\n if ((tag & 7) === 4 || tag === 0) {\n break;\n }\n reader.skip(tag & 7);\n }\n return message;\n },\n};\n\nfunction createBasePeformCommentActionParams_TranslateCommentParams_Params(): PeformCommentActionParams_TranslateCommentParams_Params {\n return { comment: undefined };\n}\n\nexport const PeformCommentActionParams_TranslateCommentParams_Params: MessageFns<\n PeformCommentActionParams_TranslateCommentParams_Params\n> = {\n encode(\n message: PeformCommentActionParams_TranslateCommentParams_Params,\n writer: BinaryWriter = new BinaryWriter(),\n ): BinaryWriter {\n if (message.comment !== undefined) {\n PeformCommentActionParams_TranslateCommentParams_Params_Comment.encode(message.comment, writer.uint32(10).fork())\n .join();\n }\n return writer;\n },\n\n decode(input: BinaryReader | Uint8Array, length?: number): PeformCommentActionParams_TranslateCommentParams_Params {\n const reader = input instanceof BinaryReader ? input : new BinaryReader(input);\n const end = length === undefined ? reader.len : reader.pos + length;\n const message = createBasePeformCommentActionParams_TranslateCommentParams_Params();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (tag !== 10) {\n break;\n }\n\n message.comment = PeformCommentActionParams_TranslateCommentParams_Params_Comment.decode(\n reader,\n reader.uint32(),\n );\n continue;\n }\n }\n if ((tag & 7) === 4 || tag === 0) {\n break;\n }\n reader.skip(tag & 7);\n }\n return message;\n },\n};\n\nfunction createBasePeformCommentActionParams_TranslateCommentParams_Params_Comment(): PeformCommentActionParams_TranslateCommentParams_Params_Comment {\n return { text: \"\" };\n}\n\nexport const PeformCommentActionParams_TranslateCommentParams_Params_Comment: MessageFns<\n PeformCommentActionParams_TranslateCommentParams_Params_Comment\n> = {\n encode(\n message: PeformCommentActionParams_TranslateCommentParams_Params_Comment,\n writer: BinaryWriter = new BinaryWriter(),\n ): BinaryWriter {\n if (message.text !== \"\") {\n writer.uint32(10).string(message.text);\n }\n return writer;\n },\n\n decode(\n input: BinaryReader | Uint8Array,\n length?: number,\n ): PeformCommentActionParams_TranslateCommentParams_Params_Comment {\n const reader = input instanceof BinaryReader ? input : new BinaryReader(input);\n const end = length === undefined ? reader.len : reader.pos + length;\n const message = createBasePeformCommentActionParams_TranslateCommentParams_Params_Comment();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (tag !== 10) {\n break;\n }\n\n message.text = reader.string();\n continue;\n }\n }\n if ((tag & 7) === 4 || tag === 0) {\n break;\n }\n reader.skip(tag & 7);\n }\n return message;\n },\n};\n\nfunction createBaseHashtag(): Hashtag {\n return { params: undefined };\n}\n\nexport const Hashtag: MessageFns = {\n encode(message: Hashtag, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {\n if (message.params !== undefined) {\n Hashtag_Params.encode(message.params, writer.uint32(746).fork()).join();\n }\n return writer;\n },\n\n decode(input: BinaryReader | Uint8Array, length?: number): Hashtag {\n const reader = input instanceof BinaryReader ? input : new BinaryReader(input);\n const end = length === undefined ? reader.len : reader.pos + length;\n const message = createBaseHashtag();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 93: {\n if (tag !== 746) {\n break;\n }\n\n message.params = Hashtag_Params.decode(reader, reader.uint32());\n continue;\n }\n }\n if ((tag & 7) === 4 || tag === 0) {\n break;\n }\n reader.skip(tag & 7);\n }\n return message;\n },\n};\n\nfunction createBaseHashtag_Params(): Hashtag_Params {\n return { hashtag: \"\", type: 0 };\n}\n\nexport const Hashtag_Params: MessageFns = {\n encode(message: Hashtag_Params, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {\n if (message.hashtag !== \"\") {\n writer.uint32(10).string(message.hashtag);\n }\n if (message.type !== 0) {\n writer.uint32(24).int32(message.type);\n }\n return writer;\n },\n\n decode(input: BinaryReader | Uint8Array, length?: number): Hashtag_Params {\n const reader = input instanceof BinaryReader ? input : new BinaryReader(input);\n const end = length === undefined ? reader.len : reader.pos + length;\n const message = createBaseHashtag_Params();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (tag !== 10) {\n break;\n }\n\n message.hashtag = reader.string();\n continue;\n }\n case 3: {\n if (tag !== 24) {\n break;\n }\n\n message.type = reader.int32();\n continue;\n }\n }\n if ((tag & 7) === 4 || tag === 0) {\n break;\n }\n reader.skip(tag & 7);\n }\n return message;\n },\n};\n\nfunction createBaseReelSequence(): ReelSequence {\n return { shortId: \"\", params: undefined, feature2: 0, feature3: 0 };\n}\n\nexport const ReelSequence: MessageFns = {\n encode(message: ReelSequence, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {\n if (message.shortId !== \"\") {\n writer.uint32(10).string(message.shortId);\n }\n if (message.params !== undefined) {\n ReelSequence_Params.encode(message.params, writer.uint32(42).fork()).join();\n }\n if (message.feature2 !== 0) {\n writer.uint32(80).int32(message.feature2);\n }\n if (message.feature3 !== 0) {\n writer.uint32(104).int32(message.feature3);\n }\n return writer;\n },\n\n decode(input: BinaryReader | Uint8Array, length?: number): ReelSequence {\n const reader = input instanceof BinaryReader ? input : new BinaryReader(input);\n const end = length === undefined ? reader.len : reader.pos + length;\n const message = createBaseReelSequence();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (tag !== 10) {\n break;\n }\n\n message.shortId = reader.string();\n continue;\n }\n case 5: {\n if (tag !== 42) {\n break;\n }\n\n message.params = ReelSequence_Params.decode(reader, reader.uint32());\n continue;\n }\n case 10: {\n if (tag !== 80) {\n break;\n }\n\n message.feature2 = reader.int32();\n continue;\n }\n case 13: {\n if (tag !== 104) {\n break;\n }\n\n message.feature3 = reader.int32();\n continue;\n }\n }\n if ((tag & 7) === 4 || tag === 0) {\n break;\n }\n reader.skip(tag & 7);\n }\n return message;\n },\n};\n\nfunction createBaseReelSequence_Params(): ReelSequence_Params {\n return { number: 0 };\n}\n\nexport const ReelSequence_Params: MessageFns = {\n encode(message: ReelSequence_Params, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {\n if (message.number !== 0) {\n writer.uint32(24).int32(message.number);\n }\n return writer;\n },\n\n decode(input: BinaryReader | Uint8Array, length?: number): ReelSequence_Params {\n const reader = input instanceof BinaryReader ? input : new BinaryReader(input);\n const end = length === undefined ? reader.len : reader.pos + length;\n const message = createBaseReelSequence_Params();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 3: {\n if (tag !== 24) {\n break;\n }\n\n message.number = reader.int32();\n continue;\n }\n }\n if ((tag & 7) === 4 || tag === 0) {\n break;\n }\n reader.skip(tag & 7);\n }\n return message;\n },\n};\n\nfunction createBaseShortsParam(): ShortsParam {\n return { f1: undefined, p59: undefined };\n}\n\nexport const ShortsParam: MessageFns = {\n encode(message: ShortsParam, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {\n if (message.f1 !== undefined) {\n ShortsParam_Field1.encode(message.f1, writer.uint32(10).fork()).join();\n }\n if (message.p59 !== undefined) {\n writer.uint32(472).int32(message.p59);\n }\n return writer;\n },\n\n decode(input: BinaryReader | Uint8Array, length?: number): ShortsParam {\n const reader = input instanceof BinaryReader ? input : new BinaryReader(input);\n const end = length === undefined ? reader.len : reader.pos + length;\n const message = createBaseShortsParam();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (tag !== 10) {\n break;\n }\n\n message.f1 = ShortsParam_Field1.decode(reader, reader.uint32());\n continue;\n }\n case 59: {\n if (tag !== 472) {\n break;\n }\n\n message.p59 = reader.int32();\n continue;\n }\n }\n if ((tag & 7) === 4 || tag === 0) {\n break;\n }\n reader.skip(tag & 7);\n }\n return message;\n },\n};\n\nfunction createBaseShortsParam_Field1(): ShortsParam_Field1 {\n return { p1: undefined };\n}\n\nexport const ShortsParam_Field1: MessageFns = {\n encode(message: ShortsParam_Field1, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {\n if (message.p1 !== undefined) {\n writer.uint32(8).int32(message.p1);\n }\n return writer;\n },\n\n decode(input: BinaryReader | Uint8Array, length?: number): ShortsParam_Field1 {\n const reader = input instanceof BinaryReader ? input : new BinaryReader(input);\n const end = length === undefined ? reader.len : reader.pos + length;\n const message = createBaseShortsParam_Field1();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (tag !== 8) {\n break;\n }\n\n message.p1 = reader.int32();\n continue;\n }\n }\n if ((tag & 7) === 4 || tag === 0) {\n break;\n }\n reader.skip(tag & 7);\n }\n return message;\n },\n};\n\nfunction createBaseNextParams(): NextParams {\n return { videoId: [], playlistTitle: undefined };\n}\n\nexport const NextParams: MessageFns = {\n encode(message: NextParams, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {\n for (const v of message.videoId) {\n writer.uint32(42).string(v!);\n }\n if (message.playlistTitle !== undefined) {\n writer.uint32(50).string(message.playlistTitle);\n }\n return writer;\n },\n\n decode(input: BinaryReader | Uint8Array, length?: number): NextParams {\n const reader = input instanceof BinaryReader ? input : new BinaryReader(input);\n const end = length === undefined ? reader.len : reader.pos + length;\n const message = createBaseNextParams();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 5: {\n if (tag !== 42) {\n break;\n }\n\n message.videoId.push(reader.string());\n continue;\n }\n case 6: {\n if (tag !== 50) {\n break;\n }\n\n message.playlistTitle = reader.string();\n continue;\n }\n }\n if ((tag & 7) === 4 || tag === 0) {\n break;\n }\n reader.skip(tag & 7);\n }\n return message;\n },\n};\n\nfunction createBaseCommunityPostParams(): CommunityPostParams {\n return { f1: undefined };\n}\n\nexport const CommunityPostParams: MessageFns = {\n encode(message: CommunityPostParams, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {\n if (message.f1 !== undefined) {\n CommunityPostParams_Field1.encode(message.f1, writer.uint32(450).fork()).join();\n }\n return writer;\n },\n\n decode(input: BinaryReader | Uint8Array, length?: number): CommunityPostParams {\n const reader = input instanceof BinaryReader ? input : new BinaryReader(input);\n const end = length === undefined ? reader.len : reader.pos + length;\n const message = createBaseCommunityPostParams();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 56: {\n if (tag !== 450) {\n break;\n }\n\n message.f1 = CommunityPostParams_Field1.decode(reader, reader.uint32());\n continue;\n }\n }\n if ((tag & 7) === 4 || tag === 0) {\n break;\n }\n reader.skip(tag & 7);\n }\n return message;\n },\n};\n\nfunction createBaseCommunityPostParams_Field1(): CommunityPostParams_Field1 {\n return { ucid1: \"\", postId: \"\", ucid2: \"\" };\n}\n\nexport const CommunityPostParams_Field1: MessageFns = {\n encode(message: CommunityPostParams_Field1, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {\n if (message.ucid1 !== \"\") {\n writer.uint32(18).string(message.ucid1);\n }\n if (message.postId !== \"\") {\n writer.uint32(26).string(message.postId);\n }\n if (message.ucid2 !== \"\") {\n writer.uint32(90).string(message.ucid2);\n }\n return writer;\n },\n\n decode(input: BinaryReader | Uint8Array, length?: number): CommunityPostParams_Field1 {\n const reader = input instanceof BinaryReader ? input : new BinaryReader(input);\n const end = length === undefined ? reader.len : reader.pos + length;\n const message = createBaseCommunityPostParams_Field1();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 2: {\n if (tag !== 18) {\n break;\n }\n\n message.ucid1 = reader.string();\n continue;\n }\n case 3: {\n if (tag !== 26) {\n break;\n }\n\n message.postId = reader.string();\n continue;\n }\n case 11: {\n if (tag !== 90) {\n break;\n }\n\n message.ucid2 = reader.string();\n continue;\n }\n }\n if ((tag & 7) === 4 || tag === 0) {\n break;\n }\n reader.skip(tag & 7);\n }\n return message;\n },\n};\n\nfunction createBaseCommunityPostCommentsParamContainer(): CommunityPostCommentsParamContainer {\n return { f0: undefined };\n}\n\nexport const CommunityPostCommentsParamContainer: MessageFns = {\n encode(message: CommunityPostCommentsParamContainer, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {\n if (message.f0 !== undefined) {\n CommunityPostCommentsParamContainer_Container.encode(message.f0, writer.uint32(641815778).fork()).join();\n }\n return writer;\n },\n\n decode(input: BinaryReader | Uint8Array, length?: number): CommunityPostCommentsParamContainer {\n const reader = input instanceof BinaryReader ? input : new BinaryReader(input);\n const end = length === undefined ? reader.len : reader.pos + length;\n const message = createBaseCommunityPostCommentsParamContainer();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 80226972: {\n if (tag !== 641815778) {\n break;\n }\n\n message.f0 = CommunityPostCommentsParamContainer_Container.decode(reader, reader.uint32());\n continue;\n }\n }\n if ((tag & 7) === 4 || tag === 0) {\n break;\n }\n reader.skip(tag & 7);\n }\n return message;\n },\n};\n\nfunction createBaseCommunityPostCommentsParamContainer_Container(): CommunityPostCommentsParamContainer_Container {\n return { location: \"\", protoData: \"\" };\n}\n\nexport const CommunityPostCommentsParamContainer_Container: MessageFns =\n {\n encode(\n message: CommunityPostCommentsParamContainer_Container,\n writer: BinaryWriter = new BinaryWriter(),\n ): BinaryWriter {\n if (message.location !== \"\") {\n writer.uint32(18).string(message.location);\n }\n if (message.protoData !== \"\") {\n writer.uint32(26).string(message.protoData);\n }\n return writer;\n },\n\n decode(input: BinaryReader | Uint8Array, length?: number): CommunityPostCommentsParamContainer_Container {\n const reader = input instanceof BinaryReader ? input : new BinaryReader(input);\n const end = length === undefined ? reader.len : reader.pos + length;\n const message = createBaseCommunityPostCommentsParamContainer_Container();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 2: {\n if (tag !== 18) {\n break;\n }\n\n message.location = reader.string();\n continue;\n }\n case 3: {\n if (tag !== 26) {\n break;\n }\n\n message.protoData = reader.string();\n continue;\n }\n }\n if ((tag & 7) === 4 || tag === 0) {\n break;\n }\n reader.skip(tag & 7);\n }\n return message;\n },\n };\n\nfunction createBaseCommunityPostCommentsParam(): CommunityPostCommentsParam {\n return { title: \"\", commentDataContainer: undefined };\n}\n\nexport const CommunityPostCommentsParam: MessageFns = {\n encode(message: CommunityPostCommentsParam, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {\n if (message.title !== \"\") {\n writer.uint32(18).string(message.title);\n }\n if (message.commentDataContainer !== undefined) {\n CommunityPostCommentsParam_CommentDataContainer.encode(message.commentDataContainer, writer.uint32(426).fork())\n .join();\n }\n return writer;\n },\n\n decode(input: BinaryReader | Uint8Array, length?: number): CommunityPostCommentsParam {\n const reader = input instanceof BinaryReader ? input : new BinaryReader(input);\n const end = length === undefined ? reader.len : reader.pos + length;\n const message = createBaseCommunityPostCommentsParam();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 2: {\n if (tag !== 18) {\n break;\n }\n\n message.title = reader.string();\n continue;\n }\n case 53: {\n if (tag !== 426) {\n break;\n }\n\n message.commentDataContainer = CommunityPostCommentsParam_CommentDataContainer.decode(\n reader,\n reader.uint32(),\n );\n continue;\n }\n }\n if ((tag & 7) === 4 || tag === 0) {\n break;\n }\n reader.skip(tag & 7);\n }\n return message;\n },\n};\n\nfunction createBaseCommunityPostCommentsParam_CommentDataContainer(): CommunityPostCommentsParam_CommentDataContainer {\n return { commentData: undefined, f0: 0, title: \"\" };\n}\n\nexport const CommunityPostCommentsParam_CommentDataContainer: MessageFns<\n CommunityPostCommentsParam_CommentDataContainer\n> = {\n encode(\n message: CommunityPostCommentsParam_CommentDataContainer,\n writer: BinaryWriter = new BinaryWriter(),\n ): BinaryWriter {\n if (message.commentData !== undefined) {\n CommunityPostCommentsParam_CommentDataContainer_CommentData.encode(message.commentData, writer.uint32(34).fork())\n .join();\n }\n if (message.f0 !== 0) {\n writer.uint32(56).int32(message.f0);\n }\n if (message.title !== \"\") {\n writer.uint32(66).string(message.title);\n }\n return writer;\n },\n\n decode(input: BinaryReader | Uint8Array, length?: number): CommunityPostCommentsParam_CommentDataContainer {\n const reader = input instanceof BinaryReader ? input : new BinaryReader(input);\n const end = length === undefined ? reader.len : reader.pos + length;\n const message = createBaseCommunityPostCommentsParam_CommentDataContainer();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 4: {\n if (tag !== 34) {\n break;\n }\n\n message.commentData = CommunityPostCommentsParam_CommentDataContainer_CommentData.decode(\n reader,\n reader.uint32(),\n );\n continue;\n }\n case 7: {\n if (tag !== 56) {\n break;\n }\n\n message.f0 = reader.int32();\n continue;\n }\n case 8: {\n if (tag !== 66) {\n break;\n }\n\n message.title = reader.string();\n continue;\n }\n }\n if ((tag & 7) === 4 || tag === 0) {\n break;\n }\n reader.skip(tag & 7);\n }\n return message;\n },\n};\n\nfunction createBaseCommunityPostCommentsParam_CommentDataContainer_CommentData(): CommunityPostCommentsParam_CommentDataContainer_CommentData {\n return { sortBy: 0, f0: 0, f1: 0, postId: \"\", channelId: \"\" };\n}\n\nexport const CommunityPostCommentsParam_CommentDataContainer_CommentData: MessageFns<\n CommunityPostCommentsParam_CommentDataContainer_CommentData\n> = {\n encode(\n message: CommunityPostCommentsParam_CommentDataContainer_CommentData,\n writer: BinaryWriter = new BinaryWriter(),\n ): BinaryWriter {\n if (message.sortBy !== 0) {\n writer.uint32(48).int32(message.sortBy);\n }\n if (message.f0 !== 0) {\n writer.uint32(120).int32(message.f0);\n }\n if (message.f1 !== 0) {\n writer.uint32(200).int32(message.f1);\n }\n if (message.postId !== \"\") {\n writer.uint32(234).string(message.postId);\n }\n if (message.channelId !== \"\") {\n writer.uint32(242).string(message.channelId);\n }\n return writer;\n },\n\n decode(\n input: BinaryReader | Uint8Array,\n length?: number,\n ): CommunityPostCommentsParam_CommentDataContainer_CommentData {\n const reader = input instanceof BinaryReader ? input : new BinaryReader(input);\n const end = length === undefined ? reader.len : reader.pos + length;\n const message = createBaseCommunityPostCommentsParam_CommentDataContainer_CommentData();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 6: {\n if (tag !== 48) {\n break;\n }\n\n message.sortBy = reader.int32();\n continue;\n }\n case 15: {\n if (tag !== 120) {\n break;\n }\n\n message.f0 = reader.int32();\n continue;\n }\n case 25: {\n if (tag !== 200) {\n break;\n }\n\n message.f1 = reader.int32();\n continue;\n }\n case 29: {\n if (tag !== 234) {\n break;\n }\n\n message.postId = reader.string();\n continue;\n }\n case 30: {\n if (tag !== 242) {\n break;\n }\n\n message.channelId = reader.string();\n continue;\n }\n }\n if ((tag & 7) === 4 || tag === 0) {\n break;\n }\n reader.skip(tag & 7);\n }\n return message;\n },\n};\n\nexport interface MessageFns {\n encode(message: T, writer?: BinaryWriter): BinaryWriter;\n decode(input: BinaryReader | Uint8Array, length?: number): T;\n}\n", "import type { ESTree } from 'meriyah';\nimport type { JsAnalyzer } from './JsAnalyzer.js';\n\nexport const WALK_STOP = Symbol('WALK_STOP');\n\nexport const jsBuiltIns = new Set([\n 'AbortController', 'AbortSignal', 'Array', 'ArrayBuffer', 'AsyncContext', 'Atomics', 'AudioContext', 'BigInt', 'BigInt64Array', 'BigUint64Array',\n 'Blob', 'Boolean', 'BroadcastChannel', 'Buffer', 'CanvasRenderingContext2D', 'clearImmediate', 'clearInterval', 'clearTimeout', 'confirm',\n 'console', 'Crypto', 'CustomEvent', 'DataView', 'Date', 'decodeURI', 'decodeURIComponent', 'document', 'Element', 'encodeURI',\n 'encodeURIComponent', 'Error', 'escape', 'eval', 'Event', 'EventTarget', 'fetch', 'File', 'FileReader', 'Float32Array', 'Float64Array',\n 'FormData', 'function', 'global', 'globalThis', 'hasOwnProperty', 'Headers', 'History', 'HTMLElement', 'HTMLCollection', 'IDBKeyRange',\n 'Infinity', 'Int16Array', 'Int32Array', 'Int8Array', 'Intl', 'IntersectionObserver', 'isFinite', 'isNaN', 'isPrototypeOf', 'JSON',\n 'location', 'log', 'Map', 'Math', 'MediaRecorder', 'MediaSource', 'MediaStream', 'MemberExpression', 'MutationObserver', 'NaN',\n 'navigator', 'Node', 'NodeList', 'Number', 'Object', 'OfflineAudioContext', 'parse', 'parseFloat', 'parseInt', 'Performance',\n 'process', 'Promise', 'prompt', 'prototype', 'Proxy', 'ReadableStream', 'Reflect', 'RegExp', 'requestAnimationFrame', 'requestIdleCallback',\n 'Request', 'Response', 'ResizeObserver', 'Screen', 'setImmediate', 'setInterval', 'setTimeout', 'SharedArrayBuffer', 'SharedWorker',\n 'SourceBuffer', 'split', 'String', 'stringify', 'structuredClone', 'SubtleCrypto', 'Symbol', 'TextDecoder', 'TextEncoder', 'this',\n 'toString', 'TransformStream', 'Uint16Array', 'Uint32Array', 'Uint8Array', 'Uint8ClampedArray', 'undefined', 'unescape', 'URL',\n 'URLSearchParams', 'valueOf', 'WeakMap', 'WeakSet', 'WebAssembly', 'WebGLRenderingContext', 'window', 'Worker', 'WritableStream',\n 'XMLHttpRequest', 'alert', 'arguments', 'atob', 'btoa', 'cancelAnimationFrame', 'cancelIdleCallback', 'queueMicrotask'\n]);\n\nexport const indent = ' '; // 2 spaces.\n\nexport type AstVisitResult = boolean | typeof WALK_STOP | void;\nexport type AstVisitFn = (node: ESTree.Node, parent: ESTree.Node | null, ancestors: ESTree.Node[]) => AstVisitResult;\n\nexport interface AstVisitObject {\n /**\n * Callback invoked when an AST node is entered.\n * @param node - Current AST node being visited.\n * @param parent - Parent of the current AST node, or null if it's the root.\n * @param ancestors - Array of ancestor nodes, starting from the root down to the parent.\n * @returns \n * - `true` to skip traversing this node's children.\n * - `WALK_STOP` to halt the entire traversal.\n * - `void`/`undefined` to continue normal traversal.\n */\n enter?(node: ESTree.Node, parent: ESTree.Node | null, ancestors: ESTree.Node[]): AstVisitResult;\n /**\n * Callback invoked when an AST node is exited.\n * @param node - Current AST node being exited.\n * @param parent - Parent of the current AST node, or null if it's the root.\n * @param ancestors - Array of ancestor nodes, starting from the root down to the parent.\n * @returns\n * - `WALK_STOP` to halt the entire traversal.\n * - `void`/`undefined` to continue normal traversal.\n */\n leave?(node: ESTree.Node, parent: ESTree.Node | null, ancestors: ESTree.Node[]): AstVisitResult;\n}\n\nexport type AstVisitor = AstVisitFn | AstVisitObject;\n\n/**\n * Performs traversal of an ESTree AST.\n * @param root - Root AST node to start the traversal from.\n * @param visitor - Callbacks invoked when nodes are entered or left.\n * @remarks\n * - If it returns `WALK_STOP`, the entire traversal is halted.\n * - Why did I not use some AST walker library instead?: They're too slow.\n */\nexport function walkAst(root: ESTree.Node, visitor: AstVisitor): void {\n if (!root || typeof root !== 'object') return;\n\n const stack: {\n node: ESTree.Node;\n parent: ESTree.Node | null;\n exit: boolean;\n }[] = [ { node: root, parent: null, exit: false } ];\n\n const ancestors: ESTree.Node[] = [];\n\n const enter = typeof visitor === 'function' ? visitor : visitor.enter ?? null;\n const leave = typeof visitor === 'function' ? null : visitor.leave ?? null;\n\n let shouldStop = false;\n\n while (!shouldStop && stack.length > 0) {\n const frame = stack.pop()!;\n const { node, parent, exit } = frame;\n\n if (exit) {\n ancestors.pop();\n if (leave && leave(node, parent, ancestors) === WALK_STOP) {\n shouldStop = true;\n }\n continue;\n }\n\n if (!node || typeof node.type !== 'string') continue;\n\n const result = enter ? enter(node, parent, ancestors) : undefined;\n\n if (result === WALK_STOP) {\n shouldStop = true;\n continue;\n }\n\n if (result === true) continue;\n\n stack.push({ node, parent, exit: true });\n ancestors.push(node);\n\n for (const key in node) {\n if (key === 'loc' || key === 'range' || key === 'start' || key === 'end') continue;\n if (!Object.prototype.hasOwnProperty.call(node, key)) continue;\n\n const value = (node as any)[key];\n if (!value) continue;\n\n if (Array.isArray(value)) {\n for (let i = value.length - 1; i >= 0; i--) {\n const item = value[i];\n if (item && typeof item.type === 'string') {\n stack.push({ node: item, parent: node, exit: false });\n }\n }\n } else if (typeof value === 'object' && typeof (value as any).type === 'string') {\n stack.push({ node: value, parent: node, exit: false });\n }\n }\n }\n}\n\n/**\n * Returns the source range of an ESTree node as a tuple of start and end positions.\n * @param node - The ESTree node to extract the source range from.\n * @returns A tuple `[start, end]` representing the source range, or `null` if unavailable.\n */\nexport function getNodeSourceRange(node: ESTree.Node | null | undefined): [number, number] | null {\n if (!node) return null;\n if (Array.isArray(node.range)) return node.range;\n if (typeof node.start === 'number' && typeof node.end === 'number') return [ node.start, node.end ];\n return null;\n};\n\n/**\n * Extracts the source code corresponding to a given AST node.\n * @param node - The AST node to extract source from.\n * @param source - The original source code.\n * @returns The source code corresponding to the node, or null if not available.\n */\nexport function extractNodeSource(node: ESTree.Node | null | undefined, source: string): string | null {\n const range = getNodeSourceRange(node);\n return range ? source.slice(range[0], range[1]) : null;\n};\n\n/**\n * Converts a member expression into its dot/bracket string form.\n * @param memberExpression - Member expression node to stringify.\n * @param source - Original source code for range lookups.\n */\nexport function memberToString(memberExpression: ESTree.Node, source: string): string | null {\n if (memberExpression.type !== 'MemberExpression') return null;\n\n const segments: string[] = [];\n let cur: ESTree.Node = memberExpression;\n\n while (cur && cur.type === 'MemberExpression') {\n const member = cur as ESTree.MemberExpression;\n const prop = member.property;\n if (!prop) return null;\n\n if (member.computed) {\n // I just don't want to bother with nested computed nodes... :P\n const propSource = extractNodeSource(prop, source);\n if (!propSource) return null;\n segments.unshift(`[${propSource.trim()}]`);\n } else {\n if (prop.type !== 'Identifier') return null;\n segments.unshift(`.${prop.name}`);\n }\n\n cur = member.object;\n }\n\n let base: string | null = null;\n\n if (cur?.type === 'Identifier') {\n base = cur.name;\n } else if (cur?.type === 'ThisExpression') {\n base = 'this';\n }\n\n return base ? base + segments.join('') : null;\n};\n\n/**\n * Retrieves the base identifier for a member expression chain.\n * @param memberExpression - Member expression whose root should be resolved.\n * @param source - Original source code for range lookups.\n */\nexport function memberBaseName(memberExpression: ESTree.MemberExpression, source: string): string | null {\n let target: ESTree.Node | null = memberExpression.object as ESTree.Node;\n\n while (target && target.type === 'MemberExpression') {\n const parentName = memberToString(target, source);\n if (parentName) return parentName;\n target = (target as ESTree.MemberExpression).object as ESTree.Node;\n }\n\n if (target?.type === 'Identifier') return target.name;\n if (target?.type === 'ThisExpression') return 'this';\n\n return null;\n};\n\n/**\n * Analyzes an AST node to determine if it's a function call or a function\n * declaration. Based on that, it then creates a new JavaScript function as\n * a string. This new function acts as a wrapper, taking a single 'input' \n * argument and forwarding it to the original function call.\n *\n * Currently can handle:\n * - `CallExpression`: Creates a wrapper that invokes the function being called in the expression.\n * - `VariableDeclarator` with a `FunctionExpression`: Creates a wrapper that calls the declared function.\n *\n * @param analyzer - The `JSAnalyzer` instance, used to resolve context like declared variables.\n * @param name - The name for the new wrapper function to be created.\n * @param node - The ESTree node.\n * @todo Look for edge cases.\n */\nexport function createWrapperFunction(analyzer: JsAnalyzer, name: string, node: ESTree.Node): string | undefined {\n if (\n node.type === 'CallExpression' &&\n node.callee.type === 'Identifier' &&\n analyzer.declaredVariables.has(node.callee.name)\n ) {\n return generateWrapper(name, node.callee.name, parseFunctionArguments(analyzer, node.arguments));\n } else if (\n node.type === 'VariableDeclarator' &&\n node.init?.type === 'FunctionExpression' &&\n node.id.type === 'Identifier'\n ) {\n return generateWrapper(name, node.id.name, parseFunctionArguments(analyzer, node.init.params));\n } else if (\n node.type === 'NewExpression' &&\n node.callee.type === 'MemberExpression' &&\n node.callee.object.type === 'Identifier'\n ) {\n const targetFunction = memberToString(node.callee, analyzer.getSource());\n if (!targetFunction) return undefined;\n return generateWrapper(name, targetFunction, parseFunctionArguments(analyzer, node.arguments), true);\n }\n}\n\n/**\n * Generates a wrapper function string.\n * @param functionName - The name of the wrapper function.\n * @param targetFunction - The name of the target function to call.\n * @param args - The arguments to pass to the target function.\n */\nfunction generateWrapper(functionName: string, targetFunction: string, args: string[], useNew: boolean = false): string {\n return [\n `${indent}function ${functionName}(${args.join(', ')}) {`,\n `${indent}${indent}return ${useNew ? 'new ' : ''}${targetFunction}(${args.join(', ')});`,\n `${indent}}`\n ].join('\\n');\n}\n\n/**\n * Parses function arguments to create a string representation suitable for\n * use in our custom function calls.\n * @param analyzer - The JsAnalyzer instance to use.\n * @param args - The function arguments to parse.\n */\nfunction parseFunctionArguments(analyzer: JsAnalyzer, args: ESTree.Node[]) {\n const params: string[] = [];\n\n for (const arg of args) {\n if (arg.type === 'Identifier' && analyzer.declaredVariables.has(arg.name)) {\n params.push(arg.name);\n } else if (arg.type === 'Literal' && (typeof arg.value === 'string' || typeof arg.value === 'number')) {\n params.push(JSON.stringify(arg.value));\n } else if (arg.type === 'UnaryExpression') {\n const argSource = extractNodeSource(arg, analyzer.getSource());\n if (argSource) {\n params.push(argSource.trim());\n }\n } else if (arg.type === 'AssignmentPattern' && arg.left.type === 'Identifier') {\n params.push(arg.left.name);\n } else if (arg.type === 'Identifier') {\n params.push(arg.name);\n } else if (!params.includes('input'))\n params.push('input');\n }\n\n return params;\n}", "import type { ESTree } from 'meriyah';\nimport { WALK_STOP, walkAst } from './helpers.js';\n\nexport function nsigMatcher(node: ESTree.Node) {\n if (node.type !== 'VariableDeclarator')\n return false;\n\n const init = node.init;\n\n if (!init || init.type !== 'FunctionExpression')\n return false;\n\n if (init.params.length < 3)\n return false;\n\n const [ url, sigName, sigValue ] = init.params;\n\n if (url.type !== 'Identifier' || sigName.type !== 'AssignmentPattern' || sigValue.type !== 'AssignmentPattern')\n return false;\n\n const body = init.body;\n const blockStatementBody = body?.body || [];\n\n let hasUrlCtor = false;\n let hasSetAlr = false;\n\n for (const statement of blockStatementBody) {\n if (statement.type !== 'ExpressionStatement')\n continue;\n\n const expr = statement.expression;\n\n if (expr.type === 'AssignmentExpression' && expr.operator === '=' && expr.left.type === 'Identifier' && expr.left.name === url.name) {\n const right = expr.right;\n if (right.type === 'NewExpression' && right.callee.type === 'MemberExpression') {\n hasUrlCtor = true;\n }\n }\n\n if (expr.type === 'CallExpression' && expr.callee.type === 'MemberExpression') {\n const args = expr.arguments;\n if (args.length === 2 && args[0].type === 'Literal' && args[0].value === 'alr' && args[1].type === 'Literal' && args[1].value === 'yes') {\n hasSetAlr = true;\n }\n }\n }\n\n if (!hasUrlCtor || !hasSetAlr)\n return false;\n\n return node;\n}\n\nexport function timestampMatcher(node: ESTree.Node) {\n if (node.type !== 'VariableDeclarator' || node.init?.type !== 'FunctionExpression') {\n return false;\n }\n\n const funcBody = node.init.body;\n if (!funcBody) return false;\n\n let foundObject: ESTree.Node | null = null;\n\n walkAst(funcBody, (innerNode) => {\n if (innerNode.type === 'ObjectExpression') {\n for (const prop of innerNode.properties) {\n if (prop.type === 'Property' && prop.key.type === 'Identifier' && prop.key.name === 'signatureTimestamp') {\n foundObject = prop;\n return WALK_STOP;\n }\n }\n }\n });\n\n return foundObject || false;\n}", "const unicodeLookup = ((compressed, lookup) => {\n const result = new Uint32Array(69632);\n let index = 0;\n let subIndex = 0;\n while (index < 2571) {\n const inst = compressed[index++];\n if (inst < 0) {\n subIndex -= inst;\n }\n else {\n let code = compressed[index++];\n if (inst & 2)\n code = lookup[code];\n if (inst & 1) {\n result.fill(code, subIndex, subIndex += compressed[index++]);\n }\n else {\n result[subIndex++] = code;\n }\n }\n }\n return result;\n})([-1, 2, 26, 2, 27, 2, 5, -1, 0, 77595648, 3, 44, 2, 3, 0, 14, 2, 63, 2, 64, 3, 0, 3, 0, 3168796671, 0, 4294956992, 2, 1, 2, 0, 2, 41, 3, 0, 4, 0, 4294966523, 3, 0, 4, 2, 16, 2, 65, 2, 0, 0, 4294836735, 0, 3221225471, 0, 4294901942, 2, 66, 0, 134152192, 3, 0, 2, 0, 4294951935, 3, 0, 2, 0, 2683305983, 0, 2684354047, 2, 18, 2, 0, 0, 4294961151, 3, 0, 2, 2, 19, 2, 0, 0, 608174079, 2, 0, 2, 60, 2, 7, 2, 6, 0, 4286611199, 3, 0, 2, 2, 1, 3, 0, 3, 0, 4294901711, 2, 40, 0, 4089839103, 0, 2961209759, 0, 1342439375, 0, 4294543342, 0, 3547201023, 0, 1577204103, 0, 4194240, 0, 4294688750, 2, 2, 0, 80831, 0, 4261478351, 0, 4294549486, 2, 2, 0, 2967484831, 0, 196559, 0, 3594373100, 0, 3288319768, 0, 8469959, 0, 65472, 2, 3, 0, 4093640191, 0, 660618719, 0, 65487, 0, 4294828015, 0, 4092591615, 0, 1616920031, 0, 982991, 2, 3, 2, 0, 0, 2163244511, 0, 4227923919, 0, 4236247022, 2, 71, 0, 4284449919, 0, 851904, 2, 4, 2, 12, 0, 67076095, -1, 2, 72, 0, 1073741743, 0, 4093607775, -1, 0, 50331649, 0, 3265266687, 2, 33, 0, 4294844415, 0, 4278190047, 2, 20, 2, 137, -1, 3, 0, 2, 2, 23, 2, 0, 2, 10, 2, 0, 2, 15, 2, 22, 3, 0, 10, 2, 74, 2, 0, 2, 75, 2, 76, 2, 77, 2, 0, 2, 78, 2, 0, 2, 11, 0, 261632, 2, 25, 3, 0, 2, 2, 13, 2, 4, 3, 0, 18, 2, 79, 2, 5, 3, 0, 2, 2, 80, 0, 2151677951, 2, 29, 2, 9, 0, 909311, 3, 0, 2, 0, 814743551, 2, 49, 0, 67090432, 3, 0, 2, 2, 42, 2, 0, 2, 6, 2, 0, 2, 30, 2, 8, 0, 268374015, 2, 110, 2, 51, 2, 0, 2, 81, 0, 134153215, -1, 2, 7, 2, 0, 2, 8, 0, 2684354559, 0, 67044351, 0, 3221160064, 2, 17, -1, 3, 0, 2, 2, 53, 0, 1046528, 3, 0, 3, 2, 9, 2, 0, 2, 54, 0, 4294960127, 2, 10, 2, 6, 2, 11, 0, 4294377472, 2, 12, 3, 0, 16, 2, 13, 2, 0, 2, 82, 2, 10, 2, 0, 2, 83, 2, 84, 2, 85, 0, 12288, 2, 55, 0, 1048577, 2, 86, 2, 14, -1, 2, 14, 0, 131042, 2, 87, 2, 88, 2, 89, 2, 0, 2, 34, -83, 3, 0, 7, 0, 1046559, 2, 0, 2, 15, 2, 0, 0, 2147516671, 2, 21, 3, 90, 2, 2, 0, -16, 2, 91, 0, 524222462, 2, 4, 2, 0, 0, 4269801471, 2, 4, 3, 0, 2, 2, 28, 2, 16, 3, 0, 2, 2, 17, 2, 0, -1, 2, 18, -16, 3, 0, 206, -2, 3, 0, 692, 2, 73, -1, 2, 18, 2, 10, 3, 0, 8, 2, 93, 2, 133, 2, 0, 0, 3220242431, 3, 0, 3, 2, 19, 2, 94, 2, 95, 3, 0, 2, 2, 96, 2, 0, 2, 97, 2, 46, 2, 0, 0, 4351, 2, 0, 2, 9, 3, 0, 2, 0, 67043391, 0, 3909091327, 2, 0, 2, 24, 2, 9, 2, 20, 3, 0, 2, 0, 67076097, 2, 8, 2, 0, 2, 21, 0, 67059711, 0, 4236247039, 3, 0, 2, 0, 939524103, 0, 8191999, 2, 101, 2, 102, 2, 22, 2, 23, 3, 0, 3, 0, 67057663, 3, 0, 349, 2, 103, 2, 104, 2, 7, -264, 3, 0, 11, 2, 24, 3, 0, 2, 2, 32, -1, 0, 3774349439, 2, 105, 2, 106, 3, 0, 2, 2, 19, 2, 107, 3, 0, 10, 2, 10, 2, 18, 2, 0, 2, 47, 2, 0, 2, 31, 2, 108, 2, 25, 0, 1638399, 0, 57344, 2, 109, 3, 0, 3, 2, 20, 2, 26, 2, 27, 2, 5, 2, 28, 2, 0, 2, 8, 2, 111, -1, 2, 112, 2, 113, 2, 114, -1, 3, 0, 3, 2, 12, -2, 2, 0, 2, 29, -3, 0, 536870912, -4, 2, 20, 2, 0, 2, 36, 0, 1, 2, 0, 2, 67, 2, 6, 2, 12, 2, 10, 2, 0, 2, 115, -1, 3, 0, 4, 2, 10, 2, 23, 2, 116, 2, 7, 2, 0, 2, 117, 2, 0, 2, 118, 2, 119, 2, 120, 2, 0, 2, 9, 3, 0, 9, 2, 21, 2, 30, 2, 31, 2, 121, 2, 122, -2, 2, 123, 2, 124, 2, 30, 2, 21, 2, 8, -2, 2, 125, 2, 30, 2, 32, -2, 2, 0, 2, 39, -2, 0, 4277137519, 0, 2269118463, -1, 3, 20, 2, -1, 2, 33, 2, 38, 2, 0, 3, 30, 2, 2, 35, 2, 19, -3, 3, 0, 2, 2, 34, -1, 2, 0, 2, 35, 2, 0, 2, 35, 2, 0, 2, 48, 2, 0, 0, 4294950463, 2, 37, -7, 2, 0, 0, 203775, 2, 57, 0, 4026531840, 2, 20, 2, 43, 2, 36, 2, 18, 2, 37, 2, 18, 2, 126, 2, 21, 3, 0, 2, 2, 38, 0, 2151677888, 2, 0, 2, 12, 0, 4294901764, 2, 144, 2, 0, 2, 58, 2, 56, 0, 5242879, 3, 0, 2, 0, 402644511, -1, 2, 128, 2, 39, 0, 3, -1, 2, 129, 2, 130, 2, 0, 0, 67045375, 2, 40, 0, 4226678271, 0, 3766565279, 0, 2039759, 2, 132, 2, 41, 0, 1046437, 0, 6, 3, 0, 2, 0, 3288270847, 0, 3, 3, 0, 2, 0, 67043519, -5, 2, 0, 0, 4282384383, 0, 1056964609, -1, 3, 0, 2, 0, 67043345, -1, 2, 0, 2, 42, 2, 23, 2, 50, 2, 11, 2, 61, 2, 38, -5, 2, 0, 2, 12, -3, 3, 0, 2, 0, 2147484671, 2, 134, 0, 4190109695, 2, 52, -2, 2, 135, 0, 4244635647, 0, 27, 2, 0, 2, 8, 2, 43, 2, 0, 2, 68, 2, 18, 2, 0, 2, 42, -6, 2, 0, 2, 45, 2, 59, 2, 44, 2, 45, 2, 46, 2, 47, 0, 8388351, -2, 2, 136, 0, 3028287487, 2, 48, 2, 138, 0, 33259519, 2, 49, -9, 2, 21, 0, 4294836223, 0, 3355443199, 0, 134152199, -2, 2, 69, -2, 3, 0, 28, 2, 32, -3, 3, 0, 3, 2, 17, 3, 0, 6, 2, 50, -81, 2, 18, 3, 0, 2, 2, 36, 3, 0, 33, 2, 25, 2, 30, 3, 0, 124, 2, 12, 3, 0, 18, 2, 38, -213, 2, 0, 2, 32, -54, 3, 0, 17, 2, 42, 2, 8, 2, 23, 2, 0, 2, 8, 2, 23, 2, 51, 2, 0, 2, 21, 2, 52, 2, 139, 2, 25, -13, 2, 0, 2, 53, -6, 3, 0, 2, -4, 3, 0, 2, 0, 4294936575, 2, 0, 0, 4294934783, -2, 0, 196635, 3, 0, 191, 2, 54, 3, 0, 38, 2, 30, 2, 55, 2, 34, -278, 2, 140, 3, 0, 9, 2, 141, 2, 142, 2, 56, 3, 0, 11, 2, 7, -72, 3, 0, 3, 2, 143, 0, 1677656575, -130, 2, 26, -16, 2, 0, 2, 24, 2, 38, -16, 0, 4161266656, 0, 4071, 0, 15360, -4, 2, 57, -13, 3, 0, 2, 2, 58, 2, 0, 2, 145, 2, 146, 2, 62, 2, 0, 2, 147, 2, 148, 2, 149, 3, 0, 10, 2, 150, 2, 151, 2, 22, 3, 58, 2, 3, 152, 2, 3, 59, 2, 0, 4294954999, 2, 0, -16, 2, 0, 2, 92, 2, 0, 0, 2105343, 0, 4160749584, 0, 65534, -34, 2, 8, 2, 154, -6, 0, 4194303871, 0, 4294903771, 2, 0, 2, 60, 2, 100, -3, 2, 0, 0, 1073684479, 0, 17407, -9, 2, 18, 2, 17, 2, 0, 2, 32, -14, 2, 18, 2, 32, -6, 2, 18, 2, 12, -15, 2, 155, 3, 0, 6, 0, 8323103, -1, 3, 0, 2, 2, 61, -37, 2, 62, 2, 156, 2, 157, 2, 158, 2, 159, 2, 160, -105, 2, 26, -32, 3, 0, 1335, -1, 3, 0, 129, 2, 32, 3, 0, 6, 2, 10, 3, 0, 180, 2, 161, 3, 0, 233, 2, 162, 3, 0, 18, 2, 10, -77, 3, 0, 16, 2, 10, -47, 3, 0, 154, 2, 6, 3, 0, 130, 2, 25, -22250, 3, 0, 7, 2, 25, -6130, 3, 5, 2, -1, 0, 69207040, 3, 44, 2, 3, 0, 14, 2, 63, 2, 64, -3, 0, 3168731136, 0, 4294956864, 2, 1, 2, 0, 2, 41, 3, 0, 4, 0, 4294966275, 3, 0, 4, 2, 16, 2, 65, 2, 0, 2, 34, -1, 2, 18, 2, 66, -1, 2, 0, 0, 2047, 0, 4294885376, 3, 0, 2, 0, 3145727, 0, 2617294944, 0, 4294770688, 2, 25, 2, 67, 3, 0, 2, 0, 131135, 2, 98, 0, 70256639, 0, 71303167, 0, 272, 2, 42, 2, 6, 0, 32511, 2, 0, 2, 49, -1, 2, 99, 2, 68, 0, 4278255616, 0, 4294836227, 0, 4294549473, 0, 600178175, 0, 2952806400, 0, 268632067, 0, 4294543328, 0, 57540095, 0, 1577058304, 0, 1835008, 0, 4294688736, 2, 70, 2, 69, 0, 33554435, 2, 131, 2, 70, 0, 2952790016, 0, 131075, 0, 3594373096, 0, 67094296, 2, 69, -1, 0, 4294828000, 0, 603979263, 0, 654311424, 0, 3, 0, 4294828001, 0, 602930687, 0, 1610612736, 0, 393219, 0, 4294828016, 0, 671088639, 0, 2154840064, 0, 4227858435, 0, 4236247008, 2, 71, 2, 38, -1, 2, 4, 0, 917503, 2, 38, -1, 2, 72, 0, 537788335, 0, 4026531935, -1, 0, 1, -1, 2, 33, 2, 73, 0, 7936, -3, 2, 0, 0, 2147485695, 0, 1010761728, 0, 4292984930, 0, 16387, 2, 0, 2, 15, 2, 22, 3, 0, 10, 2, 74, 2, 0, 2, 75, 2, 76, 2, 77, 2, 0, 2, 78, 2, 0, 2, 12, -1, 2, 25, 3, 0, 2, 2, 13, 2, 4, 3, 0, 18, 2, 79, 2, 5, 3, 0, 2, 2, 80, 0, 2147745791, 3, 19, 2, 0, 122879, 2, 0, 2, 9, 0, 276824064, -2, 3, 0, 2, 2, 42, 2, 0, 0, 4294903295, 2, 0, 2, 30, 2, 8, -1, 2, 18, 2, 51, 2, 0, 2, 81, 2, 49, -1, 2, 21, 2, 0, 2, 29, -2, 0, 128, -2, 2, 28, 2, 9, 0, 8160, -1, 2, 127, 0, 4227907585, 2, 0, 2, 37, 2, 0, 2, 50, 0, 4227915776, 2, 10, 2, 6, 2, 11, -1, 0, 74440192, 3, 0, 6, -2, 3, 0, 8, 2, 13, 2, 0, 2, 82, 2, 10, 2, 0, 2, 83, 2, 84, 2, 85, -3, 2, 86, 2, 14, -3, 2, 87, 2, 88, 2, 89, 2, 0, 2, 34, -83, 3, 0, 7, 0, 817183, 2, 0, 2, 15, 2, 0, 0, 33023, 2, 21, 3, 90, 2, -17, 2, 91, 0, 524157950, 2, 4, 2, 0, 2, 92, 2, 4, 2, 0, 2, 22, 2, 28, 2, 16, 3, 0, 2, 2, 17, 2, 0, -1, 2, 18, -16, 3, 0, 206, -2, 3, 0, 692, 2, 73, -1, 2, 18, 2, 10, 3, 0, 8, 2, 93, 0, 3072, 2, 0, 0, 2147516415, 2, 10, 3, 0, 2, 2, 25, 2, 94, 2, 95, 3, 0, 2, 2, 96, 2, 0, 2, 97, 2, 46, 0, 4294965179, 0, 7, 2, 0, 2, 9, 2, 95, 2, 9, -1, 0, 1761345536, 2, 98, 0, 4294901823, 2, 38, 2, 20, 2, 99, 2, 35, 2, 100, 0, 2080440287, 2, 0, 2, 34, 2, 153, 0, 3296722943, 2, 0, 0, 1046675455, 0, 939524101, 0, 1837055, 2, 101, 2, 102, 2, 22, 2, 23, 3, 0, 3, 0, 7, 3, 0, 349, 2, 103, 2, 104, 2, 7, -264, 3, 0, 11, 2, 24, 3, 0, 2, 2, 32, -1, 0, 2700607615, 2, 105, 2, 106, 3, 0, 2, 2, 19, 2, 107, 3, 0, 10, 2, 10, 2, 18, 2, 0, 2, 47, 2, 0, 2, 31, 2, 108, -3, 2, 109, 3, 0, 3, 2, 20, -1, 3, 5, 2, 2, 110, 2, 0, 2, 8, 2, 111, -1, 2, 112, 2, 113, 2, 114, -1, 3, 0, 3, 2, 12, -2, 2, 0, 2, 29, -8, 2, 20, 2, 0, 2, 36, -1, 2, 0, 2, 67, 2, 6, 2, 30, 2, 10, 2, 0, 2, 115, -1, 3, 0, 4, 2, 10, 2, 18, 2, 116, 2, 7, 2, 0, 2, 117, 2, 0, 2, 118, 2, 119, 2, 120, 2, 0, 2, 9, 3, 0, 9, 2, 21, 2, 30, 2, 31, 2, 121, 2, 122, -2, 2, 123, 2, 124, 2, 30, 2, 21, 2, 8, -2, 2, 125, 2, 30, 2, 32, -2, 2, 0, 2, 39, -2, 0, 4277075969, 2, 30, -1, 3, 20, 2, -1, 2, 33, 2, 126, 2, 0, 3, 30, 2, 2, 35, 2, 19, -3, 3, 0, 2, 2, 34, -1, 2, 0, 2, 35, 2, 0, 2, 35, 2, 0, 2, 50, 2, 98, 0, 4294934591, 2, 37, -7, 2, 0, 0, 197631, 2, 57, -1, 2, 20, 2, 43, 2, 37, 2, 18, 0, 3, 2, 18, 2, 126, 2, 21, 2, 127, 2, 54, -1, 0, 2490368, 2, 127, 2, 25, 2, 18, 2, 34, 2, 127, 2, 38, 0, 4294901904, 0, 4718591, 2, 127, 2, 35, 0, 335544350, -1, 2, 128, 0, 2147487743, 0, 1, -1, 2, 129, 2, 130, 2, 8, -1, 2, 131, 2, 70, 0, 3758161920, 0, 3, 2, 132, 0, 12582911, 0, 655360, -1, 2, 0, 2, 29, 0, 2147485568, 0, 3, 2, 0, 2, 25, 0, 176, -5, 2, 0, 2, 17, 0, 251658240, -1, 2, 0, 2, 25, 0, 16, -1, 2, 0, 0, 16779263, -2, 2, 12, -1, 2, 38, -5, 2, 0, 2, 133, -3, 3, 0, 2, 2, 55, 2, 134, 0, 2147549183, 0, 2, -2, 2, 135, 2, 36, 0, 10, 0, 4294965249, 0, 67633151, 0, 4026597376, 2, 0, 0, 536871935, 2, 18, 2, 0, 2, 42, -6, 2, 0, 0, 1, 2, 59, 2, 17, 0, 1, 2, 46, 2, 25, -3, 2, 136, 2, 36, 2, 137, 2, 138, 0, 16778239, -10, 2, 35, 0, 4294836212, 2, 9, -3, 2, 69, -2, 3, 0, 28, 2, 32, -3, 3, 0, 3, 2, 17, 3, 0, 6, 2, 50, -81, 2, 18, 3, 0, 2, 2, 36, 3, 0, 33, 2, 25, 0, 126, 3, 0, 124, 2, 12, 3, 0, 18, 2, 38, -213, 2, 10, -55, 3, 0, 17, 2, 42, 2, 8, 2, 18, 2, 0, 2, 8, 2, 18, 2, 60, 2, 0, 2, 25, 2, 50, 2, 139, 2, 25, -13, 2, 0, 2, 73, -6, 3, 0, 2, -4, 3, 0, 2, 0, 67583, -1, 2, 107, -2, 0, 11, 3, 0, 191, 2, 54, 3, 0, 38, 2, 30, 2, 55, 2, 34, -278, 2, 140, 3, 0, 9, 2, 141, 2, 142, 2, 56, 3, 0, 11, 2, 7, -72, 3, 0, 3, 2, 143, 2, 144, -187, 3, 0, 2, 2, 58, 2, 0, 2, 145, 2, 146, 2, 62, 2, 0, 2, 147, 2, 148, 2, 149, 3, 0, 10, 2, 150, 2, 151, 2, 22, 3, 58, 2, 3, 152, 2, 3, 59, 2, 2, 153, -57, 2, 8, 2, 154, -7, 2, 18, 2, 0, 2, 60, -4, 2, 0, 0, 1065361407, 0, 16384, -9, 2, 18, 2, 60, 2, 0, 2, 133, -14, 2, 18, 2, 133, -6, 2, 18, 0, 81919, -15, 2, 155, 3, 0, 6, 2, 126, -1, 3, 0, 2, 0, 2063, -37, 2, 62, 2, 156, 2, 157, 2, 158, 2, 159, 2, 160, -138, 3, 0, 1335, -1, 3, 0, 129, 2, 32, 3, 0, 6, 2, 10, 3, 0, 180, 2, 161, 3, 0, 233, 2, 162, 3, 0, 18, 2, 10, -77, 3, 0, 16, 2, 10, -47, 3, 0, 154, 2, 6, 3, 0, 130, 2, 25, -28386], [4294967295, 4294967291, 4092460543, 4294828031, 4294967294, 134217726, 4294903807, 268435455, 2147483647, 1048575, 1073741823, 3892314111, 134217727, 1061158911, 536805376, 4294910143, 4294901759, 32767, 4294901760, 262143, 536870911, 8388607, 4160749567, 4294902783, 4294918143, 65535, 67043328, 2281701374, 4294967264, 2097151, 4194303, 255, 67108863, 4294967039, 511, 524287, 131071, 63, 127, 3238002687, 4294549487, 4290772991, 33554431, 4294901888, 4286578687, 67043329, 4294705152, 4294770687, 67043583, 1023, 15, 2047999, 67043343, 67051519, 16777215, 2147483648, 4294902000, 28, 4292870143, 4294966783, 16383, 67047423, 4294967279, 262083, 20511, 41943039, 493567, 4294959104, 603979775, 65536, 602799615, 805044223, 4294965206, 8191, 1031749119, 4294917631, 2134769663, 4286578493, 4282253311, 4294942719, 33540095, 4294905855, 2868854591, 1608515583, 265232348, 534519807, 2147614720, 1060109444, 4093640016, 17376, 2139062143, 224, 4169138175, 4294909951, 4286578688, 4294967292, 4294965759, 535511039, 4294966272, 4294967280, 32768, 8289918, 4294934399, 4294901775, 4294965375, 1602223615, 4294967259, 4294443008, 268369920, 4292804608, 4294967232, 486341884, 4294963199, 3087007615, 1073692671, 4128527, 4279238655, 4294902015, 4160684047, 4290246655, 469499899, 4294967231, 134086655, 4294966591, 2445279231, 3670015, 31, 4294967288, 4294705151, 3221208447, 4294902271, 4294549472, 4294921215, 4095, 4285526655, 4294966527, 4294966143, 64, 4294966719, 3774873592, 1877934080, 262151, 2555904, 536807423, 67043839, 3758096383, 3959414372, 3755993023, 2080374783, 4294835295, 4294967103, 4160749565, 4294934527, 4087, 2016, 2147446655, 184024726, 2862017156, 1593309078, 268434431, 268434414, 4294901763, 4294901761]);\nconst isIDContinue = (code) => (unicodeLookup[(code >>> 5) + 0] >>> code & 31 & 1) !== 0;\nconst isIDStart = (code) => (unicodeLookup[(code >>> 5) + 34816] >>> code & 31 & 1) !== 0;\n\nfunction advanceChar(parser) {\n parser.column++;\n return (parser.currentChar = parser.source.charCodeAt(++parser.index));\n}\nfunction consumePossibleSurrogatePair(parser) {\n const hi = parser.currentChar;\n if ((hi & 0xfc00) !== 55296)\n return 0;\n const lo = parser.source.charCodeAt(parser.index + 1);\n if ((lo & 0xfc00) !== 56320)\n return 0;\n return 65536 + ((hi & 0x3ff) << 10) + (lo & 0x3ff);\n}\nfunction consumeLineFeed(parser, state) {\n parser.currentChar = parser.source.charCodeAt(++parser.index);\n parser.flags |= 1;\n if ((state & 4) === 0) {\n parser.column = 0;\n parser.line++;\n }\n}\nfunction scanNewLine(parser) {\n parser.flags |= 1;\n parser.currentChar = parser.source.charCodeAt(++parser.index);\n parser.column = 0;\n parser.line++;\n}\nfunction isExoticECMAScriptWhitespace(ch) {\n return (ch === 160 ||\n ch === 65279 ||\n ch === 133 ||\n ch === 5760 ||\n (ch >= 8192 && ch <= 8203) ||\n ch === 8239 ||\n ch === 8287 ||\n ch === 12288 ||\n ch === 8201 ||\n ch === 65519);\n}\nfunction toHex(code) {\n return code < 65 ? code - 48 : (code - 65 + 10) & 0xf;\n}\nfunction convertTokenType(t) {\n switch (t) {\n case 134283266:\n return 'NumericLiteral';\n case 134283267:\n return 'StringLiteral';\n case 86021:\n case 86022:\n return 'BooleanLiteral';\n case 86023:\n return 'NullLiteral';\n case 65540:\n return 'RegularExpression';\n case 67174408:\n case 67174409:\n case 131:\n return 'TemplateLiteral';\n default:\n if ((t & 143360) === 143360)\n return 'Identifier';\n if ((t & 4096) === 4096)\n return 'Keyword';\n return 'Punctuator';\n }\n}\n\nconst CharTypes = [\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 8 | 1024,\n 0,\n 0,\n 8 | 2048,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 8192,\n 0,\n 1 | 2,\n 0,\n 0,\n 8192,\n 0,\n 0,\n 0,\n 256,\n 0,\n 256 | 32768,\n 0,\n 0,\n 2 | 16 | 128 | 32 | 64,\n 2 | 16 | 128 | 32 | 64,\n 2 | 16 | 32 | 64,\n 2 | 16 | 32 | 64,\n 2 | 16 | 32 | 64,\n 2 | 16 | 32 | 64,\n 2 | 16 | 32 | 64,\n 2 | 16 | 32 | 64,\n 2 | 16 | 512 | 64,\n 2 | 16 | 512 | 64,\n 0,\n 0,\n 16384,\n 0,\n 0,\n 0,\n 0,\n 1 | 2 | 64,\n 1 | 2 | 64,\n 1 | 2 | 64,\n 1 | 2 | 64,\n 1 | 2 | 64,\n 1 | 2 | 64,\n 1 | 2,\n 1 | 2,\n 1 | 2,\n 1 | 2,\n 1 | 2,\n 1 | 2,\n 1 | 2,\n 1 | 2,\n 1 | 2,\n 1 | 2,\n 1 | 2,\n 1 | 2,\n 1 | 2,\n 1 | 2,\n 1 | 2,\n 1 | 2,\n 1 | 2,\n 1 | 2,\n 1 | 2,\n 1 | 2,\n 0,\n 1,\n 0,\n 0,\n 1 | 2 | 4096,\n 0,\n 1 | 2 | 4 | 64,\n 1 | 2 | 4 | 64,\n 1 | 2 | 4 | 64,\n 1 | 2 | 4 | 64,\n 1 | 2 | 4 | 64,\n 1 | 2 | 4 | 64,\n 1 | 2 | 4,\n 1 | 2 | 4,\n 1 | 2 | 4,\n 1 | 2 | 4,\n 1 | 2 | 4,\n 1 | 2 | 4,\n 1 | 2 | 4,\n 1 | 2 | 4,\n 1 | 2 | 4,\n 1 | 2 | 4,\n 1 | 2 | 4,\n 1 | 2 | 4,\n 1 | 2 | 4,\n 1 | 2 | 4,\n 1 | 2 | 4,\n 1 | 2 | 4,\n 1 | 2 | 4,\n 1 | 2 | 4,\n 1 | 2 | 4,\n 1 | 2 | 4,\n 16384,\n 0,\n 0,\n 0,\n 0\n];\nconst isIdStart = [\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 1,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 0,\n 0,\n 0,\n 0,\n 1,\n 0,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 0,\n 0,\n 0,\n 0,\n 0\n];\nconst isIdPart = [\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 1,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 0,\n 0,\n 0,\n 0,\n 1,\n 0,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 0,\n 0,\n 0,\n 0,\n 0\n];\nfunction isIdentifierStart(code) {\n return code <= 0x7F\n ? isIdStart[code] > 0\n : isIDStart(code);\n}\nfunction isIdentifierPart(code) {\n return code <= 0x7F\n ? isIdPart[code] > 0\n : isIDContinue(code) || (code === 8204 || code === 8205);\n}\n\nconst CommentTypes = ['SingleLine', 'MultiLine', 'HTMLOpen', 'HTMLClose', 'HashbangComment'];\nfunction skipHashBang(parser) {\n const { source } = parser;\n if (parser.currentChar === 35 && source.charCodeAt(parser.index + 1) === 33) {\n advanceChar(parser);\n advanceChar(parser);\n skipSingleLineComment(parser, source, 0, 4, parser.tokenStart);\n }\n}\nfunction skipSingleHTMLComment(parser, source, state, context, type, start) {\n if (context & 2)\n parser.report(0);\n return skipSingleLineComment(parser, source, state, type, start);\n}\nfunction skipSingleLineComment(parser, source, state, type, start) {\n const { index } = parser;\n parser.tokenIndex = parser.index;\n parser.tokenLine = parser.line;\n parser.tokenColumn = parser.column;\n while (parser.index < parser.end) {\n if (CharTypes[parser.currentChar] & 8) {\n const isCR = parser.currentChar === 13;\n scanNewLine(parser);\n if (isCR && parser.index < parser.end && parser.currentChar === 10)\n parser.currentChar = source.charCodeAt(++parser.index);\n break;\n }\n else if ((parser.currentChar ^ 8232) <= 1) {\n scanNewLine(parser);\n break;\n }\n advanceChar(parser);\n parser.tokenIndex = parser.index;\n parser.tokenLine = parser.line;\n parser.tokenColumn = parser.column;\n }\n if (parser.options.onComment) {\n const loc = {\n start: {\n line: start.line,\n column: start.column,\n },\n end: {\n line: parser.tokenLine,\n column: parser.tokenColumn,\n },\n };\n parser.options.onComment(CommentTypes[type & 0xff], source.slice(index, parser.tokenIndex), start.index, parser.tokenIndex, loc);\n }\n return state | 1;\n}\nfunction skipMultiLineComment(parser, source, state) {\n const { index } = parser;\n while (parser.index < parser.end) {\n if (parser.currentChar < 0x2b) {\n let skippedOneAsterisk = false;\n while (parser.currentChar === 42) {\n if (!skippedOneAsterisk) {\n state &= -5;\n skippedOneAsterisk = true;\n }\n if (advanceChar(parser) === 47) {\n advanceChar(parser);\n if (parser.options.onComment) {\n const loc = {\n start: {\n line: parser.tokenLine,\n column: parser.tokenColumn,\n },\n end: {\n line: parser.line,\n column: parser.column,\n },\n };\n parser.options.onComment(CommentTypes[1 & 0xff], source.slice(index, parser.index - 2), index - 2, parser.index, loc);\n }\n parser.tokenIndex = parser.index;\n parser.tokenLine = parser.line;\n parser.tokenColumn = parser.column;\n return state;\n }\n }\n if (skippedOneAsterisk) {\n continue;\n }\n if (CharTypes[parser.currentChar] & 8) {\n if (parser.currentChar === 13) {\n state |= 1 | 4;\n scanNewLine(parser);\n }\n else {\n consumeLineFeed(parser, state);\n state = (state & -5) | 1;\n }\n }\n else {\n advanceChar(parser);\n }\n }\n else if ((parser.currentChar ^ 8232) <= 1) {\n state = (state & -5) | 1;\n scanNewLine(parser);\n }\n else {\n state &= -5;\n advanceChar(parser);\n }\n }\n parser.report(18);\n}\n\nvar RegexState;\n(function (RegexState) {\n RegexState[RegexState[\"Empty\"] = 0] = \"Empty\";\n RegexState[RegexState[\"Escape\"] = 1] = \"Escape\";\n RegexState[RegexState[\"Class\"] = 2] = \"Class\";\n})(RegexState || (RegexState = {}));\nvar RegexFlags;\n(function (RegexFlags) {\n RegexFlags[RegexFlags[\"Empty\"] = 0] = \"Empty\";\n RegexFlags[RegexFlags[\"IgnoreCase\"] = 1] = \"IgnoreCase\";\n RegexFlags[RegexFlags[\"Global\"] = 2] = \"Global\";\n RegexFlags[RegexFlags[\"Multiline\"] = 4] = \"Multiline\";\n RegexFlags[RegexFlags[\"Unicode\"] = 16] = \"Unicode\";\n RegexFlags[RegexFlags[\"Sticky\"] = 8] = \"Sticky\";\n RegexFlags[RegexFlags[\"DotAll\"] = 32] = \"DotAll\";\n RegexFlags[RegexFlags[\"Indices\"] = 64] = \"Indices\";\n RegexFlags[RegexFlags[\"UnicodeSets\"] = 128] = \"UnicodeSets\";\n})(RegexFlags || (RegexFlags = {}));\nfunction scanRegularExpression(parser) {\n const bodyStart = parser.index;\n let preparseState = RegexState.Empty;\n loop: while (true) {\n const ch = parser.currentChar;\n advanceChar(parser);\n if (preparseState & RegexState.Escape) {\n preparseState &= ~RegexState.Escape;\n }\n else {\n switch (ch) {\n case 47:\n if (!preparseState)\n break loop;\n else\n break;\n case 92:\n preparseState |= RegexState.Escape;\n break;\n case 91:\n preparseState |= RegexState.Class;\n break;\n case 93:\n preparseState &= RegexState.Escape;\n break;\n }\n }\n if (ch === 13 ||\n ch === 10 ||\n ch === 8232 ||\n ch === 8233) {\n parser.report(34);\n }\n if (parser.index >= parser.source.length) {\n return parser.report(34);\n }\n }\n const bodyEnd = parser.index - 1;\n let mask = RegexFlags.Empty;\n let char = parser.currentChar;\n const { index: flagStart } = parser;\n while (isIdentifierPart(char)) {\n switch (char) {\n case 103:\n if (mask & RegexFlags.Global)\n parser.report(36, 'g');\n mask |= RegexFlags.Global;\n break;\n case 105:\n if (mask & RegexFlags.IgnoreCase)\n parser.report(36, 'i');\n mask |= RegexFlags.IgnoreCase;\n break;\n case 109:\n if (mask & RegexFlags.Multiline)\n parser.report(36, 'm');\n mask |= RegexFlags.Multiline;\n break;\n case 117:\n if (mask & RegexFlags.Unicode)\n parser.report(36, 'u');\n if (mask & RegexFlags.UnicodeSets)\n parser.report(36, 'vu');\n mask |= RegexFlags.Unicode;\n break;\n case 118:\n if (mask & RegexFlags.Unicode)\n parser.report(36, 'uv');\n if (mask & RegexFlags.UnicodeSets)\n parser.report(36, 'v');\n mask |= RegexFlags.UnicodeSets;\n break;\n case 121:\n if (mask & RegexFlags.Sticky)\n parser.report(36, 'y');\n mask |= RegexFlags.Sticky;\n break;\n case 115:\n if (mask & RegexFlags.DotAll)\n parser.report(36, 's');\n mask |= RegexFlags.DotAll;\n break;\n case 100:\n if (mask & RegexFlags.Indices)\n parser.report(36, 'd');\n mask |= RegexFlags.Indices;\n break;\n default:\n parser.report(35);\n }\n char = advanceChar(parser);\n }\n const flags = parser.source.slice(flagStart, parser.index);\n const pattern = parser.source.slice(bodyStart, bodyEnd);\n parser.tokenRegExp = { pattern, flags };\n if (parser.options.raw)\n parser.tokenRaw = parser.source.slice(parser.tokenIndex, parser.index);\n parser.tokenValue = validate(parser, pattern, flags);\n return 65540;\n}\nfunction validate(parser, pattern, flags) {\n try {\n return new RegExp(pattern, flags);\n }\n catch {\n try {\n new RegExp(pattern, flags);\n return null;\n }\n catch {\n parser.report(34);\n }\n }\n}\n\nfunction scanString(parser, context, quote) {\n const { index: start } = parser;\n let ret = '';\n let char = advanceChar(parser);\n let marker = parser.index;\n while ((CharTypes[char] & 8) === 0) {\n if (char === quote) {\n ret += parser.source.slice(marker, parser.index);\n advanceChar(parser);\n if (parser.options.raw)\n parser.tokenRaw = parser.source.slice(start, parser.index);\n parser.tokenValue = ret;\n return 134283267;\n }\n if ((char & 8) === 8 && char === 92) {\n ret += parser.source.slice(marker, parser.index);\n char = advanceChar(parser);\n if (char < 0x7f || char === 8232 || char === 8233) {\n const code = parseEscape(parser, context, char);\n if (code >= 0)\n ret += String.fromCodePoint(code);\n else\n handleStringError(parser, code, 0);\n }\n else {\n ret += String.fromCodePoint(char);\n }\n marker = parser.index + 1;\n }\n else if (char === 8232 || char === 8233) {\n parser.column = -1;\n parser.line++;\n }\n if (parser.index >= parser.end)\n parser.report(16);\n char = advanceChar(parser);\n }\n parser.report(16);\n}\nfunction parseEscape(parser, context, first, isTemplate = 0) {\n switch (first) {\n case 98:\n return 8;\n case 102:\n return 12;\n case 114:\n return 13;\n case 110:\n return 10;\n case 116:\n return 9;\n case 118:\n return 11;\n case 13: {\n if (parser.index < parser.end) {\n const nextChar = parser.source.charCodeAt(parser.index + 1);\n if (nextChar === 10) {\n parser.index = parser.index + 1;\n parser.currentChar = nextChar;\n }\n }\n }\n case 10:\n case 8232:\n case 8233:\n parser.column = -1;\n parser.line++;\n return -1;\n case 48:\n case 49:\n case 50:\n case 51: {\n let code = first - 48;\n let index = parser.index + 1;\n let column = parser.column + 1;\n if (index < parser.end) {\n const next = parser.source.charCodeAt(index);\n if ((CharTypes[next] & 32) === 0) {\n if (code !== 0 || CharTypes[next] & 512) {\n if (context & 1 || isTemplate)\n return -2;\n parser.flags |= 64;\n }\n }\n else if (context & 1 || isTemplate) {\n return -2;\n }\n else {\n parser.currentChar = next;\n code = (code << 3) | (next - 48);\n index++;\n column++;\n if (index < parser.end) {\n const next = parser.source.charCodeAt(index);\n if (CharTypes[next] & 32) {\n parser.currentChar = next;\n code = (code << 3) | (next - 48);\n index++;\n column++;\n }\n }\n parser.flags |= 64;\n }\n parser.index = index - 1;\n parser.column = column - 1;\n }\n return code;\n }\n case 52:\n case 53:\n case 54:\n case 55: {\n if (isTemplate || context & 1)\n return -2;\n let code = first - 48;\n const index = parser.index + 1;\n const column = parser.column + 1;\n if (index < parser.end) {\n const next = parser.source.charCodeAt(index);\n if (CharTypes[next] & 32) {\n code = (code << 3) | (next - 48);\n parser.currentChar = next;\n parser.index = index;\n parser.column = column;\n }\n }\n parser.flags |= 64;\n return code;\n }\n case 120: {\n const ch1 = advanceChar(parser);\n if ((CharTypes[ch1] & 64) === 0)\n return -4;\n const hi = toHex(ch1);\n const ch2 = advanceChar(parser);\n if ((CharTypes[ch2] & 64) === 0)\n return -4;\n const lo = toHex(ch2);\n return (hi << 4) | lo;\n }\n case 117: {\n const ch = advanceChar(parser);\n if (parser.currentChar === 123) {\n let code = 0;\n while ((CharTypes[advanceChar(parser)] & 64) !== 0) {\n code = (code << 4) | toHex(parser.currentChar);\n if (code > 1114111)\n return -5;\n }\n if (parser.currentChar < 1 || parser.currentChar !== 125) {\n return -4;\n }\n return code;\n }\n else {\n if ((CharTypes[ch] & 64) === 0)\n return -4;\n const ch2 = parser.source.charCodeAt(parser.index + 1);\n if ((CharTypes[ch2] & 64) === 0)\n return -4;\n const ch3 = parser.source.charCodeAt(parser.index + 2);\n if ((CharTypes[ch3] & 64) === 0)\n return -4;\n const ch4 = parser.source.charCodeAt(parser.index + 3);\n if ((CharTypes[ch4] & 64) === 0)\n return -4;\n parser.index += 3;\n parser.column += 3;\n parser.currentChar = parser.source.charCodeAt(parser.index);\n return (toHex(ch) << 12) | (toHex(ch2) << 8) | (toHex(ch3) << 4) | toHex(ch4);\n }\n }\n case 56:\n case 57:\n if (isTemplate || !parser.options.webcompat || context & 1)\n return -3;\n parser.flags |= 4096;\n default:\n return first;\n }\n}\nfunction handleStringError(parser, code, isTemplate) {\n switch (code) {\n case -1:\n return;\n case -2:\n parser.report(isTemplate ? 2 : 1);\n case -3:\n parser.report(isTemplate ? 3 : 14);\n case -4:\n parser.report(7);\n case -5:\n parser.report(104);\n }\n}\n\nfunction scanTemplate(parser, context) {\n const { index: start } = parser;\n let token = 67174409;\n let ret = '';\n let char = advanceChar(parser);\n while (char !== 96) {\n if (char === 36 && parser.source.charCodeAt(parser.index + 1) === 123) {\n advanceChar(parser);\n token = 67174408;\n break;\n }\n else if (char === 92) {\n char = advanceChar(parser);\n if (char > 0x7e) {\n ret += String.fromCodePoint(char);\n }\n else {\n const { index, line, column } = parser;\n const code = parseEscape(parser, context | 1, char, 1);\n if (code >= 0) {\n ret += String.fromCodePoint(code);\n }\n else if (code !== -1 && context & 64) {\n parser.index = index;\n parser.line = line;\n parser.column = column;\n ret = null;\n char = scanBadTemplate(parser, char);\n if (char < 0)\n token = 67174408;\n break;\n }\n else {\n handleStringError(parser, code, 1);\n }\n }\n }\n else if (parser.index < parser.end) {\n if (char === 13 && parser.source.charCodeAt(parser.index) === 10) {\n ret += String.fromCodePoint(char);\n parser.currentChar = parser.source.charCodeAt(++parser.index);\n }\n if (((char & 83) < 3 && char === 10) || (char ^ 8232) <= 1) {\n parser.column = -1;\n parser.line++;\n }\n ret += String.fromCodePoint(char);\n }\n if (parser.index >= parser.end)\n parser.report(17);\n char = advanceChar(parser);\n }\n advanceChar(parser);\n parser.tokenValue = ret;\n parser.tokenRaw = parser.source.slice(start + 1, parser.index - (token === 67174409 ? 1 : 2));\n return token;\n}\nfunction scanBadTemplate(parser, ch) {\n while (ch !== 96) {\n switch (ch) {\n case 36: {\n const index = parser.index + 1;\n if (index < parser.end && parser.source.charCodeAt(index) === 123) {\n parser.index = index;\n parser.column++;\n return -ch;\n }\n break;\n }\n case 10:\n case 8232:\n case 8233:\n parser.column = -1;\n parser.line++;\n }\n if (parser.index >= parser.end)\n parser.report(17);\n ch = advanceChar(parser);\n }\n return ch;\n}\nfunction scanTemplateTail(parser, context) {\n if (parser.index >= parser.end)\n parser.report(0);\n parser.index--;\n parser.column--;\n return scanTemplate(parser, context);\n}\n\nconst errorMessages = {\n [0]: 'Unexpected token',\n [30]: \"Unexpected token: '%0'\",\n [1]: 'Octal escape sequences are not allowed in strict mode',\n [2]: 'Octal escape sequences are not allowed in template strings',\n [3]: '\\\\8 and \\\\9 are not allowed in template strings',\n [4]: 'Private identifier #%0 is not defined',\n [5]: 'Illegal Unicode escape sequence',\n [6]: 'Invalid code point %0',\n [7]: 'Invalid hexadecimal escape sequence',\n [9]: 'Octal literals are not allowed in strict mode',\n [8]: 'Decimal integer literals with a leading zero are forbidden in strict mode',\n [10]: 'Expected number in radix %0',\n [151]: 'Invalid left-hand side assignment to a destructible right-hand side',\n [11]: 'Non-number found after exponent indicator',\n [12]: 'Invalid BigIntLiteral',\n [13]: 'No identifiers allowed directly after numeric literal',\n [14]: 'Escapes \\\\8 or \\\\9 are not syntactically valid escapes',\n [15]: 'Escapes \\\\8 or \\\\9 are not allowed in strict mode',\n [16]: 'Unterminated string literal',\n [17]: 'Unterminated template literal',\n [18]: 'Multiline comment was not closed properly',\n [19]: 'The identifier contained dynamic unicode escape that was not closed',\n [20]: \"Illegal character '%0'\",\n [21]: 'Missing hexadecimal digits',\n [22]: 'Invalid implicit octal',\n [23]: 'Invalid line break in string literal',\n [24]: 'Only unicode escapes are legal in identifier names',\n [25]: \"Expected '%0'\",\n [26]: 'Invalid left-hand side in assignment',\n [27]: 'Invalid left-hand side in async arrow',\n [28]: 'Calls to super must be in the \"constructor\" method of a class expression or class declaration that has a superclass',\n [29]: 'Member access on super must be in a method',\n [31]: 'Await expression not allowed in formal parameter',\n [32]: 'Yield expression not allowed in formal parameter',\n [95]: \"Unexpected token: 'escaped keyword'\",\n [33]: 'Unary expressions as the left operand of an exponentiation expression must be disambiguated with parentheses',\n [123]: 'Async functions can only be declared at the top level or inside a block',\n [34]: 'Unterminated regular expression',\n [35]: 'Unexpected regular expression flag',\n [36]: \"Duplicate regular expression flag '%0'\",\n [37]: '%0 functions must have exactly %1 argument%2',\n [38]: 'Setter function argument must not be a rest parameter',\n [39]: '%0 declaration must have a name in this context',\n [40]: 'Function name may not contain any reserved words or be eval or arguments in strict mode',\n [41]: 'The rest operator is missing an argument',\n [42]: 'A getter cannot be a generator',\n [43]: 'A setter cannot be a generator',\n [44]: 'A computed property name must be followed by a colon or paren',\n [134]: 'Object literal keys that are strings or numbers must be a method or have a colon',\n [46]: 'Found `* async x(){}` but this should be `async * x(){}`',\n [45]: 'Getters and setters can not be generators',\n [47]: \"'%0' can not be generator method\",\n [48]: \"No line break is allowed after '=>'\",\n [49]: 'The left-hand side of the arrow can only be destructed through assignment',\n [50]: 'The binding declaration is not destructible',\n [51]: 'Async arrow can not be followed by new expression',\n [52]: \"Classes may not have a static property named 'prototype'\",\n [53]: 'Class constructor may not be a %0',\n [54]: 'Duplicate constructor method in class',\n [55]: 'Invalid increment/decrement operand',\n [56]: 'Invalid use of `new` keyword on an increment/decrement expression',\n [57]: '`=>` is an invalid assignment target',\n [58]: 'Rest element may not have a trailing comma',\n [59]: 'Missing initializer in %0 declaration',\n [60]: \"'for-%0' loop head declarations can not have an initializer\",\n [61]: 'Invalid left-hand side in for-%0 loop: Must have a single binding',\n [62]: 'Invalid shorthand property initializer',\n [63]: 'Property name __proto__ appears more than once in object literal',\n [64]: 'Let is disallowed as a lexically bound name',\n [65]: \"Invalid use of '%0' inside new expression\",\n [66]: \"Illegal 'use strict' directive in function with non-simple parameter list\",\n [67]: 'Identifier \"let\" disallowed as left-hand side expression in strict mode',\n [68]: 'Illegal continue statement',\n [69]: 'Illegal break statement',\n [70]: 'Cannot have `let[...]` as a var name in strict mode',\n [71]: 'Invalid destructuring assignment target',\n [72]: 'Rest parameter may not have a default initializer',\n [73]: 'The rest argument must the be last parameter',\n [74]: 'Invalid rest argument',\n [76]: 'In strict mode code, functions can only be declared at top level or inside a block',\n [77]: 'In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement',\n [78]: 'Without web compatibility enabled functions can not be declared at top level, inside a block, or as the body of an if statement',\n [79]: \"Class declaration can't appear in single-statement context\",\n [80]: 'Invalid left-hand side in for-%0',\n [81]: 'Invalid assignment in for-%0',\n [82]: 'for await (... of ...) is only valid in async functions and async generators',\n [83]: 'The first token after the template expression should be a continuation of the template',\n [85]: '`let` declaration not allowed here and `let` cannot be a regular var name in strict mode',\n [84]: '`let \\n [` is a restricted production at the start of a statement',\n [86]: 'Catch clause requires exactly one parameter, not more (and no trailing comma)',\n [87]: 'Catch clause parameter does not support default values',\n [88]: 'Missing catch or finally after try',\n [89]: 'More than one default clause in switch statement',\n [90]: 'Illegal newline after throw',\n [91]: 'Strict mode code may not include a with statement',\n [92]: 'Illegal return statement',\n [93]: 'The left hand side of the for-header binding declaration is not destructible',\n [94]: 'new.target only allowed within functions or static blocks',\n [96]: \"'#' not followed by identifier\",\n [102]: 'Invalid keyword',\n [101]: \"Can not use 'let' as a class name\",\n [100]: \"'A lexical declaration can't define a 'let' binding\",\n [99]: 'Can not use `let` as variable name in strict mode',\n [97]: \"'%0' may not be used as an identifier in this context\",\n [98]: 'Await is only valid in async functions',\n [103]: 'The %0 keyword can only be used with the module goal',\n [104]: 'Unicode codepoint must not be greater than 0x10FFFF',\n [105]: '%0 source must be string',\n [106]: 'Only a identifier or string can be used to indicate alias',\n [107]: \"Only '*' or '{...}' can be imported after default\",\n [108]: 'Trailing decorator may be followed by method',\n [109]: \"Decorators can't be used with a constructor\",\n [110]: 'Can not use `await` as identifier in module or async func',\n [111]: 'Can not use `await` as identifier in module',\n [112]: 'HTML comments are only allowed with web compatibility (Annex B)',\n [113]: \"The identifier 'let' must not be in expression position in strict mode\",\n [114]: 'Cannot assign to `eval` and `arguments` in strict mode',\n [115]: \"The left-hand side of a for-of loop may not start with 'let'\",\n [116]: 'Block body arrows can not be immediately invoked without a group',\n [117]: 'Block body arrows can not be immediately accessed without a group',\n [118]: 'Unexpected strict mode reserved word',\n [119]: 'Unexpected eval or arguments in strict mode',\n [120]: 'Decorators must not be followed by a semicolon',\n [121]: 'Calling delete on expression not allowed in strict mode',\n [122]: 'Pattern can not have a tail',\n [124]: 'Can not have a `yield` expression on the left side of a ternary',\n [125]: 'An arrow function can not have a postfix update operator',\n [126]: 'Invalid object literal key character after generator star',\n [127]: 'Private fields can not be deleted',\n [129]: 'Classes may not have a field called constructor',\n [128]: 'Classes may not have a private element named constructor',\n [130]: 'A class field initializer or static block may not contain arguments',\n [131]: 'Generators can only be declared at the top level or inside a block',\n [132]: 'Async methods are a restricted production and cannot have a newline following it',\n [133]: 'Unexpected character after object literal property name',\n [135]: 'Invalid key token',\n [136]: \"Label '%0' has already been declared\",\n [137]: 'continue statement must be nested within an iteration statement',\n [138]: \"Undefined label '%0'\",\n [139]: 'Trailing comma is disallowed inside import(...) arguments',\n [140]: 'Invalid binding in JSON import',\n [141]: 'import() requires exactly one argument',\n [142]: 'Cannot use new with import(...)',\n [143]: '... is not allowed in import()',\n [144]: \"Expected '=>'\",\n [145]: \"Duplicate binding '%0'\",\n [146]: 'Duplicate private identifier #%0',\n [147]: \"Cannot export a duplicate name '%0'\",\n [150]: 'Duplicate %0 for-binding',\n [148]: \"Exported binding '%0' needs to refer to a top-level declared variable\",\n [149]: 'Unexpected private field',\n [153]: 'Numeric separators are not allowed at the end of numeric literals',\n [152]: 'Only one underscore is allowed as numeric separator',\n [154]: 'JSX value should be either an expression or a quoted JSX text',\n [155]: 'Expected corresponding JSX closing tag for %0',\n [156]: 'Adjacent JSX elements must be wrapped in an enclosing tag',\n [157]: \"JSX attributes must only be assigned a non-empty 'expression'\",\n [158]: \"'%0' has already been declared\",\n [159]: \"'%0' shadowed a catch clause binding\",\n [160]: 'Dot property must be an identifier',\n [161]: 'Encountered invalid input after spread/rest argument',\n [162]: 'Catch without try',\n [163]: 'Finally without try',\n [164]: 'Expected corresponding closing tag for JSX fragment',\n [165]: 'Coalescing and logical operators used together in the same expression must be disambiguated with parentheses',\n [166]: 'Invalid tagged template on optional chain',\n [167]: 'Invalid optional chain from super property',\n [168]: 'Invalid optional chain from new expression',\n [169]: 'Cannot use \"import.meta\" outside a module',\n [170]: 'Leading decorators must be attached to a class declaration',\n [171]: 'An export name cannot include a lone surrogate, found %0',\n [172]: 'A string literal cannot be used as an exported binding without `from`',\n [173]: \"Private fields can't be accessed on super\",\n [174]: \"The only valid meta property for import is 'import.meta'\",\n [175]: \"'import.meta' must not contain escaped characters\",\n [176]: 'cannot use \"await\" as identifier inside an async function',\n [177]: 'cannot use \"await\" in static blocks',\n};\nclass ParseError extends SyntaxError {\n start;\n end;\n range;\n loc;\n description;\n constructor(start, end, type, ...params) {\n const description = errorMessages[type].replace(/%(\\d+)/g, (_, i) => params[i]);\n const message = '[' + start.line + ':' + start.column + '-' + end.line + ':' + end.column + ']: ' + description;\n super(message);\n this.start = start.index;\n this.end = end.index;\n this.range = [start.index, end.index];\n this.loc = {\n start: { line: start.line, column: start.column },\n end: { line: end.line, column: end.column },\n };\n this.description = description;\n }\n}\n\nfunction scanNumber(parser, context, kind) {\n let char = parser.currentChar;\n let value = 0;\n let digit = 9;\n let atStart = kind & 64 ? 0 : 1;\n let digits = 0;\n let allowSeparator = 0;\n if (kind & 64) {\n value = '.' + scanDecimalDigitsOrSeparator(parser, char);\n char = parser.currentChar;\n if (char === 110)\n parser.report(12);\n }\n else {\n if (char === 48) {\n char = advanceChar(parser);\n if ((char | 32) === 120) {\n kind = 8 | 128;\n char = advanceChar(parser);\n while (CharTypes[char] & (64 | 4096)) {\n if (char === 95) {\n if (!allowSeparator)\n parser.report(152);\n allowSeparator = 0;\n char = advanceChar(parser);\n continue;\n }\n allowSeparator = 1;\n value = value * 0x10 + toHex(char);\n digits++;\n char = advanceChar(parser);\n }\n if (digits === 0 || !allowSeparator) {\n parser.report(digits === 0 ? 21 : 153);\n }\n }\n else if ((char | 32) === 111) {\n kind = 4 | 128;\n char = advanceChar(parser);\n while (CharTypes[char] & (32 | 4096)) {\n if (char === 95) {\n if (!allowSeparator) {\n parser.report(152);\n }\n allowSeparator = 0;\n char = advanceChar(parser);\n continue;\n }\n allowSeparator = 1;\n value = value * 8 + (char - 48);\n digits++;\n char = advanceChar(parser);\n }\n if (digits === 0 || !allowSeparator) {\n parser.report(digits === 0 ? 0 : 153);\n }\n }\n else if ((char | 32) === 98) {\n kind = 2 | 128;\n char = advanceChar(parser);\n while (CharTypes[char] & (128 | 4096)) {\n if (char === 95) {\n if (!allowSeparator) {\n parser.report(152);\n }\n allowSeparator = 0;\n char = advanceChar(parser);\n continue;\n }\n allowSeparator = 1;\n value = value * 2 + (char - 48);\n digits++;\n char = advanceChar(parser);\n }\n if (digits === 0 || !allowSeparator) {\n parser.report(digits === 0 ? 0 : 153);\n }\n }\n else if (CharTypes[char] & 32) {\n if (context & 1)\n parser.report(1);\n kind = 1;\n while (CharTypes[char] & 16) {\n if (CharTypes[char] & 512) {\n kind = 32;\n atStart = 0;\n break;\n }\n value = value * 8 + (char - 48);\n char = advanceChar(parser);\n }\n }\n else if (CharTypes[char] & 512) {\n if (context & 1)\n parser.report(1);\n parser.flags |= 64;\n kind = 32;\n }\n else if (char === 95) {\n parser.report(0);\n }\n }\n if (kind & 48) {\n if (atStart) {\n while (digit >= 0 && CharTypes[char] & (16 | 4096)) {\n if (char === 95) {\n char = advanceChar(parser);\n if (char === 95 || kind & 32) {\n throw new ParseError(parser.currentLocation, { index: parser.index + 1, line: parser.line, column: parser.column }, 152);\n }\n allowSeparator = 1;\n continue;\n }\n allowSeparator = 0;\n value = 10 * value + (char - 48);\n char = advanceChar(parser);\n --digit;\n }\n if (allowSeparator) {\n throw new ParseError(parser.currentLocation, { index: parser.index + 1, line: parser.line, column: parser.column }, 153);\n }\n if (digit >= 0 && !isIdentifierStart(char) && char !== 46) {\n parser.tokenValue = value;\n if (parser.options.raw)\n parser.tokenRaw = parser.source.slice(parser.tokenIndex, parser.index);\n return 134283266;\n }\n }\n value += scanDecimalDigitsOrSeparator(parser, char);\n char = parser.currentChar;\n if (char === 46) {\n if (advanceChar(parser) === 95)\n parser.report(0);\n kind = 64;\n value += '.' + scanDecimalDigitsOrSeparator(parser, parser.currentChar);\n char = parser.currentChar;\n }\n }\n }\n const end = parser.index;\n let isBigInt = 0;\n if (char === 110 && kind & 128) {\n isBigInt = 1;\n char = advanceChar(parser);\n }\n else {\n if ((char | 32) === 101) {\n char = advanceChar(parser);\n if (CharTypes[char] & 256)\n char = advanceChar(parser);\n const { index } = parser;\n if ((CharTypes[char] & 16) === 0)\n parser.report(11);\n value += parser.source.substring(end, index) + scanDecimalDigitsOrSeparator(parser, char);\n char = parser.currentChar;\n }\n }\n if ((parser.index < parser.end && CharTypes[char] & 16) || isIdentifierStart(char)) {\n parser.report(13);\n }\n if (isBigInt) {\n parser.tokenRaw = parser.source.slice(parser.tokenIndex, parser.index);\n parser.tokenValue = BigInt(parser.tokenRaw.slice(0, -1).replaceAll('_', ''));\n return 134283388;\n }\n parser.tokenValue =\n kind & (1 | 2 | 8 | 4)\n ? value\n : kind & 32\n ? parseFloat(parser.source.substring(parser.tokenIndex, parser.index))\n : +value;\n if (parser.options.raw)\n parser.tokenRaw = parser.source.slice(parser.tokenIndex, parser.index);\n return 134283266;\n}\nfunction scanDecimalDigitsOrSeparator(parser, char) {\n let allowSeparator = 0;\n let start = parser.index;\n let ret = '';\n while (CharTypes[char] & (16 | 4096)) {\n if (char === 95) {\n const { index } = parser;\n char = advanceChar(parser);\n if (char === 95) {\n throw new ParseError(parser.currentLocation, { index: parser.index + 1, line: parser.line, column: parser.column }, 152);\n }\n allowSeparator = 1;\n ret += parser.source.substring(start, index);\n start = parser.index;\n continue;\n }\n allowSeparator = 0;\n char = advanceChar(parser);\n }\n if (allowSeparator) {\n throw new ParseError(parser.currentLocation, { index: parser.index + 1, line: parser.line, column: parser.column }, 153);\n }\n return ret + parser.source.substring(start, parser.index);\n}\n\nconst KeywordDescTable = [\n 'end of source',\n 'identifier', 'number', 'string', 'regular expression',\n 'false', 'true', 'null',\n 'template continuation', 'template tail',\n '=>', '(', '{', '.', '...', '}', ')', ';', ',', '[', ']', ':', '?', '\\'', '\"',\n '++', '--',\n '=', '<<=', '>>=', '>>>=', '**=', '+=', '-=', '*=', '/=', '%=', '^=', '|=',\n '&=', '||=', '&&=', '??=',\n 'typeof', 'delete', 'void', '!', '~', '+', '-', 'in', 'instanceof', '*', '%', '/', '**', '&&',\n '||', '===', '!==', '==', '!=', '<=', '>=', '<', '>', '<<', '>>', '>>>', '&', '|', '^',\n 'var', 'let', 'const',\n 'break', 'case', 'catch', 'class', 'continue', 'debugger', 'default', 'do', 'else', 'export',\n 'extends', 'finally', 'for', 'function', 'if', 'import', 'new', 'return', 'super', 'switch',\n 'this', 'throw', 'try', 'while', 'with',\n 'implements', 'interface', 'package', 'private', 'protected', 'public', 'static', 'yield',\n 'as', 'async', 'await', 'constructor', 'get', 'set', 'accessor', 'from', 'of',\n 'enum', 'eval', 'arguments', 'escaped keyword', 'escaped future reserved keyword', 'reserved if strict', '#',\n 'BigIntLiteral', '??', '?.', 'WhiteSpace', 'Illegal', 'LineTerminator', 'PrivateField',\n 'Template', '@', 'target', 'meta', 'LineFeed', 'Escaped', 'JSXText'\n];\nconst descKeywordTable = {\n this: 86111,\n function: 86104,\n if: 20569,\n return: 20572,\n var: 86088,\n else: 20563,\n for: 20567,\n new: 86107,\n in: 8673330,\n typeof: 16863275,\n while: 20578,\n case: 20556,\n break: 20555,\n try: 20577,\n catch: 20557,\n delete: 16863276,\n throw: 86112,\n switch: 86110,\n continue: 20559,\n default: 20561,\n instanceof: 8411187,\n do: 20562,\n void: 16863277,\n finally: 20566,\n async: 209005,\n await: 209006,\n class: 86094,\n const: 86090,\n constructor: 12399,\n debugger: 20560,\n export: 20564,\n extends: 20565,\n false: 86021,\n from: 209011,\n get: 209008,\n implements: 36964,\n import: 86106,\n interface: 36965,\n let: 241737,\n null: 86023,\n of: 471156,\n package: 36966,\n private: 36967,\n protected: 36968,\n public: 36969,\n set: 209009,\n static: 36970,\n super: 86109,\n true: 86022,\n with: 20579,\n yield: 241771,\n enum: 86133,\n eval: 537079926,\n as: 77932,\n arguments: 537079927,\n target: 209029,\n meta: 209030,\n accessor: 12402,\n};\n\nfunction matchOrInsertSemicolon(parser, context) {\n if ((parser.flags & 1) === 0 && (parser.getToken() & 1048576) !== 1048576) {\n parser.report(30, KeywordDescTable[parser.getToken() & 255]);\n }\n if (!consumeOpt(parser, context, 1074790417)) {\n parser.options.onInsertedSemicolon?.(parser.startIndex);\n }\n}\nfunction isValidStrictMode(parser, index, tokenIndex, tokenValue) {\n if (index - tokenIndex < 13 && tokenValue === 'use strict') {\n if ((parser.getToken() & 1048576) === 1048576 || parser.flags & 1) {\n return 1;\n }\n }\n return 0;\n}\nfunction optionalBit(parser, context, t) {\n if (parser.getToken() !== t)\n return 0;\n nextToken(parser, context);\n return 1;\n}\nfunction consumeOpt(parser, context, t) {\n if (parser.getToken() !== t)\n return false;\n nextToken(parser, context);\n return true;\n}\nfunction consume(parser, context, t) {\n if (parser.getToken() !== t)\n parser.report(25, KeywordDescTable[t & 255]);\n nextToken(parser, context);\n}\nfunction reinterpretToPattern(parser, node) {\n switch (node.type) {\n case 'ArrayExpression': {\n node.type = 'ArrayPattern';\n const { elements } = node;\n for (let i = 0, n = elements.length; i < n; ++i) {\n const element = elements[i];\n if (element)\n reinterpretToPattern(parser, element);\n }\n return;\n }\n case 'ObjectExpression': {\n node.type = 'ObjectPattern';\n const { properties } = node;\n for (let i = 0, n = properties.length; i < n; ++i) {\n reinterpretToPattern(parser, properties[i]);\n }\n return;\n }\n case 'AssignmentExpression':\n node.type = 'AssignmentPattern';\n if (node.operator !== '=')\n parser.report(71);\n delete node.operator;\n reinterpretToPattern(parser, node.left);\n return;\n case 'Property':\n reinterpretToPattern(parser, node.value);\n return;\n case 'SpreadElement':\n node.type = 'RestElement';\n reinterpretToPattern(parser, node.argument);\n }\n}\nfunction validateBindingIdentifier(parser, context, kind, t, skipEvalArgCheck) {\n if (context & 1) {\n if ((t & 36864) === 36864) {\n parser.report(118);\n }\n if (!skipEvalArgCheck && (t & 537079808) === 537079808) {\n parser.report(119);\n }\n }\n if ((t & 20480) === 20480 || t === -2147483528) {\n parser.report(102);\n }\n if (kind & (8 | 16) && (t & 255) === (241737 & 255)) {\n parser.report(100);\n }\n if (context & (2048 | 2) && t === 209006) {\n parser.report(110);\n }\n if (context & (1024 | 1) && t === 241771) {\n parser.report(97, 'yield');\n }\n}\nfunction validateFunctionName(parser, context, t) {\n if (context & 1) {\n if ((t & 36864) === 36864) {\n parser.report(118);\n }\n if ((t & 537079808) === 537079808) {\n parser.report(119);\n }\n if (t === -2147483527) {\n parser.report(95);\n }\n if (t === -2147483528) {\n parser.report(95);\n }\n }\n if ((t & 20480) === 20480) {\n parser.report(102);\n }\n if (context & (2048 | 2) && t === 209006) {\n parser.report(110);\n }\n if (context & (1024 | 1) && t === 241771) {\n parser.report(97, 'yield');\n }\n}\nfunction isStrictReservedWord(parser, context, t) {\n if (t === 209006) {\n if (context & (2048 | 2))\n parser.report(110);\n parser.destructible |= 128;\n }\n if (t === 241771 && context & 1024)\n parser.report(97, 'yield');\n return ((t & 20480) === 20480 ||\n (t & 36864) === 36864 ||\n t == -2147483527);\n}\nfunction isPropertyWithPrivateFieldKey(expr) {\n return !expr.property ? false : expr.property.type === 'PrivateIdentifier';\n}\nfunction isValidLabel(parser, labels, name, isIterationStatement) {\n while (labels) {\n if (labels['$' + name]) {\n if (isIterationStatement)\n parser.report(137);\n return 1;\n }\n if (isIterationStatement && labels.loop)\n isIterationStatement = 0;\n labels = labels['$'];\n }\n return 0;\n}\nfunction validateAndDeclareLabel(parser, labels, name) {\n let set = labels;\n while (set) {\n if (set['$' + name])\n parser.report(136, name);\n set = set['$'];\n }\n labels['$' + name] = 1;\n}\nfunction isEqualTagName(elementName) {\n switch (elementName.type) {\n case 'JSXIdentifier':\n return elementName.name;\n case 'JSXNamespacedName':\n return elementName.namespace + ':' + elementName.name;\n case 'JSXMemberExpression':\n return isEqualTagName(elementName.object) + '.' + isEqualTagName(elementName.property);\n }\n}\nfunction isValidIdentifier(context, t) {\n if (context & (1 | 1024)) {\n if (context & 2 && t === 209006)\n return false;\n if (context & 1024 && t === 241771)\n return false;\n return (t & 12288) === 12288;\n }\n return (t & 12288) === 12288 || (t & 36864) === 36864;\n}\nfunction classifyIdentifier(parser, context, t) {\n if ((t & 537079808) === 537079808) {\n if (context & 1)\n parser.report(119);\n parser.flags |= 512;\n }\n if (!isValidIdentifier(context, t))\n parser.report(0);\n}\nfunction getOwnProperty(object, key) {\n return Object.hasOwn(object, key) ? object[key] : undefined;\n}\n\nfunction scanIdentifier(parser, context, isValidAsKeyword) {\n while (isIdPart[advanceChar(parser)])\n ;\n parser.tokenValue = parser.source.slice(parser.tokenIndex, parser.index);\n return parser.currentChar !== 92 && parser.currentChar <= 0x7e\n ? (getOwnProperty(descKeywordTable, parser.tokenValue) ?? 208897)\n : scanIdentifierSlowCase(parser, context, 0, isValidAsKeyword);\n}\nfunction scanUnicodeIdentifier(parser, context) {\n const cookedChar = scanIdentifierUnicodeEscape(parser);\n if (!isIdentifierStart(cookedChar))\n parser.report(5);\n parser.tokenValue = String.fromCodePoint(cookedChar);\n return scanIdentifierSlowCase(parser, context, 1, CharTypes[cookedChar] & 4);\n}\nfunction scanIdentifierSlowCase(parser, context, hasEscape, isValidAsKeyword) {\n let start = parser.index;\n while (parser.index < parser.end) {\n if (parser.currentChar === 92) {\n parser.tokenValue += parser.source.slice(start, parser.index);\n hasEscape = 1;\n const code = scanIdentifierUnicodeEscape(parser);\n if (!isIdentifierPart(code))\n parser.report(5);\n isValidAsKeyword = isValidAsKeyword && CharTypes[code] & 4;\n parser.tokenValue += String.fromCodePoint(code);\n start = parser.index;\n }\n else {\n const merged = consumePossibleSurrogatePair(parser);\n if (merged > 0) {\n if (!isIdentifierPart(merged)) {\n parser.report(20, String.fromCodePoint(merged));\n }\n parser.currentChar = merged;\n parser.index++;\n parser.column++;\n }\n else if (!isIdentifierPart(parser.currentChar)) {\n break;\n }\n advanceChar(parser);\n }\n }\n if (parser.index <= parser.end) {\n parser.tokenValue += parser.source.slice(start, parser.index);\n }\n const { length } = parser.tokenValue;\n if (isValidAsKeyword && length >= 2 && length <= 11) {\n const token = getOwnProperty(descKeywordTable, parser.tokenValue);\n if (token === void 0)\n return 208897 | (hasEscape ? -2147483648 : 0);\n if (!hasEscape)\n return token;\n if (token === 209006) {\n if ((context & (2 | 2048)) === 0) {\n return token | -2147483648;\n }\n return -2147483528;\n }\n if (context & 1) {\n if (token === 36970) {\n return -2147483527;\n }\n if ((token & 36864) === 36864) {\n return -2147483527;\n }\n if ((token & 20480) === 20480) {\n if (context & 262144 && (context & 8) === 0) {\n return token | -2147483648;\n }\n else {\n return -2147483528;\n }\n }\n return 209018 | -2147483648;\n }\n if (context & 262144 &&\n (context & 8) === 0 &&\n (token & 20480) === 20480) {\n return token | -2147483648;\n }\n if (token === 241771) {\n return context & 262144\n ? 209018 | -2147483648\n : context & 1024\n ? -2147483528\n : token | -2147483648;\n }\n if (token === 209005) {\n return 209018 | -2147483648;\n }\n if ((token & 36864) === 36864) {\n return token | 12288 | -2147483648;\n }\n return -2147483528;\n }\n return 208897 | (hasEscape ? -2147483648 : 0);\n}\nfunction scanPrivateIdentifier(parser) {\n let char = advanceChar(parser);\n if (char === 92)\n return 130;\n const merged = consumePossibleSurrogatePair(parser);\n if (merged)\n char = merged;\n if (!isIdentifierStart(char))\n parser.report(96);\n return 130;\n}\nfunction scanIdentifierUnicodeEscape(parser) {\n if (parser.source.charCodeAt(parser.index + 1) !== 117) {\n parser.report(5);\n }\n parser.currentChar = parser.source.charCodeAt((parser.index += 2));\n parser.column += 2;\n return scanUnicodeEscape(parser);\n}\nfunction scanUnicodeEscape(parser) {\n let codePoint = 0;\n const char = parser.currentChar;\n if (char === 123) {\n const begin = parser.index - 2;\n while (CharTypes[advanceChar(parser)] & 64) {\n codePoint = (codePoint << 4) | toHex(parser.currentChar);\n if (codePoint > 1114111)\n throw new ParseError({ index: begin, line: parser.line, column: parser.column }, parser.currentLocation, 104);\n }\n if (parser.currentChar !== 125) {\n throw new ParseError({ index: begin, line: parser.line, column: parser.column }, parser.currentLocation, 7);\n }\n advanceChar(parser);\n return codePoint;\n }\n if ((CharTypes[char] & 64) === 0)\n parser.report(7);\n const char2 = parser.source.charCodeAt(parser.index + 1);\n if ((CharTypes[char2] & 64) === 0)\n parser.report(7);\n const char3 = parser.source.charCodeAt(parser.index + 2);\n if ((CharTypes[char3] & 64) === 0)\n parser.report(7);\n const char4 = parser.source.charCodeAt(parser.index + 3);\n if ((CharTypes[char4] & 64) === 0)\n parser.report(7);\n codePoint = (toHex(char) << 12) | (toHex(char2) << 8) | (toHex(char3) << 4) | toHex(char4);\n parser.currentChar = parser.source.charCodeAt((parser.index += 4));\n parser.column += 4;\n return codePoint;\n}\n\nconst TokenLookup = [\n 128,\n 128,\n 128,\n 128,\n 128,\n 128,\n 128,\n 128,\n 128,\n 127,\n 135,\n 127,\n 127,\n 129,\n 128,\n 128,\n 128,\n 128,\n 128,\n 128,\n 128,\n 128,\n 128,\n 128,\n 128,\n 128,\n 128,\n 128,\n 128,\n 128,\n 128,\n 128,\n 127,\n 16842798,\n 134283267,\n 130,\n 208897,\n 8391477,\n 8390213,\n 134283267,\n 67174411,\n 16,\n 8391476,\n 25233968,\n 18,\n 25233969,\n 67108877,\n 8457014,\n 134283266,\n 134283266,\n 134283266,\n 134283266,\n 134283266,\n 134283266,\n 134283266,\n 134283266,\n 134283266,\n 134283266,\n 21,\n 1074790417,\n 8456256,\n 1077936155,\n 8390721,\n 22,\n 132,\n 208897,\n 208897,\n 208897,\n 208897,\n 208897,\n 208897,\n 208897,\n 208897,\n 208897,\n 208897,\n 208897,\n 208897,\n 208897,\n 208897,\n 208897,\n 208897,\n 208897,\n 208897,\n 208897,\n 208897,\n 208897,\n 208897,\n 208897,\n 208897,\n 208897,\n 208897,\n 69271571,\n 136,\n 20,\n 8389959,\n 208897,\n 131,\n 4096,\n 4096,\n 4096,\n 4096,\n 4096,\n 4096,\n 4096,\n 208897,\n 4096,\n 208897,\n 208897,\n 4096,\n 208897,\n 4096,\n 208897,\n 4096,\n 208897,\n 4096,\n 4096,\n 4096,\n 208897,\n 4096,\n 4096,\n 208897,\n 4096,\n 4096,\n 2162700,\n 8389702,\n 1074790415,\n 16842799,\n 128,\n];\nfunction nextToken(parser, context) {\n parser.flags = (parser.flags | 1) ^ 1;\n parser.startIndex = parser.index;\n parser.startColumn = parser.column;\n parser.startLine = parser.line;\n parser.setToken(scanSingleToken(parser, context, 0));\n}\nfunction scanSingleToken(parser, context, state) {\n const isStartOfLine = parser.index === 0;\n const { source } = parser;\n let start = parser.currentLocation;\n while (parser.index < parser.end) {\n parser.tokenIndex = parser.index;\n parser.tokenColumn = parser.column;\n parser.tokenLine = parser.line;\n let char = parser.currentChar;\n if (char <= 0x7e) {\n const token = TokenLookup[char];\n switch (token) {\n case 67174411:\n case 16:\n case 2162700:\n case 1074790415:\n case 69271571:\n case 20:\n case 21:\n case 1074790417:\n case 18:\n case 16842799:\n case 132:\n case 128:\n advanceChar(parser);\n return token;\n case 208897:\n return scanIdentifier(parser, context, 0);\n case 4096:\n return scanIdentifier(parser, context, 1);\n case 134283266:\n return scanNumber(parser, context, 16 | 128);\n case 134283267:\n return scanString(parser, context, char);\n case 131:\n return scanTemplate(parser, context);\n case 136:\n return scanUnicodeIdentifier(parser, context);\n case 130:\n return scanPrivateIdentifier(parser);\n case 127:\n advanceChar(parser);\n break;\n case 129:\n state |= 1 | 4;\n scanNewLine(parser);\n break;\n case 135:\n consumeLineFeed(parser, state);\n state = (state & -5) | 1;\n break;\n case 8456256: {\n const ch = advanceChar(parser);\n if (parser.index < parser.end) {\n if (ch === 60) {\n if (parser.index < parser.end && advanceChar(parser) === 61) {\n advanceChar(parser);\n return 4194332;\n }\n return 8390978;\n }\n else if (ch === 61) {\n advanceChar(parser);\n return 8390718;\n }\n if (ch === 33) {\n const index = parser.index + 1;\n if (index + 1 < parser.end &&\n source.charCodeAt(index) === 45 &&\n source.charCodeAt(index + 1) == 45) {\n parser.column += 3;\n parser.currentChar = source.charCodeAt((parser.index += 3));\n state = skipSingleHTMLComment(parser, source, state, context, 2, parser.tokenStart);\n start = parser.tokenStart;\n continue;\n }\n return 8456256;\n }\n }\n return 8456256;\n }\n case 1077936155: {\n advanceChar(parser);\n const ch = parser.currentChar;\n if (ch === 61) {\n if (advanceChar(parser) === 61) {\n advanceChar(parser);\n return 8390458;\n }\n return 8390460;\n }\n if (ch === 62) {\n advanceChar(parser);\n return 10;\n }\n return 1077936155;\n }\n case 16842798:\n if (advanceChar(parser) !== 61) {\n return 16842798;\n }\n if (advanceChar(parser) !== 61) {\n return 8390461;\n }\n advanceChar(parser);\n return 8390459;\n case 8391477:\n if (advanceChar(parser) !== 61)\n return 8391477;\n advanceChar(parser);\n return 4194340;\n case 8391476: {\n advanceChar(parser);\n if (parser.index >= parser.end)\n return 8391476;\n const ch = parser.currentChar;\n if (ch === 61) {\n advanceChar(parser);\n return 4194338;\n }\n if (ch !== 42)\n return 8391476;\n if (advanceChar(parser) !== 61)\n return 8391735;\n advanceChar(parser);\n return 4194335;\n }\n case 8389959:\n if (advanceChar(parser) !== 61)\n return 8389959;\n advanceChar(parser);\n return 4194341;\n case 25233968: {\n advanceChar(parser);\n const ch = parser.currentChar;\n if (ch === 43) {\n advanceChar(parser);\n return 33619993;\n }\n if (ch === 61) {\n advanceChar(parser);\n return 4194336;\n }\n return 25233968;\n }\n case 25233969: {\n advanceChar(parser);\n const ch = parser.currentChar;\n if (ch === 45) {\n advanceChar(parser);\n if ((state & 1 || isStartOfLine) && parser.currentChar === 62) {\n if (!parser.options.webcompat)\n parser.report(112);\n advanceChar(parser);\n state = skipSingleHTMLComment(parser, source, state, context, 3, start);\n start = parser.tokenStart;\n continue;\n }\n return 33619994;\n }\n if (ch === 61) {\n advanceChar(parser);\n return 4194337;\n }\n return 25233969;\n }\n case 8457014: {\n advanceChar(parser);\n if (parser.index < parser.end) {\n const ch = parser.currentChar;\n if (ch === 47) {\n advanceChar(parser);\n state = skipSingleLineComment(parser, source, state, 0, parser.tokenStart);\n start = parser.tokenStart;\n continue;\n }\n if (ch === 42) {\n advanceChar(parser);\n state = skipMultiLineComment(parser, source, state);\n start = parser.tokenStart;\n continue;\n }\n if (context & 32) {\n return scanRegularExpression(parser);\n }\n if (ch === 61) {\n advanceChar(parser);\n return 4259875;\n }\n }\n return 8457014;\n }\n case 67108877: {\n const next = advanceChar(parser);\n if (next >= 48 && next <= 57)\n return scanNumber(parser, context, 64 | 16);\n if (next === 46) {\n const index = parser.index + 1;\n if (index < parser.end && source.charCodeAt(index) === 46) {\n parser.column += 2;\n parser.currentChar = source.charCodeAt((parser.index += 2));\n return 14;\n }\n }\n return 67108877;\n }\n case 8389702: {\n advanceChar(parser);\n const ch = parser.currentChar;\n if (ch === 124) {\n advanceChar(parser);\n if (parser.currentChar === 61) {\n advanceChar(parser);\n return 4194344;\n }\n return 8913465;\n }\n if (ch === 61) {\n advanceChar(parser);\n return 4194342;\n }\n return 8389702;\n }\n case 8390721: {\n advanceChar(parser);\n const ch = parser.currentChar;\n if (ch === 61) {\n advanceChar(parser);\n return 8390719;\n }\n if (ch !== 62)\n return 8390721;\n advanceChar(parser);\n if (parser.index < parser.end) {\n const ch = parser.currentChar;\n if (ch === 62) {\n if (advanceChar(parser) === 61) {\n advanceChar(parser);\n return 4194334;\n }\n return 8390980;\n }\n if (ch === 61) {\n advanceChar(parser);\n return 4194333;\n }\n }\n return 8390979;\n }\n case 8390213: {\n advanceChar(parser);\n const ch = parser.currentChar;\n if (ch === 38) {\n advanceChar(parser);\n if (parser.currentChar === 61) {\n advanceChar(parser);\n return 4194345;\n }\n return 8913720;\n }\n if (ch === 61) {\n advanceChar(parser);\n return 4194343;\n }\n return 8390213;\n }\n case 22: {\n let ch = advanceChar(parser);\n if (ch === 63) {\n advanceChar(parser);\n if (parser.currentChar === 61) {\n advanceChar(parser);\n return 4194346;\n }\n return 276824445;\n }\n if (ch === 46) {\n const index = parser.index + 1;\n if (index < parser.end) {\n ch = source.charCodeAt(index);\n if (!(ch >= 48 && ch <= 57)) {\n advanceChar(parser);\n return 67108990;\n }\n }\n }\n return 22;\n }\n }\n }\n else {\n if ((char ^ 8232) <= 1) {\n state = (state & -5) | 1;\n scanNewLine(parser);\n continue;\n }\n const merged = consumePossibleSurrogatePair(parser);\n if (merged > 0)\n char = merged;\n if (isIDStart(char)) {\n parser.tokenValue = '';\n return scanIdentifierSlowCase(parser, context, 0, 0);\n }\n if (isExoticECMAScriptWhitespace(char)) {\n advanceChar(parser);\n continue;\n }\n parser.report(20, String.fromCodePoint(char));\n }\n }\n return 1048576;\n}\n\nconst entities = {\n AElig: '\\u00C6',\n AMP: '\\u0026',\n Aacute: '\\u00C1',\n Abreve: '\\u0102',\n Acirc: '\\u00C2',\n Acy: '\\u0410',\n Afr: '\\uD835\\uDD04',\n Agrave: '\\u00C0',\n Alpha: '\\u0391',\n Amacr: '\\u0100',\n And: '\\u2A53',\n Aogon: '\\u0104',\n Aopf: '\\uD835\\uDD38',\n ApplyFunction: '\\u2061',\n Aring: '\\u00C5',\n Ascr: '\\uD835\\uDC9C',\n Assign: '\\u2254',\n Atilde: '\\u00C3',\n Auml: '\\u00C4',\n Backslash: '\\u2216',\n Barv: '\\u2AE7',\n Barwed: '\\u2306',\n Bcy: '\\u0411',\n Because: '\\u2235',\n Bernoullis: '\\u212C',\n Beta: '\\u0392',\n Bfr: '\\uD835\\uDD05',\n Bopf: '\\uD835\\uDD39',\n Breve: '\\u02D8',\n Bscr: '\\u212C',\n Bumpeq: '\\u224E',\n CHcy: '\\u0427',\n COPY: '\\u00A9',\n Cacute: '\\u0106',\n Cap: '\\u22D2',\n CapitalDifferentialD: '\\u2145',\n Cayleys: '\\u212D',\n Ccaron: '\\u010C',\n Ccedil: '\\u00C7',\n Ccirc: '\\u0108',\n Cconint: '\\u2230',\n Cdot: '\\u010A',\n Cedilla: '\\u00B8',\n CenterDot: '\\u00B7',\n Cfr: '\\u212D',\n Chi: '\\u03A7',\n CircleDot: '\\u2299',\n CircleMinus: '\\u2296',\n CirclePlus: '\\u2295',\n CircleTimes: '\\u2297',\n ClockwiseContourIntegral: '\\u2232',\n CloseCurlyDoubleQuote: '\\u201D',\n CloseCurlyQuote: '\\u2019',\n Colon: '\\u2237',\n Colone: '\\u2A74',\n Congruent: '\\u2261',\n Conint: '\\u222F',\n ContourIntegral: '\\u222E',\n Copf: '\\u2102',\n Coproduct: '\\u2210',\n CounterClockwiseContourIntegral: '\\u2233',\n Cross: '\\u2A2F',\n Cscr: '\\uD835\\uDC9E',\n Cup: '\\u22D3',\n CupCap: '\\u224D',\n DD: '\\u2145',\n DDotrahd: '\\u2911',\n DJcy: '\\u0402',\n DScy: '\\u0405',\n DZcy: '\\u040F',\n Dagger: '\\u2021',\n Darr: '\\u21A1',\n Dashv: '\\u2AE4',\n Dcaron: '\\u010E',\n Dcy: '\\u0414',\n Del: '\\u2207',\n Delta: '\\u0394',\n Dfr: '\\uD835\\uDD07',\n DiacriticalAcute: '\\u00B4',\n DiacriticalDot: '\\u02D9',\n DiacriticalDoubleAcute: '\\u02DD',\n DiacriticalGrave: '\\u0060',\n DiacriticalTilde: '\\u02DC',\n Diamond: '\\u22C4',\n DifferentialD: '\\u2146',\n Dopf: '\\uD835\\uDD3B',\n Dot: '\\u00A8',\n DotDot: '\\u20DC',\n DotEqual: '\\u2250',\n DoubleContourIntegral: '\\u222F',\n DoubleDot: '\\u00A8',\n DoubleDownArrow: '\\u21D3',\n DoubleLeftArrow: '\\u21D0',\n DoubleLeftRightArrow: '\\u21D4',\n DoubleLeftTee: '\\u2AE4',\n DoubleLongLeftArrow: '\\u27F8',\n DoubleLongLeftRightArrow: '\\u27FA',\n DoubleLongRightArrow: '\\u27F9',\n DoubleRightArrow: '\\u21D2',\n DoubleRightTee: '\\u22A8',\n DoubleUpArrow: '\\u21D1',\n DoubleUpDownArrow: '\\u21D5',\n DoubleVerticalBar: '\\u2225',\n DownArrow: '\\u2193',\n DownArrowBar: '\\u2913',\n DownArrowUpArrow: '\\u21F5',\n DownBreve: '\\u0311',\n DownLeftRightVector: '\\u2950',\n DownLeftTeeVector: '\\u295E',\n DownLeftVector: '\\u21BD',\n DownLeftVectorBar: '\\u2956',\n DownRightTeeVector: '\\u295F',\n DownRightVector: '\\u21C1',\n DownRightVectorBar: '\\u2957',\n DownTee: '\\u22A4',\n DownTeeArrow: '\\u21A7',\n Downarrow: '\\u21D3',\n Dscr: '\\uD835\\uDC9F',\n Dstrok: '\\u0110',\n ENG: '\\u014A',\n ETH: '\\u00D0',\n Eacute: '\\u00C9',\n Ecaron: '\\u011A',\n Ecirc: '\\u00CA',\n Ecy: '\\u042D',\n Edot: '\\u0116',\n Efr: '\\uD835\\uDD08',\n Egrave: '\\u00C8',\n Element: '\\u2208',\n Emacr: '\\u0112',\n EmptySmallSquare: '\\u25FB',\n EmptyVerySmallSquare: '\\u25AB',\n Eogon: '\\u0118',\n Eopf: '\\uD835\\uDD3C',\n Epsilon: '\\u0395',\n Equal: '\\u2A75',\n EqualTilde: '\\u2242',\n Equilibrium: '\\u21CC',\n Escr: '\\u2130',\n Esim: '\\u2A73',\n Eta: '\\u0397',\n Euml: '\\u00CB',\n Exists: '\\u2203',\n ExponentialE: '\\u2147',\n Fcy: '\\u0424',\n Ffr: '\\uD835\\uDD09',\n FilledSmallSquare: '\\u25FC',\n FilledVerySmallSquare: '\\u25AA',\n Fopf: '\\uD835\\uDD3D',\n ForAll: '\\u2200',\n Fouriertrf: '\\u2131',\n Fscr: '\\u2131',\n GJcy: '\\u0403',\n GT: '\\u003E',\n Gamma: '\\u0393',\n Gammad: '\\u03DC',\n Gbreve: '\\u011E',\n Gcedil: '\\u0122',\n Gcirc: '\\u011C',\n Gcy: '\\u0413',\n Gdot: '\\u0120',\n Gfr: '\\uD835\\uDD0A',\n Gg: '\\u22D9',\n Gopf: '\\uD835\\uDD3E',\n GreaterEqual: '\\u2265',\n GreaterEqualLess: '\\u22DB',\n GreaterFullEqual: '\\u2267',\n GreaterGreater: '\\u2AA2',\n GreaterLess: '\\u2277',\n GreaterSlantEqual: '\\u2A7E',\n GreaterTilde: '\\u2273',\n Gscr: '\\uD835\\uDCA2',\n Gt: '\\u226B',\n HARDcy: '\\u042A',\n Hacek: '\\u02C7',\n Hat: '\\u005E',\n Hcirc: '\\u0124',\n Hfr: '\\u210C',\n HilbertSpace: '\\u210B',\n Hopf: '\\u210D',\n HorizontalLine: '\\u2500',\n Hscr: '\\u210B',\n Hstrok: '\\u0126',\n HumpDownHump: '\\u224E',\n HumpEqual: '\\u224F',\n IEcy: '\\u0415',\n IJlig: '\\u0132',\n IOcy: '\\u0401',\n Iacute: '\\u00CD',\n Icirc: '\\u00CE',\n Icy: '\\u0418',\n Idot: '\\u0130',\n Ifr: '\\u2111',\n Igrave: '\\u00CC',\n Im: '\\u2111',\n Imacr: '\\u012A',\n ImaginaryI: '\\u2148',\n Implies: '\\u21D2',\n Int: '\\u222C',\n Integral: '\\u222B',\n Intersection: '\\u22C2',\n InvisibleComma: '\\u2063',\n InvisibleTimes: '\\u2062',\n Iogon: '\\u012E',\n Iopf: '\\uD835\\uDD40',\n Iota: '\\u0399',\n Iscr: '\\u2110',\n Itilde: '\\u0128',\n Iukcy: '\\u0406',\n Iuml: '\\u00CF',\n Jcirc: '\\u0134',\n Jcy: '\\u0419',\n Jfr: '\\uD835\\uDD0D',\n Jopf: '\\uD835\\uDD41',\n Jscr: '\\uD835\\uDCA5',\n Jsercy: '\\u0408',\n Jukcy: '\\u0404',\n KHcy: '\\u0425',\n KJcy: '\\u040C',\n Kappa: '\\u039A',\n Kcedil: '\\u0136',\n Kcy: '\\u041A',\n Kfr: '\\uD835\\uDD0E',\n Kopf: '\\uD835\\uDD42',\n Kscr: '\\uD835\\uDCA6',\n LJcy: '\\u0409',\n LT: '\\u003C',\n Lacute: '\\u0139',\n Lambda: '\\u039B',\n Lang: '\\u27EA',\n Laplacetrf: '\\u2112',\n Larr: '\\u219E',\n Lcaron: '\\u013D',\n Lcedil: '\\u013B',\n Lcy: '\\u041B',\n LeftAngleBracket: '\\u27E8',\n LeftArrow: '\\u2190',\n LeftArrowBar: '\\u21E4',\n LeftArrowRightArrow: '\\u21C6',\n LeftCeiling: '\\u2308',\n LeftDoubleBracket: '\\u27E6',\n LeftDownTeeVector: '\\u2961',\n LeftDownVector: '\\u21C3',\n LeftDownVectorBar: '\\u2959',\n LeftFloor: '\\u230A',\n LeftRightArrow: '\\u2194',\n LeftRightVector: '\\u294E',\n LeftTee: '\\u22A3',\n LeftTeeArrow: '\\u21A4',\n LeftTeeVector: '\\u295A',\n LeftTriangle: '\\u22B2',\n LeftTriangleBar: '\\u29CF',\n LeftTriangleEqual: '\\u22B4',\n LeftUpDownVector: '\\u2951',\n LeftUpTeeVector: '\\u2960',\n LeftUpVector: '\\u21BF',\n LeftUpVectorBar: '\\u2958',\n LeftVector: '\\u21BC',\n LeftVectorBar: '\\u2952',\n Leftarrow: '\\u21D0',\n Leftrightarrow: '\\u21D4',\n LessEqualGreater: '\\u22DA',\n LessFullEqual: '\\u2266',\n LessGreater: '\\u2276',\n LessLess: '\\u2AA1',\n LessSlantEqual: '\\u2A7D',\n LessTilde: '\\u2272',\n Lfr: '\\uD835\\uDD0F',\n Ll: '\\u22D8',\n Lleftarrow: '\\u21DA',\n Lmidot: '\\u013F',\n LongLeftArrow: '\\u27F5',\n LongLeftRightArrow: '\\u27F7',\n LongRightArrow: '\\u27F6',\n Longleftarrow: '\\u27F8',\n Longleftrightarrow: '\\u27FA',\n Longrightarrow: '\\u27F9',\n Lopf: '\\uD835\\uDD43',\n LowerLeftArrow: '\\u2199',\n LowerRightArrow: '\\u2198',\n Lscr: '\\u2112',\n Lsh: '\\u21B0',\n Lstrok: '\\u0141',\n Lt: '\\u226A',\n Map: '\\u2905',\n Mcy: '\\u041C',\n MediumSpace: '\\u205F',\n Mellintrf: '\\u2133',\n Mfr: '\\uD835\\uDD10',\n MinusPlus: '\\u2213',\n Mopf: '\\uD835\\uDD44',\n Mscr: '\\u2133',\n Mu: '\\u039C',\n NJcy: '\\u040A',\n Nacute: '\\u0143',\n Ncaron: '\\u0147',\n Ncedil: '\\u0145',\n Ncy: '\\u041D',\n NegativeMediumSpace: '\\u200B',\n NegativeThickSpace: '\\u200B',\n NegativeThinSpace: '\\u200B',\n NegativeVeryThinSpace: '\\u200B',\n NestedGreaterGreater: '\\u226B',\n NestedLessLess: '\\u226A',\n NewLine: '\\u000A',\n Nfr: '\\uD835\\uDD11',\n NoBreak: '\\u2060',\n NonBreakingSpace: '\\u00A0',\n Nopf: '\\u2115',\n Not: '\\u2AEC',\n NotCongruent: '\\u2262',\n NotCupCap: '\\u226D',\n NotDoubleVerticalBar: '\\u2226',\n NotElement: '\\u2209',\n NotEqual: '\\u2260',\n NotEqualTilde: '\\u2242\\u0338',\n NotExists: '\\u2204',\n NotGreater: '\\u226F',\n NotGreaterEqual: '\\u2271',\n NotGreaterFullEqual: '\\u2267\\u0338',\n NotGreaterGreater: '\\u226B\\u0338',\n NotGreaterLess: '\\u2279',\n NotGreaterSlantEqual: '\\u2A7E\\u0338',\n NotGreaterTilde: '\\u2275',\n NotHumpDownHump: '\\u224E\\u0338',\n NotHumpEqual: '\\u224F\\u0338',\n NotLeftTriangle: '\\u22EA',\n NotLeftTriangleBar: '\\u29CF\\u0338',\n NotLeftTriangleEqual: '\\u22EC',\n NotLess: '\\u226E',\n NotLessEqual: '\\u2270',\n NotLessGreater: '\\u2278',\n NotLessLess: '\\u226A\\u0338',\n NotLessSlantEqual: '\\u2A7D\\u0338',\n NotLessTilde: '\\u2274',\n NotNestedGreaterGreater: '\\u2AA2\\u0338',\n NotNestedLessLess: '\\u2AA1\\u0338',\n NotPrecedes: '\\u2280',\n NotPrecedesEqual: '\\u2AAF\\u0338',\n NotPrecedesSlantEqual: '\\u22E0',\n NotReverseElement: '\\u220C',\n NotRightTriangle: '\\u22EB',\n NotRightTriangleBar: '\\u29D0\\u0338',\n NotRightTriangleEqual: '\\u22ED',\n NotSquareSubset: '\\u228F\\u0338',\n NotSquareSubsetEqual: '\\u22E2',\n NotSquareSuperset: '\\u2290\\u0338',\n NotSquareSupersetEqual: '\\u22E3',\n NotSubset: '\\u2282\\u20D2',\n NotSubsetEqual: '\\u2288',\n NotSucceeds: '\\u2281',\n NotSucceedsEqual: '\\u2AB0\\u0338',\n NotSucceedsSlantEqual: '\\u22E1',\n NotSucceedsTilde: '\\u227F\\u0338',\n NotSuperset: '\\u2283\\u20D2',\n NotSupersetEqual: '\\u2289',\n NotTilde: '\\u2241',\n NotTildeEqual: '\\u2244',\n NotTildeFullEqual: '\\u2247',\n NotTildeTilde: '\\u2249',\n NotVerticalBar: '\\u2224',\n Nscr: '\\uD835\\uDCA9',\n Ntilde: '\\u00D1',\n Nu: '\\u039D',\n OElig: '\\u0152',\n Oacute: '\\u00D3',\n Ocirc: '\\u00D4',\n Ocy: '\\u041E',\n Odblac: '\\u0150',\n Ofr: '\\uD835\\uDD12',\n Ograve: '\\u00D2',\n Omacr: '\\u014C',\n Omega: '\\u03A9',\n Omicron: '\\u039F',\n Oopf: '\\uD835\\uDD46',\n OpenCurlyDoubleQuote: '\\u201C',\n OpenCurlyQuote: '\\u2018',\n Or: '\\u2A54',\n Oscr: '\\uD835\\uDCAA',\n Oslash: '\\u00D8',\n Otilde: '\\u00D5',\n Otimes: '\\u2A37',\n Ouml: '\\u00D6',\n OverBar: '\\u203E',\n OverBrace: '\\u23DE',\n OverBracket: '\\u23B4',\n OverParenthesis: '\\u23DC',\n PartialD: '\\u2202',\n Pcy: '\\u041F',\n Pfr: '\\uD835\\uDD13',\n Phi: '\\u03A6',\n Pi: '\\u03A0',\n PlusMinus: '\\u00B1',\n Poincareplane: '\\u210C',\n Popf: '\\u2119',\n Pr: '\\u2ABB',\n Precedes: '\\u227A',\n PrecedesEqual: '\\u2AAF',\n PrecedesSlantEqual: '\\u227C',\n PrecedesTilde: '\\u227E',\n Prime: '\\u2033',\n Product: '\\u220F',\n Proportion: '\\u2237',\n Proportional: '\\u221D',\n Pscr: '\\uD835\\uDCAB',\n Psi: '\\u03A8',\n QUOT: '\\u0022',\n Qfr: '\\uD835\\uDD14',\n Qopf: '\\u211A',\n Qscr: '\\uD835\\uDCAC',\n RBarr: '\\u2910',\n REG: '\\u00AE',\n Racute: '\\u0154',\n Rang: '\\u27EB',\n Rarr: '\\u21A0',\n Rarrtl: '\\u2916',\n Rcaron: '\\u0158',\n Rcedil: '\\u0156',\n Rcy: '\\u0420',\n Re: '\\u211C',\n ReverseElement: '\\u220B',\n ReverseEquilibrium: '\\u21CB',\n ReverseUpEquilibrium: '\\u296F',\n Rfr: '\\u211C',\n Rho: '\\u03A1',\n RightAngleBracket: '\\u27E9',\n RightArrow: '\\u2192',\n RightArrowBar: '\\u21E5',\n RightArrowLeftArrow: '\\u21C4',\n RightCeiling: '\\u2309',\n RightDoubleBracket: '\\u27E7',\n RightDownTeeVector: '\\u295D',\n RightDownVector: '\\u21C2',\n RightDownVectorBar: '\\u2955',\n RightFloor: '\\u230B',\n RightTee: '\\u22A2',\n RightTeeArrow: '\\u21A6',\n RightTeeVector: '\\u295B',\n RightTriangle: '\\u22B3',\n RightTriangleBar: '\\u29D0',\n RightTriangleEqual: '\\u22B5',\n RightUpDownVector: '\\u294F',\n RightUpTeeVector: '\\u295C',\n RightUpVector: '\\u21BE',\n RightUpVectorBar: '\\u2954',\n RightVector: '\\u21C0',\n RightVectorBar: '\\u2953',\n Rightarrow: '\\u21D2',\n Ropf: '\\u211D',\n RoundImplies: '\\u2970',\n Rrightarrow: '\\u21DB',\n Rscr: '\\u211B',\n Rsh: '\\u21B1',\n RuleDelayed: '\\u29F4',\n SHCHcy: '\\u0429',\n SHcy: '\\u0428',\n SOFTcy: '\\u042C',\n Sacute: '\\u015A',\n Sc: '\\u2ABC',\n Scaron: '\\u0160',\n Scedil: '\\u015E',\n Scirc: '\\u015C',\n Scy: '\\u0421',\n Sfr: '\\uD835\\uDD16',\n ShortDownArrow: '\\u2193',\n ShortLeftArrow: '\\u2190',\n ShortRightArrow: '\\u2192',\n ShortUpArrow: '\\u2191',\n Sigma: '\\u03A3',\n SmallCircle: '\\u2218',\n Sopf: '\\uD835\\uDD4A',\n Sqrt: '\\u221A',\n Square: '\\u25A1',\n SquareIntersection: '\\u2293',\n SquareSubset: '\\u228F',\n SquareSubsetEqual: '\\u2291',\n SquareSuperset: '\\u2290',\n SquareSupersetEqual: '\\u2292',\n SquareUnion: '\\u2294',\n Sscr: '\\uD835\\uDCAE',\n Star: '\\u22C6',\n Sub: '\\u22D0',\n Subset: '\\u22D0',\n SubsetEqual: '\\u2286',\n Succeeds: '\\u227B',\n SucceedsEqual: '\\u2AB0',\n SucceedsSlantEqual: '\\u227D',\n SucceedsTilde: '\\u227F',\n SuchThat: '\\u220B',\n Sum: '\\u2211',\n Sup: '\\u22D1',\n Superset: '\\u2283',\n SupersetEqual: '\\u2287',\n Supset: '\\u22D1',\n THORN: '\\u00DE',\n TRADE: '\\u2122',\n TSHcy: '\\u040B',\n TScy: '\\u0426',\n Tab: '\\u0009',\n Tau: '\\u03A4',\n Tcaron: '\\u0164',\n Tcedil: '\\u0162',\n Tcy: '\\u0422',\n Tfr: '\\uD835\\uDD17',\n Therefore: '\\u2234',\n Theta: '\\u0398',\n ThickSpace: '\\u205F\\u200A',\n ThinSpace: '\\u2009',\n Tilde: '\\u223C',\n TildeEqual: '\\u2243',\n TildeFullEqual: '\\u2245',\n TildeTilde: '\\u2248',\n Topf: '\\uD835\\uDD4B',\n TripleDot: '\\u20DB',\n Tscr: '\\uD835\\uDCAF',\n Tstrok: '\\u0166',\n Uacute: '\\u00DA',\n Uarr: '\\u219F',\n Uarrocir: '\\u2949',\n Ubrcy: '\\u040E',\n Ubreve: '\\u016C',\n Ucirc: '\\u00DB',\n Ucy: '\\u0423',\n Udblac: '\\u0170',\n Ufr: '\\uD835\\uDD18',\n Ugrave: '\\u00D9',\n Umacr: '\\u016A',\n UnderBar: '\\u005F',\n UnderBrace: '\\u23DF',\n UnderBracket: '\\u23B5',\n UnderParenthesis: '\\u23DD',\n Union: '\\u22C3',\n UnionPlus: '\\u228E',\n Uogon: '\\u0172',\n Uopf: '\\uD835\\uDD4C',\n UpArrow: '\\u2191',\n UpArrowBar: '\\u2912',\n UpArrowDownArrow: '\\u21C5',\n UpDownArrow: '\\u2195',\n UpEquilibrium: '\\u296E',\n UpTee: '\\u22A5',\n UpTeeArrow: '\\u21A5',\n Uparrow: '\\u21D1',\n Updownarrow: '\\u21D5',\n UpperLeftArrow: '\\u2196',\n UpperRightArrow: '\\u2197',\n Upsi: '\\u03D2',\n Upsilon: '\\u03A5',\n Uring: '\\u016E',\n Uscr: '\\uD835\\uDCB0',\n Utilde: '\\u0168',\n Uuml: '\\u00DC',\n VDash: '\\u22AB',\n Vbar: '\\u2AEB',\n Vcy: '\\u0412',\n Vdash: '\\u22A9',\n Vdashl: '\\u2AE6',\n Vee: '\\u22C1',\n Verbar: '\\u2016',\n Vert: '\\u2016',\n VerticalBar: '\\u2223',\n VerticalLine: '\\u007C',\n VerticalSeparator: '\\u2758',\n VerticalTilde: '\\u2240',\n VeryThinSpace: '\\u200A',\n Vfr: '\\uD835\\uDD19',\n Vopf: '\\uD835\\uDD4D',\n Vscr: '\\uD835\\uDCB1',\n Vvdash: '\\u22AA',\n Wcirc: '\\u0174',\n Wedge: '\\u22C0',\n Wfr: '\\uD835\\uDD1A',\n Wopf: '\\uD835\\uDD4E',\n Wscr: '\\uD835\\uDCB2',\n Xfr: '\\uD835\\uDD1B',\n Xi: '\\u039E',\n Xopf: '\\uD835\\uDD4F',\n Xscr: '\\uD835\\uDCB3',\n YAcy: '\\u042F',\n YIcy: '\\u0407',\n YUcy: '\\u042E',\n Yacute: '\\u00DD',\n Ycirc: '\\u0176',\n Ycy: '\\u042B',\n Yfr: '\\uD835\\uDD1C',\n Yopf: '\\uD835\\uDD50',\n Yscr: '\\uD835\\uDCB4',\n Yuml: '\\u0178',\n ZHcy: '\\u0416',\n Zacute: '\\u0179',\n Zcaron: '\\u017D',\n Zcy: '\\u0417',\n Zdot: '\\u017B',\n ZeroWidthSpace: '\\u200B',\n Zeta: '\\u0396',\n Zfr: '\\u2128',\n Zopf: '\\u2124',\n Zscr: '\\uD835\\uDCB5',\n aacute: '\\u00E1',\n abreve: '\\u0103',\n ac: '\\u223E',\n acE: '\\u223E\\u0333',\n acd: '\\u223F',\n acirc: '\\u00E2',\n acute: '\\u00B4',\n acy: '\\u0430',\n aelig: '\\u00E6',\n af: '\\u2061',\n afr: '\\uD835\\uDD1E',\n agrave: '\\u00E0',\n alefsym: '\\u2135',\n aleph: '\\u2135',\n alpha: '\\u03B1',\n amacr: '\\u0101',\n amalg: '\\u2A3F',\n amp: '\\u0026',\n and: '\\u2227',\n andand: '\\u2A55',\n andd: '\\u2A5C',\n andslope: '\\u2A58',\n andv: '\\u2A5A',\n ang: '\\u2220',\n ange: '\\u29A4',\n angle: '\\u2220',\n angmsd: '\\u2221',\n angmsdaa: '\\u29A8',\n angmsdab: '\\u29A9',\n angmsdac: '\\u29AA',\n angmsdad: '\\u29AB',\n angmsdae: '\\u29AC',\n angmsdaf: '\\u29AD',\n angmsdag: '\\u29AE',\n angmsdah: '\\u29AF',\n angrt: '\\u221F',\n angrtvb: '\\u22BE',\n angrtvbd: '\\u299D',\n angsph: '\\u2222',\n angst: '\\u00C5',\n angzarr: '\\u237C',\n aogon: '\\u0105',\n aopf: '\\uD835\\uDD52',\n ap: '\\u2248',\n apE: '\\u2A70',\n apacir: '\\u2A6F',\n ape: '\\u224A',\n apid: '\\u224B',\n apos: '\\u0027',\n approx: '\\u2248',\n approxeq: '\\u224A',\n aring: '\\u00E5',\n ascr: '\\uD835\\uDCB6',\n ast: '\\u002A',\n asymp: '\\u2248',\n asympeq: '\\u224D',\n atilde: '\\u00E3',\n auml: '\\u00E4',\n awconint: '\\u2233',\n awint: '\\u2A11',\n bNot: '\\u2AED',\n backcong: '\\u224C',\n backepsilon: '\\u03F6',\n backprime: '\\u2035',\n backsim: '\\u223D',\n backsimeq: '\\u22CD',\n barvee: '\\u22BD',\n barwed: '\\u2305',\n barwedge: '\\u2305',\n bbrk: '\\u23B5',\n bbrktbrk: '\\u23B6',\n bcong: '\\u224C',\n bcy: '\\u0431',\n bdquo: '\\u201E',\n becaus: '\\u2235',\n because: '\\u2235',\n bemptyv: '\\u29B0',\n bepsi: '\\u03F6',\n bernou: '\\u212C',\n beta: '\\u03B2',\n beth: '\\u2136',\n between: '\\u226C',\n bfr: '\\uD835\\uDD1F',\n bigcap: '\\u22C2',\n bigcirc: '\\u25EF',\n bigcup: '\\u22C3',\n bigodot: '\\u2A00',\n bigoplus: '\\u2A01',\n bigotimes: '\\u2A02',\n bigsqcup: '\\u2A06',\n bigstar: '\\u2605',\n bigtriangledown: '\\u25BD',\n bigtriangleup: '\\u25B3',\n biguplus: '\\u2A04',\n bigvee: '\\u22C1',\n bigwedge: '\\u22C0',\n bkarow: '\\u290D',\n blacklozenge: '\\u29EB',\n blacksquare: '\\u25AA',\n blacktriangle: '\\u25B4',\n blacktriangledown: '\\u25BE',\n blacktriangleleft: '\\u25C2',\n blacktriangleright: '\\u25B8',\n blank: '\\u2423',\n blk12: '\\u2592',\n blk14: '\\u2591',\n blk34: '\\u2593',\n block: '\\u2588',\n bne: '\\u003D\\u20E5',\n bnequiv: '\\u2261\\u20E5',\n bnot: '\\u2310',\n bopf: '\\uD835\\uDD53',\n bot: '\\u22A5',\n bottom: '\\u22A5',\n bowtie: '\\u22C8',\n boxDL: '\\u2557',\n boxDR: '\\u2554',\n boxDl: '\\u2556',\n boxDr: '\\u2553',\n boxH: '\\u2550',\n boxHD: '\\u2566',\n boxHU: '\\u2569',\n boxHd: '\\u2564',\n boxHu: '\\u2567',\n boxUL: '\\u255D',\n boxUR: '\\u255A',\n boxUl: '\\u255C',\n boxUr: '\\u2559',\n boxV: '\\u2551',\n boxVH: '\\u256C',\n boxVL: '\\u2563',\n boxVR: '\\u2560',\n boxVh: '\\u256B',\n boxVl: '\\u2562',\n boxVr: '\\u255F',\n boxbox: '\\u29C9',\n boxdL: '\\u2555',\n boxdR: '\\u2552',\n boxdl: '\\u2510',\n boxdr: '\\u250C',\n boxh: '\\u2500',\n boxhD: '\\u2565',\n boxhU: '\\u2568',\n boxhd: '\\u252C',\n boxhu: '\\u2534',\n boxminus: '\\u229F',\n boxplus: '\\u229E',\n boxtimes: '\\u22A0',\n boxuL: '\\u255B',\n boxuR: '\\u2558',\n boxul: '\\u2518',\n boxur: '\\u2514',\n boxv: '\\u2502',\n boxvH: '\\u256A',\n boxvL: '\\u2561',\n boxvR: '\\u255E',\n boxvh: '\\u253C',\n boxvl: '\\u2524',\n boxvr: '\\u251C',\n bprime: '\\u2035',\n breve: '\\u02D8',\n brvbar: '\\u00A6',\n bscr: '\\uD835\\uDCB7',\n bsemi: '\\u204F',\n bsim: '\\u223D',\n bsime: '\\u22CD',\n bsol: '\\u005C',\n bsolb: '\\u29C5',\n bsolhsub: '\\u27C8',\n bull: '\\u2022',\n bullet: '\\u2022',\n bump: '\\u224E',\n bumpE: '\\u2AAE',\n bumpe: '\\u224F',\n bumpeq: '\\u224F',\n cacute: '\\u0107',\n cap: '\\u2229',\n capand: '\\u2A44',\n capbrcup: '\\u2A49',\n capcap: '\\u2A4B',\n capcup: '\\u2A47',\n capdot: '\\u2A40',\n caps: '\\u2229\\uFE00',\n caret: '\\u2041',\n caron: '\\u02C7',\n ccaps: '\\u2A4D',\n ccaron: '\\u010D',\n ccedil: '\\u00E7',\n ccirc: '\\u0109',\n ccups: '\\u2A4C',\n ccupssm: '\\u2A50',\n cdot: '\\u010B',\n cedil: '\\u00B8',\n cemptyv: '\\u29B2',\n cent: '\\u00A2',\n centerdot: '\\u00B7',\n cfr: '\\uD835\\uDD20',\n chcy: '\\u0447',\n check: '\\u2713',\n checkmark: '\\u2713',\n chi: '\\u03C7',\n cir: '\\u25CB',\n cirE: '\\u29C3',\n circ: '\\u02C6',\n circeq: '\\u2257',\n circlearrowleft: '\\u21BA',\n circlearrowright: '\\u21BB',\n circledR: '\\u00AE',\n circledS: '\\u24C8',\n circledast: '\\u229B',\n circledcirc: '\\u229A',\n circleddash: '\\u229D',\n cire: '\\u2257',\n cirfnint: '\\u2A10',\n cirmid: '\\u2AEF',\n cirscir: '\\u29C2',\n clubs: '\\u2663',\n clubsuit: '\\u2663',\n colon: '\\u003A',\n colone: '\\u2254',\n coloneq: '\\u2254',\n comma: '\\u002C',\n commat: '\\u0040',\n comp: '\\u2201',\n compfn: '\\u2218',\n complement: '\\u2201',\n complexes: '\\u2102',\n cong: '\\u2245',\n congdot: '\\u2A6D',\n conint: '\\u222E',\n copf: '\\uD835\\uDD54',\n coprod: '\\u2210',\n copy: '\\u00A9',\n copysr: '\\u2117',\n crarr: '\\u21B5',\n cross: '\\u2717',\n cscr: '\\uD835\\uDCB8',\n csub: '\\u2ACF',\n csube: '\\u2AD1',\n csup: '\\u2AD0',\n csupe: '\\u2AD2',\n ctdot: '\\u22EF',\n cudarrl: '\\u2938',\n cudarrr: '\\u2935',\n cuepr: '\\u22DE',\n cuesc: '\\u22DF',\n cularr: '\\u21B6',\n cularrp: '\\u293D',\n cup: '\\u222A',\n cupbrcap: '\\u2A48',\n cupcap: '\\u2A46',\n cupcup: '\\u2A4A',\n cupdot: '\\u228D',\n cupor: '\\u2A45',\n cups: '\\u222A\\uFE00',\n curarr: '\\u21B7',\n curarrm: '\\u293C',\n curlyeqprec: '\\u22DE',\n curlyeqsucc: '\\u22DF',\n curlyvee: '\\u22CE',\n curlywedge: '\\u22CF',\n curren: '\\u00A4',\n curvearrowleft: '\\u21B6',\n curvearrowright: '\\u21B7',\n cuvee: '\\u22CE',\n cuwed: '\\u22CF',\n cwconint: '\\u2232',\n cwint: '\\u2231',\n cylcty: '\\u232D',\n dArr: '\\u21D3',\n dHar: '\\u2965',\n dagger: '\\u2020',\n daleth: '\\u2138',\n darr: '\\u2193',\n dash: '\\u2010',\n dashv: '\\u22A3',\n dbkarow: '\\u290F',\n dblac: '\\u02DD',\n dcaron: '\\u010F',\n dcy: '\\u0434',\n dd: '\\u2146',\n ddagger: '\\u2021',\n ddarr: '\\u21CA',\n ddotseq: '\\u2A77',\n deg: '\\u00B0',\n delta: '\\u03B4',\n demptyv: '\\u29B1',\n dfisht: '\\u297F',\n dfr: '\\uD835\\uDD21',\n dharl: '\\u21C3',\n dharr: '\\u21C2',\n diam: '\\u22C4',\n diamond: '\\u22C4',\n diamondsuit: '\\u2666',\n diams: '\\u2666',\n die: '\\u00A8',\n digamma: '\\u03DD',\n disin: '\\u22F2',\n div: '\\u00F7',\n divide: '\\u00F7',\n divideontimes: '\\u22C7',\n divonx: '\\u22C7',\n djcy: '\\u0452',\n dlcorn: '\\u231E',\n dlcrop: '\\u230D',\n dollar: '\\u0024',\n dopf: '\\uD835\\uDD55',\n dot: '\\u02D9',\n doteq: '\\u2250',\n doteqdot: '\\u2251',\n dotminus: '\\u2238',\n dotplus: '\\u2214',\n dotsquare: '\\u22A1',\n doublebarwedge: '\\u2306',\n downarrow: '\\u2193',\n downdownarrows: '\\u21CA',\n downharpoonleft: '\\u21C3',\n downharpoonright: '\\u21C2',\n drbkarow: '\\u2910',\n drcorn: '\\u231F',\n drcrop: '\\u230C',\n dscr: '\\uD835\\uDCB9',\n dscy: '\\u0455',\n dsol: '\\u29F6',\n dstrok: '\\u0111',\n dtdot: '\\u22F1',\n dtri: '\\u25BF',\n dtrif: '\\u25BE',\n duarr: '\\u21F5',\n duhar: '\\u296F',\n dwangle: '\\u29A6',\n dzcy: '\\u045F',\n dzigrarr: '\\u27FF',\n eDDot: '\\u2A77',\n eDot: '\\u2251',\n eacute: '\\u00E9',\n easter: '\\u2A6E',\n ecaron: '\\u011B',\n ecir: '\\u2256',\n ecirc: '\\u00EA',\n ecolon: '\\u2255',\n ecy: '\\u044D',\n edot: '\\u0117',\n ee: '\\u2147',\n efDot: '\\u2252',\n efr: '\\uD835\\uDD22',\n eg: '\\u2A9A',\n egrave: '\\u00E8',\n egs: '\\u2A96',\n egsdot: '\\u2A98',\n el: '\\u2A99',\n elinters: '\\u23E7',\n ell: '\\u2113',\n els: '\\u2A95',\n elsdot: '\\u2A97',\n emacr: '\\u0113',\n empty: '\\u2205',\n emptyset: '\\u2205',\n emptyv: '\\u2205',\n emsp13: '\\u2004',\n emsp14: '\\u2005',\n emsp: '\\u2003',\n eng: '\\u014B',\n ensp: '\\u2002',\n eogon: '\\u0119',\n eopf: '\\uD835\\uDD56',\n epar: '\\u22D5',\n eparsl: '\\u29E3',\n eplus: '\\u2A71',\n epsi: '\\u03B5',\n epsilon: '\\u03B5',\n epsiv: '\\u03F5',\n eqcirc: '\\u2256',\n eqcolon: '\\u2255',\n eqsim: '\\u2242',\n eqslantgtr: '\\u2A96',\n eqslantless: '\\u2A95',\n equals: '\\u003D',\n equest: '\\u225F',\n equiv: '\\u2261',\n equivDD: '\\u2A78',\n eqvparsl: '\\u29E5',\n erDot: '\\u2253',\n erarr: '\\u2971',\n escr: '\\u212F',\n esdot: '\\u2250',\n esim: '\\u2242',\n eta: '\\u03B7',\n eth: '\\u00F0',\n euml: '\\u00EB',\n euro: '\\u20AC',\n excl: '\\u0021',\n exist: '\\u2203',\n expectation: '\\u2130',\n exponentiale: '\\u2147',\n fallingdotseq: '\\u2252',\n fcy: '\\u0444',\n female: '\\u2640',\n ffilig: '\\uFB03',\n fflig: '\\uFB00',\n ffllig: '\\uFB04',\n ffr: '\\uD835\\uDD23',\n filig: '\\uFB01',\n fjlig: '\\u0066\\u006A',\n flat: '\\u266D',\n fllig: '\\uFB02',\n fltns: '\\u25B1',\n fnof: '\\u0192',\n fopf: '\\uD835\\uDD57',\n forall: '\\u2200',\n fork: '\\u22D4',\n forkv: '\\u2AD9',\n fpartint: '\\u2A0D',\n frac12: '\\u00BD',\n frac13: '\\u2153',\n frac14: '\\u00BC',\n frac15: '\\u2155',\n frac16: '\\u2159',\n frac18: '\\u215B',\n frac23: '\\u2154',\n frac25: '\\u2156',\n frac34: '\\u00BE',\n frac35: '\\u2157',\n frac38: '\\u215C',\n frac45: '\\u2158',\n frac56: '\\u215A',\n frac58: '\\u215D',\n frac78: '\\u215E',\n frasl: '\\u2044',\n frown: '\\u2322',\n fscr: '\\uD835\\uDCBB',\n gE: '\\u2267',\n gEl: '\\u2A8C',\n gacute: '\\u01F5',\n gamma: '\\u03B3',\n gammad: '\\u03DD',\n gap: '\\u2A86',\n gbreve: '\\u011F',\n gcirc: '\\u011D',\n gcy: '\\u0433',\n gdot: '\\u0121',\n ge: '\\u2265',\n gel: '\\u22DB',\n geq: '\\u2265',\n geqq: '\\u2267',\n geqslant: '\\u2A7E',\n ges: '\\u2A7E',\n gescc: '\\u2AA9',\n gesdot: '\\u2A80',\n gesdoto: '\\u2A82',\n gesdotol: '\\u2A84',\n gesl: '\\u22DB\\uFE00',\n gesles: '\\u2A94',\n gfr: '\\uD835\\uDD24',\n gg: '\\u226B',\n ggg: '\\u22D9',\n gimel: '\\u2137',\n gjcy: '\\u0453',\n gl: '\\u2277',\n glE: '\\u2A92',\n gla: '\\u2AA5',\n glj: '\\u2AA4',\n gnE: '\\u2269',\n gnap: '\\u2A8A',\n gnapprox: '\\u2A8A',\n gne: '\\u2A88',\n gneq: '\\u2A88',\n gneqq: '\\u2269',\n gnsim: '\\u22E7',\n gopf: '\\uD835\\uDD58',\n grave: '\\u0060',\n gscr: '\\u210A',\n gsim: '\\u2273',\n gsime: '\\u2A8E',\n gsiml: '\\u2A90',\n gt: '\\u003E',\n gtcc: '\\u2AA7',\n gtcir: '\\u2A7A',\n gtdot: '\\u22D7',\n gtlPar: '\\u2995',\n gtquest: '\\u2A7C',\n gtrapprox: '\\u2A86',\n gtrarr: '\\u2978',\n gtrdot: '\\u22D7',\n gtreqless: '\\u22DB',\n gtreqqless: '\\u2A8C',\n gtrless: '\\u2277',\n gtrsim: '\\u2273',\n gvertneqq: '\\u2269\\uFE00',\n gvnE: '\\u2269\\uFE00',\n hArr: '\\u21D4',\n hairsp: '\\u200A',\n half: '\\u00BD',\n hamilt: '\\u210B',\n hardcy: '\\u044A',\n harr: '\\u2194',\n harrcir: '\\u2948',\n harrw: '\\u21AD',\n hbar: '\\u210F',\n hcirc: '\\u0125',\n hearts: '\\u2665',\n heartsuit: '\\u2665',\n hellip: '\\u2026',\n hercon: '\\u22B9',\n hfr: '\\uD835\\uDD25',\n hksearow: '\\u2925',\n hkswarow: '\\u2926',\n hoarr: '\\u21FF',\n homtht: '\\u223B',\n hookleftarrow: '\\u21A9',\n hookrightarrow: '\\u21AA',\n hopf: '\\uD835\\uDD59',\n horbar: '\\u2015',\n hscr: '\\uD835\\uDCBD',\n hslash: '\\u210F',\n hstrok: '\\u0127',\n hybull: '\\u2043',\n hyphen: '\\u2010',\n iacute: '\\u00ED',\n ic: '\\u2063',\n icirc: '\\u00EE',\n icy: '\\u0438',\n iecy: '\\u0435',\n iexcl: '\\u00A1',\n iff: '\\u21D4',\n ifr: '\\uD835\\uDD26',\n igrave: '\\u00EC',\n ii: '\\u2148',\n iiiint: '\\u2A0C',\n iiint: '\\u222D',\n iinfin: '\\u29DC',\n iiota: '\\u2129',\n ijlig: '\\u0133',\n imacr: '\\u012B',\n image: '\\u2111',\n imagline: '\\u2110',\n imagpart: '\\u2111',\n imath: '\\u0131',\n imof: '\\u22B7',\n imped: '\\u01B5',\n in: '\\u2208',\n incare: '\\u2105',\n infin: '\\u221E',\n infintie: '\\u29DD',\n inodot: '\\u0131',\n int: '\\u222B',\n intcal: '\\u22BA',\n integers: '\\u2124',\n intercal: '\\u22BA',\n intlarhk: '\\u2A17',\n intprod: '\\u2A3C',\n iocy: '\\u0451',\n iogon: '\\u012F',\n iopf: '\\uD835\\uDD5A',\n iota: '\\u03B9',\n iprod: '\\u2A3C',\n iquest: '\\u00BF',\n iscr: '\\uD835\\uDCBE',\n isin: '\\u2208',\n isinE: '\\u22F9',\n isindot: '\\u22F5',\n isins: '\\u22F4',\n isinsv: '\\u22F3',\n isinv: '\\u2208',\n it: '\\u2062',\n itilde: '\\u0129',\n iukcy: '\\u0456',\n iuml: '\\u00EF',\n jcirc: '\\u0135',\n jcy: '\\u0439',\n jfr: '\\uD835\\uDD27',\n jmath: '\\u0237',\n jopf: '\\uD835\\uDD5B',\n jscr: '\\uD835\\uDCBF',\n jsercy: '\\u0458',\n jukcy: '\\u0454',\n kappa: '\\u03BA',\n kappav: '\\u03F0',\n kcedil: '\\u0137',\n kcy: '\\u043A',\n kfr: '\\uD835\\uDD28',\n kgreen: '\\u0138',\n khcy: '\\u0445',\n kjcy: '\\u045C',\n kopf: '\\uD835\\uDD5C',\n kscr: '\\uD835\\uDCC0',\n lAarr: '\\u21DA',\n lArr: '\\u21D0',\n lAtail: '\\u291B',\n lBarr: '\\u290E',\n lE: '\\u2266',\n lEg: '\\u2A8B',\n lHar: '\\u2962',\n lacute: '\\u013A',\n laemptyv: '\\u29B4',\n lagran: '\\u2112',\n lambda: '\\u03BB',\n lang: '\\u27E8',\n langd: '\\u2991',\n langle: '\\u27E8',\n lap: '\\u2A85',\n laquo: '\\u00AB',\n larr: '\\u2190',\n larrb: '\\u21E4',\n larrbfs: '\\u291F',\n larrfs: '\\u291D',\n larrhk: '\\u21A9',\n larrlp: '\\u21AB',\n larrpl: '\\u2939',\n larrsim: '\\u2973',\n larrtl: '\\u21A2',\n lat: '\\u2AAB',\n latail: '\\u2919',\n late: '\\u2AAD',\n lates: '\\u2AAD\\uFE00',\n lbarr: '\\u290C',\n lbbrk: '\\u2772',\n lbrace: '\\u007B',\n lbrack: '\\u005B',\n lbrke: '\\u298B',\n lbrksld: '\\u298F',\n lbrkslu: '\\u298D',\n lcaron: '\\u013E',\n lcedil: '\\u013C',\n lceil: '\\u2308',\n lcub: '\\u007B',\n lcy: '\\u043B',\n ldca: '\\u2936',\n ldquo: '\\u201C',\n ldquor: '\\u201E',\n ldrdhar: '\\u2967',\n ldrushar: '\\u294B',\n ldsh: '\\u21B2',\n le: '\\u2264',\n leftarrow: '\\u2190',\n leftarrowtail: '\\u21A2',\n leftharpoondown: '\\u21BD',\n leftharpoonup: '\\u21BC',\n leftleftarrows: '\\u21C7',\n leftrightarrow: '\\u2194',\n leftrightarrows: '\\u21C6',\n leftrightharpoons: '\\u21CB',\n leftrightsquigarrow: '\\u21AD',\n leftthreetimes: '\\u22CB',\n leg: '\\u22DA',\n leq: '\\u2264',\n leqq: '\\u2266',\n leqslant: '\\u2A7D',\n les: '\\u2A7D',\n lescc: '\\u2AA8',\n lesdot: '\\u2A7F',\n lesdoto: '\\u2A81',\n lesdotor: '\\u2A83',\n lesg: '\\u22DA\\uFE00',\n lesges: '\\u2A93',\n lessapprox: '\\u2A85',\n lessdot: '\\u22D6',\n lesseqgtr: '\\u22DA',\n lesseqqgtr: '\\u2A8B',\n lessgtr: '\\u2276',\n lesssim: '\\u2272',\n lfisht: '\\u297C',\n lfloor: '\\u230A',\n lfr: '\\uD835\\uDD29',\n lg: '\\u2276',\n lgE: '\\u2A91',\n lhard: '\\u21BD',\n lharu: '\\u21BC',\n lharul: '\\u296A',\n lhblk: '\\u2584',\n ljcy: '\\u0459',\n ll: '\\u226A',\n llarr: '\\u21C7',\n llcorner: '\\u231E',\n llhard: '\\u296B',\n lltri: '\\u25FA',\n lmidot: '\\u0140',\n lmoust: '\\u23B0',\n lmoustache: '\\u23B0',\n lnE: '\\u2268',\n lnap: '\\u2A89',\n lnapprox: '\\u2A89',\n lne: '\\u2A87',\n lneq: '\\u2A87',\n lneqq: '\\u2268',\n lnsim: '\\u22E6',\n loang: '\\u27EC',\n loarr: '\\u21FD',\n lobrk: '\\u27E6',\n longleftarrow: '\\u27F5',\n longleftrightarrow: '\\u27F7',\n longmapsto: '\\u27FC',\n longrightarrow: '\\u27F6',\n looparrowleft: '\\u21AB',\n looparrowright: '\\u21AC',\n lopar: '\\u2985',\n lopf: '\\uD835\\uDD5D',\n loplus: '\\u2A2D',\n lotimes: '\\u2A34',\n lowast: '\\u2217',\n lowbar: '\\u005F',\n loz: '\\u25CA',\n lozenge: '\\u25CA',\n lozf: '\\u29EB',\n lpar: '\\u0028',\n lparlt: '\\u2993',\n lrarr: '\\u21C6',\n lrcorner: '\\u231F',\n lrhar: '\\u21CB',\n lrhard: '\\u296D',\n lrm: '\\u200E',\n lrtri: '\\u22BF',\n lsaquo: '\\u2039',\n lscr: '\\uD835\\uDCC1',\n lsh: '\\u21B0',\n lsim: '\\u2272',\n lsime: '\\u2A8D',\n lsimg: '\\u2A8F',\n lsqb: '\\u005B',\n lsquo: '\\u2018',\n lsquor: '\\u201A',\n lstrok: '\\u0142',\n lt: '\\u003C',\n ltcc: '\\u2AA6',\n ltcir: '\\u2A79',\n ltdot: '\\u22D6',\n lthree: '\\u22CB',\n ltimes: '\\u22C9',\n ltlarr: '\\u2976',\n ltquest: '\\u2A7B',\n ltrPar: '\\u2996',\n ltri: '\\u25C3',\n ltrie: '\\u22B4',\n ltrif: '\\u25C2',\n lurdshar: '\\u294A',\n luruhar: '\\u2966',\n lvertneqq: '\\u2268\\uFE00',\n lvnE: '\\u2268\\uFE00',\n mDDot: '\\u223A',\n macr: '\\u00AF',\n male: '\\u2642',\n malt: '\\u2720',\n maltese: '\\u2720',\n map: '\\u21A6',\n mapsto: '\\u21A6',\n mapstodown: '\\u21A7',\n mapstoleft: '\\u21A4',\n mapstoup: '\\u21A5',\n marker: '\\u25AE',\n mcomma: '\\u2A29',\n mcy: '\\u043C',\n mdash: '\\u2014',\n measuredangle: '\\u2221',\n mfr: '\\uD835\\uDD2A',\n mho: '\\u2127',\n micro: '\\u00B5',\n mid: '\\u2223',\n midast: '\\u002A',\n midcir: '\\u2AF0',\n middot: '\\u00B7',\n minus: '\\u2212',\n minusb: '\\u229F',\n minusd: '\\u2238',\n minusdu: '\\u2A2A',\n mlcp: '\\u2ADB',\n mldr: '\\u2026',\n mnplus: '\\u2213',\n models: '\\u22A7',\n mopf: '\\uD835\\uDD5E',\n mp: '\\u2213',\n mscr: '\\uD835\\uDCC2',\n mstpos: '\\u223E',\n mu: '\\u03BC',\n multimap: '\\u22B8',\n mumap: '\\u22B8',\n nGg: '\\u22D9\\u0338',\n nGt: '\\u226B\\u20D2',\n nGtv: '\\u226B\\u0338',\n nLeftarrow: '\\u21CD',\n nLeftrightarrow: '\\u21CE',\n nLl: '\\u22D8\\u0338',\n nLt: '\\u226A\\u20D2',\n nLtv: '\\u226A\\u0338',\n nRightarrow: '\\u21CF',\n nVDash: '\\u22AF',\n nVdash: '\\u22AE',\n nabla: '\\u2207',\n nacute: '\\u0144',\n nang: '\\u2220\\u20D2',\n nap: '\\u2249',\n napE: '\\u2A70\\u0338',\n napid: '\\u224B\\u0338',\n napos: '\\u0149',\n napprox: '\\u2249',\n natur: '\\u266E',\n natural: '\\u266E',\n naturals: '\\u2115',\n nbsp: '\\u00A0',\n nbump: '\\u224E\\u0338',\n nbumpe: '\\u224F\\u0338',\n ncap: '\\u2A43',\n ncaron: '\\u0148',\n ncedil: '\\u0146',\n ncong: '\\u2247',\n ncongdot: '\\u2A6D\\u0338',\n ncup: '\\u2A42',\n ncy: '\\u043D',\n ndash: '\\u2013',\n ne: '\\u2260',\n neArr: '\\u21D7',\n nearhk: '\\u2924',\n nearr: '\\u2197',\n nearrow: '\\u2197',\n nedot: '\\u2250\\u0338',\n nequiv: '\\u2262',\n nesear: '\\u2928',\n nesim: '\\u2242\\u0338',\n nexist: '\\u2204',\n nexists: '\\u2204',\n nfr: '\\uD835\\uDD2B',\n ngE: '\\u2267\\u0338',\n nge: '\\u2271',\n ngeq: '\\u2271',\n ngeqq: '\\u2267\\u0338',\n ngeqslant: '\\u2A7E\\u0338',\n nges: '\\u2A7E\\u0338',\n ngsim: '\\u2275',\n ngt: '\\u226F',\n ngtr: '\\u226F',\n nhArr: '\\u21CE',\n nharr: '\\u21AE',\n nhpar: '\\u2AF2',\n ni: '\\u220B',\n nis: '\\u22FC',\n nisd: '\\u22FA',\n niv: '\\u220B',\n njcy: '\\u045A',\n nlArr: '\\u21CD',\n nlE: '\\u2266\\u0338',\n nlarr: '\\u219A',\n nldr: '\\u2025',\n nle: '\\u2270',\n nleftarrow: '\\u219A',\n nleftrightarrow: '\\u21AE',\n nleq: '\\u2270',\n nleqq: '\\u2266\\u0338',\n nleqslant: '\\u2A7D\\u0338',\n nles: '\\u2A7D\\u0338',\n nless: '\\u226E',\n nlsim: '\\u2274',\n nlt: '\\u226E',\n nltri: '\\u22EA',\n nltrie: '\\u22EC',\n nmid: '\\u2224',\n nopf: '\\uD835\\uDD5F',\n not: '\\u00AC',\n notin: '\\u2209',\n notinE: '\\u22F9\\u0338',\n notindot: '\\u22F5\\u0338',\n notinva: '\\u2209',\n notinvb: '\\u22F7',\n notinvc: '\\u22F6',\n notni: '\\u220C',\n notniva: '\\u220C',\n notnivb: '\\u22FE',\n notnivc: '\\u22FD',\n npar: '\\u2226',\n nparallel: '\\u2226',\n nparsl: '\\u2AFD\\u20E5',\n npart: '\\u2202\\u0338',\n npolint: '\\u2A14',\n npr: '\\u2280',\n nprcue: '\\u22E0',\n npre: '\\u2AAF\\u0338',\n nprec: '\\u2280',\n npreceq: '\\u2AAF\\u0338',\n nrArr: '\\u21CF',\n nrarr: '\\u219B',\n nrarrc: '\\u2933\\u0338',\n nrarrw: '\\u219D\\u0338',\n nrightarrow: '\\u219B',\n nrtri: '\\u22EB',\n nrtrie: '\\u22ED',\n nsc: '\\u2281',\n nsccue: '\\u22E1',\n nsce: '\\u2AB0\\u0338',\n nscr: '\\uD835\\uDCC3',\n nshortmid: '\\u2224',\n nshortparallel: '\\u2226',\n nsim: '\\u2241',\n nsime: '\\u2244',\n nsimeq: '\\u2244',\n nsmid: '\\u2224',\n nspar: '\\u2226',\n nsqsube: '\\u22E2',\n nsqsupe: '\\u22E3',\n nsub: '\\u2284',\n nsubE: '\\u2AC5\\u0338',\n nsube: '\\u2288',\n nsubset: '\\u2282\\u20D2',\n nsubseteq: '\\u2288',\n nsubseteqq: '\\u2AC5\\u0338',\n nsucc: '\\u2281',\n nsucceq: '\\u2AB0\\u0338',\n nsup: '\\u2285',\n nsupE: '\\u2AC6\\u0338',\n nsupe: '\\u2289',\n nsupset: '\\u2283\\u20D2',\n nsupseteq: '\\u2289',\n nsupseteqq: '\\u2AC6\\u0338',\n ntgl: '\\u2279',\n ntilde: '\\u00F1',\n ntlg: '\\u2278',\n ntriangleleft: '\\u22EA',\n ntrianglelefteq: '\\u22EC',\n ntriangleright: '\\u22EB',\n ntrianglerighteq: '\\u22ED',\n nu: '\\u03BD',\n num: '\\u0023',\n numero: '\\u2116',\n numsp: '\\u2007',\n nvDash: '\\u22AD',\n nvHarr: '\\u2904',\n nvap: '\\u224D\\u20D2',\n nvdash: '\\u22AC',\n nvge: '\\u2265\\u20D2',\n nvgt: '\\u003E\\u20D2',\n nvinfin: '\\u29DE',\n nvlArr: '\\u2902',\n nvle: '\\u2264\\u20D2',\n nvlt: '\\u003C\\u20D2',\n nvltrie: '\\u22B4\\u20D2',\n nvrArr: '\\u2903',\n nvrtrie: '\\u22B5\\u20D2',\n nvsim: '\\u223C\\u20D2',\n nwArr: '\\u21D6',\n nwarhk: '\\u2923',\n nwarr: '\\u2196',\n nwarrow: '\\u2196',\n nwnear: '\\u2927',\n oS: '\\u24C8',\n oacute: '\\u00F3',\n oast: '\\u229B',\n ocir: '\\u229A',\n ocirc: '\\u00F4',\n ocy: '\\u043E',\n odash: '\\u229D',\n odblac: '\\u0151',\n odiv: '\\u2A38',\n odot: '\\u2299',\n odsold: '\\u29BC',\n oelig: '\\u0153',\n ofcir: '\\u29BF',\n ofr: '\\uD835\\uDD2C',\n ogon: '\\u02DB',\n ograve: '\\u00F2',\n ogt: '\\u29C1',\n ohbar: '\\u29B5',\n ohm: '\\u03A9',\n oint: '\\u222E',\n olarr: '\\u21BA',\n olcir: '\\u29BE',\n olcross: '\\u29BB',\n oline: '\\u203E',\n olt: '\\u29C0',\n omacr: '\\u014D',\n omega: '\\u03C9',\n omicron: '\\u03BF',\n omid: '\\u29B6',\n ominus: '\\u2296',\n oopf: '\\uD835\\uDD60',\n opar: '\\u29B7',\n operp: '\\u29B9',\n oplus: '\\u2295',\n or: '\\u2228',\n orarr: '\\u21BB',\n ord: '\\u2A5D',\n order: '\\u2134',\n orderof: '\\u2134',\n ordf: '\\u00AA',\n ordm: '\\u00BA',\n origof: '\\u22B6',\n oror: '\\u2A56',\n orslope: '\\u2A57',\n orv: '\\u2A5B',\n oscr: '\\u2134',\n oslash: '\\u00F8',\n osol: '\\u2298',\n otilde: '\\u00F5',\n otimes: '\\u2297',\n otimesas: '\\u2A36',\n ouml: '\\u00F6',\n ovbar: '\\u233D',\n par: '\\u2225',\n para: '\\u00B6',\n parallel: '\\u2225',\n parsim: '\\u2AF3',\n parsl: '\\u2AFD',\n part: '\\u2202',\n pcy: '\\u043F',\n percnt: '\\u0025',\n period: '\\u002E',\n permil: '\\u2030',\n perp: '\\u22A5',\n pertenk: '\\u2031',\n pfr: '\\uD835\\uDD2D',\n phi: '\\u03C6',\n phiv: '\\u03D5',\n phmmat: '\\u2133',\n phone: '\\u260E',\n pi: '\\u03C0',\n pitchfork: '\\u22D4',\n piv: '\\u03D6',\n planck: '\\u210F',\n planckh: '\\u210E',\n plankv: '\\u210F',\n plus: '\\u002B',\n plusacir: '\\u2A23',\n plusb: '\\u229E',\n pluscir: '\\u2A22',\n plusdo: '\\u2214',\n plusdu: '\\u2A25',\n pluse: '\\u2A72',\n plusmn: '\\u00B1',\n plussim: '\\u2A26',\n plustwo: '\\u2A27',\n pm: '\\u00B1',\n pointint: '\\u2A15',\n popf: '\\uD835\\uDD61',\n pound: '\\u00A3',\n pr: '\\u227A',\n prE: '\\u2AB3',\n prap: '\\u2AB7',\n prcue: '\\u227C',\n pre: '\\u2AAF',\n prec: '\\u227A',\n precapprox: '\\u2AB7',\n preccurlyeq: '\\u227C',\n preceq: '\\u2AAF',\n precnapprox: '\\u2AB9',\n precneqq: '\\u2AB5',\n precnsim: '\\u22E8',\n precsim: '\\u227E',\n prime: '\\u2032',\n primes: '\\u2119',\n prnE: '\\u2AB5',\n prnap: '\\u2AB9',\n prnsim: '\\u22E8',\n prod: '\\u220F',\n profalar: '\\u232E',\n profline: '\\u2312',\n profsurf: '\\u2313',\n prop: '\\u221D',\n propto: '\\u221D',\n prsim: '\\u227E',\n prurel: '\\u22B0',\n pscr: '\\uD835\\uDCC5',\n psi: '\\u03C8',\n puncsp: '\\u2008',\n qfr: '\\uD835\\uDD2E',\n qint: '\\u2A0C',\n qopf: '\\uD835\\uDD62',\n qprime: '\\u2057',\n qscr: '\\uD835\\uDCC6',\n quaternions: '\\u210D',\n quatint: '\\u2A16',\n quest: '\\u003F',\n questeq: '\\u225F',\n quot: '\\u0022',\n rAarr: '\\u21DB',\n rArr: '\\u21D2',\n rAtail: '\\u291C',\n rBarr: '\\u290F',\n rHar: '\\u2964',\n race: '\\u223D\\u0331',\n racute: '\\u0155',\n radic: '\\u221A',\n raemptyv: '\\u29B3',\n rang: '\\u27E9',\n rangd: '\\u2992',\n range: '\\u29A5',\n rangle: '\\u27E9',\n raquo: '\\u00BB',\n rarr: '\\u2192',\n rarrap: '\\u2975',\n rarrb: '\\u21E5',\n rarrbfs: '\\u2920',\n rarrc: '\\u2933',\n rarrfs: '\\u291E',\n rarrhk: '\\u21AA',\n rarrlp: '\\u21AC',\n rarrpl: '\\u2945',\n rarrsim: '\\u2974',\n rarrtl: '\\u21A3',\n rarrw: '\\u219D',\n ratail: '\\u291A',\n ratio: '\\u2236',\n rationals: '\\u211A',\n rbarr: '\\u290D',\n rbbrk: '\\u2773',\n rbrace: '\\u007D',\n rbrack: '\\u005D',\n rbrke: '\\u298C',\n rbrksld: '\\u298E',\n rbrkslu: '\\u2990',\n rcaron: '\\u0159',\n rcedil: '\\u0157',\n rceil: '\\u2309',\n rcub: '\\u007D',\n rcy: '\\u0440',\n rdca: '\\u2937',\n rdldhar: '\\u2969',\n rdquo: '\\u201D',\n rdquor: '\\u201D',\n rdsh: '\\u21B3',\n real: '\\u211C',\n realine: '\\u211B',\n realpart: '\\u211C',\n reals: '\\u211D',\n rect: '\\u25AD',\n reg: '\\u00AE',\n rfisht: '\\u297D',\n rfloor: '\\u230B',\n rfr: '\\uD835\\uDD2F',\n rhard: '\\u21C1',\n rharu: '\\u21C0',\n rharul: '\\u296C',\n rho: '\\u03C1',\n rhov: '\\u03F1',\n rightarrow: '\\u2192',\n rightarrowtail: '\\u21A3',\n rightharpoondown: '\\u21C1',\n rightharpoonup: '\\u21C0',\n rightleftarrows: '\\u21C4',\n rightleftharpoons: '\\u21CC',\n rightrightarrows: '\\u21C9',\n rightsquigarrow: '\\u219D',\n rightthreetimes: '\\u22CC',\n ring: '\\u02DA',\n risingdotseq: '\\u2253',\n rlarr: '\\u21C4',\n rlhar: '\\u21CC',\n rlm: '\\u200F',\n rmoust: '\\u23B1',\n rmoustache: '\\u23B1',\n rnmid: '\\u2AEE',\n roang: '\\u27ED',\n roarr: '\\u21FE',\n robrk: '\\u27E7',\n ropar: '\\u2986',\n ropf: '\\uD835\\uDD63',\n roplus: '\\u2A2E',\n rotimes: '\\u2A35',\n rpar: '\\u0029',\n rpargt: '\\u2994',\n rppolint: '\\u2A12',\n rrarr: '\\u21C9',\n rsaquo: '\\u203A',\n rscr: '\\uD835\\uDCC7',\n rsh: '\\u21B1',\n rsqb: '\\u005D',\n rsquo: '\\u2019',\n rsquor: '\\u2019',\n rthree: '\\u22CC',\n rtimes: '\\u22CA',\n rtri: '\\u25B9',\n rtrie: '\\u22B5',\n rtrif: '\\u25B8',\n rtriltri: '\\u29CE',\n ruluhar: '\\u2968',\n rx: '\\u211E',\n sacute: '\\u015B',\n sbquo: '\\u201A',\n sc: '\\u227B',\n scE: '\\u2AB4',\n scap: '\\u2AB8',\n scaron: '\\u0161',\n sccue: '\\u227D',\n sce: '\\u2AB0',\n scedil: '\\u015F',\n scirc: '\\u015D',\n scnE: '\\u2AB6',\n scnap: '\\u2ABA',\n scnsim: '\\u22E9',\n scpolint: '\\u2A13',\n scsim: '\\u227F',\n scy: '\\u0441',\n sdot: '\\u22C5',\n sdotb: '\\u22A1',\n sdote: '\\u2A66',\n seArr: '\\u21D8',\n searhk: '\\u2925',\n searr: '\\u2198',\n searrow: '\\u2198',\n sect: '\\u00A7',\n semi: '\\u003B',\n seswar: '\\u2929',\n setminus: '\\u2216',\n setmn: '\\u2216',\n sext: '\\u2736',\n sfr: '\\uD835\\uDD30',\n sfrown: '\\u2322',\n sharp: '\\u266F',\n shchcy: '\\u0449',\n shcy: '\\u0448',\n shortmid: '\\u2223',\n shortparallel: '\\u2225',\n shy: '\\u00AD',\n sigma: '\\u03C3',\n sigmaf: '\\u03C2',\n sigmav: '\\u03C2',\n sim: '\\u223C',\n simdot: '\\u2A6A',\n sime: '\\u2243',\n simeq: '\\u2243',\n simg: '\\u2A9E',\n simgE: '\\u2AA0',\n siml: '\\u2A9D',\n simlE: '\\u2A9F',\n simne: '\\u2246',\n simplus: '\\u2A24',\n simrarr: '\\u2972',\n slarr: '\\u2190',\n smallsetminus: '\\u2216',\n smashp: '\\u2A33',\n smeparsl: '\\u29E4',\n smid: '\\u2223',\n smile: '\\u2323',\n smt: '\\u2AAA',\n smte: '\\u2AAC',\n smtes: '\\u2AAC\\uFE00',\n softcy: '\\u044C',\n sol: '\\u002F',\n solb: '\\u29C4',\n solbar: '\\u233F',\n sopf: '\\uD835\\uDD64',\n spades: '\\u2660',\n spadesuit: '\\u2660',\n spar: '\\u2225',\n sqcap: '\\u2293',\n sqcaps: '\\u2293\\uFE00',\n sqcup: '\\u2294',\n sqcups: '\\u2294\\uFE00',\n sqsub: '\\u228F',\n sqsube: '\\u2291',\n sqsubset: '\\u228F',\n sqsubseteq: '\\u2291',\n sqsup: '\\u2290',\n sqsupe: '\\u2292',\n sqsupset: '\\u2290',\n sqsupseteq: '\\u2292',\n squ: '\\u25A1',\n square: '\\u25A1',\n squarf: '\\u25AA',\n squf: '\\u25AA',\n srarr: '\\u2192',\n sscr: '\\uD835\\uDCC8',\n ssetmn: '\\u2216',\n ssmile: '\\u2323',\n sstarf: '\\u22C6',\n star: '\\u2606',\n starf: '\\u2605',\n straightepsilon: '\\u03F5',\n straightphi: '\\u03D5',\n strns: '\\u00AF',\n sub: '\\u2282',\n subE: '\\u2AC5',\n subdot: '\\u2ABD',\n sube: '\\u2286',\n subedot: '\\u2AC3',\n submult: '\\u2AC1',\n subnE: '\\u2ACB',\n subne: '\\u228A',\n subplus: '\\u2ABF',\n subrarr: '\\u2979',\n subset: '\\u2282',\n subseteq: '\\u2286',\n subseteqq: '\\u2AC5',\n subsetneq: '\\u228A',\n subsetneqq: '\\u2ACB',\n subsim: '\\u2AC7',\n subsub: '\\u2AD5',\n subsup: '\\u2AD3',\n succ: '\\u227B',\n succapprox: '\\u2AB8',\n succcurlyeq: '\\u227D',\n succeq: '\\u2AB0',\n succnapprox: '\\u2ABA',\n succneqq: '\\u2AB6',\n succnsim: '\\u22E9',\n succsim: '\\u227F',\n sum: '\\u2211',\n sung: '\\u266A',\n sup1: '\\u00B9',\n sup2: '\\u00B2',\n sup3: '\\u00B3',\n sup: '\\u2283',\n supE: '\\u2AC6',\n supdot: '\\u2ABE',\n supdsub: '\\u2AD8',\n supe: '\\u2287',\n supedot: '\\u2AC4',\n suphsol: '\\u27C9',\n suphsub: '\\u2AD7',\n suplarr: '\\u297B',\n supmult: '\\u2AC2',\n supnE: '\\u2ACC',\n supne: '\\u228B',\n supplus: '\\u2AC0',\n supset: '\\u2283',\n supseteq: '\\u2287',\n supseteqq: '\\u2AC6',\n supsetneq: '\\u228B',\n supsetneqq: '\\u2ACC',\n supsim: '\\u2AC8',\n supsub: '\\u2AD4',\n supsup: '\\u2AD6',\n swArr: '\\u21D9',\n swarhk: '\\u2926',\n swarr: '\\u2199',\n swarrow: '\\u2199',\n swnwar: '\\u292A',\n szlig: '\\u00DF',\n target: '\\u2316',\n tau: '\\u03C4',\n tbrk: '\\u23B4',\n tcaron: '\\u0165',\n tcedil: '\\u0163',\n tcy: '\\u0442',\n tdot: '\\u20DB',\n telrec: '\\u2315',\n tfr: '\\uD835\\uDD31',\n there4: '\\u2234',\n therefore: '\\u2234',\n theta: '\\u03B8',\n thetasym: '\\u03D1',\n thetav: '\\u03D1',\n thickapprox: '\\u2248',\n thicksim: '\\u223C',\n thinsp: '\\u2009',\n thkap: '\\u2248',\n thksim: '\\u223C',\n thorn: '\\u00FE',\n tilde: '\\u02DC',\n times: '\\u00D7',\n timesb: '\\u22A0',\n timesbar: '\\u2A31',\n timesd: '\\u2A30',\n tint: '\\u222D',\n toea: '\\u2928',\n top: '\\u22A4',\n topbot: '\\u2336',\n topcir: '\\u2AF1',\n topf: '\\uD835\\uDD65',\n topfork: '\\u2ADA',\n tosa: '\\u2929',\n tprime: '\\u2034',\n trade: '\\u2122',\n triangle: '\\u25B5',\n triangledown: '\\u25BF',\n triangleleft: '\\u25C3',\n trianglelefteq: '\\u22B4',\n triangleq: '\\u225C',\n triangleright: '\\u25B9',\n trianglerighteq: '\\u22B5',\n tridot: '\\u25EC',\n trie: '\\u225C',\n triminus: '\\u2A3A',\n triplus: '\\u2A39',\n trisb: '\\u29CD',\n tritime: '\\u2A3B',\n trpezium: '\\u23E2',\n tscr: '\\uD835\\uDCC9',\n tscy: '\\u0446',\n tshcy: '\\u045B',\n tstrok: '\\u0167',\n twixt: '\\u226C',\n twoheadleftarrow: '\\u219E',\n twoheadrightarrow: '\\u21A0',\n uArr: '\\u21D1',\n uHar: '\\u2963',\n uacute: '\\u00FA',\n uarr: '\\u2191',\n ubrcy: '\\u045E',\n ubreve: '\\u016D',\n ucirc: '\\u00FB',\n ucy: '\\u0443',\n udarr: '\\u21C5',\n udblac: '\\u0171',\n udhar: '\\u296E',\n ufisht: '\\u297E',\n ufr: '\\uD835\\uDD32',\n ugrave: '\\u00F9',\n uharl: '\\u21BF',\n uharr: '\\u21BE',\n uhblk: '\\u2580',\n ulcorn: '\\u231C',\n ulcorner: '\\u231C',\n ulcrop: '\\u230F',\n ultri: '\\u25F8',\n umacr: '\\u016B',\n uml: '\\u00A8',\n uogon: '\\u0173',\n uopf: '\\uD835\\uDD66',\n uparrow: '\\u2191',\n updownarrow: '\\u2195',\n upharpoonleft: '\\u21BF',\n upharpoonright: '\\u21BE',\n uplus: '\\u228E',\n upsi: '\\u03C5',\n upsih: '\\u03D2',\n upsilon: '\\u03C5',\n upuparrows: '\\u21C8',\n urcorn: '\\u231D',\n urcorner: '\\u231D',\n urcrop: '\\u230E',\n uring: '\\u016F',\n urtri: '\\u25F9',\n uscr: '\\uD835\\uDCCA',\n utdot: '\\u22F0',\n utilde: '\\u0169',\n utri: '\\u25B5',\n utrif: '\\u25B4',\n uuarr: '\\u21C8',\n uuml: '\\u00FC',\n uwangle: '\\u29A7',\n vArr: '\\u21D5',\n vBar: '\\u2AE8',\n vBarv: '\\u2AE9',\n vDash: '\\u22A8',\n vangrt: '\\u299C',\n varepsilon: '\\u03F5',\n varkappa: '\\u03F0',\n varnothing: '\\u2205',\n varphi: '\\u03D5',\n varpi: '\\u03D6',\n varpropto: '\\u221D',\n varr: '\\u2195',\n varrho: '\\u03F1',\n varsigma: '\\u03C2',\n varsubsetneq: '\\u228A\\uFE00',\n varsubsetneqq: '\\u2ACB\\uFE00',\n varsupsetneq: '\\u228B\\uFE00',\n varsupsetneqq: '\\u2ACC\\uFE00',\n vartheta: '\\u03D1',\n vartriangleleft: '\\u22B2',\n vartriangleright: '\\u22B3',\n vcy: '\\u0432',\n vdash: '\\u22A2',\n vee: '\\u2228',\n veebar: '\\u22BB',\n veeeq: '\\u225A',\n vellip: '\\u22EE',\n verbar: '\\u007C',\n vert: '\\u007C',\n vfr: '\\uD835\\uDD33',\n vltri: '\\u22B2',\n vnsub: '\\u2282\\u20D2',\n vnsup: '\\u2283\\u20D2',\n vopf: '\\uD835\\uDD67',\n vprop: '\\u221D',\n vrtri: '\\u22B3',\n vscr: '\\uD835\\uDCCB',\n vsubnE: '\\u2ACB\\uFE00',\n vsubne: '\\u228A\\uFE00',\n vsupnE: '\\u2ACC\\uFE00',\n vsupne: '\\u228B\\uFE00',\n vzigzag: '\\u299A',\n wcirc: '\\u0175',\n wedbar: '\\u2A5F',\n wedge: '\\u2227',\n wedgeq: '\\u2259',\n weierp: '\\u2118',\n wfr: '\\uD835\\uDD34',\n wopf: '\\uD835\\uDD68',\n wp: '\\u2118',\n wr: '\\u2240',\n wreath: '\\u2240',\n wscr: '\\uD835\\uDCCC',\n xcap: '\\u22C2',\n xcirc: '\\u25EF',\n xcup: '\\u22C3',\n xdtri: '\\u25BD',\n xfr: '\\uD835\\uDD35',\n xhArr: '\\u27FA',\n xharr: '\\u27F7',\n xi: '\\u03BE',\n xlArr: '\\u27F8',\n xlarr: '\\u27F5',\n xmap: '\\u27FC',\n xnis: '\\u22FB',\n xodot: '\\u2A00',\n xopf: '\\uD835\\uDD69',\n xoplus: '\\u2A01',\n xotime: '\\u2A02',\n xrArr: '\\u27F9',\n xrarr: '\\u27F6',\n xscr: '\\uD835\\uDCCD',\n xsqcup: '\\u2A06',\n xuplus: '\\u2A04',\n xutri: '\\u25B3',\n xvee: '\\u22C1',\n xwedge: '\\u22C0',\n yacute: '\\u00FD',\n yacy: '\\u044F',\n ycirc: '\\u0177',\n ycy: '\\u044B',\n yen: '\\u00A5',\n yfr: '\\uD835\\uDD36',\n yicy: '\\u0457',\n yopf: '\\uD835\\uDD6A',\n yscr: '\\uD835\\uDCCE',\n yucy: '\\u044E',\n yuml: '\\u00FF',\n zacute: '\\u017A',\n zcaron: '\\u017E',\n zcy: '\\u0437',\n zdot: '\\u017C',\n zeetrf: '\\u2128',\n zeta: '\\u03B6',\n zfr: '\\uD835\\uDD37',\n zhcy: '\\u0436',\n zigrarr: '\\u21DD',\n zopf: '\\uD835\\uDD6B',\n zscr: '\\uD835\\uDCCF',\n zwj: '\\u200D',\n zwnj: '\\u200C',\n};\nconst decodeMap = {\n '0': 65533,\n '128': 8364,\n '130': 8218,\n '131': 402,\n '132': 8222,\n '133': 8230,\n '134': 8224,\n '135': 8225,\n '136': 710,\n '137': 8240,\n '138': 352,\n '139': 8249,\n '140': 338,\n '142': 381,\n '145': 8216,\n '146': 8217,\n '147': 8220,\n '148': 8221,\n '149': 8226,\n '150': 8211,\n '151': 8212,\n '152': 732,\n '153': 8482,\n '154': 353,\n '155': 8250,\n '156': 339,\n '158': 382,\n '159': 376,\n};\nfunction decodeHTMLStrict(text) {\n return text.replace(/&(?:[a-zA-Z]+|#[xX][\\da-fA-F]+|#\\d+);/g, (key) => {\n if (key.charAt(1) === '#') {\n const secondChar = key.charAt(2);\n const codePoint = secondChar === 'X' || secondChar === 'x' ? parseInt(key.slice(3), 16) : parseInt(key.slice(2), 10);\n return decodeCodePoint(codePoint);\n }\n return getOwnProperty(entities, key.slice(1, -1)) ?? key;\n });\n}\nfunction decodeCodePoint(codePoint) {\n if ((codePoint >= 0xd800 && codePoint <= 0xdfff) || codePoint > 0x10ffff) {\n return '\\uFFFD';\n }\n return String.fromCodePoint(getOwnProperty(decodeMap, codePoint) ?? codePoint);\n}\n\nfunction scanJSXAttributeValue(parser, context) {\n parser.startIndex = parser.tokenIndex = parser.index;\n parser.startColumn = parser.tokenColumn = parser.column;\n parser.startLine = parser.tokenLine = parser.line;\n parser.setToken(CharTypes[parser.currentChar] & 8192\n ? scanJSXString(parser)\n : scanSingleToken(parser, context, 0));\n return parser.getToken();\n}\nfunction scanJSXString(parser) {\n const quote = parser.currentChar;\n let char = advanceChar(parser);\n const start = parser.index;\n while (char !== quote) {\n if (parser.index >= parser.end)\n parser.report(16);\n char = advanceChar(parser);\n }\n if (char !== quote)\n parser.report(16);\n parser.tokenValue = parser.source.slice(start, parser.index);\n advanceChar(parser);\n if (parser.options.raw)\n parser.tokenRaw = parser.source.slice(parser.tokenIndex, parser.index);\n return 134283267;\n}\nfunction nextJSXToken(parser) {\n parser.startIndex = parser.tokenIndex = parser.index;\n parser.startColumn = parser.tokenColumn = parser.column;\n parser.startLine = parser.tokenLine = parser.line;\n if (parser.index >= parser.end) {\n parser.setToken(1048576);\n return;\n }\n if (parser.currentChar === 60) {\n advanceChar(parser);\n parser.setToken(8456256);\n return;\n }\n if (parser.currentChar === 123) {\n advanceChar(parser);\n parser.setToken(2162700);\n return;\n }\n let state = 0;\n while (parser.index < parser.end) {\n const type = CharTypes[parser.source.charCodeAt(parser.index)];\n if (type & 1024) {\n state |= 1 | 4;\n scanNewLine(parser);\n }\n else if (type & 2048) {\n consumeLineFeed(parser, state);\n state = (state & -5) | 1;\n }\n else {\n advanceChar(parser);\n }\n if (CharTypes[parser.currentChar] & 16384)\n break;\n }\n if (parser.tokenIndex === parser.index)\n parser.report(0);\n const raw = parser.source.slice(parser.tokenIndex, parser.index);\n if (parser.options.raw)\n parser.tokenRaw = raw;\n parser.tokenValue = decodeHTMLStrict(raw);\n parser.setToken(137);\n}\nfunction rescanJSXIdentifier(parser) {\n if ((parser.getToken() & 143360) === 143360) {\n const { index } = parser;\n let char = parser.currentChar;\n while (CharTypes[char] & (32768 | 2)) {\n char = advanceChar(parser);\n }\n parser.tokenValue += parser.source.slice(index, parser.index);\n parser.setToken(208897, true);\n }\n return parser.getToken();\n}\n\nclass Scope {\n parser;\n type;\n parent;\n scopeError;\n variableBindings = new Map();\n constructor(parser, type = 2, parent) {\n this.parser = parser;\n this.type = type;\n this.parent = parent;\n }\n createChildScope(type) {\n return new Scope(this.parser, type, this);\n }\n addVarOrBlock(context, name, kind, origin) {\n if (kind & 4) {\n this.addVarName(context, name, kind);\n }\n else {\n this.addBlockName(context, name, kind, origin);\n }\n if (origin & 64) {\n this.parser.declareUnboundVariable(name);\n }\n }\n addVarName(context, name, kind) {\n const { parser } = this;\n let currentScope = this;\n while (currentScope && (currentScope.type & 128) === 0) {\n const { variableBindings } = currentScope;\n const value = variableBindings.get(name);\n if (value && value & 248) {\n if (parser.options.webcompat &&\n (context & 1) === 0 &&\n ((kind & 128 && value & 68) ||\n (value & 128 && kind & 68))) ;\n else {\n parser.report(145, name);\n }\n }\n if (currentScope === this) {\n if (value && value & 1 && kind & 1) {\n currentScope.recordScopeError(145, name);\n }\n }\n if (value &&\n (value & 256 || (value & 512 && !parser.options.webcompat))) {\n parser.report(145, name);\n }\n currentScope.variableBindings.set(name, kind);\n currentScope = currentScope.parent;\n }\n }\n hasVariable(name) {\n return this.variableBindings.has(name);\n }\n addBlockName(context, name, kind, origin) {\n const { parser } = this;\n const value = this.variableBindings.get(name);\n if (value && (value & 2) === 0) {\n if (kind & 1) {\n this.recordScopeError(145, name);\n }\n else if (parser.options.webcompat &&\n (context & 1) === 0 &&\n origin & 2 &&\n value === 64 &&\n kind === 64) ;\n else {\n parser.report(145, name);\n }\n }\n if (this.type & 64 &&\n this.parent?.hasVariable(name) &&\n (this.parent.variableBindings.get(name) & 2) === 0) {\n parser.report(145, name);\n }\n if (this.type & 512 && value && (value & 2) === 0) {\n if (kind & 1) {\n this.recordScopeError(145, name);\n }\n }\n if (this.type & 32) {\n if (this.parent.variableBindings.get(name) & 768)\n parser.report(159, name);\n }\n this.variableBindings.set(name, kind);\n }\n recordScopeError(type, ...params) {\n this.scopeError = {\n type,\n params,\n start: this.parser.tokenStart,\n end: this.parser.currentLocation,\n };\n }\n reportScopeError() {\n const { scopeError } = this;\n if (!scopeError) {\n return;\n }\n throw new ParseError(scopeError.start, scopeError.end, scopeError.type, ...scopeError.params);\n }\n}\nfunction createArrowHeadParsingScope(parser, context, value) {\n const scope = parser.createScope().createChildScope(512);\n scope.addBlockName(context, value, 1, 0);\n return scope;\n}\n\nclass PrivateScope {\n parser;\n parent;\n refs = Object.create(null);\n privateIdentifiers = new Map();\n constructor(parser, parent) {\n this.parser = parser;\n this.parent = parent;\n }\n addPrivateIdentifier(name, kind) {\n const { privateIdentifiers } = this;\n let focusKind = kind & (32 | 768);\n if (!(focusKind & 768))\n focusKind |= 768;\n const value = privateIdentifiers.get(name);\n if (this.hasPrivateIdentifier(name) &&\n ((value & 32) !== (focusKind & 32) || value & focusKind & 768)) {\n this.parser.report(146, name);\n }\n privateIdentifiers.set(name, this.hasPrivateIdentifier(name) ? value | focusKind : focusKind);\n }\n addPrivateIdentifierRef(name) {\n this.refs[name] ??= [];\n this.refs[name].push(this.parser.tokenStart);\n }\n isPrivateIdentifierDefined(name) {\n return this.hasPrivateIdentifier(name) || Boolean(this.parent?.isPrivateIdentifierDefined(name));\n }\n validatePrivateIdentifierRefs() {\n for (const name in this.refs) {\n if (!this.isPrivateIdentifierDefined(name)) {\n const { index, line, column } = this.refs[name][0];\n throw new ParseError({ index, line, column }, { index: index + name.length, line, column: column + name.length }, 4, name);\n }\n }\n }\n hasPrivateIdentifier(name) {\n return this.privateIdentifiers.has(name);\n }\n}\n\nclass Parser {\n source;\n options;\n lastOnToken = null;\n token = 1048576;\n flags = 0;\n index = 0;\n line = 1;\n column = 0;\n startIndex = 0;\n end = 0;\n tokenIndex = 0;\n startColumn = 0;\n tokenColumn = 0;\n tokenLine = 1;\n startLine = 1;\n tokenValue = '';\n tokenRaw = '';\n tokenRegExp = void 0;\n currentChar = 0;\n exportedNames = new Set();\n exportedBindings = new Set();\n assignable = 1;\n destructible = 0;\n leadingDecorators = { decorators: [] };\n constructor(source, options = {}) {\n this.source = source;\n this.options = options;\n this.end = source.length;\n this.currentChar = source.charCodeAt(0);\n }\n getToken() {\n return this.token;\n }\n setToken(value, replaceLast = false) {\n this.token = value;\n const { onToken } = this.options;\n if (onToken) {\n if (value !== 1048576) {\n const loc = {\n start: {\n line: this.tokenLine,\n column: this.tokenColumn,\n },\n end: {\n line: this.line,\n column: this.column,\n },\n };\n if (!replaceLast && this.lastOnToken) {\n onToken(...this.lastOnToken);\n }\n this.lastOnToken = [convertTokenType(value), this.tokenIndex, this.index, loc];\n }\n else {\n if (this.lastOnToken) {\n onToken(...this.lastOnToken);\n this.lastOnToken = null;\n }\n }\n }\n return value;\n }\n get tokenStart() {\n return {\n index: this.tokenIndex,\n line: this.tokenLine,\n column: this.tokenColumn,\n };\n }\n get currentLocation() {\n return { index: this.index, line: this.line, column: this.column };\n }\n finishNode(node, start, end) {\n if (this.options.ranges) {\n node.start = start.index;\n const endIndex = end ? end.index : this.startIndex;\n node.end = endIndex;\n node.range = [start.index, endIndex];\n }\n if (this.options.loc) {\n node.loc = {\n start: {\n line: start.line,\n column: start.column,\n },\n end: end ? { line: end.line, column: end.column } : { line: this.startLine, column: this.startColumn },\n };\n if (this.options.source) {\n node.loc.source = this.options.source;\n }\n }\n return node;\n }\n addBindingToExports(name) {\n this.exportedBindings.add(name);\n }\n declareUnboundVariable(name) {\n const { exportedNames } = this;\n if (exportedNames.has(name)) {\n this.report(147, name);\n }\n exportedNames.add(name);\n }\n report(type, ...params) {\n throw new ParseError(this.tokenStart, this.currentLocation, type, ...params);\n }\n createScopeIfLexical(type, parent) {\n if (this.options.lexical) {\n return this.createScope(type, parent);\n }\n return undefined;\n }\n createScope(type, parent) {\n return new Scope(this, type, parent);\n }\n createPrivateScopeIfLexical(parent) {\n if (this.options.lexical) {\n return new PrivateScope(this, parent);\n }\n return undefined;\n }\n}\nfunction pushComment(comments, options) {\n return function (type, value, start, end, loc) {\n const comment = {\n type,\n value,\n };\n if (options.ranges) {\n comment.start = start;\n comment.end = end;\n comment.range = [start, end];\n }\n if (options.loc) {\n comment.loc = loc;\n }\n comments.push(comment);\n };\n}\nfunction pushToken(tokens, options) {\n return function (type, start, end, loc) {\n const token = {\n token: type,\n };\n if (options.ranges) {\n token.start = start;\n token.end = end;\n token.range = [start, end];\n }\n if (options.loc) {\n token.loc = loc;\n }\n tokens.push(token);\n };\n}\n\nfunction normalizeOptions(rawOptions) {\n const options = { ...rawOptions };\n if (options.onComment) {\n options.onComment = Array.isArray(options.onComment) ? pushComment(options.onComment, options) : options.onComment;\n }\n if (options.onToken) {\n options.onToken = Array.isArray(options.onToken) ? pushToken(options.onToken, options) : options.onToken;\n }\n return options;\n}\n\nfunction parseSource(source, rawOptions = {}, context = 0) {\n const options = normalizeOptions(rawOptions);\n if (options.module)\n context |= 2 | 1;\n if (options.globalReturn)\n context |= 4096;\n if (options.impliedStrict)\n context |= 1;\n const parser = new Parser(source, options);\n skipHashBang(parser);\n const scope = parser.createScopeIfLexical();\n let body = [];\n let sourceType = 'script';\n if (context & 2) {\n sourceType = 'module';\n body = parseModuleItemList(parser, context | 8, scope);\n if (scope) {\n for (const name of parser.exportedBindings) {\n if (!scope.hasVariable(name))\n parser.report(148, name);\n }\n }\n }\n else {\n body = parseStatementList(parser, context | 8, scope);\n }\n return parser.finishNode({\n type: 'Program',\n sourceType,\n body,\n }, { index: 0, line: 1, column: 0 }, parser.currentLocation);\n}\nfunction parseStatementList(parser, context, scope) {\n nextToken(parser, context | 32 | 262144);\n const statements = [];\n while (parser.getToken() === 134283267) {\n const { index, tokenValue, tokenStart, tokenIndex } = parser;\n const token = parser.getToken();\n const expr = parseLiteral(parser, context);\n if (isValidStrictMode(parser, index, tokenIndex, tokenValue)) {\n context |= 1;\n if (parser.flags & 64) {\n throw new ParseError(parser.tokenStart, parser.currentLocation, 9);\n }\n if (parser.flags & 4096) {\n throw new ParseError(parser.tokenStart, parser.currentLocation, 15);\n }\n }\n statements.push(parseDirective(parser, context, expr, token, tokenStart));\n }\n while (parser.getToken() !== 1048576) {\n statements.push(parseStatementListItem(parser, context, scope, undefined, 4, {}));\n }\n return statements;\n}\nfunction parseModuleItemList(parser, context, scope) {\n nextToken(parser, context | 32);\n const statements = [];\n while (parser.getToken() === 134283267) {\n const { tokenStart } = parser;\n const token = parser.getToken();\n statements.push(parseDirective(parser, context, parseLiteral(parser, context), token, tokenStart));\n }\n while (parser.getToken() !== 1048576) {\n statements.push(parseModuleItem(parser, context, scope));\n }\n return statements;\n}\nfunction parseModuleItem(parser, context, scope) {\n if (parser.getToken() === 132) {\n Object.assign(parser.leadingDecorators, {\n start: parser.tokenStart,\n decorators: parseDecorators(parser, context, undefined),\n });\n }\n let moduleItem;\n switch (parser.getToken()) {\n case 20564:\n moduleItem = parseExportDeclaration(parser, context, scope);\n break;\n case 86106:\n moduleItem = parseImportDeclaration(parser, context, scope);\n break;\n default:\n moduleItem = parseStatementListItem(parser, context, scope, undefined, 4, {});\n }\n if (parser.leadingDecorators?.decorators.length) {\n parser.report(170);\n }\n return moduleItem;\n}\nfunction parseStatementListItem(parser, context, scope, privateScope, origin, labels) {\n const start = parser.tokenStart;\n switch (parser.getToken()) {\n case 86104:\n return parseFunctionDeclaration(parser, context, scope, privateScope, origin, 1, 0, 0, start);\n case 132:\n case 86094:\n return parseClassDeclaration(parser, context, scope, privateScope, 0);\n case 86090:\n return parseLexicalDeclaration(parser, context, scope, privateScope, 16, 0);\n case 241737:\n return parseLetIdentOrVarDeclarationStatement(parser, context, scope, privateScope, origin);\n case 20564:\n parser.report(103, 'export');\n case 86106:\n nextToken(parser, context);\n switch (parser.getToken()) {\n case 67174411:\n return parseImportCallDeclaration(parser, context, privateScope, start);\n case 67108877:\n return parseImportMetaDeclaration(parser, context, start);\n default:\n parser.report(103, 'import');\n }\n case 209005:\n return parseAsyncArrowOrAsyncFunctionDeclaration(parser, context, scope, privateScope, origin, labels, 1);\n default:\n return parseStatement(parser, context, scope, privateScope, origin, labels, 1);\n }\n}\nfunction parseStatement(parser, context, scope, privateScope, origin, labels, allowFuncDecl) {\n switch (parser.getToken()) {\n case 86088:\n return parseVariableStatement(parser, context, scope, privateScope, 0);\n case 20572:\n return parseReturnStatement(parser, context, privateScope);\n case 20569:\n return parseIfStatement(parser, context, scope, privateScope, labels);\n case 20567:\n return parseForStatement(parser, context, scope, privateScope, labels);\n case 20562:\n return parseDoWhileStatement(parser, context, scope, privateScope, labels);\n case 20578:\n return parseWhileStatement(parser, context, scope, privateScope, labels);\n case 86110:\n return parseSwitchStatement(parser, context, scope, privateScope, labels);\n case 1074790417:\n return parseEmptyStatement(parser, context);\n case 2162700:\n return parseBlock(parser, context, scope?.createChildScope(), privateScope, labels, parser.tokenStart);\n case 86112:\n return parseThrowStatement(parser, context, privateScope);\n case 20555:\n return parseBreakStatement(parser, context, labels);\n case 20559:\n return parseContinueStatement(parser, context, labels);\n case 20577:\n return parseTryStatement(parser, context, scope, privateScope, labels);\n case 20579:\n return parseWithStatement(parser, context, scope, privateScope, labels);\n case 20560:\n return parseDebuggerStatement(parser, context);\n case 209005:\n return parseAsyncArrowOrAsyncFunctionDeclaration(parser, context, scope, privateScope, origin, labels, 0);\n case 20557:\n parser.report(162);\n case 20566:\n parser.report(163);\n case 86104:\n parser.report(context & 1\n ? 76\n : !parser.options.webcompat\n ? 78\n : 77);\n case 86094:\n parser.report(79);\n default:\n return parseExpressionOrLabelledStatement(parser, context, scope, privateScope, origin, labels, allowFuncDecl);\n }\n}\nfunction parseExpressionOrLabelledStatement(parser, context, scope, privateScope, origin, labels, allowFuncDecl) {\n const { tokenValue, tokenStart } = parser;\n const token = parser.getToken();\n let expr;\n switch (token) {\n case 241737:\n expr = parseIdentifier(parser, context);\n if (context & 1)\n parser.report(85);\n if (parser.getToken() === 69271571)\n parser.report(84);\n break;\n default:\n expr = parsePrimaryExpression(parser, context, privateScope, 2, 0, 1, 0, 1, parser.tokenStart);\n }\n if (token & 143360 && parser.getToken() === 21) {\n return parseLabelledStatement(parser, context, scope, privateScope, origin, labels, tokenValue, expr, token, allowFuncDecl, tokenStart);\n }\n expr = parseMemberOrUpdateExpression(parser, context, privateScope, expr, 0, 0, tokenStart);\n expr = parseAssignmentExpression(parser, context, privateScope, 0, 0, tokenStart, expr);\n if (parser.getToken() === 18) {\n expr = parseSequenceExpression(parser, context, privateScope, 0, tokenStart, expr);\n }\n return parseExpressionStatement(parser, context, expr, tokenStart);\n}\nfunction parseBlock(parser, context, scope, privateScope, labels, start = parser.tokenStart, type = 'BlockStatement') {\n const body = [];\n consume(parser, context | 32, 2162700);\n while (parser.getToken() !== 1074790415) {\n body.push(parseStatementListItem(parser, context, scope, privateScope, 2, { $: labels }));\n }\n consume(parser, context | 32, 1074790415);\n return parser.finishNode({\n type,\n body,\n }, start);\n}\nfunction parseReturnStatement(parser, context, privateScope) {\n if ((context & 4096) === 0)\n parser.report(92);\n const start = parser.tokenStart;\n nextToken(parser, context | 32);\n const argument = parser.flags & 1 || parser.getToken() & 1048576\n ? null\n : parseExpressions(parser, context, privateScope, 0, 1, parser.tokenStart);\n matchOrInsertSemicolon(parser, context | 32);\n return parser.finishNode({\n type: 'ReturnStatement',\n argument,\n }, start);\n}\nfunction parseExpressionStatement(parser, context, expression, start) {\n matchOrInsertSemicolon(parser, context | 32);\n return parser.finishNode({\n type: 'ExpressionStatement',\n expression,\n }, start);\n}\nfunction parseLabelledStatement(parser, context, scope, privateScope, origin, labels, value, expr, token, allowFuncDecl, start) {\n validateBindingIdentifier(parser, context, 0, token, 1);\n validateAndDeclareLabel(parser, labels, value);\n nextToken(parser, context | 32);\n const body = allowFuncDecl &&\n (context & 1) === 0 &&\n parser.options.webcompat &&\n parser.getToken() === 86104\n ? parseFunctionDeclaration(parser, context, scope?.createChildScope(), privateScope, origin, 0, 0, 0, parser.tokenStart)\n : parseStatement(parser, context, scope, privateScope, origin, labels, allowFuncDecl);\n return parser.finishNode({\n type: 'LabeledStatement',\n label: expr,\n body,\n }, start);\n}\nfunction parseAsyncArrowOrAsyncFunctionDeclaration(parser, context, scope, privateScope, origin, labels, allowFuncDecl) {\n const { tokenValue, tokenStart: start } = parser;\n const token = parser.getToken();\n let expr = parseIdentifier(parser, context);\n if (parser.getToken() === 21) {\n return parseLabelledStatement(parser, context, scope, privateScope, origin, labels, tokenValue, expr, token, 1, start);\n }\n const asyncNewLine = parser.flags & 1;\n if (!asyncNewLine) {\n if (parser.getToken() === 86104) {\n if (!allowFuncDecl)\n parser.report(123);\n return parseFunctionDeclaration(parser, context, scope, privateScope, origin, 1, 0, 1, start);\n }\n if (isValidIdentifier(context, parser.getToken())) {\n expr = parseAsyncArrowAfterIdent(parser, context, privateScope, 1, start);\n if (parser.getToken() === 18)\n expr = parseSequenceExpression(parser, context, privateScope, 0, start, expr);\n return parseExpressionStatement(parser, context, expr, start);\n }\n }\n if (parser.getToken() === 67174411) {\n expr = parseAsyncArrowOrCallExpression(parser, context, privateScope, expr, 1, 1, 0, asyncNewLine, start);\n }\n else {\n if (parser.getToken() === 10) {\n classifyIdentifier(parser, context, token);\n if ((token & 36864) === 36864) {\n parser.flags |= 256;\n }\n expr = parseArrowFromIdentifier(parser, context | 2048, privateScope, parser.tokenValue, expr, 0, 1, 0, start);\n }\n parser.assignable = 1;\n }\n expr = parseMemberOrUpdateExpression(parser, context, privateScope, expr, 0, 0, start);\n expr = parseAssignmentExpression(parser, context, privateScope, 0, 0, start, expr);\n parser.assignable = 1;\n if (parser.getToken() === 18) {\n expr = parseSequenceExpression(parser, context, privateScope, 0, start, expr);\n }\n return parseExpressionStatement(parser, context, expr, start);\n}\nfunction parseDirective(parser, context, expression, token, start) {\n const endIndex = parser.startIndex;\n if (token !== 1074790417) {\n parser.assignable = 2;\n expression = parseMemberOrUpdateExpression(parser, context, undefined, expression, 0, 0, start);\n if (parser.getToken() !== 1074790417) {\n expression = parseAssignmentExpression(parser, context, undefined, 0, 0, start, expression);\n if (parser.getToken() === 18) {\n expression = parseSequenceExpression(parser, context, undefined, 0, start, expression);\n }\n }\n matchOrInsertSemicolon(parser, context | 32);\n }\n const node = {\n type: 'ExpressionStatement',\n expression,\n };\n if (expression.type === 'Literal' && typeof expression.value === 'string') {\n node.directive = parser.source.slice(start.index + 1, endIndex - 1);\n }\n return parser.finishNode(node, start);\n}\nfunction parseEmptyStatement(parser, context) {\n const start = parser.tokenStart;\n nextToken(parser, context | 32);\n return parser.finishNode({\n type: 'EmptyStatement',\n }, start);\n}\nfunction parseThrowStatement(parser, context, privateScope) {\n const start = parser.tokenStart;\n nextToken(parser, context | 32);\n if (parser.flags & 1)\n parser.report(90);\n const argument = parseExpressions(parser, context, privateScope, 0, 1, parser.tokenStart);\n matchOrInsertSemicolon(parser, context | 32);\n return parser.finishNode({\n type: 'ThrowStatement',\n argument,\n }, start);\n}\nfunction parseIfStatement(parser, context, scope, privateScope, labels) {\n const start = parser.tokenStart;\n nextToken(parser, context);\n consume(parser, context | 32, 67174411);\n parser.assignable = 1;\n const test = parseExpressions(parser, context, privateScope, 0, 1, parser.tokenStart);\n consume(parser, context | 32, 16);\n const consequent = parseConsequentOrAlternative(parser, context, scope, privateScope, labels);\n let alternate = null;\n if (parser.getToken() === 20563) {\n nextToken(parser, context | 32);\n alternate = parseConsequentOrAlternative(parser, context, scope, privateScope, labels);\n }\n return parser.finishNode({\n type: 'IfStatement',\n test,\n consequent,\n alternate,\n }, start);\n}\nfunction parseConsequentOrAlternative(parser, context, scope, privateScope, labels) {\n const { tokenStart } = parser;\n return context & 1 ||\n !parser.options.webcompat ||\n parser.getToken() !== 86104\n ? parseStatement(parser, context, scope, privateScope, 0, { $: labels }, 0)\n : parseFunctionDeclaration(parser, context, scope?.createChildScope(), privateScope, 0, 0, 0, 0, tokenStart);\n}\nfunction parseSwitchStatement(parser, context, scope, privateScope, labels) {\n const start = parser.tokenStart;\n nextToken(parser, context);\n consume(parser, context | 32, 67174411);\n const discriminant = parseExpressions(parser, context, privateScope, 0, 1, parser.tokenStart);\n consume(parser, context, 16);\n consume(parser, context, 2162700);\n const cases = [];\n let seenDefault = 0;\n scope = scope?.createChildScope(8);\n while (parser.getToken() !== 1074790415) {\n const { tokenStart } = parser;\n let test = null;\n const consequent = [];\n if (consumeOpt(parser, context | 32, 20556)) {\n test = parseExpressions(parser, context, privateScope, 0, 1, parser.tokenStart);\n }\n else {\n consume(parser, context | 32, 20561);\n if (seenDefault)\n parser.report(89);\n seenDefault = 1;\n }\n consume(parser, context | 32, 21);\n while (parser.getToken() !== 20556 &&\n parser.getToken() !== 1074790415 &&\n parser.getToken() !== 20561) {\n consequent.push(parseStatementListItem(parser, context | 4, scope, privateScope, 2, {\n $: labels,\n }));\n }\n cases.push(parser.finishNode({\n type: 'SwitchCase',\n test,\n consequent,\n }, tokenStart));\n }\n consume(parser, context | 32, 1074790415);\n return parser.finishNode({\n type: 'SwitchStatement',\n discriminant,\n cases,\n }, start);\n}\nfunction parseWhileStatement(parser, context, scope, privateScope, labels) {\n const start = parser.tokenStart;\n nextToken(parser, context);\n consume(parser, context | 32, 67174411);\n const test = parseExpressions(parser, context, privateScope, 0, 1, parser.tokenStart);\n consume(parser, context | 32, 16);\n const body = parseIterationStatementBody(parser, context, scope, privateScope, labels);\n return parser.finishNode({\n type: 'WhileStatement',\n test,\n body,\n }, start);\n}\nfunction parseIterationStatementBody(parser, context, scope, privateScope, labels) {\n return parseStatement(parser, ((context | 131072) ^ 131072) | 128, scope, privateScope, 0, { loop: 1, $: labels }, 0);\n}\nfunction parseContinueStatement(parser, context, labels) {\n if ((context & 128) === 0)\n parser.report(68);\n const start = parser.tokenStart;\n nextToken(parser, context);\n let label = null;\n if ((parser.flags & 1) === 0 && parser.getToken() & 143360) {\n const { tokenValue } = parser;\n label = parseIdentifier(parser, context | 32);\n if (!isValidLabel(parser, labels, tokenValue, 1))\n parser.report(138, tokenValue);\n }\n matchOrInsertSemicolon(parser, context | 32);\n return parser.finishNode({\n type: 'ContinueStatement',\n label,\n }, start);\n}\nfunction parseBreakStatement(parser, context, labels) {\n const start = parser.tokenStart;\n nextToken(parser, context | 32);\n let label = null;\n if ((parser.flags & 1) === 0 && parser.getToken() & 143360) {\n const { tokenValue } = parser;\n label = parseIdentifier(parser, context | 32);\n if (!isValidLabel(parser, labels, tokenValue, 0))\n parser.report(138, tokenValue);\n }\n else if ((context & (4 | 128)) === 0) {\n parser.report(69);\n }\n matchOrInsertSemicolon(parser, context | 32);\n return parser.finishNode({\n type: 'BreakStatement',\n label,\n }, start);\n}\nfunction parseWithStatement(parser, context, scope, privateScope, labels) {\n const start = parser.tokenStart;\n nextToken(parser, context);\n if (context & 1)\n parser.report(91);\n consume(parser, context | 32, 67174411);\n const object = parseExpressions(parser, context, privateScope, 0, 1, parser.tokenStart);\n consume(parser, context | 32, 16);\n const body = parseStatement(parser, context, scope, privateScope, 2, labels, 0);\n return parser.finishNode({\n type: 'WithStatement',\n object,\n body,\n }, start);\n}\nfunction parseDebuggerStatement(parser, context) {\n const start = parser.tokenStart;\n nextToken(parser, context | 32);\n matchOrInsertSemicolon(parser, context | 32);\n return parser.finishNode({\n type: 'DebuggerStatement',\n }, start);\n}\nfunction parseTryStatement(parser, context, scope, privateScope, labels) {\n const start = parser.tokenStart;\n nextToken(parser, context | 32);\n const firstScope = scope?.createChildScope(16);\n const block = parseBlock(parser, context, firstScope, privateScope, { $: labels });\n const { tokenStart } = parser;\n const handler = consumeOpt(parser, context | 32, 20557)\n ? parseCatchBlock(parser, context, scope, privateScope, labels, tokenStart)\n : null;\n let finalizer = null;\n if (parser.getToken() === 20566) {\n nextToken(parser, context | 32);\n const finalizerScope = scope?.createChildScope(4);\n const block = parseBlock(parser, context, finalizerScope, privateScope, { $: labels });\n finalizer = block;\n }\n if (!handler && !finalizer) {\n parser.report(88);\n }\n return parser.finishNode({\n type: 'TryStatement',\n block,\n handler,\n finalizer,\n }, start);\n}\nfunction parseCatchBlock(parser, context, scope, privateScope, labels, start) {\n let param = null;\n let additionalScope = scope;\n if (consumeOpt(parser, context, 67174411)) {\n scope = scope?.createChildScope(4);\n param = parseBindingPattern(parser, context, scope, privateScope, (parser.getToken() & 2097152) === 2097152\n ? 256\n : 512, 0);\n if (parser.getToken() === 18) {\n parser.report(86);\n }\n else if (parser.getToken() === 1077936155) {\n parser.report(87);\n }\n consume(parser, context | 32, 16);\n }\n additionalScope = scope?.createChildScope(32);\n const body = parseBlock(parser, context, additionalScope, privateScope, { $: labels });\n return parser.finishNode({\n type: 'CatchClause',\n param,\n body,\n }, start);\n}\nfunction parseStaticBlock(parser, context, scope, privateScope, start) {\n scope = scope?.createChildScope();\n const ctorContext = 512 | 4096 | 1024 | 4 | 128;\n context =\n ((context | ctorContext) ^ ctorContext) |\n 256 |\n 2048 |\n 524288 |\n 65536;\n return parseBlock(parser, context, scope, privateScope, {}, start, 'StaticBlock');\n}\nfunction parseDoWhileStatement(parser, context, scope, privateScope, labels) {\n const start = parser.tokenStart;\n nextToken(parser, context | 32);\n const body = parseIterationStatementBody(parser, context, scope, privateScope, labels);\n consume(parser, context, 20578);\n consume(parser, context | 32, 67174411);\n const test = parseExpressions(parser, context, privateScope, 0, 1, parser.tokenStart);\n consume(parser, context | 32, 16);\n consumeOpt(parser, context | 32, 1074790417);\n return parser.finishNode({\n type: 'DoWhileStatement',\n body,\n test,\n }, start);\n}\nfunction parseLetIdentOrVarDeclarationStatement(parser, context, scope, privateScope, origin) {\n const { tokenValue, tokenStart } = parser;\n const token = parser.getToken();\n let expr = parseIdentifier(parser, context);\n if (parser.getToken() & (143360 | 2097152)) {\n const declarations = parseVariableDeclarationList(parser, context, scope, privateScope, 8, 0);\n matchOrInsertSemicolon(parser, context | 32);\n return parser.finishNode({\n type: 'VariableDeclaration',\n kind: 'let',\n declarations,\n }, tokenStart);\n }\n parser.assignable = 1;\n if (context & 1)\n parser.report(85);\n if (parser.getToken() === 21) {\n return parseLabelledStatement(parser, context, scope, privateScope, origin, {}, tokenValue, expr, token, 0, tokenStart);\n }\n if (parser.getToken() === 10) {\n let scope = void 0;\n if (parser.options.lexical)\n scope = createArrowHeadParsingScope(parser, context, tokenValue);\n parser.flags = (parser.flags | 128) ^ 128;\n expr = parseArrowFunctionExpression(parser, context, scope, privateScope, [expr], 0, tokenStart);\n }\n else {\n expr = parseMemberOrUpdateExpression(parser, context, privateScope, expr, 0, 0, tokenStart);\n expr = parseAssignmentExpression(parser, context, privateScope, 0, 0, tokenStart, expr);\n }\n if (parser.getToken() === 18) {\n expr = parseSequenceExpression(parser, context, privateScope, 0, tokenStart, expr);\n }\n return parseExpressionStatement(parser, context, expr, tokenStart);\n}\nfunction parseLexicalDeclaration(parser, context, scope, privateScope, kind, origin) {\n const start = parser.tokenStart;\n nextToken(parser, context);\n const declarations = parseVariableDeclarationList(parser, context, scope, privateScope, kind, origin);\n matchOrInsertSemicolon(parser, context | 32);\n return parser.finishNode({\n type: 'VariableDeclaration',\n kind: kind & 8 ? 'let' : 'const',\n declarations,\n }, start);\n}\nfunction parseVariableStatement(parser, context, scope, privateScope, origin) {\n const start = parser.tokenStart;\n nextToken(parser, context);\n const declarations = parseVariableDeclarationList(parser, context, scope, privateScope, 4, origin);\n matchOrInsertSemicolon(parser, context | 32);\n return parser.finishNode({\n type: 'VariableDeclaration',\n kind: 'var',\n declarations,\n }, start);\n}\nfunction parseVariableDeclarationList(parser, context, scope, privateScope, kind, origin) {\n let bindingCount = 1;\n const list = [\n parseVariableDeclaration(parser, context, scope, privateScope, kind, origin),\n ];\n while (consumeOpt(parser, context, 18)) {\n bindingCount++;\n list.push(parseVariableDeclaration(parser, context, scope, privateScope, kind, origin));\n }\n if (bindingCount > 1 && origin & 32 && parser.getToken() & 262144) {\n parser.report(61, KeywordDescTable[parser.getToken() & 255]);\n }\n return list;\n}\nfunction parseVariableDeclaration(parser, context, scope, privateScope, kind, origin) {\n const { tokenStart } = parser;\n const token = parser.getToken();\n let init = null;\n const id = parseBindingPattern(parser, context, scope, privateScope, kind, origin);\n if (parser.getToken() === 1077936155) {\n nextToken(parser, context | 32);\n init = parseExpression(parser, context, privateScope, 1, 0, parser.tokenStart);\n if (origin & 32 || (token & 2097152) === 0) {\n if (parser.getToken() === 471156 ||\n (parser.getToken() === 8673330 &&\n (token & 2097152 || (kind & 4) === 0 || context & 1))) {\n throw new ParseError(tokenStart, parser.currentLocation, 60, parser.getToken() === 471156 ? 'of' : 'in');\n }\n }\n }\n else if ((kind & 16 || (token & 2097152) > 0) &&\n (parser.getToken() & 262144) !== 262144) {\n parser.report(59, kind & 16 ? 'const' : 'destructuring');\n }\n return parser.finishNode({\n type: 'VariableDeclarator',\n id,\n init,\n }, tokenStart);\n}\nfunction parseForStatement(parser, context, scope, privateScope, labels) {\n const start = parser.tokenStart;\n nextToken(parser, context);\n const forAwait = ((context & 2048) > 0 || ((context & 2) > 0 && (context & 8) > 0)) &&\n consumeOpt(parser, context, 209006);\n consume(parser, context | 32, 67174411);\n scope = scope?.createChildScope(1);\n let test = null;\n let update = null;\n let destructible = 0;\n let init = null;\n let isVarDecl = parser.getToken() === 86088 ||\n parser.getToken() === 241737 ||\n parser.getToken() === 86090;\n let right;\n const { tokenStart } = parser;\n const token = parser.getToken();\n if (isVarDecl) {\n if (token === 241737) {\n init = parseIdentifier(parser, context);\n if (parser.getToken() & (143360 | 2097152)) {\n if (parser.getToken() === 8673330) {\n if (context & 1)\n parser.report(67);\n }\n else {\n init = parser.finishNode({\n type: 'VariableDeclaration',\n kind: 'let',\n declarations: parseVariableDeclarationList(parser, context | 131072, scope, privateScope, 8, 32),\n }, tokenStart);\n }\n parser.assignable = 1;\n }\n else if (context & 1) {\n parser.report(67);\n }\n else {\n isVarDecl = false;\n parser.assignable = 1;\n init = parseMemberOrUpdateExpression(parser, context, privateScope, init, 0, 0, tokenStart);\n if (parser.getToken() === 471156)\n parser.report(115);\n }\n }\n else {\n nextToken(parser, context);\n init = parser.finishNode(token === 86088\n ? {\n type: 'VariableDeclaration',\n kind: 'var',\n declarations: parseVariableDeclarationList(parser, context | 131072, scope, privateScope, 4, 32),\n }\n : {\n type: 'VariableDeclaration',\n kind: 'const',\n declarations: parseVariableDeclarationList(parser, context | 131072, scope, privateScope, 16, 32),\n }, tokenStart);\n parser.assignable = 1;\n }\n }\n else if (token === 1074790417) {\n if (forAwait)\n parser.report(82);\n }\n else if ((token & 2097152) === 2097152) {\n const patternStart = parser.tokenStart;\n init =\n token === 2162700\n ? parseObjectLiteralOrPattern(parser, context, void 0, privateScope, 1, 0, 0, 2, 32)\n : parseArrayExpressionOrPattern(parser, context, void 0, privateScope, 1, 0, 0, 2, 32);\n destructible = parser.destructible;\n if (destructible & 64) {\n parser.report(63);\n }\n parser.assignable =\n destructible & 16 ? 2 : 1;\n init = parseMemberOrUpdateExpression(parser, context | 131072, privateScope, init, 0, 0, patternStart);\n }\n else {\n init = parseLeftHandSideExpression(parser, context | 131072, privateScope, 1, 0, 1);\n }\n if ((parser.getToken() & 262144) === 262144) {\n if (parser.getToken() === 471156) {\n if (parser.assignable & 2)\n parser.report(80, forAwait ? 'await' : 'of');\n reinterpretToPattern(parser, init);\n nextToken(parser, context | 32);\n right = parseExpression(parser, context, privateScope, 1, 0, parser.tokenStart);\n consume(parser, context | 32, 16);\n const body = parseIterationStatementBody(parser, context, scope, privateScope, labels);\n return parser.finishNode({\n type: 'ForOfStatement',\n left: init,\n right,\n body,\n await: forAwait,\n }, start);\n }\n if (parser.assignable & 2)\n parser.report(80, 'in');\n reinterpretToPattern(parser, init);\n nextToken(parser, context | 32);\n if (forAwait)\n parser.report(82);\n right = parseExpressions(parser, context, privateScope, 0, 1, parser.tokenStart);\n consume(parser, context | 32, 16);\n const body = parseIterationStatementBody(parser, context, scope, privateScope, labels);\n return parser.finishNode({\n type: 'ForInStatement',\n body,\n left: init,\n right,\n }, start);\n }\n if (forAwait)\n parser.report(82);\n if (!isVarDecl) {\n if (destructible & 8 && parser.getToken() !== 1077936155) {\n parser.report(80, 'loop');\n }\n init = parseAssignmentExpression(parser, context | 131072, privateScope, 0, 0, tokenStart, init);\n }\n if (parser.getToken() === 18)\n init = parseSequenceExpression(parser, context, privateScope, 0, tokenStart, init);\n consume(parser, context | 32, 1074790417);\n if (parser.getToken() !== 1074790417)\n test = parseExpressions(parser, context, privateScope, 0, 1, parser.tokenStart);\n consume(parser, context | 32, 1074790417);\n if (parser.getToken() !== 16)\n update = parseExpressions(parser, context, privateScope, 0, 1, parser.tokenStart);\n consume(parser, context | 32, 16);\n const body = parseIterationStatementBody(parser, context, scope, privateScope, labels);\n return parser.finishNode({\n type: 'ForStatement',\n init,\n test,\n update,\n body,\n }, start);\n}\nfunction parseRestrictedIdentifier(parser, context, scope) {\n if (!isValidIdentifier(context, parser.getToken()))\n parser.report(118);\n if ((parser.getToken() & 537079808) === 537079808)\n parser.report(119);\n scope?.addBlockName(context, parser.tokenValue, 8, 0);\n return parseIdentifier(parser, context);\n}\nfunction parseImportDeclaration(parser, context, scope) {\n const start = parser.tokenStart;\n nextToken(parser, context);\n let source = null;\n const { tokenStart } = parser;\n let specifiers = [];\n if (parser.getToken() === 134283267) {\n source = parseLiteral(parser, context);\n }\n else {\n if (parser.getToken() & 143360) {\n const local = parseRestrictedIdentifier(parser, context, scope);\n specifiers = [\n parser.finishNode({\n type: 'ImportDefaultSpecifier',\n local,\n }, tokenStart),\n ];\n if (consumeOpt(parser, context, 18)) {\n switch (parser.getToken()) {\n case 8391476:\n specifiers.push(parseImportNamespaceSpecifier(parser, context, scope));\n break;\n case 2162700:\n parseImportSpecifierOrNamedImports(parser, context, scope, specifiers);\n break;\n default:\n parser.report(107);\n }\n }\n }\n else {\n switch (parser.getToken()) {\n case 8391476:\n specifiers = [parseImportNamespaceSpecifier(parser, context, scope)];\n break;\n case 2162700:\n parseImportSpecifierOrNamedImports(parser, context, scope, specifiers);\n break;\n case 67174411:\n return parseImportCallDeclaration(parser, context, undefined, start);\n case 67108877:\n return parseImportMetaDeclaration(parser, context, start);\n default:\n parser.report(30, KeywordDescTable[parser.getToken() & 255]);\n }\n }\n source = parseModuleSpecifier(parser, context);\n }\n const attributes = parseImportAttributes(parser, context);\n const node = {\n type: 'ImportDeclaration',\n specifiers,\n source,\n attributes,\n };\n matchOrInsertSemicolon(parser, context | 32);\n return parser.finishNode(node, start);\n}\nfunction parseImportNamespaceSpecifier(parser, context, scope) {\n const { tokenStart } = parser;\n nextToken(parser, context);\n consume(parser, context, 77932);\n if ((parser.getToken() & 134217728) === 134217728) {\n throw new ParseError(tokenStart, parser.currentLocation, 30, KeywordDescTable[parser.getToken() & 255]);\n }\n return parser.finishNode({\n type: 'ImportNamespaceSpecifier',\n local: parseRestrictedIdentifier(parser, context, scope),\n }, tokenStart);\n}\nfunction parseModuleSpecifier(parser, context) {\n consume(parser, context, 209011);\n if (parser.getToken() !== 134283267)\n parser.report(105, 'Import');\n return parseLiteral(parser, context);\n}\nfunction parseImportSpecifierOrNamedImports(parser, context, scope, specifiers) {\n nextToken(parser, context);\n while (parser.getToken() & 143360 || parser.getToken() === 134283267) {\n let { tokenValue, tokenStart } = parser;\n const token = parser.getToken();\n const imported = parseModuleExportName(parser, context);\n let local;\n if (consumeOpt(parser, context, 77932)) {\n if ((parser.getToken() & 134217728) === 134217728 ||\n parser.getToken() === 18) {\n parser.report(106);\n }\n else {\n validateBindingIdentifier(parser, context, 16, parser.getToken(), 0);\n }\n tokenValue = parser.tokenValue;\n local = parseIdentifier(parser, context);\n }\n else if (imported.type === 'Identifier') {\n validateBindingIdentifier(parser, context, 16, token, 0);\n local = imported;\n }\n else {\n parser.report(25, KeywordDescTable[77932 & 255]);\n }\n scope?.addBlockName(context, tokenValue, 8, 0);\n specifiers.push(parser.finishNode({\n type: 'ImportSpecifier',\n local,\n imported,\n }, tokenStart));\n if (parser.getToken() !== 1074790415)\n consume(parser, context, 18);\n }\n consume(parser, context, 1074790415);\n return specifiers;\n}\nfunction parseImportMetaDeclaration(parser, context, start) {\n let expr = parseImportMetaExpression(parser, context, parser.finishNode({\n type: 'Identifier',\n name: 'import',\n }, start), start);\n expr = parseMemberOrUpdateExpression(parser, context, undefined, expr, 0, 0, start);\n expr = parseAssignmentExpression(parser, context, undefined, 0, 0, start, expr);\n if (parser.getToken() === 18) {\n expr = parseSequenceExpression(parser, context, undefined, 0, start, expr);\n }\n return parseExpressionStatement(parser, context, expr, start);\n}\nfunction parseImportCallDeclaration(parser, context, privateScope, start) {\n let expr = parseImportExpression(parser, context, privateScope, 0, start);\n expr = parseMemberOrUpdateExpression(parser, context, privateScope, expr, 0, 0, start);\n if (parser.getToken() === 18) {\n expr = parseSequenceExpression(parser, context, privateScope, 0, start, expr);\n }\n return parseExpressionStatement(parser, context, expr, start);\n}\nfunction parseExportDeclaration(parser, context, scope) {\n const start = parser.leadingDecorators.decorators.length ? parser.leadingDecorators.start : parser.tokenStart;\n nextToken(parser, context | 32);\n const specifiers = [];\n let declaration = null;\n let source = null;\n let attributes = [];\n if (consumeOpt(parser, context | 32, 20561)) {\n switch (parser.getToken()) {\n case 86104: {\n declaration = parseFunctionDeclaration(parser, context, scope, undefined, 4, 1, 1, 0, parser.tokenStart);\n break;\n }\n case 132:\n case 86094:\n declaration = parseClassDeclaration(parser, context, scope, undefined, 1);\n break;\n case 209005: {\n const { tokenStart } = parser;\n declaration = parseIdentifier(parser, context);\n const { flags } = parser;\n if ((flags & 1) === 0) {\n if (parser.getToken() === 86104) {\n declaration = parseFunctionDeclaration(parser, context, scope, undefined, 4, 1, 1, 1, tokenStart);\n }\n else {\n if (parser.getToken() === 67174411) {\n declaration = parseAsyncArrowOrCallExpression(parser, context, undefined, declaration, 1, 1, 0, flags, tokenStart);\n declaration = parseMemberOrUpdateExpression(parser, context, undefined, declaration, 0, 0, tokenStart);\n declaration = parseAssignmentExpression(parser, context, undefined, 0, 0, tokenStart, declaration);\n }\n else if (parser.getToken() & 143360) {\n if (scope)\n scope = createArrowHeadParsingScope(parser, context, parser.tokenValue);\n declaration = parseIdentifier(parser, context);\n declaration = parseArrowFunctionExpression(parser, context, scope, undefined, [declaration], 1, tokenStart);\n }\n }\n }\n break;\n }\n default:\n declaration = parseExpression(parser, context, undefined, 1, 0, parser.tokenStart);\n matchOrInsertSemicolon(parser, context | 32);\n }\n if (scope)\n parser.declareUnboundVariable('default');\n return parser.finishNode({\n type: 'ExportDefaultDeclaration',\n declaration,\n }, start);\n }\n switch (parser.getToken()) {\n case 8391476: {\n nextToken(parser, context);\n let exported = null;\n const isNamedDeclaration = consumeOpt(parser, context, 77932);\n if (isNamedDeclaration) {\n if (scope)\n parser.declareUnboundVariable(parser.tokenValue);\n exported = parseModuleExportName(parser, context);\n }\n consume(parser, context, 209011);\n if (parser.getToken() !== 134283267)\n parser.report(105, 'Export');\n source = parseLiteral(parser, context);\n const attributes = parseImportAttributes(parser, context);\n const node = {\n type: 'ExportAllDeclaration',\n source,\n exported,\n attributes,\n };\n matchOrInsertSemicolon(parser, context | 32);\n return parser.finishNode(node, start);\n }\n case 2162700: {\n nextToken(parser, context);\n const tmpExportedNames = [];\n const tmpExportedBindings = [];\n let hasLiteralLocal = 0;\n while (parser.getToken() & 143360 || parser.getToken() === 134283267) {\n const { tokenStart, tokenValue } = parser;\n const local = parseModuleExportName(parser, context);\n if (local.type === 'Literal') {\n hasLiteralLocal = 1;\n }\n let exported;\n if (parser.getToken() === 77932) {\n nextToken(parser, context);\n if ((parser.getToken() & 143360) === 0 && parser.getToken() !== 134283267) {\n parser.report(106);\n }\n if (scope) {\n tmpExportedNames.push(parser.tokenValue);\n tmpExportedBindings.push(tokenValue);\n }\n exported = parseModuleExportName(parser, context);\n }\n else {\n if (scope) {\n tmpExportedNames.push(parser.tokenValue);\n tmpExportedBindings.push(parser.tokenValue);\n }\n exported = local;\n }\n specifiers.push(parser.finishNode({\n type: 'ExportSpecifier',\n local,\n exported,\n }, tokenStart));\n if (parser.getToken() !== 1074790415)\n consume(parser, context, 18);\n }\n consume(parser, context, 1074790415);\n if (consumeOpt(parser, context, 209011)) {\n if (parser.getToken() !== 134283267)\n parser.report(105, 'Export');\n source = parseLiteral(parser, context);\n attributes = parseImportAttributes(parser, context);\n if (scope) {\n tmpExportedNames.forEach((n) => parser.declareUnboundVariable(n));\n }\n }\n else {\n if (hasLiteralLocal) {\n parser.report(172);\n }\n if (scope) {\n tmpExportedNames.forEach((n) => parser.declareUnboundVariable(n));\n tmpExportedBindings.forEach((b) => parser.addBindingToExports(b));\n }\n }\n matchOrInsertSemicolon(parser, context | 32);\n break;\n }\n case 132:\n case 86094:\n declaration = parseClassDeclaration(parser, context, scope, undefined, 2);\n break;\n case 86104:\n declaration = parseFunctionDeclaration(parser, context, scope, undefined, 4, 1, 2, 0, parser.tokenStart);\n break;\n case 241737:\n declaration = parseLexicalDeclaration(parser, context, scope, undefined, 8, 64);\n break;\n case 86090:\n declaration = parseLexicalDeclaration(parser, context, scope, undefined, 16, 64);\n break;\n case 86088:\n declaration = parseVariableStatement(parser, context, scope, undefined, 64);\n break;\n case 209005: {\n const { tokenStart } = parser;\n nextToken(parser, context);\n if ((parser.flags & 1) === 0 && parser.getToken() === 86104) {\n declaration = parseFunctionDeclaration(parser, context, scope, undefined, 4, 1, 2, 1, tokenStart);\n break;\n }\n }\n default:\n parser.report(30, KeywordDescTable[parser.getToken() & 255]);\n }\n const node = {\n type: 'ExportNamedDeclaration',\n declaration,\n specifiers,\n source,\n attributes: attributes,\n };\n return parser.finishNode(node, start);\n}\nfunction parseExpression(parser, context, privateScope, canAssign, inGroup, start) {\n let expr = parsePrimaryExpression(parser, context, privateScope, 2, 0, canAssign, inGroup, 1, start);\n expr = parseMemberOrUpdateExpression(parser, context, privateScope, expr, inGroup, 0, start);\n return parseAssignmentExpression(parser, context, privateScope, inGroup, 0, start, expr);\n}\nfunction parseSequenceExpression(parser, context, privateScope, inGroup, start, expr) {\n const expressions = [expr];\n while (consumeOpt(parser, context | 32, 18)) {\n expressions.push(parseExpression(parser, context, privateScope, 1, inGroup, parser.tokenStart));\n }\n return parser.finishNode({\n type: 'SequenceExpression',\n expressions,\n }, start);\n}\nfunction parseExpressions(parser, context, privateScope, inGroup, canAssign, start) {\n const expr = parseExpression(parser, context, privateScope, canAssign, inGroup, start);\n return parser.getToken() === 18\n ? parseSequenceExpression(parser, context, privateScope, inGroup, start, expr)\n : expr;\n}\nfunction parseAssignmentExpression(parser, context, privateScope, inGroup, isPattern, start, left) {\n const token = parser.getToken();\n if ((token & 4194304) === 4194304) {\n if (parser.assignable & 2)\n parser.report(26);\n if ((!isPattern && token === 1077936155 && left.type === 'ArrayExpression') ||\n left.type === 'ObjectExpression') {\n reinterpretToPattern(parser, left);\n }\n nextToken(parser, context | 32);\n const right = parseExpression(parser, context, privateScope, 1, inGroup, parser.tokenStart);\n parser.assignable = 2;\n return parser.finishNode(isPattern\n ? {\n type: 'AssignmentPattern',\n left,\n right,\n }\n : {\n type: 'AssignmentExpression',\n left,\n operator: KeywordDescTable[token & 255],\n right,\n }, start);\n }\n if ((token & 8388608) === 8388608) {\n left = parseBinaryExpression(parser, context, privateScope, inGroup, start, 4, token, left);\n }\n if (consumeOpt(parser, context | 32, 22)) {\n left = parseConditionalExpression(parser, context, privateScope, left, start);\n }\n return left;\n}\nfunction parseAssignmentExpressionOrPattern(parser, context, privateScope, inGroup, isPattern, start, left) {\n const token = parser.getToken();\n nextToken(parser, context | 32);\n const right = parseExpression(parser, context, privateScope, 1, inGroup, parser.tokenStart);\n left = parser.finishNode(isPattern\n ? {\n type: 'AssignmentPattern',\n left,\n right,\n }\n : {\n type: 'AssignmentExpression',\n left,\n operator: KeywordDescTable[token & 255],\n right,\n }, start);\n parser.assignable = 2;\n return left;\n}\nfunction parseConditionalExpression(parser, context, privateScope, test, start) {\n const consequent = parseExpression(parser, (context | 131072) ^ 131072, privateScope, 1, 0, parser.tokenStart);\n consume(parser, context | 32, 21);\n parser.assignable = 1;\n const alternate = parseExpression(parser, context, privateScope, 1, 0, parser.tokenStart);\n parser.assignable = 2;\n return parser.finishNode({\n type: 'ConditionalExpression',\n test,\n consequent,\n alternate,\n }, start);\n}\nfunction parseBinaryExpression(parser, context, privateScope, inGroup, start, minPrecedence, operator, left) {\n const bit = -((context & 131072) > 0) & 8673330;\n let t;\n let precedence;\n parser.assignable = 2;\n while (parser.getToken() & 8388608) {\n t = parser.getToken();\n precedence = t & 3840;\n if ((t & 524288 && operator & 268435456) || (operator & 524288 && t & 268435456)) {\n parser.report(165);\n }\n if (precedence + ((t === 8391735) << 8) - ((bit === t) << 12) <= minPrecedence)\n break;\n nextToken(parser, context | 32);\n left = parser.finishNode({\n type: t & 524288 || t & 268435456 ? 'LogicalExpression' : 'BinaryExpression',\n left,\n right: parseBinaryExpression(parser, context, privateScope, inGroup, parser.tokenStart, precedence, t, parseLeftHandSideExpression(parser, context, privateScope, 0, inGroup, 1)),\n operator: KeywordDescTable[t & 255],\n }, start);\n }\n if (parser.getToken() === 1077936155)\n parser.report(26);\n return left;\n}\nfunction parseUnaryExpression(parser, context, privateScope, isLHS, inGroup) {\n if (!isLHS)\n parser.report(0);\n const { tokenStart } = parser;\n const unaryOperator = parser.getToken();\n nextToken(parser, context | 32);\n const arg = parseLeftHandSideExpression(parser, context, privateScope, 0, inGroup, 1);\n if (parser.getToken() === 8391735)\n parser.report(33);\n if (context & 1 && unaryOperator === 16863276) {\n if (arg.type === 'Identifier') {\n parser.report(121);\n }\n else if (isPropertyWithPrivateFieldKey(arg)) {\n parser.report(127);\n }\n }\n parser.assignable = 2;\n return parser.finishNode({\n type: 'UnaryExpression',\n operator: KeywordDescTable[unaryOperator & 255],\n argument: arg,\n prefix: true,\n }, tokenStart);\n}\nfunction parseAsyncExpression(parser, context, privateScope, inGroup, isLHS, canAssign, inNew, start) {\n const token = parser.getToken();\n const expr = parseIdentifier(parser, context);\n const { flags } = parser;\n if ((flags & 1) === 0) {\n if (parser.getToken() === 86104) {\n return parseFunctionExpression(parser, context, privateScope, 1, inGroup, start);\n }\n if (isValidIdentifier(context, parser.getToken())) {\n if (!isLHS)\n parser.report(0);\n if ((parser.getToken() & 36864) === 36864) {\n parser.flags |= 256;\n }\n return parseAsyncArrowAfterIdent(parser, context, privateScope, canAssign, start);\n }\n }\n if (!inNew && parser.getToken() === 67174411) {\n return parseAsyncArrowOrCallExpression(parser, context, privateScope, expr, canAssign, 1, 0, flags, start);\n }\n if (parser.getToken() === 10) {\n classifyIdentifier(parser, context, token);\n if (inNew)\n parser.report(51);\n if ((token & 36864) === 36864) {\n parser.flags |= 256;\n }\n return parseArrowFromIdentifier(parser, context, privateScope, parser.tokenValue, expr, inNew, canAssign, 0, start);\n }\n parser.assignable = 1;\n return expr;\n}\nfunction parseYieldExpressionOrIdentifier(parser, context, privateScope, inGroup, canAssign, start) {\n if (inGroup)\n parser.destructible |= 256;\n if (context & 1024) {\n nextToken(parser, context | 32);\n if (context & 8192)\n parser.report(32);\n if (!canAssign)\n parser.report(26);\n if (parser.getToken() === 22)\n parser.report(124);\n let argument = null;\n let delegate = false;\n if ((parser.flags & 1) === 0) {\n delegate = consumeOpt(parser, context | 32, 8391476);\n if (parser.getToken() & (12288 | 65536) || delegate) {\n argument = parseExpression(parser, context, privateScope, 1, 0, parser.tokenStart);\n }\n }\n else if (parser.getToken() === 8391476) {\n parser.report(30, KeywordDescTable[parser.getToken() & 255]);\n }\n parser.assignable = 2;\n return parser.finishNode({\n type: 'YieldExpression',\n argument,\n delegate,\n }, start);\n }\n if (context & 1)\n parser.report(97, 'yield');\n return parseIdentifierOrArrow(parser, context, privateScope);\n}\nfunction parseAwaitExpressionOrIdentifier(parser, context, privateScope, inNew, inGroup, start) {\n if (inGroup)\n parser.destructible |= 128;\n if (context & 524288)\n parser.report(177);\n const possibleIdentifierOrArrowFunc = parseIdentifierOrArrow(parser, context, privateScope);\n const isIdentifier = possibleIdentifierOrArrowFunc.type === 'ArrowFunctionExpression' ||\n (parser.getToken() & 65536) === 0;\n if (isIdentifier) {\n if (context & 2048)\n throw new ParseError(start, { index: parser.startIndex, line: parser.startLine, column: parser.startColumn }, 176);\n if (context & 2)\n throw new ParseError(start, { index: parser.startIndex, line: parser.startLine, column: parser.startColumn }, 110);\n if (context & 8192 && context & 2048)\n throw new ParseError(start, { index: parser.startIndex, line: parser.startLine, column: parser.startColumn }, 110);\n return possibleIdentifierOrArrowFunc;\n }\n if (context & 8192) {\n throw new ParseError(start, { index: parser.startIndex, line: parser.startLine, column: parser.startColumn }, 31);\n }\n if (context & 2048 || (context & 2 && context & 8)) {\n if (inNew)\n throw new ParseError(start, { index: parser.startIndex, line: parser.startLine, column: parser.startColumn }, 0);\n const argument = parseLeftHandSideExpression(parser, context, privateScope, 0, 0, 1);\n if (parser.getToken() === 8391735)\n parser.report(33);\n parser.assignable = 2;\n return parser.finishNode({\n type: 'AwaitExpression',\n argument,\n }, start);\n }\n if (context & 2)\n throw new ParseError(start, { index: parser.startIndex, line: parser.startLine, column: parser.startColumn }, 98);\n return possibleIdentifierOrArrowFunc;\n}\nfunction parseFunctionBody(parser, context, scope, privateScope, origin, funcNameToken, functionScope) {\n const { tokenStart } = parser;\n consume(parser, context | 32, 2162700);\n const body = [];\n if (parser.getToken() !== 1074790415) {\n while (parser.getToken() === 134283267) {\n const { index, tokenStart, tokenIndex, tokenValue } = parser;\n const token = parser.getToken();\n const expr = parseLiteral(parser, context);\n if (isValidStrictMode(parser, index, tokenIndex, tokenValue)) {\n context |= 1;\n if (parser.flags & 128) {\n throw new ParseError(tokenStart, parser.currentLocation, 66);\n }\n if (parser.flags & 64) {\n throw new ParseError(tokenStart, parser.currentLocation, 9);\n }\n if (parser.flags & 4096) {\n throw new ParseError(tokenStart, parser.currentLocation, 15);\n }\n functionScope?.reportScopeError();\n }\n body.push(parseDirective(parser, context, expr, token, tokenStart));\n }\n if (context & 1) {\n if (funcNameToken) {\n if ((funcNameToken & 537079808) === 537079808) {\n parser.report(119);\n }\n if ((funcNameToken & 36864) === 36864) {\n parser.report(40);\n }\n }\n if (parser.flags & 512)\n parser.report(119);\n if (parser.flags & 256)\n parser.report(118);\n }\n }\n parser.flags =\n (parser.flags | 512 | 256 | 64 | 4096) ^\n (512 | 256 | 64 | 4096);\n parser.destructible = (parser.destructible | 256) ^ 256;\n while (parser.getToken() !== 1074790415) {\n body.push(parseStatementListItem(parser, context, scope, privateScope, 4, {}));\n }\n consume(parser, origin & (16 | 8) ? context | 32 : context, 1074790415);\n parser.flags &= -4289;\n if (parser.getToken() === 1077936155)\n parser.report(26);\n return parser.finishNode({\n type: 'BlockStatement',\n body,\n }, tokenStart);\n}\nfunction parseSuperExpression(parser, context) {\n const { tokenStart } = parser;\n nextToken(parser, context);\n switch (parser.getToken()) {\n case 67108990:\n parser.report(167);\n case 67174411: {\n if ((context & 512) === 0)\n parser.report(28);\n parser.assignable = 2;\n break;\n }\n case 69271571:\n case 67108877: {\n if ((context & 256) === 0)\n parser.report(29);\n parser.assignable = 1;\n break;\n }\n default:\n parser.report(30, 'super');\n }\n return parser.finishNode({ type: 'Super' }, tokenStart);\n}\nfunction parseLeftHandSideExpression(parser, context, privateScope, canAssign, inGroup, isLHS) {\n const start = parser.tokenStart;\n const expression = parsePrimaryExpression(parser, context, privateScope, 2, 0, canAssign, inGroup, isLHS, start);\n return parseMemberOrUpdateExpression(parser, context, privateScope, expression, inGroup, 0, start);\n}\nfunction parseUpdateExpression(parser, context, expr, start) {\n if (parser.assignable & 2)\n parser.report(55);\n const token = parser.getToken();\n nextToken(parser, context);\n parser.assignable = 2;\n return parser.finishNode({\n type: 'UpdateExpression',\n argument: expr,\n operator: KeywordDescTable[token & 255],\n prefix: false,\n }, start);\n}\nfunction parseMemberOrUpdateExpression(parser, context, privateScope, expr, inGroup, inChain, start) {\n if ((parser.getToken() & 33619968) === 33619968 && (parser.flags & 1) === 0) {\n expr = parseUpdateExpression(parser, context, expr, start);\n }\n else if ((parser.getToken() & 67108864) === 67108864) {\n context = (context | 131072) ^ 131072;\n switch (parser.getToken()) {\n case 67108877: {\n nextToken(parser, (context | 262144 | 8) ^ 8);\n if (context & 16 && parser.getToken() === 130 && parser.tokenValue === 'super') {\n parser.report(173);\n }\n parser.assignable = 1;\n const property = parsePropertyOrPrivatePropertyName(parser, context | 64, privateScope);\n expr = parser.finishNode({\n type: 'MemberExpression',\n object: expr,\n computed: false,\n property,\n optional: false,\n }, start);\n break;\n }\n case 69271571: {\n let restoreHasOptionalChaining = false;\n if ((parser.flags & 2048) === 2048) {\n restoreHasOptionalChaining = true;\n parser.flags = (parser.flags | 2048) ^ 2048;\n }\n nextToken(parser, context | 32);\n const { tokenStart } = parser;\n const property = parseExpressions(parser, context, privateScope, inGroup, 1, tokenStart);\n consume(parser, context, 20);\n parser.assignable = 1;\n expr = parser.finishNode({\n type: 'MemberExpression',\n object: expr,\n computed: true,\n property,\n optional: false,\n }, start);\n if (restoreHasOptionalChaining) {\n parser.flags |= 2048;\n }\n break;\n }\n case 67174411: {\n if ((parser.flags & 1024) === 1024) {\n parser.flags = (parser.flags | 1024) ^ 1024;\n return expr;\n }\n let restoreHasOptionalChaining = false;\n if ((parser.flags & 2048) === 2048) {\n restoreHasOptionalChaining = true;\n parser.flags = (parser.flags | 2048) ^ 2048;\n }\n const args = parseArguments(parser, context, privateScope, inGroup);\n parser.assignable = 2;\n expr = parser.finishNode({\n type: 'CallExpression',\n callee: expr,\n arguments: args,\n optional: false,\n }, start);\n if (restoreHasOptionalChaining) {\n parser.flags |= 2048;\n }\n break;\n }\n case 67108990: {\n nextToken(parser, (context | 262144 | 8) ^ 8);\n parser.flags |= 2048;\n parser.assignable = 2;\n expr = parseOptionalChain(parser, context, privateScope, expr, start);\n break;\n }\n default:\n if ((parser.flags & 2048) === 2048) {\n parser.report(166);\n }\n parser.assignable = 2;\n expr = parser.finishNode({\n type: 'TaggedTemplateExpression',\n tag: expr,\n quasi: parser.getToken() === 67174408\n ? parseTemplate(parser, context | 64, privateScope)\n : parseTemplateLiteral(parser, context),\n }, start);\n }\n expr = parseMemberOrUpdateExpression(parser, context, privateScope, expr, 0, 1, start);\n }\n if (inChain === 0 && (parser.flags & 2048) === 2048) {\n parser.flags = (parser.flags | 2048) ^ 2048;\n expr = parser.finishNode({\n type: 'ChainExpression',\n expression: expr,\n }, start);\n }\n return expr;\n}\nfunction parseOptionalChain(parser, context, privateScope, expr, start) {\n let restoreHasOptionalChaining = false;\n let node;\n if (parser.getToken() === 69271571 || parser.getToken() === 67174411) {\n if ((parser.flags & 2048) === 2048) {\n restoreHasOptionalChaining = true;\n parser.flags = (parser.flags | 2048) ^ 2048;\n }\n }\n if (parser.getToken() === 69271571) {\n nextToken(parser, context | 32);\n const { tokenStart } = parser;\n const property = parseExpressions(parser, context, privateScope, 0, 1, tokenStart);\n consume(parser, context, 20);\n parser.assignable = 2;\n node = parser.finishNode({\n type: 'MemberExpression',\n object: expr,\n computed: true,\n optional: true,\n property,\n }, start);\n }\n else if (parser.getToken() === 67174411) {\n const args = parseArguments(parser, context, privateScope, 0);\n parser.assignable = 2;\n node = parser.finishNode({\n type: 'CallExpression',\n callee: expr,\n arguments: args,\n optional: true,\n }, start);\n }\n else {\n const property = parsePropertyOrPrivatePropertyName(parser, context, privateScope);\n parser.assignable = 2;\n node = parser.finishNode({\n type: 'MemberExpression',\n object: expr,\n computed: false,\n optional: true,\n property,\n }, start);\n }\n if (restoreHasOptionalChaining) {\n parser.flags |= 2048;\n }\n return node;\n}\nfunction parsePropertyOrPrivatePropertyName(parser, context, privateScope) {\n if ((parser.getToken() & 143360) === 0 &&\n parser.getToken() !== -2147483528 &&\n parser.getToken() !== -2147483527 &&\n parser.getToken() !== 130) {\n parser.report(160);\n }\n return parser.getToken() === 130\n ? parsePrivateIdentifier(parser, context, privateScope, 0)\n : parseIdentifier(parser, context);\n}\nfunction parseUpdateExpressionPrefixed(parser, context, privateScope, inNew, isLHS, start) {\n if (inNew)\n parser.report(56);\n if (!isLHS)\n parser.report(0);\n const token = parser.getToken();\n nextToken(parser, context | 32);\n const arg = parseLeftHandSideExpression(parser, context, privateScope, 0, 0, 1);\n if (parser.assignable & 2) {\n parser.report(55);\n }\n parser.assignable = 2;\n return parser.finishNode({\n type: 'UpdateExpression',\n argument: arg,\n operator: KeywordDescTable[token & 255],\n prefix: true,\n }, start);\n}\nfunction parsePrimaryExpression(parser, context, privateScope, kind, inNew, canAssign, inGroup, isLHS, start) {\n if ((parser.getToken() & 143360) === 143360) {\n switch (parser.getToken()) {\n case 209006:\n return parseAwaitExpressionOrIdentifier(parser, context, privateScope, inNew, inGroup, start);\n case 241771:\n return parseYieldExpressionOrIdentifier(parser, context, privateScope, inGroup, canAssign, start);\n case 209005:\n return parseAsyncExpression(parser, context, privateScope, inGroup, isLHS, canAssign, inNew, start);\n }\n const { tokenValue } = parser;\n const token = parser.getToken();\n const expr = parseIdentifier(parser, context | 64);\n if (parser.getToken() === 10) {\n if (!isLHS)\n parser.report(0);\n classifyIdentifier(parser, context, token);\n if ((token & 36864) === 36864) {\n parser.flags |= 256;\n }\n return parseArrowFromIdentifier(parser, context, privateScope, tokenValue, expr, inNew, canAssign, 0, start);\n }\n if (context & 16 &&\n !(context & 32768) &&\n !(context & 8192) &&\n parser.tokenValue === 'arguments')\n parser.report(130);\n if ((token & 255) === (241737 & 255)) {\n if (context & 1)\n parser.report(113);\n if (kind & (8 | 16))\n parser.report(100);\n }\n parser.assignable =\n context & 1 && (token & 537079808) === 537079808\n ? 2\n : 1;\n return expr;\n }\n if ((parser.getToken() & 134217728) === 134217728) {\n return parseLiteral(parser, context);\n }\n switch (parser.getToken()) {\n case 33619993:\n case 33619994:\n return parseUpdateExpressionPrefixed(parser, context, privateScope, inNew, isLHS, start);\n case 16863276:\n case 16842798:\n case 16842799:\n case 25233968:\n case 25233969:\n case 16863275:\n case 16863277:\n return parseUnaryExpression(parser, context, privateScope, isLHS, inGroup);\n case 86104:\n return parseFunctionExpression(parser, context, privateScope, 0, inGroup, start);\n case 2162700:\n return parseObjectLiteral(parser, context, privateScope, canAssign ? 0 : 1, inGroup);\n case 69271571:\n return parseArrayLiteral(parser, context, privateScope, canAssign ? 0 : 1, inGroup);\n case 67174411:\n return parseParenthesizedExpression(parser, context | 64, privateScope, canAssign, 1, 0, start);\n case 86021:\n case 86022:\n case 86023:\n return parseNullOrTrueOrFalseLiteral(parser, context);\n case 86111:\n return parseThisExpression(parser, context);\n case 65540:\n return parseRegExpLiteral(parser, context);\n case 132:\n case 86094:\n return parseClassExpression(parser, context, privateScope, inGroup, start);\n case 86109:\n return parseSuperExpression(parser, context);\n case 67174409:\n return parseTemplateLiteral(parser, context);\n case 67174408:\n return parseTemplate(parser, context, privateScope);\n case 86107:\n return parseNewExpression(parser, context, privateScope, inGroup);\n case 134283388:\n return parseBigIntLiteral(parser, context);\n case 130:\n return parsePrivateIdentifier(parser, context, privateScope, 0);\n case 86106:\n return parseImportCallOrMetaExpression(parser, context, privateScope, inNew, inGroup, start);\n case 8456256:\n if (parser.options.jsx)\n return parseJSXRootElementOrFragment(parser, context, privateScope, 0, parser.tokenStart);\n default:\n if (isValidIdentifier(context, parser.getToken()))\n return parseIdentifierOrArrow(parser, context, privateScope);\n parser.report(30, KeywordDescTable[parser.getToken() & 255]);\n }\n}\nfunction parseImportCallOrMetaExpression(parser, context, privateScope, inNew, inGroup, start) {\n let expr = parseIdentifier(parser, context);\n if (parser.getToken() === 67108877) {\n return parseImportMetaExpression(parser, context, expr, start);\n }\n if (inNew)\n parser.report(142);\n expr = parseImportExpression(parser, context, privateScope, inGroup, start);\n parser.assignable = 2;\n return parseMemberOrUpdateExpression(parser, context, privateScope, expr, inGroup, 0, start);\n}\nfunction parseImportMetaExpression(parser, context, meta, start) {\n if ((context & 2) === 0)\n parser.report(169);\n nextToken(parser, context);\n const token = parser.getToken();\n if (token !== 209030 && parser.tokenValue !== 'meta') {\n parser.report(174);\n }\n else if (token & -2147483648) {\n parser.report(175);\n }\n parser.assignable = 2;\n return parser.finishNode({\n type: 'MetaProperty',\n meta,\n property: parseIdentifier(parser, context),\n }, start);\n}\nfunction parseImportExpression(parser, context, privateScope, inGroup, start) {\n consume(parser, context | 32, 67174411);\n if (parser.getToken() === 14)\n parser.report(143);\n const source = parseExpression(parser, context, privateScope, 1, inGroup, parser.tokenStart);\n let options = null;\n if (parser.getToken() === 18) {\n consume(parser, context, 18);\n if (parser.getToken() !== 16) {\n const expContext = (context | 131072) ^ 131072;\n options = parseExpression(parser, expContext, privateScope, 1, inGroup, parser.tokenStart);\n }\n consumeOpt(parser, context, 18);\n }\n const node = {\n type: 'ImportExpression',\n source,\n options,\n };\n consume(parser, context, 16);\n return parser.finishNode(node, start);\n}\nfunction parseImportAttributes(parser, context) {\n if (!consumeOpt(parser, context, 20579))\n return [];\n consume(parser, context, 2162700);\n const attributes = [];\n const keysContent = new Set();\n while (parser.getToken() !== 1074790415) {\n const start = parser.tokenStart;\n const key = parseIdentifierOrStringLiteral(parser, context);\n consume(parser, context, 21);\n const value = parseStringLiteral(parser, context);\n const keyContent = key.type === 'Literal' ? key.value : key.name;\n if (keysContent.has(keyContent)) {\n parser.report(145, `${keyContent}`);\n }\n keysContent.add(keyContent);\n attributes.push(parser.finishNode({\n type: 'ImportAttribute',\n key,\n value,\n }, start));\n if (parser.getToken() !== 1074790415) {\n consume(parser, context, 18);\n }\n }\n consume(parser, context, 1074790415);\n return attributes;\n}\nfunction parseStringLiteral(parser, context) {\n if (parser.getToken() === 134283267) {\n return parseLiteral(parser, context);\n }\n else {\n parser.report(30, KeywordDescTable[parser.getToken() & 255]);\n }\n}\nfunction parseIdentifierOrStringLiteral(parser, context) {\n if (parser.getToken() === 134283267) {\n return parseLiteral(parser, context);\n }\n else if (parser.getToken() & 143360) {\n return parseIdentifier(parser, context);\n }\n else {\n parser.report(30, KeywordDescTable[parser.getToken() & 255]);\n }\n}\nfunction validateStringWellFormed(parser, str) {\n const len = str.length;\n for (let i = 0; i < len; i++) {\n const code = str.charCodeAt(i);\n if ((code & 0xfc00) !== 55296)\n continue;\n if (code > 56319 || ++i >= len || (str.charCodeAt(i) & 0xfc00) !== 56320) {\n parser.report(171, JSON.stringify(str.charAt(i--)));\n }\n }\n}\nfunction parseModuleExportName(parser, context) {\n if (parser.getToken() === 134283267) {\n validateStringWellFormed(parser, parser.tokenValue);\n return parseLiteral(parser, context);\n }\n else if (parser.getToken() & 143360) {\n return parseIdentifier(parser, context);\n }\n else {\n parser.report(30, KeywordDescTable[parser.getToken() & 255]);\n }\n}\nfunction parseBigIntLiteral(parser, context) {\n const { tokenRaw, tokenValue, tokenStart } = parser;\n nextToken(parser, context);\n parser.assignable = 2;\n const node = {\n type: 'Literal',\n value: tokenValue,\n bigint: String(tokenValue),\n };\n if (parser.options.raw) {\n node.raw = tokenRaw;\n }\n return parser.finishNode(node, tokenStart);\n}\nfunction parseTemplateLiteral(parser, context) {\n parser.assignable = 2;\n const { tokenValue, tokenRaw, tokenStart } = parser;\n consume(parser, context, 67174409);\n const quasis = [parseTemplateElement(parser, tokenValue, tokenRaw, tokenStart, true)];\n return parser.finishNode({\n type: 'TemplateLiteral',\n expressions: [],\n quasis,\n }, tokenStart);\n}\nfunction parseTemplate(parser, context, privateScope) {\n context = (context | 131072) ^ 131072;\n const { tokenValue, tokenRaw, tokenStart } = parser;\n consume(parser, (context & -65) | 32, 67174408);\n const quasis = [parseTemplateElement(parser, tokenValue, tokenRaw, tokenStart, false)];\n const expressions = [\n parseExpressions(parser, context & -65, privateScope, 0, 1, parser.tokenStart),\n ];\n if (parser.getToken() !== 1074790415)\n parser.report(83);\n while (parser.setToken(scanTemplateTail(parser, context), true) !== 67174409) {\n const { tokenValue, tokenRaw, tokenStart } = parser;\n consume(parser, (context & -65) | 32, 67174408);\n quasis.push(parseTemplateElement(parser, tokenValue, tokenRaw, tokenStart, false));\n expressions.push(parseExpressions(parser, context, privateScope, 0, 1, parser.tokenStart));\n if (parser.getToken() !== 1074790415)\n parser.report(83);\n }\n {\n const { tokenValue, tokenRaw, tokenStart } = parser;\n consume(parser, context, 67174409);\n quasis.push(parseTemplateElement(parser, tokenValue, tokenRaw, tokenStart, true));\n }\n return parser.finishNode({\n type: 'TemplateLiteral',\n expressions,\n quasis,\n }, tokenStart);\n}\nfunction parseTemplateElement(parser, cooked, raw, start, tail) {\n const node = parser.finishNode({\n type: 'TemplateElement',\n value: {\n cooked,\n raw,\n },\n tail,\n }, start);\n const tailSize = tail ? 1 : 2;\n if (parser.options.ranges) {\n node.start += 1;\n node.range[0] += 1;\n node.end -= tailSize;\n node.range[1] -= tailSize;\n }\n if (parser.options.loc) {\n node.loc.start.column += 1;\n node.loc.end.column -= tailSize;\n }\n return node;\n}\nfunction parseSpreadElement(parser, context, privateScope) {\n const start = parser.tokenStart;\n context = (context | 131072) ^ 131072;\n consume(parser, context | 32, 14);\n const argument = parseExpression(parser, context, privateScope, 1, 0, parser.tokenStart);\n parser.assignable = 1;\n return parser.finishNode({\n type: 'SpreadElement',\n argument,\n }, start);\n}\nfunction parseArguments(parser, context, privateScope, inGroup) {\n nextToken(parser, context | 32);\n const args = [];\n if (parser.getToken() === 16) {\n nextToken(parser, context | 64);\n return args;\n }\n while (parser.getToken() !== 16) {\n if (parser.getToken() === 14) {\n args.push(parseSpreadElement(parser, context, privateScope));\n }\n else {\n args.push(parseExpression(parser, context, privateScope, 1, inGroup, parser.tokenStart));\n }\n if (parser.getToken() !== 18)\n break;\n nextToken(parser, context | 32);\n if (parser.getToken() === 16)\n break;\n }\n consume(parser, context | 64, 16);\n return args;\n}\nfunction parseIdentifier(parser, context) {\n const { tokenValue, tokenStart } = parser;\n const allowRegex = tokenValue === 'await' && (parser.getToken() & -2147483648) === 0;\n nextToken(parser, context | (allowRegex ? 32 : 0));\n return parser.finishNode({\n type: 'Identifier',\n name: tokenValue,\n }, tokenStart);\n}\nfunction parseLiteral(parser, context) {\n const { tokenValue, tokenRaw, tokenStart } = parser;\n if (parser.getToken() === 134283388) {\n return parseBigIntLiteral(parser, context);\n }\n nextToken(parser, context);\n parser.assignable = 2;\n return parser.finishNode(parser.options.raw\n ? {\n type: 'Literal',\n value: tokenValue,\n raw: tokenRaw,\n }\n : {\n type: 'Literal',\n value: tokenValue,\n }, tokenStart);\n}\nfunction parseNullOrTrueOrFalseLiteral(parser, context) {\n const start = parser.tokenStart;\n const raw = KeywordDescTable[parser.getToken() & 255];\n const value = parser.getToken() === 86023 ? null : raw === 'true';\n nextToken(parser, context);\n parser.assignable = 2;\n return parser.finishNode(parser.options.raw\n ? {\n type: 'Literal',\n value,\n raw,\n }\n : {\n type: 'Literal',\n value,\n }, start);\n}\nfunction parseThisExpression(parser, context) {\n const { tokenStart } = parser;\n nextToken(parser, context);\n parser.assignable = 2;\n return parser.finishNode({\n type: 'ThisExpression',\n }, tokenStart);\n}\nfunction parseFunctionDeclaration(parser, context, scope, privateScope, origin, allowGen, flags, isAsync, start) {\n nextToken(parser, context | 32);\n const isGenerator = allowGen ? optionalBit(parser, context, 8391476) : 0;\n let id = null;\n let funcNameToken;\n let functionScope = scope ? parser.createScope() : void 0;\n if (parser.getToken() === 67174411) {\n if ((flags & 1) === 0)\n parser.report(39, 'Function');\n }\n else {\n const kind = origin & 4 && ((context & 8) === 0 || (context & 2) === 0)\n ? 4\n : 64 | (isAsync ? 1024 : 0) | (isGenerator ? 1024 : 0);\n validateFunctionName(parser, context, parser.getToken());\n if (scope) {\n if (kind & 4) {\n scope.addVarName(context, parser.tokenValue, kind);\n }\n else {\n scope.addBlockName(context, parser.tokenValue, kind, origin);\n }\n functionScope = functionScope?.createChildScope(128);\n if (flags) {\n if (flags & 2) {\n parser.declareUnboundVariable(parser.tokenValue);\n }\n }\n }\n funcNameToken = parser.getToken();\n if (parser.getToken() & 143360) {\n id = parseIdentifier(parser, context);\n }\n else {\n parser.report(30, KeywordDescTable[parser.getToken() & 255]);\n }\n }\n {\n const modifierFlags = 256 |\n 512 |\n 1024 |\n 2048 |\n 8192 |\n 16384;\n context =\n ((context | modifierFlags) ^ modifierFlags) |\n 65536 |\n (isAsync ? 2048 : 0) |\n (isGenerator ? 1024 : 0) |\n (isGenerator ? 0 : 262144);\n }\n functionScope = functionScope?.createChildScope(256);\n const params = parseFormalParametersOrFormalList(parser, (context | 8192) & -524289, functionScope, privateScope, 0, 1);\n const modifierFlags = 8 | 4 | 128 | 524288;\n const body = parseFunctionBody(parser, ((context | modifierFlags) ^ modifierFlags) | 32768 | 4096, functionScope?.createChildScope(64), privateScope, 8, funcNameToken, functionScope);\n return parser.finishNode({\n type: 'FunctionDeclaration',\n id,\n params,\n body,\n async: isAsync === 1,\n generator: isGenerator === 1,\n }, start);\n}\nfunction parseFunctionExpression(parser, context, privateScope, isAsync, inGroup, start) {\n nextToken(parser, context | 32);\n const isGenerator = optionalBit(parser, context, 8391476);\n const generatorAndAsyncFlags = (isAsync ? 2048 : 0) | (isGenerator ? 1024 : 0);\n let id = null;\n let funcNameToken;\n let scope = parser.createScopeIfLexical();\n const modifierFlags = 256 |\n 512 |\n 1024 |\n 2048 |\n 8192 |\n 16384 |\n 524288;\n if (parser.getToken() & 143360) {\n validateFunctionName(parser, ((context | modifierFlags) ^ modifierFlags) | generatorAndAsyncFlags, parser.getToken());\n scope = scope?.createChildScope(128);\n funcNameToken = parser.getToken();\n id = parseIdentifier(parser, context);\n }\n context =\n ((context | modifierFlags) ^ modifierFlags) |\n 65536 |\n generatorAndAsyncFlags |\n (isGenerator ? 0 : 262144);\n scope = scope?.createChildScope(256);\n const params = parseFormalParametersOrFormalList(parser, (context | 8192) & -524289, scope, privateScope, inGroup, 1);\n const body = parseFunctionBody(parser, (context & -131229) |\n 32768 |\n 4096, scope?.createChildScope(64), privateScope, 0, funcNameToken, scope);\n parser.assignable = 2;\n return parser.finishNode({\n type: 'FunctionExpression',\n id,\n params,\n body,\n async: isAsync === 1,\n generator: isGenerator === 1,\n }, start);\n}\nfunction parseArrayLiteral(parser, context, privateScope, skipInitializer, inGroup) {\n const expr = parseArrayExpressionOrPattern(parser, context, void 0, privateScope, skipInitializer, inGroup, 0, 2, 0);\n if (parser.destructible & 64) {\n parser.report(63);\n }\n if (parser.destructible & 8) {\n parser.report(62);\n }\n return expr;\n}\nfunction parseArrayExpressionOrPattern(parser, context, scope, privateScope, skipInitializer, inGroup, isPattern, kind, origin) {\n const { tokenStart: start } = parser;\n nextToken(parser, context | 32);\n const elements = [];\n let destructible = 0;\n context = (context | 131072) ^ 131072;\n while (parser.getToken() !== 20) {\n if (consumeOpt(parser, context | 32, 18)) {\n elements.push(null);\n }\n else {\n let left;\n const { tokenStart, tokenValue } = parser;\n const token = parser.getToken();\n if (token & 143360) {\n left = parsePrimaryExpression(parser, context, privateScope, kind, 0, 1, inGroup, 1, tokenStart);\n if (parser.getToken() === 1077936155) {\n if (parser.assignable & 2)\n parser.report(26);\n nextToken(parser, context | 32);\n scope?.addVarOrBlock(context, tokenValue, kind, origin);\n const right = parseExpression(parser, context, privateScope, 1, inGroup, parser.tokenStart);\n left = parser.finishNode(isPattern\n ? {\n type: 'AssignmentPattern',\n left,\n right,\n }\n : {\n type: 'AssignmentExpression',\n operator: '=',\n left,\n right,\n }, tokenStart);\n destructible |=\n parser.destructible & 256\n ? 256\n : 0 | (parser.destructible & 128)\n ? 128\n : 0;\n }\n else if (parser.getToken() === 18 || parser.getToken() === 20) {\n if (parser.assignable & 2) {\n destructible |= 16;\n }\n else {\n scope?.addVarOrBlock(context, tokenValue, kind, origin);\n }\n destructible |=\n parser.destructible & 256\n ? 256\n : 0 | (parser.destructible & 128)\n ? 128\n : 0;\n }\n else {\n destructible |=\n kind & 1\n ? 32\n : (kind & 2) === 0\n ? 16\n : 0;\n left = parseMemberOrUpdateExpression(parser, context, privateScope, left, inGroup, 0, tokenStart);\n if (parser.getToken() !== 18 && parser.getToken() !== 20) {\n if (parser.getToken() !== 1077936155)\n destructible |= 16;\n left = parseAssignmentExpression(parser, context, privateScope, inGroup, isPattern, tokenStart, left);\n }\n else if (parser.getToken() !== 1077936155) {\n destructible |=\n parser.assignable & 2\n ? 16\n : 32;\n }\n }\n }\n else if (token & 2097152) {\n left =\n parser.getToken() === 2162700\n ? parseObjectLiteralOrPattern(parser, context, scope, privateScope, 0, inGroup, isPattern, kind, origin)\n : parseArrayExpressionOrPattern(parser, context, scope, privateScope, 0, inGroup, isPattern, kind, origin);\n destructible |= parser.destructible;\n parser.assignable =\n parser.destructible & 16\n ? 2\n : 1;\n if (parser.getToken() === 18 || parser.getToken() === 20) {\n if (parser.assignable & 2) {\n destructible |= 16;\n }\n }\n else if (parser.destructible & 8) {\n parser.report(71);\n }\n else {\n left = parseMemberOrUpdateExpression(parser, context, privateScope, left, inGroup, 0, tokenStart);\n destructible = parser.assignable & 2 ? 16 : 0;\n if (parser.getToken() !== 18 && parser.getToken() !== 20) {\n left = parseAssignmentExpression(parser, context, privateScope, inGroup, isPattern, tokenStart, left);\n }\n else if (parser.getToken() !== 1077936155) {\n destructible |=\n parser.assignable & 2\n ? 16\n : 32;\n }\n }\n }\n else if (token === 14) {\n left = parseSpreadOrRestElement(parser, context, scope, privateScope, 20, kind, origin, 0, inGroup, isPattern);\n destructible |= parser.destructible;\n if (parser.getToken() !== 18 && parser.getToken() !== 20)\n parser.report(30, KeywordDescTable[parser.getToken() & 255]);\n }\n else {\n left = parseLeftHandSideExpression(parser, context, privateScope, 1, 0, 1);\n if (parser.getToken() !== 18 && parser.getToken() !== 20) {\n left = parseAssignmentExpression(parser, context, privateScope, inGroup, isPattern, tokenStart, left);\n if ((kind & (2 | 1)) === 0 && token === 67174411)\n destructible |= 16;\n }\n else if (parser.assignable & 2) {\n destructible |= 16;\n }\n else if (token === 67174411) {\n destructible |=\n parser.assignable & 1 && kind & (2 | 1)\n ? 32\n : 16;\n }\n }\n elements.push(left);\n if (consumeOpt(parser, context | 32, 18)) {\n if (parser.getToken() === 20)\n break;\n }\n else\n break;\n }\n }\n consume(parser, context, 20);\n const node = parser.finishNode({\n type: isPattern ? 'ArrayPattern' : 'ArrayExpression',\n elements,\n }, start);\n if (!skipInitializer && parser.getToken() & 4194304) {\n return parseArrayOrObjectAssignmentPattern(parser, context, privateScope, destructible, inGroup, isPattern, start, node);\n }\n parser.destructible = destructible;\n return node;\n}\nfunction parseArrayOrObjectAssignmentPattern(parser, context, privateScope, destructible, inGroup, isPattern, start, node) {\n if (parser.getToken() !== 1077936155)\n parser.report(26);\n nextToken(parser, context | 32);\n if (destructible & 16)\n parser.report(26);\n if (!isPattern)\n reinterpretToPattern(parser, node);\n const { tokenStart } = parser;\n const right = parseExpression(parser, context, privateScope, 1, inGroup, tokenStart);\n parser.destructible =\n ((destructible | 64 | 8) ^\n (8 | 64)) |\n (parser.destructible & 128 ? 128 : 0) |\n (parser.destructible & 256 ? 256 : 0);\n return parser.finishNode(isPattern\n ? {\n type: 'AssignmentPattern',\n left: node,\n right,\n }\n : {\n type: 'AssignmentExpression',\n left: node,\n operator: '=',\n right,\n }, start);\n}\nfunction parseSpreadOrRestElement(parser, context, scope, privateScope, closingToken, kind, origin, isAsync, inGroup, isPattern) {\n const { tokenStart: start } = parser;\n nextToken(parser, context | 32);\n let argument = null;\n let destructible = 0;\n const { tokenValue, tokenStart } = parser;\n let token = parser.getToken();\n if (token & 143360) {\n parser.assignable = 1;\n argument = parsePrimaryExpression(parser, context, privateScope, kind, 0, 1, inGroup, 1, tokenStart);\n token = parser.getToken();\n argument = parseMemberOrUpdateExpression(parser, context, privateScope, argument, inGroup, 0, tokenStart);\n if (parser.getToken() !== 18 && parser.getToken() !== closingToken) {\n if (parser.assignable & 2 && parser.getToken() === 1077936155)\n parser.report(71);\n destructible |= 16;\n argument = parseAssignmentExpression(parser, context, privateScope, inGroup, isPattern, tokenStart, argument);\n }\n if (parser.assignable & 2) {\n destructible |= 16;\n }\n else if (token === closingToken || token === 18) {\n scope?.addVarOrBlock(context, tokenValue, kind, origin);\n }\n else {\n destructible |= 32;\n }\n destructible |= parser.destructible & 128 ? 128 : 0;\n }\n else if (token === closingToken) {\n parser.report(41);\n }\n else if (token & 2097152) {\n argument =\n parser.getToken() === 2162700\n ? parseObjectLiteralOrPattern(parser, context, scope, privateScope, 1, inGroup, isPattern, kind, origin)\n : parseArrayExpressionOrPattern(parser, context, scope, privateScope, 1, inGroup, isPattern, kind, origin);\n token = parser.getToken();\n if (token !== 1077936155 && token !== closingToken && token !== 18) {\n if (parser.destructible & 8)\n parser.report(71);\n argument = parseMemberOrUpdateExpression(parser, context, privateScope, argument, inGroup, 0, tokenStart);\n destructible |= parser.assignable & 2 ? 16 : 0;\n if ((parser.getToken() & 4194304) === 4194304) {\n if (parser.getToken() !== 1077936155)\n destructible |= 16;\n argument = parseAssignmentExpression(parser, context, privateScope, inGroup, isPattern, tokenStart, argument);\n }\n else {\n if ((parser.getToken() & 8388608) === 8388608) {\n argument = parseBinaryExpression(parser, context, privateScope, 1, tokenStart, 4, token, argument);\n }\n if (consumeOpt(parser, context | 32, 22)) {\n argument = parseConditionalExpression(parser, context, privateScope, argument, tokenStart);\n }\n destructible |=\n parser.assignable & 2\n ? 16\n : 32;\n }\n }\n else {\n destructible |=\n closingToken === 1074790415 && token !== 1077936155\n ? 16\n : parser.destructible;\n }\n }\n else {\n destructible |= 32;\n argument = parseLeftHandSideExpression(parser, context, privateScope, 1, inGroup, 1);\n const { tokenStart } = parser;\n const token = parser.getToken();\n if (token === 1077936155) {\n if (parser.assignable & 2)\n parser.report(26);\n argument = parseAssignmentExpression(parser, context, privateScope, inGroup, isPattern, tokenStart, argument);\n destructible |= 16;\n }\n else {\n if (token === 18) {\n destructible |= 16;\n }\n else if (token !== closingToken) {\n argument = parseAssignmentExpression(parser, context, privateScope, inGroup, isPattern, tokenStart, argument);\n }\n destructible |=\n parser.assignable & 1 ? 32 : 16;\n }\n parser.destructible = destructible;\n if (parser.getToken() !== closingToken && parser.getToken() !== 18)\n parser.report(161);\n return parser.finishNode({\n type: isPattern ? 'RestElement' : 'SpreadElement',\n argument: argument,\n }, start);\n }\n if (parser.getToken() !== closingToken) {\n if (kind & 1)\n destructible |= isAsync ? 16 : 32;\n if (consumeOpt(parser, context | 32, 1077936155)) {\n if (destructible & 16)\n parser.report(26);\n reinterpretToPattern(parser, argument);\n const right = parseExpression(parser, context, privateScope, 1, inGroup, parser.tokenStart);\n argument = parser.finishNode(isPattern\n ? {\n type: 'AssignmentPattern',\n left: argument,\n right,\n }\n : {\n type: 'AssignmentExpression',\n left: argument,\n operator: '=',\n right,\n }, tokenStart);\n destructible = 16;\n }\n else {\n destructible |= 16;\n }\n }\n parser.destructible = destructible;\n return parser.finishNode({\n type: isPattern ? 'RestElement' : 'SpreadElement',\n argument: argument,\n }, start);\n}\nfunction parseMethodDefinition(parser, context, privateScope, kind, inGroup, start) {\n const modifierFlags = 1024 |\n 2048 |\n 8192 |\n ((kind & 64) === 0 ? 512 | 16384 : 0);\n context =\n ((context | modifierFlags) ^ modifierFlags) |\n (kind & 8 ? 1024 : 0) |\n (kind & 16 ? 2048 : 0) |\n (kind & 64 ? 16384 : 0) |\n 256 |\n 32768 |\n 65536;\n let scope = parser.createScopeIfLexical(256);\n const params = parseMethodFormals(parser, (context | 8192) & -524289, scope, privateScope, kind, 1, inGroup);\n scope = scope?.createChildScope(64);\n const body = parseFunctionBody(parser, (context & -655373) |\n 32768 |\n 4096, scope, privateScope, 0, void 0, scope?.parent);\n return parser.finishNode({\n type: 'FunctionExpression',\n params,\n body,\n async: (kind & 16) > 0,\n generator: (kind & 8) > 0,\n id: null,\n }, start);\n}\nfunction parseObjectLiteral(parser, context, privateScope, skipInitializer, inGroup) {\n const expr = parseObjectLiteralOrPattern(parser, context, void 0, privateScope, skipInitializer, inGroup, 0, 2, 0);\n if (parser.destructible & 64) {\n parser.report(63);\n }\n if (parser.destructible & 8) {\n parser.report(62);\n }\n return expr;\n}\nfunction parseObjectLiteralOrPattern(parser, context, scope, privateScope, skipInitializer, inGroup, isPattern, kind, origin) {\n const { tokenStart: start } = parser;\n nextToken(parser, context);\n const properties = [];\n let destructible = 0;\n let prototypeCount = 0;\n context = (context | 131072) ^ 131072;\n while (parser.getToken() !== 1074790415) {\n const { tokenValue, tokenStart } = parser;\n const token = parser.getToken();\n if (token === 14) {\n properties.push(parseSpreadOrRestElement(parser, context, scope, privateScope, 1074790415, kind, origin, 0, inGroup, isPattern));\n }\n else {\n let state = 0;\n let key = null;\n let value;\n if (parser.getToken() & 143360 ||\n parser.getToken() === -2147483528 ||\n parser.getToken() === -2147483527) {\n if (parser.getToken() === -2147483527)\n destructible |= 16;\n key = parseIdentifier(parser, context);\n if (parser.getToken() === 18 ||\n parser.getToken() === 1074790415 ||\n parser.getToken() === 1077936155) {\n state |= 4;\n if (context & 1 && (token & 537079808) === 537079808) {\n destructible |= 16;\n }\n else {\n validateBindingIdentifier(parser, context, kind, token, 0);\n }\n scope?.addVarOrBlock(context, tokenValue, kind, origin);\n if (consumeOpt(parser, context | 32, 1077936155)) {\n destructible |= 8;\n const right = parseExpression(parser, context, privateScope, 1, inGroup, parser.tokenStart);\n destructible |=\n parser.destructible & 256\n ? 256\n : 0 | (parser.destructible & 128)\n ? 128\n : 0;\n value = parser.finishNode({\n type: 'AssignmentPattern',\n left: parser.options.uniqueKeyInPattern ? Object.assign({}, key) : key,\n right,\n }, tokenStart);\n }\n else {\n destructible |=\n (token === 209006 ? 128 : 0) |\n (token === -2147483528 ? 16 : 0);\n value = parser.options.uniqueKeyInPattern ? Object.assign({}, key) : key;\n }\n }\n else if (consumeOpt(parser, context | 32, 21)) {\n const { tokenStart } = parser;\n if (tokenValue === '__proto__')\n prototypeCount++;\n if (parser.getToken() & 143360) {\n const tokenAfterColon = parser.getToken();\n const valueAfterColon = parser.tokenValue;\n value = parsePrimaryExpression(parser, context, privateScope, kind, 0, 1, inGroup, 1, tokenStart);\n const token = parser.getToken();\n value = parseMemberOrUpdateExpression(parser, context, privateScope, value, inGroup, 0, tokenStart);\n if (parser.getToken() === 18 || parser.getToken() === 1074790415) {\n if (token === 1077936155 || token === 1074790415 || token === 18) {\n destructible |= parser.destructible & 128 ? 128 : 0;\n if (parser.assignable & 2) {\n destructible |= 16;\n }\n else if ((tokenAfterColon & 143360) === 143360) {\n scope?.addVarOrBlock(context, valueAfterColon, kind, origin);\n }\n }\n else {\n destructible |=\n parser.assignable & 1\n ? 32\n : 16;\n }\n }\n else if ((parser.getToken() & 4194304) === 4194304) {\n if (parser.assignable & 2) {\n destructible |= 16;\n }\n else if (token !== 1077936155) {\n destructible |= 32;\n }\n else {\n scope?.addVarOrBlock(context, valueAfterColon, kind, origin);\n }\n value = parseAssignmentExpression(parser, context, privateScope, inGroup, isPattern, tokenStart, value);\n }\n else {\n destructible |= 16;\n if ((parser.getToken() & 8388608) === 8388608) {\n value = parseBinaryExpression(parser, context, privateScope, 1, tokenStart, 4, token, value);\n }\n if (consumeOpt(parser, context | 32, 22)) {\n value = parseConditionalExpression(parser, context, privateScope, value, tokenStart);\n }\n }\n }\n else if ((parser.getToken() & 2097152) === 2097152) {\n value =\n parser.getToken() === 69271571\n ? parseArrayExpressionOrPattern(parser, context, scope, privateScope, 0, inGroup, isPattern, kind, origin)\n : parseObjectLiteralOrPattern(parser, context, scope, privateScope, 0, inGroup, isPattern, kind, origin);\n destructible = parser.destructible;\n parser.assignable =\n destructible & 16 ? 2 : 1;\n if (parser.getToken() === 18 || parser.getToken() === 1074790415) {\n if (parser.assignable & 2)\n destructible |= 16;\n }\n else if (parser.destructible & 8) {\n parser.report(71);\n }\n else {\n value = parseMemberOrUpdateExpression(parser, context, privateScope, value, inGroup, 0, tokenStart);\n destructible = parser.assignable & 2 ? 16 : 0;\n if ((parser.getToken() & 4194304) === 4194304) {\n value = parseAssignmentExpressionOrPattern(parser, context, privateScope, inGroup, isPattern, tokenStart, value);\n }\n else {\n if ((parser.getToken() & 8388608) === 8388608) {\n value = parseBinaryExpression(parser, context, privateScope, 1, tokenStart, 4, token, value);\n }\n if (consumeOpt(parser, context | 32, 22)) {\n value = parseConditionalExpression(parser, context, privateScope, value, tokenStart);\n }\n destructible |=\n parser.assignable & 2\n ? 16\n : 32;\n }\n }\n }\n else {\n value = parseLeftHandSideExpression(parser, context, privateScope, 1, inGroup, 1);\n destructible |=\n parser.assignable & 1\n ? 32\n : 16;\n if (parser.getToken() === 18 || parser.getToken() === 1074790415) {\n if (parser.assignable & 2)\n destructible |= 16;\n }\n else {\n value = parseMemberOrUpdateExpression(parser, context, privateScope, value, inGroup, 0, tokenStart);\n destructible = parser.assignable & 2 ? 16 : 0;\n if (parser.getToken() !== 18 && token !== 1074790415) {\n if (parser.getToken() !== 1077936155)\n destructible |= 16;\n value = parseAssignmentExpression(parser, context, privateScope, inGroup, isPattern, tokenStart, value);\n }\n }\n }\n }\n else if (parser.getToken() === 69271571) {\n destructible |= 16;\n if (token === 209005)\n state |= 16;\n state |=\n (token === 209008\n ? 256\n : token === 209009\n ? 512\n : 1) | 2;\n key = parseComputedPropertyName(parser, context, privateScope, inGroup);\n destructible |= parser.assignable;\n value = parseMethodDefinition(parser, context, privateScope, state, inGroup, parser.tokenStart);\n }\n else if (parser.getToken() & 143360) {\n destructible |= 16;\n if (token === -2147483528)\n parser.report(95);\n if (token === 209005) {\n if (parser.flags & 1)\n parser.report(132);\n state |= 16 | 1;\n }\n else if (token === 209008) {\n state |= 256;\n }\n else if (token === 209009) {\n state |= 512;\n }\n else {\n parser.report(0);\n }\n key = parseIdentifier(parser, context);\n value = parseMethodDefinition(parser, context, privateScope, state, inGroup, parser.tokenStart);\n }\n else if (parser.getToken() === 67174411) {\n destructible |= 16;\n state |= 1;\n value = parseMethodDefinition(parser, context, privateScope, state, inGroup, parser.tokenStart);\n }\n else if (parser.getToken() === 8391476) {\n destructible |= 16;\n if (token === 209008) {\n parser.report(42);\n }\n else if (token === 209009) {\n parser.report(43);\n }\n else if (token !== 209005) {\n parser.report(30, KeywordDescTable[8391476 & 255]);\n }\n nextToken(parser, context);\n state |=\n 8 | 1 | (token === 209005 ? 16 : 0);\n if (parser.getToken() & 143360) {\n key = parseIdentifier(parser, context);\n }\n else if ((parser.getToken() & 134217728) === 134217728) {\n key = parseLiteral(parser, context);\n }\n else if (parser.getToken() === 69271571) {\n state |= 2;\n key = parseComputedPropertyName(parser, context, privateScope, inGroup);\n destructible |= parser.assignable;\n }\n else {\n parser.report(30, KeywordDescTable[parser.getToken() & 255]);\n }\n value = parseMethodDefinition(parser, context, privateScope, state, inGroup, parser.tokenStart);\n }\n else if ((parser.getToken() & 134217728) === 134217728) {\n if (token === 209005)\n state |= 16;\n state |=\n token === 209008\n ? 256\n : token === 209009\n ? 512\n : 1;\n destructible |= 16;\n key = parseLiteral(parser, context);\n value = parseMethodDefinition(parser, context, privateScope, state, inGroup, parser.tokenStart);\n }\n else {\n parser.report(133);\n }\n }\n else if ((parser.getToken() & 134217728) === 134217728) {\n key = parseLiteral(parser, context);\n if (parser.getToken() === 21) {\n consume(parser, context | 32, 21);\n const { tokenStart } = parser;\n if (tokenValue === '__proto__')\n prototypeCount++;\n if (parser.getToken() & 143360) {\n value = parsePrimaryExpression(parser, context, privateScope, kind, 0, 1, inGroup, 1, tokenStart);\n const { tokenValue: valueAfterColon } = parser;\n const token = parser.getToken();\n value = parseMemberOrUpdateExpression(parser, context, privateScope, value, inGroup, 0, tokenStart);\n if (parser.getToken() === 18 || parser.getToken() === 1074790415) {\n if (token === 1077936155 || token === 1074790415 || token === 18) {\n if (parser.assignable & 2) {\n destructible |= 16;\n }\n else {\n scope?.addVarOrBlock(context, valueAfterColon, kind, origin);\n }\n }\n else {\n destructible |=\n parser.assignable & 1\n ? 32\n : 16;\n }\n }\n else if (parser.getToken() === 1077936155) {\n if (parser.assignable & 2)\n destructible |= 16;\n value = parseAssignmentExpression(parser, context, privateScope, inGroup, isPattern, tokenStart, value);\n }\n else {\n destructible |= 16;\n value = parseAssignmentExpression(parser, context, privateScope, inGroup, isPattern, tokenStart, value);\n }\n }\n else if ((parser.getToken() & 2097152) === 2097152) {\n value =\n parser.getToken() === 69271571\n ? parseArrayExpressionOrPattern(parser, context, scope, privateScope, 0, inGroup, isPattern, kind, origin)\n : parseObjectLiteralOrPattern(parser, context, scope, privateScope, 0, inGroup, isPattern, kind, origin);\n destructible = parser.destructible;\n parser.assignable =\n destructible & 16 ? 2 : 1;\n if (parser.getToken() === 18 || parser.getToken() === 1074790415) {\n if (parser.assignable & 2) {\n destructible |= 16;\n }\n }\n else if ((parser.destructible & 8) !== 8) {\n value = parseMemberOrUpdateExpression(parser, context, privateScope, value, inGroup, 0, tokenStart);\n destructible = parser.assignable & 2 ? 16 : 0;\n if ((parser.getToken() & 4194304) === 4194304) {\n value = parseAssignmentExpressionOrPattern(parser, context, privateScope, inGroup, isPattern, tokenStart, value);\n }\n else {\n if ((parser.getToken() & 8388608) === 8388608) {\n value = parseBinaryExpression(parser, context, privateScope, 1, tokenStart, 4, token, value);\n }\n if (consumeOpt(parser, context | 32, 22)) {\n value = parseConditionalExpression(parser, context, privateScope, value, tokenStart);\n }\n destructible |=\n parser.assignable & 2\n ? 16\n : 32;\n }\n }\n }\n else {\n value = parseLeftHandSideExpression(parser, context, privateScope, 1, 0, 1);\n destructible |=\n parser.assignable & 1\n ? 32\n : 16;\n if (parser.getToken() === 18 || parser.getToken() === 1074790415) {\n if (parser.assignable & 2) {\n destructible |= 16;\n }\n }\n else {\n value = parseMemberOrUpdateExpression(parser, context, privateScope, value, inGroup, 0, tokenStart);\n destructible = parser.assignable & 1 ? 0 : 16;\n if (parser.getToken() !== 18 && parser.getToken() !== 1074790415) {\n if (parser.getToken() !== 1077936155)\n destructible |= 16;\n value = parseAssignmentExpression(parser, context, privateScope, inGroup, isPattern, tokenStart, value);\n }\n }\n }\n }\n else if (parser.getToken() === 67174411) {\n state |= 1;\n value = parseMethodDefinition(parser, context, privateScope, state, inGroup, parser.tokenStart);\n destructible = parser.assignable | 16;\n }\n else {\n parser.report(134);\n }\n }\n else if (parser.getToken() === 69271571) {\n key = parseComputedPropertyName(parser, context, privateScope, inGroup);\n destructible |= parser.destructible & 256 ? 256 : 0;\n state |= 2;\n if (parser.getToken() === 21) {\n nextToken(parser, context | 32);\n const { tokenStart, tokenValue } = parser;\n const tokenAfterColon = parser.getToken();\n if (parser.getToken() & 143360) {\n value = parsePrimaryExpression(parser, context, privateScope, kind, 0, 1, inGroup, 1, tokenStart);\n const token = parser.getToken();\n value = parseMemberOrUpdateExpression(parser, context, privateScope, value, inGroup, 0, tokenStart);\n if ((parser.getToken() & 4194304) === 4194304) {\n destructible |=\n parser.assignable & 2\n ? 16\n : token === 1077936155\n ? 0\n : 32;\n value = parseAssignmentExpressionOrPattern(parser, context, privateScope, inGroup, isPattern, tokenStart, value);\n }\n else if (parser.getToken() === 18 || parser.getToken() === 1074790415) {\n if (token === 1077936155 || token === 1074790415 || token === 18) {\n if (parser.assignable & 2) {\n destructible |= 16;\n }\n else if ((tokenAfterColon & 143360) === 143360) {\n scope?.addVarOrBlock(context, tokenValue, kind, origin);\n }\n }\n else {\n destructible |=\n parser.assignable & 1\n ? 32\n : 16;\n }\n }\n else {\n destructible |= 16;\n value = parseAssignmentExpression(parser, context, privateScope, inGroup, isPattern, tokenStart, value);\n }\n }\n else if ((parser.getToken() & 2097152) === 2097152) {\n value =\n parser.getToken() === 69271571\n ? parseArrayExpressionOrPattern(parser, context, scope, privateScope, 0, inGroup, isPattern, kind, origin)\n : parseObjectLiteralOrPattern(parser, context, scope, privateScope, 0, inGroup, isPattern, kind, origin);\n destructible = parser.destructible;\n parser.assignable =\n destructible & 16 ? 2 : 1;\n if (parser.getToken() === 18 || parser.getToken() === 1074790415) {\n if (parser.assignable & 2)\n destructible |= 16;\n }\n else if (destructible & 8) {\n parser.report(62);\n }\n else {\n value = parseMemberOrUpdateExpression(parser, context, privateScope, value, inGroup, 0, tokenStart);\n destructible =\n parser.assignable & 2 ? destructible | 16 : 0;\n if ((parser.getToken() & 4194304) === 4194304) {\n if (parser.getToken() !== 1077936155)\n destructible |= 16;\n value = parseAssignmentExpressionOrPattern(parser, context, privateScope, inGroup, isPattern, tokenStart, value);\n }\n else {\n if ((parser.getToken() & 8388608) === 8388608) {\n value = parseBinaryExpression(parser, context, privateScope, 1, tokenStart, 4, token, value);\n }\n if (consumeOpt(parser, context | 32, 22)) {\n value = parseConditionalExpression(parser, context, privateScope, value, tokenStart);\n }\n destructible |=\n parser.assignable & 2\n ? 16\n : 32;\n }\n }\n }\n else {\n value = parseLeftHandSideExpression(parser, context, privateScope, 1, 0, 1);\n destructible |=\n parser.assignable & 1\n ? 32\n : 16;\n if (parser.getToken() === 18 || parser.getToken() === 1074790415) {\n if (parser.assignable & 2)\n destructible |= 16;\n }\n else {\n value = parseMemberOrUpdateExpression(parser, context, privateScope, value, inGroup, 0, tokenStart);\n destructible = parser.assignable & 1 ? 0 : 16;\n if (parser.getToken() !== 18 && parser.getToken() !== 1074790415) {\n if (parser.getToken() !== 1077936155)\n destructible |= 16;\n value = parseAssignmentExpression(parser, context, privateScope, inGroup, isPattern, tokenStart, value);\n }\n }\n }\n }\n else if (parser.getToken() === 67174411) {\n state |= 1;\n value = parseMethodDefinition(parser, context, privateScope, state, inGroup, parser.tokenStart);\n destructible = 16;\n }\n else {\n parser.report(44);\n }\n }\n else if (token === 8391476) {\n consume(parser, context | 32, 8391476);\n state |= 8;\n if (parser.getToken() & 143360) {\n const token = parser.getToken();\n key = parseIdentifier(parser, context);\n state |= 1;\n if (parser.getToken() === 67174411) {\n destructible |= 16;\n value = parseMethodDefinition(parser, context, privateScope, state, inGroup, parser.tokenStart);\n }\n else {\n throw new ParseError(parser.tokenStart, parser.currentLocation, token === 209005\n ? 46\n : token === 209008 || parser.getToken() === 209009\n ? 45\n : 47, KeywordDescTable[token & 255]);\n }\n }\n else if ((parser.getToken() & 134217728) === 134217728) {\n destructible |= 16;\n key = parseLiteral(parser, context);\n state |= 1;\n value = parseMethodDefinition(parser, context, privateScope, state, inGroup, parser.tokenStart);\n }\n else if (parser.getToken() === 69271571) {\n destructible |= 16;\n state |= 2 | 1;\n key = parseComputedPropertyName(parser, context, privateScope, inGroup);\n value = parseMethodDefinition(parser, context, privateScope, state, inGroup, parser.tokenStart);\n }\n else {\n parser.report(126);\n }\n }\n else {\n parser.report(30, KeywordDescTable[token & 255]);\n }\n destructible |= parser.destructible & 128 ? 128 : 0;\n parser.destructible = destructible;\n properties.push(parser.finishNode({\n type: 'Property',\n key: key,\n value,\n kind: !(state & 768) ? 'init' : state & 512 ? 'set' : 'get',\n computed: (state & 2) > 0,\n method: (state & 1) > 0,\n shorthand: (state & 4) > 0,\n }, tokenStart));\n }\n destructible |= parser.destructible;\n if (parser.getToken() !== 18)\n break;\n nextToken(parser, context);\n }\n consume(parser, context, 1074790415);\n if (prototypeCount > 1)\n destructible |= 64;\n const node = parser.finishNode({\n type: isPattern ? 'ObjectPattern' : 'ObjectExpression',\n properties,\n }, start);\n if (!skipInitializer && parser.getToken() & 4194304) {\n return parseArrayOrObjectAssignmentPattern(parser, context, privateScope, destructible, inGroup, isPattern, start, node);\n }\n parser.destructible = destructible;\n return node;\n}\nfunction parseMethodFormals(parser, context, scope, privateScope, kind, type, inGroup) {\n consume(parser, context, 67174411);\n const params = [];\n parser.flags = (parser.flags | 128) ^ 128;\n if (parser.getToken() === 16) {\n if (kind & 512) {\n parser.report(37, 'Setter', 'one', '');\n }\n nextToken(parser, context);\n return params;\n }\n if (kind & 256) {\n parser.report(37, 'Getter', 'no', 's');\n }\n if (kind & 512 && parser.getToken() === 14) {\n parser.report(38);\n }\n context = (context | 131072) ^ 131072;\n let setterArgs = 0;\n let isNonSimpleParameterList = 0;\n while (parser.getToken() !== 18) {\n let left = null;\n const { tokenStart } = parser;\n if (parser.getToken() & 143360) {\n if ((context & 1) === 0) {\n if ((parser.getToken() & 36864) === 36864) {\n parser.flags |= 256;\n }\n if ((parser.getToken() & 537079808) === 537079808) {\n parser.flags |= 512;\n }\n }\n left = parseAndClassifyIdentifier(parser, context, scope, kind | 1, 0);\n }\n else {\n if (parser.getToken() === 2162700) {\n left = parseObjectLiteralOrPattern(parser, context, scope, privateScope, 1, inGroup, 1, type, 0);\n }\n else if (parser.getToken() === 69271571) {\n left = parseArrayExpressionOrPattern(parser, context, scope, privateScope, 1, inGroup, 1, type, 0);\n }\n else if (parser.getToken() === 14) {\n left = parseSpreadOrRestElement(parser, context, scope, privateScope, 16, type, 0, 0, inGroup, 1);\n }\n isNonSimpleParameterList = 1;\n if (parser.destructible & (32 | 16))\n parser.report(50);\n }\n if (parser.getToken() === 1077936155) {\n nextToken(parser, context | 32);\n isNonSimpleParameterList = 1;\n const right = parseExpression(parser, context, privateScope, 1, 0, parser.tokenStart);\n left = parser.finishNode({\n type: 'AssignmentPattern',\n left: left,\n right,\n }, tokenStart);\n }\n setterArgs++;\n params.push(left);\n if (!consumeOpt(parser, context, 18))\n break;\n if (parser.getToken() === 16) {\n break;\n }\n }\n if (kind & 512 && setterArgs !== 1) {\n parser.report(37, 'Setter', 'one', '');\n }\n scope?.reportScopeError();\n if (isNonSimpleParameterList)\n parser.flags |= 128;\n consume(parser, context, 16);\n return params;\n}\nfunction parseComputedPropertyName(parser, context, privateScope, inGroup) {\n nextToken(parser, context | 32);\n const key = parseExpression(parser, (context | 131072) ^ 131072, privateScope, 1, inGroup, parser.tokenStart);\n consume(parser, context, 20);\n return key;\n}\nfunction parseParenthesizedExpression(parser, context, privateScope, canAssign, kind, origin, start) {\n parser.flags = (parser.flags | 128) ^ 128;\n const parenthesesStart = parser.tokenStart;\n nextToken(parser, context | 32 | 262144);\n const scope = parser.createScopeIfLexical()?.createChildScope(512);\n context = (context | 131072) ^ 131072;\n if (consumeOpt(parser, context, 16)) {\n return parseParenthesizedArrow(parser, context, scope, privateScope, [], canAssign, 0, start);\n }\n let destructible = 0;\n parser.destructible &= -385;\n let expr;\n let expressions = [];\n let isSequence = 0;\n let isNonSimpleParameterList = 0;\n let hasStrictReserved = 0;\n const tokenAfterParenthesesStart = parser.tokenStart;\n parser.assignable = 1;\n while (parser.getToken() !== 16) {\n const { tokenStart } = parser;\n const token = parser.getToken();\n if (token & 143360) {\n scope?.addBlockName(context, parser.tokenValue, 1, 0);\n if ((token & 537079808) === 537079808) {\n isNonSimpleParameterList = 1;\n }\n else if ((token & 36864) === 36864) {\n hasStrictReserved = 1;\n }\n expr = parsePrimaryExpression(parser, context, privateScope, kind, 0, 1, 1, 1, tokenStart);\n if (parser.getToken() === 16 || parser.getToken() === 18) {\n if (parser.assignable & 2) {\n destructible |= 16;\n isNonSimpleParameterList = 1;\n }\n }\n else {\n if (parser.getToken() === 1077936155) {\n isNonSimpleParameterList = 1;\n }\n else {\n destructible |= 16;\n }\n expr = parseMemberOrUpdateExpression(parser, context, privateScope, expr, 1, 0, tokenStart);\n if (parser.getToken() !== 16 && parser.getToken() !== 18) {\n expr = parseAssignmentExpression(parser, context, privateScope, 1, 0, tokenStart, expr);\n }\n }\n }\n else if ((token & 2097152) === 2097152) {\n expr =\n token === 2162700\n ? parseObjectLiteralOrPattern(parser, context | 262144, scope, privateScope, 0, 1, 0, kind, origin)\n : parseArrayExpressionOrPattern(parser, context | 262144, scope, privateScope, 0, 1, 0, kind, origin);\n destructible |= parser.destructible;\n isNonSimpleParameterList = 1;\n parser.assignable = 2;\n if (parser.getToken() !== 16 && parser.getToken() !== 18) {\n if (destructible & 8)\n parser.report(122);\n expr = parseMemberOrUpdateExpression(parser, context, privateScope, expr, 0, 0, tokenStart);\n destructible |= 16;\n if (parser.getToken() !== 16 && parser.getToken() !== 18) {\n expr = parseAssignmentExpression(parser, context, privateScope, 0, 0, tokenStart, expr);\n }\n }\n }\n else if (token === 14) {\n expr = parseSpreadOrRestElement(parser, context, scope, privateScope, 16, kind, origin, 0, 1, 0);\n if (parser.destructible & 16)\n parser.report(74);\n isNonSimpleParameterList = 1;\n if (isSequence && (parser.getToken() === 16 || parser.getToken() === 18)) {\n expressions.push(expr);\n }\n destructible |= 8;\n break;\n }\n else {\n destructible |= 16;\n expr = parseExpression(parser, context, privateScope, 1, 1, tokenStart);\n if (isSequence && (parser.getToken() === 16 || parser.getToken() === 18)) {\n expressions.push(expr);\n }\n if (parser.getToken() === 18) {\n if (!isSequence) {\n isSequence = 1;\n expressions = [expr];\n }\n }\n if (isSequence) {\n while (consumeOpt(parser, context | 32, 18)) {\n expressions.push(parseExpression(parser, context, privateScope, 1, 1, parser.tokenStart));\n }\n parser.assignable = 2;\n expr = parser.finishNode({\n type: 'SequenceExpression',\n expressions,\n }, tokenAfterParenthesesStart);\n }\n consume(parser, context, 16);\n parser.destructible = destructible;\n return parser.options.preserveParens\n ? parser.finishNode({\n type: 'ParenthesizedExpression',\n expression: expr,\n }, parenthesesStart)\n : expr;\n }\n if (isSequence && (parser.getToken() === 16 || parser.getToken() === 18)) {\n expressions.push(expr);\n }\n if (!consumeOpt(parser, context | 32, 18))\n break;\n if (!isSequence) {\n isSequence = 1;\n expressions = [expr];\n }\n if (parser.getToken() === 16) {\n destructible |= 8;\n break;\n }\n }\n if (isSequence) {\n parser.assignable = 2;\n expr = parser.finishNode({\n type: 'SequenceExpression',\n expressions,\n }, tokenAfterParenthesesStart);\n }\n consume(parser, context, 16);\n if (destructible & 16 && destructible & 8)\n parser.report(151);\n destructible |=\n parser.destructible & 256\n ? 256\n : 0 | (parser.destructible & 128)\n ? 128\n : 0;\n if (parser.getToken() === 10) {\n if (destructible & (32 | 16))\n parser.report(49);\n if (context & (2048 | 2) && destructible & 128)\n parser.report(31);\n if (context & (1 | 1024) && destructible & 256) {\n parser.report(32);\n }\n if (isNonSimpleParameterList)\n parser.flags |= 128;\n if (hasStrictReserved)\n parser.flags |= 256;\n return parseParenthesizedArrow(parser, context, scope, privateScope, isSequence ? expressions : [expr], canAssign, 0, start);\n }\n if (destructible & 64) {\n parser.report(63);\n }\n if (destructible & 8) {\n parser.report(144);\n }\n parser.destructible = ((parser.destructible | 256) ^ 256) | destructible;\n return parser.options.preserveParens\n ? parser.finishNode({\n type: 'ParenthesizedExpression',\n expression: expr,\n }, parenthesesStart)\n : expr;\n}\nfunction parseIdentifierOrArrow(parser, context, privateScope) {\n const { tokenStart: start } = parser;\n const { tokenValue } = parser;\n let isNonSimpleParameterList = 0;\n let hasStrictReserved = 0;\n if ((parser.getToken() & 537079808) === 537079808) {\n isNonSimpleParameterList = 1;\n }\n else if ((parser.getToken() & 36864) === 36864) {\n hasStrictReserved = 1;\n }\n const expr = parseIdentifier(parser, context);\n parser.assignable = 1;\n if (parser.getToken() === 10) {\n const scope = parser.options.lexical ? createArrowHeadParsingScope(parser, context, tokenValue) : undefined;\n if (isNonSimpleParameterList)\n parser.flags |= 128;\n if (hasStrictReserved)\n parser.flags |= 256;\n return parseArrowFunctionExpression(parser, context, scope, privateScope, [expr], 0, start);\n }\n return expr;\n}\nfunction parseArrowFromIdentifier(parser, context, privateScope, value, expr, inNew, canAssign, isAsync, start) {\n if (!canAssign)\n parser.report(57);\n if (inNew)\n parser.report(51);\n parser.flags &= -129;\n const scope = parser.options.lexical ? createArrowHeadParsingScope(parser, context, value) : void 0;\n return parseArrowFunctionExpression(parser, context, scope, privateScope, [expr], isAsync, start);\n}\nfunction parseParenthesizedArrow(parser, context, scope, privateScope, params, canAssign, isAsync, start) {\n if (!canAssign)\n parser.report(57);\n for (let i = 0; i < params.length; ++i)\n reinterpretToPattern(parser, params[i]);\n return parseArrowFunctionExpression(parser, context, scope, privateScope, params, isAsync, start);\n}\nfunction parseArrowFunctionExpression(parser, context, scope, privateScope, params, isAsync, start) {\n if (parser.flags & 1)\n parser.report(48);\n consume(parser, context | 32, 10);\n const modifierFlags = 1024 | 2048 | 8192 | 524288;\n context = ((context | modifierFlags) ^ modifierFlags) | (isAsync ? 2048 : 0);\n const expression = parser.getToken() !== 2162700;\n let body;\n scope?.reportScopeError();\n if (expression) {\n parser.flags =\n (parser.flags | 512 | 256 | 64 | 4096) ^\n (512 | 256 | 64 | 4096);\n body = parseExpression(parser, context, privateScope, 1, 0, parser.tokenStart);\n }\n else {\n scope = scope?.createChildScope(64);\n const modifierFlags = 4 | 131072 | 8;\n body = parseFunctionBody(parser, ((context | modifierFlags) ^ modifierFlags) | 4096, scope, privateScope, 16, void 0, void 0);\n switch (parser.getToken()) {\n case 69271571:\n if ((parser.flags & 1) === 0) {\n parser.report(116);\n }\n break;\n case 67108877:\n case 67174409:\n case 22:\n parser.report(117);\n case 67174411:\n if ((parser.flags & 1) === 0) {\n parser.report(116);\n }\n parser.flags |= 1024;\n break;\n }\n if ((parser.getToken() & 8388608) === 8388608 && (parser.flags & 1) === 0)\n parser.report(30, KeywordDescTable[parser.getToken() & 255]);\n if ((parser.getToken() & 33619968) === 33619968)\n parser.report(125);\n }\n parser.assignable = 2;\n return parser.finishNode({\n type: 'ArrowFunctionExpression',\n params,\n body,\n async: isAsync === 1,\n expression,\n generator: false,\n }, start);\n}\nfunction parseFormalParametersOrFormalList(parser, context, scope, privateScope, inGroup, kind) {\n consume(parser, context, 67174411);\n parser.flags = (parser.flags | 128) ^ 128;\n const params = [];\n if (consumeOpt(parser, context, 16))\n return params;\n context = (context | 131072) ^ 131072;\n let isNonSimpleParameterList = 0;\n while (parser.getToken() !== 18) {\n let left;\n const { tokenStart } = parser;\n const token = parser.getToken();\n if (token & 143360) {\n if ((context & 1) === 0) {\n if ((token & 36864) === 36864) {\n parser.flags |= 256;\n }\n if ((token & 537079808) === 537079808) {\n parser.flags |= 512;\n }\n }\n left = parseAndClassifyIdentifier(parser, context, scope, kind | 1, 0);\n }\n else {\n if (token === 2162700) {\n left = parseObjectLiteralOrPattern(parser, context, scope, privateScope, 1, inGroup, 1, kind, 0);\n }\n else if (token === 69271571) {\n left = parseArrayExpressionOrPattern(parser, context, scope, privateScope, 1, inGroup, 1, kind, 0);\n }\n else if (token === 14) {\n left = parseSpreadOrRestElement(parser, context, scope, privateScope, 16, kind, 0, 0, inGroup, 1);\n }\n else {\n parser.report(30, KeywordDescTable[token & 255]);\n }\n isNonSimpleParameterList = 1;\n if (parser.destructible & (32 | 16)) {\n parser.report(50);\n }\n }\n if (parser.getToken() === 1077936155) {\n nextToken(parser, context | 32);\n isNonSimpleParameterList = 1;\n const right = parseExpression(parser, context, privateScope, 1, inGroup, parser.tokenStart);\n left = parser.finishNode({\n type: 'AssignmentPattern',\n left,\n right,\n }, tokenStart);\n }\n params.push(left);\n if (!consumeOpt(parser, context, 18))\n break;\n if (parser.getToken() === 16) {\n break;\n }\n }\n if (isNonSimpleParameterList)\n parser.flags |= 128;\n if (isNonSimpleParameterList || context & 1) {\n scope?.reportScopeError();\n }\n consume(parser, context, 16);\n return params;\n}\nfunction parseMemberExpressionNoCall(parser, context, privateScope, expr, inGroup, start) {\n const token = parser.getToken();\n if (token & 67108864) {\n if (token === 67108877) {\n nextToken(parser, context | 262144);\n parser.assignable = 1;\n const property = parsePropertyOrPrivatePropertyName(parser, context, privateScope);\n return parseMemberExpressionNoCall(parser, context, privateScope, parser.finishNode({\n type: 'MemberExpression',\n object: expr,\n computed: false,\n property,\n optional: false,\n }, start), 0, start);\n }\n else if (token === 69271571) {\n nextToken(parser, context | 32);\n const { tokenStart } = parser;\n const property = parseExpressions(parser, context, privateScope, inGroup, 1, tokenStart);\n consume(parser, context, 20);\n parser.assignable = 1;\n return parseMemberExpressionNoCall(parser, context, privateScope, parser.finishNode({\n type: 'MemberExpression',\n object: expr,\n computed: true,\n property,\n optional: false,\n }, start), 0, start);\n }\n else if (token === 67174408 || token === 67174409) {\n parser.assignable = 2;\n return parseMemberExpressionNoCall(parser, context, privateScope, parser.finishNode({\n type: 'TaggedTemplateExpression',\n tag: expr,\n quasi: parser.getToken() === 67174408\n ? parseTemplate(parser, context | 64, privateScope)\n : parseTemplateLiteral(parser, context | 64),\n }, start), 0, start);\n }\n }\n return expr;\n}\nfunction parseNewExpression(parser, context, privateScope, inGroup) {\n const { tokenStart: start } = parser;\n const id = parseIdentifier(parser, context | 32);\n const { tokenStart } = parser;\n if (consumeOpt(parser, context, 67108877)) {\n if (context & 65536 && parser.getToken() === 209029) {\n parser.assignable = 2;\n return parseMetaProperty(parser, context, id, start);\n }\n parser.report(94);\n }\n parser.assignable = 2;\n if ((parser.getToken() & 16842752) === 16842752) {\n parser.report(65, KeywordDescTable[parser.getToken() & 255]);\n }\n const expr = parsePrimaryExpression(parser, context, privateScope, 2, 1, 0, inGroup, 1, tokenStart);\n context = (context | 131072) ^ 131072;\n if (parser.getToken() === 67108990)\n parser.report(168);\n const callee = parseMemberExpressionNoCall(parser, context, privateScope, expr, inGroup, tokenStart);\n parser.assignable = 2;\n return parser.finishNode({\n type: 'NewExpression',\n callee,\n arguments: parser.getToken() === 67174411 ? parseArguments(parser, context, privateScope, inGroup) : [],\n }, start);\n}\nfunction parseMetaProperty(parser, context, meta, start) {\n const property = parseIdentifier(parser, context);\n return parser.finishNode({\n type: 'MetaProperty',\n meta,\n property,\n }, start);\n}\nfunction parseAsyncArrowAfterIdent(parser, context, privateScope, canAssign, start) {\n if (parser.getToken() === 209006)\n parser.report(31);\n if (context & (1 | 1024) && parser.getToken() === 241771) {\n parser.report(32);\n }\n classifyIdentifier(parser, context, parser.getToken());\n if ((parser.getToken() & 36864) === 36864) {\n parser.flags |= 256;\n }\n return parseArrowFromIdentifier(parser, (context & -524289) | 2048, privateScope, parser.tokenValue, parseIdentifier(parser, context), 0, canAssign, 1, start);\n}\nfunction parseAsyncArrowOrCallExpression(parser, context, privateScope, callee, canAssign, kind, origin, flags, start) {\n nextToken(parser, context | 32);\n const scope = parser.createScopeIfLexical()?.createChildScope(512);\n context = (context | 131072) ^ 131072;\n if (consumeOpt(parser, context, 16)) {\n if (parser.getToken() === 10) {\n if (flags & 1)\n parser.report(48);\n return parseParenthesizedArrow(parser, context, scope, privateScope, [], canAssign, 1, start);\n }\n return parser.finishNode({\n type: 'CallExpression',\n callee,\n arguments: [],\n optional: false,\n }, start);\n }\n let destructible = 0;\n let expr = null;\n let isNonSimpleParameterList = 0;\n parser.destructible =\n (parser.destructible | 256 | 128) ^\n (256 | 128);\n const params = [];\n while (parser.getToken() !== 16) {\n const { tokenStart } = parser;\n const token = parser.getToken();\n if (token & 143360) {\n scope?.addBlockName(context, parser.tokenValue, kind, 0);\n if ((token & 537079808) === 537079808) {\n parser.flags |= 512;\n }\n else if ((token & 36864) === 36864) {\n parser.flags |= 256;\n }\n expr = parsePrimaryExpression(parser, context, privateScope, kind, 0, 1, 1, 1, tokenStart);\n if (parser.getToken() === 16 || parser.getToken() === 18) {\n if (parser.assignable & 2) {\n destructible |= 16;\n isNonSimpleParameterList = 1;\n }\n }\n else {\n if (parser.getToken() === 1077936155) {\n isNonSimpleParameterList = 1;\n }\n else {\n destructible |= 16;\n }\n expr = parseMemberOrUpdateExpression(parser, context, privateScope, expr, 1, 0, tokenStart);\n if (parser.getToken() !== 16 && parser.getToken() !== 18) {\n expr = parseAssignmentExpression(parser, context, privateScope, 1, 0, tokenStart, expr);\n }\n }\n }\n else if (token & 2097152) {\n expr =\n token === 2162700\n ? parseObjectLiteralOrPattern(parser, context, scope, privateScope, 0, 1, 0, kind, origin)\n : parseArrayExpressionOrPattern(parser, context, scope, privateScope, 0, 1, 0, kind, origin);\n destructible |= parser.destructible;\n isNonSimpleParameterList = 1;\n if (parser.getToken() !== 16 && parser.getToken() !== 18) {\n if (destructible & 8)\n parser.report(122);\n expr = parseMemberOrUpdateExpression(parser, context, privateScope, expr, 0, 0, tokenStart);\n destructible |= 16;\n if ((parser.getToken() & 8388608) === 8388608) {\n expr = parseBinaryExpression(parser, context, privateScope, 1, start, 4, token, expr);\n }\n if (consumeOpt(parser, context | 32, 22)) {\n expr = parseConditionalExpression(parser, context, privateScope, expr, start);\n }\n }\n }\n else if (token === 14) {\n expr = parseSpreadOrRestElement(parser, context, scope, privateScope, 16, kind, origin, 1, 1, 0);\n destructible |=\n (parser.getToken() === 16 ? 0 : 16) | parser.destructible;\n isNonSimpleParameterList = 1;\n }\n else {\n expr = parseExpression(parser, context, privateScope, 1, 0, tokenStart);\n destructible = parser.assignable;\n params.push(expr);\n while (consumeOpt(parser, context | 32, 18)) {\n params.push(parseExpression(parser, context, privateScope, 1, 0, tokenStart));\n }\n destructible |= parser.assignable;\n consume(parser, context, 16);\n parser.destructible = destructible | 16;\n parser.assignable = 2;\n return parser.finishNode({\n type: 'CallExpression',\n callee,\n arguments: params,\n optional: false,\n }, start);\n }\n params.push(expr);\n if (!consumeOpt(parser, context | 32, 18))\n break;\n }\n consume(parser, context, 16);\n destructible |=\n parser.destructible & 256\n ? 256\n : 0 | (parser.destructible & 128)\n ? 128\n : 0;\n if (parser.getToken() === 10) {\n if (destructible & (32 | 16))\n parser.report(27);\n if (parser.flags & 1 || flags & 1)\n parser.report(48);\n if (destructible & 128)\n parser.report(31);\n if (context & (1 | 1024) && destructible & 256)\n parser.report(32);\n if (isNonSimpleParameterList)\n parser.flags |= 128;\n return parseParenthesizedArrow(parser, context | 2048, scope, privateScope, params, canAssign, 1, start);\n }\n if (destructible & 64) {\n parser.report(63);\n }\n if (destructible & 8) {\n parser.report(62);\n }\n parser.assignable = 2;\n return parser.finishNode({\n type: 'CallExpression',\n callee,\n arguments: params,\n optional: false,\n }, start);\n}\nfunction parseRegExpLiteral(parser, context) {\n const { tokenRaw, tokenRegExp, tokenValue, tokenStart } = parser;\n nextToken(parser, context);\n parser.assignable = 2;\n const node = {\n type: 'Literal',\n value: tokenValue,\n regex: tokenRegExp,\n };\n if (parser.options.raw) {\n node.raw = tokenRaw;\n }\n return parser.finishNode(node, tokenStart);\n}\nfunction parseClassDeclaration(parser, context, scope, privateScope, flags) {\n let start;\n let decorators;\n if (parser.leadingDecorators.decorators.length) {\n if (parser.getToken() === 132) {\n parser.report(30, '@');\n }\n start = parser.leadingDecorators.start;\n decorators = [...parser.leadingDecorators.decorators];\n parser.leadingDecorators.decorators.length = 0;\n }\n else {\n start = parser.tokenStart;\n decorators = parseDecorators(parser, context, privateScope);\n }\n context = (context | 16384 | 1) ^ 16384;\n nextToken(parser, context);\n let id = null;\n let superClass = null;\n const { tokenValue } = parser;\n if (parser.getToken() & 4096 && parser.getToken() !== 20565) {\n if (isStrictReservedWord(parser, context, parser.getToken())) {\n parser.report(118);\n }\n if ((parser.getToken() & 537079808) === 537079808) {\n parser.report(119);\n }\n if (scope) {\n scope.addBlockName(context, tokenValue, 32, 0);\n if (flags) {\n if (flags & 2) {\n parser.declareUnboundVariable(tokenValue);\n }\n }\n }\n id = parseIdentifier(parser, context);\n }\n else {\n if ((flags & 1) === 0)\n parser.report(39, 'Class');\n }\n let inheritedContext = context;\n if (consumeOpt(parser, context | 32, 20565)) {\n superClass = parseLeftHandSideExpression(parser, context, privateScope, 0, 0, 0);\n inheritedContext |= 512;\n }\n else {\n inheritedContext = (inheritedContext | 512) ^ 512;\n }\n const body = parseClassBody(parser, inheritedContext, context, scope, privateScope, 2, 8, 0);\n return parser.finishNode({\n type: 'ClassDeclaration',\n id,\n superClass,\n body,\n ...(parser.options.next ? { decorators } : null),\n }, start);\n}\nfunction parseClassExpression(parser, context, privateScope, inGroup, start) {\n let id = null;\n let superClass = null;\n const decorators = parseDecorators(parser, context, privateScope);\n context = (context | 1 | 16384) ^ 16384;\n nextToken(parser, context);\n if (parser.getToken() & 4096 && parser.getToken() !== 20565) {\n if (isStrictReservedWord(parser, context, parser.getToken()))\n parser.report(118);\n if ((parser.getToken() & 537079808) === 537079808) {\n parser.report(119);\n }\n id = parseIdentifier(parser, context);\n }\n let inheritedContext = context;\n if (consumeOpt(parser, context | 32, 20565)) {\n superClass = parseLeftHandSideExpression(parser, context, privateScope, 0, inGroup, 0);\n inheritedContext |= 512;\n }\n else {\n inheritedContext = (inheritedContext | 512) ^ 512;\n }\n const body = parseClassBody(parser, inheritedContext, context, void 0, privateScope, 2, 0, inGroup);\n parser.assignable = 2;\n return parser.finishNode({\n type: 'ClassExpression',\n id,\n superClass,\n body,\n ...(parser.options.next ? { decorators } : null),\n }, start);\n}\nfunction parseDecorators(parser, context, privateScope) {\n const list = [];\n if (parser.options.next) {\n while (parser.getToken() === 132) {\n list.push(parseDecoratorList(parser, context, privateScope));\n }\n }\n return list;\n}\nfunction parseDecoratorList(parser, context, privateScope) {\n const start = parser.tokenStart;\n nextToken(parser, context | 32);\n let expression = parsePrimaryExpression(parser, context, privateScope, 2, 0, 1, 0, 1, start);\n expression = parseMemberOrUpdateExpression(parser, context, privateScope, expression, 0, 0, parser.tokenStart);\n return parser.finishNode({\n type: 'Decorator',\n expression,\n }, start);\n}\nfunction parseClassBody(parser, context, inheritedContext, scope, parentScope, kind, origin, inGroup) {\n const { tokenStart } = parser;\n const privateScope = parser.createPrivateScopeIfLexical(parentScope);\n consume(parser, context | 32, 2162700);\n const modifierFlags = 131072 | 524288;\n context = (context | modifierFlags) ^ modifierFlags;\n const hasConstr = parser.flags & 32;\n parser.flags = (parser.flags | 32) ^ 32;\n const body = [];\n while (parser.getToken() !== 1074790415) {\n const decoratorStart = parser.tokenStart;\n const decorators = parseDecorators(parser, context, privateScope);\n if (decorators.length > 0 && parser.tokenValue === 'constructor') {\n parser.report(109);\n }\n if (parser.getToken() === 1074790415)\n parser.report(108);\n if (consumeOpt(parser, context, 1074790417)) {\n if (decorators.length > 0)\n parser.report(120);\n continue;\n }\n body.push(parseClassElementList(parser, context, scope, privateScope, inheritedContext, kind, decorators, 0, inGroup, decorators.length > 0 ? decoratorStart : parser.tokenStart));\n }\n consume(parser, origin & 8 ? context | 32 : context, 1074790415);\n privateScope?.validatePrivateIdentifierRefs();\n parser.flags = (parser.flags & -33) | hasConstr;\n return parser.finishNode({\n type: 'ClassBody',\n body,\n }, tokenStart);\n}\nfunction parseClassElementList(parser, context, scope, privateScope, inheritedContext, type, decorators, isStatic, inGroup, start) {\n let kind = isStatic ? 32 : 0;\n let key = null;\n const token = parser.getToken();\n if (token & (143360 | 36864) || token === -2147483528) {\n key = parseIdentifier(parser, context);\n switch (token) {\n case 36970:\n if (!isStatic &&\n parser.getToken() !== 67174411 &&\n (parser.getToken() & 1048576) !== 1048576 &&\n parser.getToken() !== 1077936155) {\n return parseClassElementList(parser, context, scope, privateScope, inheritedContext, type, decorators, 1, inGroup, start);\n }\n break;\n case 209005:\n if (parser.getToken() !== 67174411 && (parser.flags & 1) === 0) {\n if ((parser.getToken() & 1073741824) === 1073741824) {\n return parsePropertyDefinition(parser, context, privateScope, key, kind, decorators, start);\n }\n kind |= 16 | (optionalBit(parser, context, 8391476) ? 8 : 0);\n }\n break;\n case 209008:\n if (parser.getToken() !== 67174411) {\n if ((parser.getToken() & 1073741824) === 1073741824) {\n return parsePropertyDefinition(parser, context, privateScope, key, kind, decorators, start);\n }\n kind |= 256;\n }\n break;\n case 209009:\n if (parser.getToken() !== 67174411) {\n if ((parser.getToken() & 1073741824) === 1073741824) {\n return parsePropertyDefinition(parser, context, privateScope, key, kind, decorators, start);\n }\n kind |= 512;\n }\n break;\n case 12402:\n if (parser.getToken() !== 67174411 && (parser.flags & 1) === 0) {\n if ((parser.getToken() & 1073741824) === 1073741824) {\n return parsePropertyDefinition(parser, context, privateScope, key, kind, decorators, start);\n }\n if (parser.options.next)\n kind |= 1024;\n }\n break;\n }\n }\n else if (token === 69271571) {\n kind |= 2;\n key = parseComputedPropertyName(parser, inheritedContext, privateScope, inGroup);\n }\n else if ((token & 134217728) === 134217728) {\n key = parseLiteral(parser, context);\n }\n else if (token === 8391476) {\n kind |= 8;\n nextToken(parser, context);\n }\n else if (parser.getToken() === 130) {\n kind |= 8192;\n key = parsePrivateIdentifier(parser, context | 16, privateScope, 768);\n }\n else if ((parser.getToken() & 1073741824) === 1073741824) {\n kind |= 128;\n }\n else if (isStatic && token === 2162700) {\n return parseStaticBlock(parser, context | 16, scope, privateScope, start);\n }\n else if (token === -2147483527) {\n key = parseIdentifier(parser, context);\n if (parser.getToken() !== 67174411)\n parser.report(30, KeywordDescTable[parser.getToken() & 255]);\n }\n else {\n parser.report(30, KeywordDescTable[parser.getToken() & 255]);\n }\n if (kind & (8 | 16 | 768 | 1024)) {\n if (parser.getToken() & 143360 ||\n parser.getToken() === -2147483528 ||\n parser.getToken() === -2147483527) {\n key = parseIdentifier(parser, context);\n }\n else if ((parser.getToken() & 134217728) === 134217728) {\n key = parseLiteral(parser, context);\n }\n else if (parser.getToken() === 69271571) {\n kind |= 2;\n key = parseComputedPropertyName(parser, context, privateScope, 0);\n }\n else if (parser.getToken() === 130) {\n kind |= 8192;\n key = parsePrivateIdentifier(parser, context, privateScope, kind);\n }\n else\n parser.report(135);\n }\n if ((kind & 2) === 0) {\n if (parser.tokenValue === 'constructor') {\n if ((parser.getToken() & 1073741824) === 1073741824) {\n parser.report(129);\n }\n else if ((kind & 32) === 0 && parser.getToken() === 67174411) {\n if (kind & (768 | 16 | 128 | 8)) {\n parser.report(53, 'accessor');\n }\n else if ((context & 512) === 0) {\n if (parser.flags & 32)\n parser.report(54);\n else\n parser.flags |= 32;\n }\n }\n kind |= 64;\n }\n else if ((kind & 8192) === 0 &&\n kind & 32 &&\n parser.tokenValue === 'prototype') {\n parser.report(52);\n }\n }\n if (kind & 1024 || (parser.getToken() !== 67174411 && (kind & 768) === 0)) {\n return parsePropertyDefinition(parser, context, privateScope, key, kind, decorators, start);\n }\n const value = parseMethodDefinition(parser, context | 16, privateScope, kind, inGroup, parser.tokenStart);\n return parser.finishNode({\n type: 'MethodDefinition',\n kind: (kind & 32) === 0 && kind & 64\n ? 'constructor'\n : kind & 256\n ? 'get'\n : kind & 512\n ? 'set'\n : 'method',\n static: (kind & 32) > 0,\n computed: (kind & 2) > 0,\n key,\n value,\n ...(parser.options.next ? { decorators } : null),\n }, start);\n}\nfunction parsePrivateIdentifier(parser, context, privateScope, kind) {\n const { tokenStart } = parser;\n nextToken(parser, context);\n const { tokenValue } = parser;\n if (tokenValue === 'constructor')\n parser.report(128);\n if (parser.options.lexical) {\n if (!privateScope)\n parser.report(4, tokenValue);\n if (kind) {\n privateScope.addPrivateIdentifier(tokenValue, kind);\n }\n else {\n privateScope.addPrivateIdentifierRef(tokenValue);\n }\n }\n nextToken(parser, context);\n return parser.finishNode({\n type: 'PrivateIdentifier',\n name: tokenValue,\n }, tokenStart);\n}\nfunction parsePropertyDefinition(parser, context, privateScope, key, state, decorators, start) {\n let value = null;\n if (state & 8)\n parser.report(0);\n if (parser.getToken() === 1077936155) {\n nextToken(parser, context | 32);\n const { tokenStart } = parser;\n if (parser.getToken() === 537079927)\n parser.report(119);\n const modifierFlags = 1024 |\n 2048 |\n 8192 |\n ((state & 64) === 0 ? 512 | 16384 : 0);\n context =\n ((context | modifierFlags) ^ modifierFlags) |\n (state & 8 ? 1024 : 0) |\n (state & 16 ? 2048 : 0) |\n (state & 64 ? 16384 : 0) |\n 256 |\n 65536;\n value = parsePrimaryExpression(parser, context | 16, privateScope, 2, 0, 1, 0, 1, tokenStart);\n if ((parser.getToken() & 1073741824) !== 1073741824 ||\n (parser.getToken() & 4194304) === 4194304) {\n value = parseMemberOrUpdateExpression(parser, context | 16, privateScope, value, 0, 0, tokenStart);\n value = parseAssignmentExpression(parser, context | 16, privateScope, 0, 0, tokenStart, value);\n }\n }\n matchOrInsertSemicolon(parser, context);\n return parser.finishNode({\n type: state & 1024 ? 'AccessorProperty' : 'PropertyDefinition',\n key,\n value,\n static: (state & 32) > 0,\n computed: (state & 2) > 0,\n ...(parser.options.next ? { decorators } : null),\n }, start);\n}\nfunction parseBindingPattern(parser, context, scope, privateScope, type, origin) {\n if (parser.getToken() & 143360 ||\n ((context & 1) === 0 && parser.getToken() === -2147483527))\n return parseAndClassifyIdentifier(parser, context, scope, type, origin);\n if ((parser.getToken() & 2097152) !== 2097152)\n parser.report(30, KeywordDescTable[parser.getToken() & 255]);\n const left = parser.getToken() === 69271571\n ? parseArrayExpressionOrPattern(parser, context, scope, privateScope, 1, 0, 1, type, origin)\n : parseObjectLiteralOrPattern(parser, context, scope, privateScope, 1, 0, 1, type, origin);\n if (parser.destructible & 16)\n parser.report(50);\n if (parser.destructible & 32)\n parser.report(50);\n return left;\n}\nfunction parseAndClassifyIdentifier(parser, context, scope, kind, origin) {\n const token = parser.getToken();\n if (context & 1) {\n if ((token & 537079808) === 537079808) {\n parser.report(119);\n }\n else if ((token & 36864) === 36864 || token === -2147483527) {\n parser.report(118);\n }\n }\n if ((token & 20480) === 20480) {\n parser.report(102);\n }\n if (token === 241771) {\n if (context & 1024)\n parser.report(32);\n if (context & 2)\n parser.report(111);\n }\n if ((token & 255) === (241737 & 255)) {\n if (kind & (8 | 16))\n parser.report(100);\n }\n if (token === 209006) {\n if (context & 2048)\n parser.report(176);\n if (context & 2)\n parser.report(110);\n }\n const { tokenValue, tokenStart: start } = parser;\n nextToken(parser, context);\n scope?.addVarOrBlock(context, tokenValue, kind, origin);\n return parser.finishNode({\n type: 'Identifier',\n name: tokenValue,\n }, start);\n}\nfunction parseJSXRootElementOrFragment(parser, context, privateScope, inJSXChild, start) {\n if (!inJSXChild)\n consume(parser, context, 8456256);\n if (parser.getToken() === 8390721) {\n const openingFragment = parseJSXOpeningFragment(parser, start);\n const [children, closingFragment] = parseJSXChildrenAndClosingFragment(parser, context, privateScope, inJSXChild);\n return parser.finishNode({\n type: 'JSXFragment',\n openingFragment,\n children,\n closingFragment,\n }, start);\n }\n if (parser.getToken() === 8457014)\n parser.report(30, KeywordDescTable[parser.getToken() & 255]);\n let closingElement = null;\n let children = [];\n const openingElement = parseJSXOpeningElementOrSelfCloseElement(parser, context, privateScope, inJSXChild, start);\n if (!openingElement.selfClosing) {\n [children, closingElement] = parseJSXChildrenAndClosingElement(parser, context, privateScope, inJSXChild);\n const close = isEqualTagName(closingElement.name);\n if (isEqualTagName(openingElement.name) !== close)\n parser.report(155, close);\n }\n return parser.finishNode({\n type: 'JSXElement',\n children,\n openingElement,\n closingElement,\n }, start);\n}\nfunction parseJSXOpeningFragment(parser, start) {\n nextJSXToken(parser);\n return parser.finishNode({\n type: 'JSXOpeningFragment',\n }, start);\n}\nfunction parseJSXClosingElement(parser, context, inJSXChild, start) {\n consume(parser, context, 8457014);\n const name = parseJSXElementName(parser, context);\n if (parser.getToken() !== 8390721) {\n parser.report(25, KeywordDescTable[8390721 & 255]);\n }\n if (inJSXChild) {\n nextJSXToken(parser);\n }\n else {\n nextToken(parser, context);\n }\n return parser.finishNode({\n type: 'JSXClosingElement',\n name,\n }, start);\n}\nfunction parseJSXClosingFragment(parser, context, inJSXChild, start) {\n consume(parser, context, 8457014);\n if (parser.getToken() !== 8390721) {\n parser.report(25, KeywordDescTable[8390721 & 255]);\n }\n if (inJSXChild) {\n nextJSXToken(parser);\n }\n else {\n nextToken(parser, context);\n }\n return parser.finishNode({\n type: 'JSXClosingFragment',\n }, start);\n}\nfunction parseJSXChildrenAndClosingElement(parser, context, privateScope, inJSXChild) {\n const children = [];\n while (true) {\n const child = parseJSXChildOrClosingElement(parser, context, privateScope, inJSXChild);\n if (child.type === 'JSXClosingElement') {\n return [children, child];\n }\n children.push(child);\n }\n}\nfunction parseJSXChildrenAndClosingFragment(parser, context, privateScope, inJSXChild) {\n const children = [];\n while (true) {\n const child = parseJSXChildOrClosingFragment(parser, context, privateScope, inJSXChild);\n if (child.type === 'JSXClosingFragment') {\n return [children, child];\n }\n children.push(child);\n }\n}\nfunction parseJSXChildOrClosingElement(parser, context, privateScope, inJSXChild) {\n if (parser.getToken() === 137)\n return parseJSXText(parser, context);\n if (parser.getToken() === 2162700)\n return parseJSXExpressionContainer(parser, context, privateScope, 1, 0);\n if (parser.getToken() === 8456256) {\n const { tokenStart } = parser;\n nextToken(parser, context);\n if (parser.getToken() === 8457014)\n return parseJSXClosingElement(parser, context, inJSXChild, tokenStart);\n return parseJSXRootElementOrFragment(parser, context, privateScope, 1, tokenStart);\n }\n parser.report(0);\n}\nfunction parseJSXChildOrClosingFragment(parser, context, privateScope, inJSXChild) {\n if (parser.getToken() === 137)\n return parseJSXText(parser, context);\n if (parser.getToken() === 2162700)\n return parseJSXExpressionContainer(parser, context, privateScope, 1, 0);\n if (parser.getToken() === 8456256) {\n const { tokenStart } = parser;\n nextToken(parser, context);\n if (parser.getToken() === 8457014)\n return parseJSXClosingFragment(parser, context, inJSXChild, tokenStart);\n return parseJSXRootElementOrFragment(parser, context, privateScope, 1, tokenStart);\n }\n parser.report(0);\n}\nfunction parseJSXText(parser, context) {\n const start = parser.tokenStart;\n nextToken(parser, context);\n const node = {\n type: 'JSXText',\n value: parser.tokenValue,\n };\n if (parser.options.raw) {\n node.raw = parser.tokenRaw;\n }\n return parser.finishNode(node, start);\n}\nfunction parseJSXOpeningElementOrSelfCloseElement(parser, context, privateScope, inJSXChild, start) {\n if ((parser.getToken() & 143360) !== 143360 &&\n (parser.getToken() & 4096) !== 4096)\n parser.report(0);\n const tagName = parseJSXElementName(parser, context);\n const attributes = parseJSXAttributes(parser, context, privateScope);\n const selfClosing = parser.getToken() === 8457014;\n if (selfClosing)\n consume(parser, context, 8457014);\n if (parser.getToken() !== 8390721) {\n parser.report(25, KeywordDescTable[8390721 & 255]);\n }\n if (inJSXChild || !selfClosing) {\n nextJSXToken(parser);\n }\n else {\n nextToken(parser, context);\n }\n return parser.finishNode({\n type: 'JSXOpeningElement',\n name: tagName,\n attributes,\n selfClosing,\n }, start);\n}\nfunction parseJSXElementName(parser, context) {\n const { tokenStart } = parser;\n rescanJSXIdentifier(parser);\n let key = parseJSXIdentifier(parser, context);\n if (parser.getToken() === 21)\n return parseJSXNamespacedName(parser, context, key, tokenStart);\n while (consumeOpt(parser, context, 67108877)) {\n rescanJSXIdentifier(parser);\n key = parseJSXMemberExpression(parser, context, key, tokenStart);\n }\n return key;\n}\nfunction parseJSXMemberExpression(parser, context, object, start) {\n const property = parseJSXIdentifier(parser, context);\n return parser.finishNode({\n type: 'JSXMemberExpression',\n object,\n property,\n }, start);\n}\nfunction parseJSXAttributes(parser, context, privateScope) {\n const attributes = [];\n while (parser.getToken() !== 8457014 &&\n parser.getToken() !== 8390721 &&\n parser.getToken() !== 1048576) {\n attributes.push(parseJsxAttribute(parser, context, privateScope));\n }\n return attributes;\n}\nfunction parseJSXSpreadAttribute(parser, context, privateScope) {\n const start = parser.tokenStart;\n nextToken(parser, context);\n consume(parser, context, 14);\n const expression = parseExpression(parser, context, privateScope, 1, 0, parser.tokenStart);\n consume(parser, context, 1074790415);\n return parser.finishNode({\n type: 'JSXSpreadAttribute',\n argument: expression,\n }, start);\n}\nfunction parseJsxAttribute(parser, context, privateScope) {\n const { tokenStart } = parser;\n if (parser.getToken() === 2162700)\n return parseJSXSpreadAttribute(parser, context, privateScope);\n rescanJSXIdentifier(parser);\n let value = null;\n let name = parseJSXIdentifier(parser, context);\n if (parser.getToken() === 21) {\n name = parseJSXNamespacedName(parser, context, name, tokenStart);\n }\n if (parser.getToken() === 1077936155) {\n const token = scanJSXAttributeValue(parser, context);\n switch (token) {\n case 134283267:\n value = parseLiteral(parser, context);\n break;\n case 8456256:\n value = parseJSXRootElementOrFragment(parser, context, privateScope, 0, parser.tokenStart);\n break;\n case 2162700:\n value = parseJSXExpressionContainer(parser, context, privateScope, 0, 1);\n break;\n default:\n parser.report(154);\n }\n }\n return parser.finishNode({\n type: 'JSXAttribute',\n value,\n name,\n }, tokenStart);\n}\nfunction parseJSXNamespacedName(parser, context, namespace, start) {\n consume(parser, context, 21);\n const name = parseJSXIdentifier(parser, context);\n return parser.finishNode({\n type: 'JSXNamespacedName',\n namespace,\n name,\n }, start);\n}\nfunction parseJSXExpressionContainer(parser, context, privateScope, inJSXChild, isAttr) {\n const { tokenStart: start } = parser;\n nextToken(parser, context | 32);\n const { tokenStart } = parser;\n if (parser.getToken() === 14)\n return parseJSXSpreadChild(parser, context, privateScope, start);\n let expression = null;\n if (parser.getToken() === 1074790415) {\n if (isAttr)\n parser.report(157);\n expression = parseJSXEmptyExpression(parser, {\n index: parser.startIndex,\n line: parser.startLine,\n column: parser.startColumn,\n });\n }\n else {\n expression = parseExpression(parser, context, privateScope, 1, 0, tokenStart);\n }\n if (parser.getToken() !== 1074790415) {\n parser.report(25, KeywordDescTable[1074790415 & 255]);\n }\n if (inJSXChild) {\n nextJSXToken(parser);\n }\n else {\n nextToken(parser, context);\n }\n return parser.finishNode({\n type: 'JSXExpressionContainer',\n expression,\n }, start);\n}\nfunction parseJSXSpreadChild(parser, context, privateScope, start) {\n consume(parser, context, 14);\n const expression = parseExpression(parser, context, privateScope, 1, 0, parser.tokenStart);\n consume(parser, context, 1074790415);\n return parser.finishNode({\n type: 'JSXSpreadChild',\n expression,\n }, start);\n}\nfunction parseJSXEmptyExpression(parser, start) {\n return parser.finishNode({\n type: 'JSXEmptyExpression',\n }, start, parser.tokenStart);\n}\nfunction parseJSXIdentifier(parser, context) {\n const start = parser.tokenStart;\n if (!(parser.getToken() & 143360)) {\n parser.report(30, KeywordDescTable[parser.getToken() & 255]);\n }\n const { tokenValue } = parser;\n nextToken(parser, context);\n return parser.finishNode({\n type: 'JSXIdentifier',\n name: tokenValue,\n }, start);\n}\n\nvar version$1 = \"6.1.4\";\n\nconst version = version$1;\nfunction parseScript(source, options) {\n return parseSource(source, options);\n}\nfunction parseModule(source, options) {\n return parseSource(source, options, 1 | 2);\n}\nfunction parse(source, options) {\n return parseSource(source, options);\n}\n\nexport { parse, parseModule, parseScript, version };\n", "import { parseScript, type ESTree } from 'meriyah';\nimport { jsBuiltIns, memberBaseName, memberToString, walkAst } from './helpers.js';\n\nexport interface ExtractionConfig {\n /**\n * Predicate that determines whether the current node should be considered a match.\n */\n match: (node: ESTree.Node) => boolean | ESTree.Node;\n /**\n * When `false`, dependency resolution is not enforced and extractions are marked as ready immediately\n * when `stopWhenReady` is true.\n */\n collectDependencies?: boolean;\n /**\n * When `true`, traversal stops once the extraction is matched and all its dependencies (when `collectDependencies=true`) resolve.\n * Only useful for small functions/vars without too many dependencies. Deeper dependency trees will usually have the unresolvable\n * member expression here and there, for example:\n * ```js\n * var Vmi = g.dX.window, Wr = Vmi?.yt?.config_ || Vmi?.ytcfg?.data_ || {};\n * ```\n * \n * Since `Vmi.ytcfg` is a dependency, it will never resolve because it comes from `g.dX.window`, which is an external object we don't have access to. \n * In cases like this, `stopWhenReady` option does nothing useful.\n */\n stopWhenReady?: boolean;\n /**\n * If `true`, dependency collection is limited to the match context node itself.\n */\n onlyProcessMatchContext?: boolean;\n /**\n * Name for easier identification of extractions.\n */\n friendlyName?: string;\n}\n\nexport interface AnalyzerOptions {\n /**\n * One or more extraction configurations to look for while traversing.\n */\n extractions?: ExtractionConfig | ExtractionConfig[];\n}\n\nexport interface VariableMetadata {\n name: string;\n node?: any;\n dependencies: Set;\n dependents: Set;\n prototypeAliases: Map>;\n predeclared: boolean;\n}\n\nexport interface ExtractionState {\n config: ExtractionConfig;\n node?: ESTree.Node;\n metadata?: VariableMetadata;\n dependencies: Set;\n dependents: Set;\n matchContext?: ESTree.Node;\n ready: boolean;\n}\n\nexport type ExtractionMatch = ExtractionState;\n\ntype Scope = {\n names: Set;\n type: 'function' | 'block'\n};\n\n/**\n * Performs dependency-aware extraction of variables inside an IIFE.\n */\nexport class JsAnalyzer {\n private readonly source: string;\n private readonly programAst: ESTree.Program;\n private readonly hasExtractions: boolean;\n private readonly extractionStates: ExtractionState[];\n private readonly dependentsTracker: Map> = new Map();\n private pendingPrototypeAliasBinding: [string, VariableMetadata] | null = null;\n\n public iifeParamName: string | null = null;\n public readonly declaredVariables: Map = new Map();\n\n /**\n * Creates a new instance over the provided source.\n * @param code JavaScript source to parse and inspect.\n * @param options Optional traversal settings.\n */\n constructor(code: string, options: AnalyzerOptions = {}) {\n this.source = code;\n const extractionConfigs = options.extractions\n ? Array.isArray(options.extractions)\n ? options.extractions\n : [ options.extractions ]\n : [];\n\n this.extractionStates = extractionConfigs.map((config) => ({\n config: { collectDependencies: true, stopWhenReady: true, ...config },\n dependencies: new Set(),\n dependents: new Set(),\n ready: false\n }));\n\n this.hasExtractions = this.extractionStates.length > 0;\n\n this.programAst = parseScript(code, {\n ranges: true,\n loc: false,\n module: false\n });\n\n this.analyzeAst();\n }\n\n /**\n * Walks the AST to collect declarations and resolve initial targets.\n */\n private analyzeAst(): void {\n let iifeBody: ESTree.BlockStatement | undefined;\n\n for (const statement of this.programAst.body) {\n if (statement.type === 'ExpressionStatement' && statement.expression.type === 'CallExpression') {\n const callExpr = statement.expression;\n if (callExpr.callee.type === 'FunctionExpression') {\n const funcExpr = callExpr.callee;\n const firstParam = funcExpr.params.length > 0 ? funcExpr.params[0] : null;\n\n if (!this.iifeParamName && firstParam?.type === 'Identifier') {\n this.iifeParamName = firstParam.name; // Maybe it should be an array?\n }\n\n if (funcExpr.body?.type === 'BlockStatement') {\n iifeBody = funcExpr.body;\n break; // Found it, no need to continue.\n }\n }\n }\n }\n\n if (!iifeBody) return;\n\n for (const currentNode of iifeBody.body) {\n switch (currentNode.type) {\n case 'ExpressionStatement': {\n const assignment = currentNode.expression;\n if (assignment.type !== 'AssignmentExpression') continue;\n\n const left = assignment.left;\n const right = assignment.right;\n\n // Detect things like `a.b = g.c.prototype` so later `a.b.foo = ...` can be attributed back to `g.c`.\n if (\n right.type === 'MemberExpression' &&\n !right.computed &&\n right.property.type === 'Identifier' &&\n right.property.name === 'prototype'\n ) {\n const prototypeSourceExpr = memberToString(right, this.source);\n const aliasTargetExpr = left.type === 'Identifier' ? left.name : memberToString(left, this.source);\n\n if (prototypeSourceExpr) {\n const prototypeOwnerMeta = this.declaredVariables.get(\n prototypeSourceExpr.replace('.prototype', '')\n );\n\n if (aliasTargetExpr && prototypeOwnerMeta) {\n const aliasedPrototypeMembers = new Set();\n const aliasExpr = `${aliasTargetExpr}.`; // Had to add a dot here so we can detect it later when matching member expressions..\n\n // Activate an alias binding context, so subsequent member assignments to the alias (`a.b.foo = ...`) can be tracked.\n // NOTE: This assumes that the alias members come right after this declaration and are grouped together in the code, hehe :)\n this.pendingPrototypeAliasBinding = [ aliasExpr, prototypeOwnerMeta ];\n\n prototypeOwnerMeta.prototypeAliases.set(aliasExpr, aliasedPrototypeMembers);\n }\n }\n }\n\n if (left.type === 'Identifier') {\n // This identifier existing means it was a pre-declared and\n // we just got to it.\n const existingVariable = this.declaredVariables.get(left.name);\n if (!existingVariable) continue;\n\n existingVariable.node.init = right;\n\n if (this.needsDependencyAnalysis(right)) {\n existingVariable.dependencies = this.findDependencies(assignment.right, left.name);\n }\n\n if (this.onMatch(existingVariable.node, existingVariable)) return;\n } else if (assignment.left.type === 'MemberExpression') {\n const memberName = memberToString(assignment.left, this.source);\n const activeAliasExpr = this.pendingPrototypeAliasBinding?.[0];\n\n // While an alias binding is active, collect member assignments made through the alias (`g.q.foo = ...`).\n if (activeAliasExpr && (memberName?.includes(activeAliasExpr) || memberName === activeAliasExpr.slice(0, -1))) {\n const aliasOwnerMeta = this.declaredVariables.get(this.pendingPrototypeAliasBinding?.[1].name || '');\n if (aliasOwnerMeta) {\n const existingAliasedMembers = aliasOwnerMeta.prototypeAliases.get(activeAliasExpr);\n\n const aliasedMemberMeta: VariableMetadata = {\n name: memberName,\n node: currentNode,\n dependents: this.dependentsTracker.get(memberName) || new Set(),\n predeclared: false,\n prototypeAliases: new Map>(),\n dependencies: this.findDependencies(right, memberName)\n };\n\n if (existingAliasedMembers) {\n existingAliasedMembers.add(aliasedMemberMeta);\n } else {\n aliasOwnerMeta.prototypeAliases.set(activeAliasExpr, new Set([ aliasedMemberMeta ]));\n }\n }\n } else {\n this.pendingPrototypeAliasBinding = null;\n }\n\n if (!memberName || this.declaredVariables.has(memberName)) continue;\n\n const metadata: VariableMetadata = {\n name: memberName,\n node: currentNode,\n dependents: this.dependentsTracker.get(memberName) || new Set(),\n predeclared: false,\n prototypeAliases: new Map>(),\n dependencies: this.findDependencies(right, memberName)\n };\n\n const baseName = memberBaseName(assignment.left, this.source);\n if (baseName && baseName !== memberName && !baseName.startsWith('this.')) {\n metadata.dependencies.add(baseName.replace('.prototype', ''));\n }\n\n if (this.dependentsTracker.has(memberName)) {\n this.dependentsTracker.delete(memberName);\n }\n\n this.declaredVariables.set(memberName, metadata);\n\n if (this.onMatch(currentNode, metadata)) return;\n }\n break;\n }\n case 'VariableDeclaration': {\n this.pendingPrototypeAliasBinding = null;\n\n for (const declaration of currentNode.declarations) {\n if (declaration.id.type !== 'Identifier') continue;\n\n const metadata: VariableMetadata = {\n name: declaration.id.name,\n node: declaration,\n dependents: this.dependentsTracker.get(declaration.id.name) || new Set(),\n prototypeAliases: new Map>(),\n dependencies: new Set(),\n predeclared: false\n };\n\n const init = declaration.init;\n\n if (!init && currentNode.kind === 'var') {\n metadata.predeclared = true; // \"var x, y, z;\"\n } else if (init && this.needsDependencyAnalysis(init)) {\n metadata.dependencies = this.findDependencies(init, metadata.name);\n }\n\n if (this.dependentsTracker.has(metadata.name)) {\n this.dependentsTracker.delete(metadata.name);\n }\n\n this.declaredVariables.set(metadata.name, metadata);\n\n if (this.onMatch(declaration, metadata)) return;\n }\n break;\n }\n }\n }\n }\n\n /**\n * Quick check if node type requires dependency analysis\n */\n private needsDependencyAnalysis(node: ESTree.Node | null): boolean {\n if (!node) return false;\n switch (node.type) {\n case 'FunctionExpression':\n case 'ArrowFunctionExpression':\n case 'ArrayExpression':\n case 'LogicalExpression':\n case 'CallExpression':\n case 'NewExpression':\n case 'MemberExpression':\n case 'BinaryExpression':\n case 'ConditionalExpression':\n case 'ObjectExpression':\n case 'SequenceExpression':\n case 'ClassExpression':\n case 'Identifier':\n return true;\n default:\n return false;\n }\n }\n\n /**\n * Records a match, attaches metadata, and updates readiness state.\n * @returns True when traversal can stop as a result of the match.\n */\n private onMatch(\n node: ESTree.Node,\n metadata?: VariableMetadata\n ): boolean {\n if (!this.hasExtractions) return false;\n\n let matched = false;\n let result: ESTree.Node | boolean = false;\n\n for (const state of this.extractionStates) {\n if (!state.node) {\n if (node.type === 'VariableDeclarator' && !node.init) continue;\n\n result = state.config.match(node);\n\n if (!result) continue;\n state.node = node;\n\n matched = true;\n\n if (metadata) {\n state.metadata = metadata;\n state.dependents = metadata.dependents;\n state.dependencies = metadata.dependencies;\n if (typeof result !== 'boolean')\n state.matchContext = result;\n }\n\n this.refreshExtractionState(state);\n } else if (state.node !== node) {\n // Use this as a chance to refresh readiness in case dependencies were resolved since last time\n // we checked.\n this.refreshExtractionState(state);\n\n if (this.shouldStopTraversal()) {\n return true;\n }\n }\n }\n\n if (!matched) return false;\n\n return this.shouldStopTraversal();\n }\n\n /**\n * Refreshes the readiness state of an extraction target based on its dependencies\n * and/or configuration.\n * @param state - State to refresh.\n */\n private refreshExtractionState(state: ExtractionState): void {\n if (!state.node) {\n state.ready = false;\n return;\n }\n\n if (state.config.collectDependencies === false) {\n state.ready = true;\n return;\n }\n\n if (!state.metadata) {\n state.ready = false;\n return;\n }\n\n state.ready = this.areDependenciesResolved(state.dependencies);\n }\n\n /**\n * Determines whether traversal should stop based on extraction states and configuration.\n */\n private shouldStopTraversal(): boolean {\n if (!this.hasExtractions) return false;\n\n let hasStoppingTarget = false;\n\n for (const state of this.extractionStates) {\n if (state.config.stopWhenReady === false) continue;\n\n hasStoppingTarget = true;\n\n if (!state.node) return false;\n if (!state.ready) return false;\n }\n\n return hasStoppingTarget;\n }\n\n /**\n * Checks if every dependency resolves to a declaration or built-in symbol.\n * @param dependencies - Dependencies to validate.\n * @param seen - Tracks recursively visited identifiers.\n */\n private areDependenciesResolved(\n dependencies: Set,\n seen: Set = new Set()\n ): boolean {\n if (!dependencies || dependencies.size === 0)\n return true;\n\n for (const dependency of dependencies) {\n if (!dependency) continue;\n if (jsBuiltIns.has(dependency)) continue;\n if (dependency === this.iifeParamName) continue;\n\n if (seen.has(dependency)) continue;\n\n const depMeta = this.declaredVariables.get(dependency);\n if (!depMeta) return false;\n\n seen.add(dependency);\n\n if (!this.areDependenciesResolved(depMeta.dependencies, seen)) {\n return false;\n }\n }\n\n return true;\n }\n\n /**\n * Collects free identifier dependencies reachable from the provided AST node.\n * @param rootNode - AST node to search for dependencies.\n * @param identifierName - Name of the identifier represented by `rootNode`, used for tracking dependents.\n */\n private findDependencies(rootNode: ESTree.Node, identifierName: string): Set {\n const dependencies = new Set();\n if (!rootNode) return dependencies;\n\n const scopeStack: Scope[] = [\n {\n names: new Set(),\n type: 'block'\n }\n ];\n\n const currentScope = () => scopeStack[scopeStack.length - 1];\n\n const isInScope = (name: string) => {\n for (let i = scopeStack.length - 1; i >= 0; i--) {\n if (scopeStack[i].names.has(name)) return true;\n }\n return false;\n };\n\n const rootIdentifierName = 'id' in rootNode && rootNode?.id?.type === 'Identifier' ? rootNode.id.name : undefined;\n\n const collectBindingIdentifiers = (pattern: ESTree.Node | null, target: Set) => {\n if (!pattern)\n return;\n\n switch (pattern.type) {\n case 'Identifier':\n target.add(pattern.name);\n break;\n case 'ObjectPattern':\n for (const prop of pattern.properties) {\n if (prop.type === 'RestElement') {\n collectBindingIdentifiers(prop.argument, target);\n } else if (prop.type === 'Property') {\n collectBindingIdentifiers(prop.value, target);\n }\n }\n break;\n case 'ArrayPattern':\n for (const el of pattern.elements) {\n if (el) collectBindingIdentifiers(el, target);\n }\n break;\n case 'RestElement':\n collectBindingIdentifiers(pattern.argument, target);\n break;\n case 'AssignmentPattern':\n collectBindingIdentifiers(pattern.left, target);\n break;\n }\n };\n\n const collectParams = (fnNode: ESTree.ArrowFunctionExpression | ESTree.FunctionExpression | ESTree.FunctionDeclaration, target: Set) => {\n if (!fnNode?.params) return;\n for (const p of fnNode.params) collectBindingIdentifiers(p, target);\n };\n\n walkAst(rootNode, {\n enter: (n, parent) => {\n switch (n.type) {\n // Note for anybody debugging this in the future:\n // *DO NOT* add MethodDefinition here.\n // MethodDefinition.value is a FunctionExpression, so it is already handled...\n case 'FunctionDeclaration':\n case 'FunctionExpression':\n case 'ArrowFunctionExpression': {\n const isDecl = n.type === 'FunctionDeclaration';\n const fnName = 'id' in n ? n.id?.name : undefined;\n\n // Add func name to scope if it's a declaration, this way it won't be considered a dep itself.\n if (isDecl && fnName) {\n currentScope().names.add(fnName);\n }\n\n // Enter function scope.\n const fnScope: Scope = { names: new Set(), type: 'function' };\n\n if (n.type === 'FunctionExpression' && fnName) {\n fnScope.names.add(fnName);\n }\n\n collectParams(n, fnScope.names);\n scopeStack.push(fnScope);\n break;\n }\n case 'BlockStatement': {\n scopeStack.push({ names: new Set(), type: 'block' });\n break;\n }\n case 'CatchClause': {\n const s = new Set();\n if (n.param) collectBindingIdentifiers(n.param, s);\n scopeStack.push({ names: s, type: 'block' });\n break;\n }\n case 'VariableDeclaration': {\n // var hoists to function scope...\n const targetScope = n.kind === 'var'\n ? scopeStack.findLast((s) => s.type === 'function') ?? currentScope()\n : currentScope();\n for (const d of n.declarations) {\n collectBindingIdentifiers(d.id, targetScope.names);\n }\n break;\n }\n case 'ClassDeclaration': {\n if (n.id?.name) {\n currentScope().names.add(n.id.name);\n }\n break;\n }\n case 'LabeledStatement': { // YouTube uses these things for some reason.\n if (n.label?.type === 'Identifier') currentScope().names.add(n.label.name);\n break;\n }\n case 'Identifier': {\n if (n.name === rootIdentifierName) return;\n\n // Ignore if it's a property name (e.g., \"obj.prop\" or \"{prop: 1}\"\", we don't care about the \"prop\" name itself).\n if (parent?.type === 'Property' && parent.key === n && !parent.computed) return;\n // Ignore class method names. They are declarations, not external dependencies.\n if (parent?.type === 'MethodDefinition' && parent.key === n && !parent.computed) return;\n if (parent?.type === 'MemberExpression' && parent.property === n && !parent.computed) {\n if (parent.object.type === 'ThisExpression') return; // Skip 'this.property', etc.\n\n const full = memberToString(parent, this.source);\n if (!full) return;\n\n const declaredVariable = this.declaredVariables.get(full);\n if (declaredVariable) {\n declaredVariable.dependents.add(identifierName);\n dependencies.add(full);\n } else if (parent.object.type === 'Identifier') {\n const baseName = parent.object.name;\n\n const declaredBaseVariable = this.declaredVariables.get(baseName);\n if (\n (declaredBaseVariable || baseName === this.iifeParamName) &&\n !isInScope(baseName) && !jsBuiltIns.has(baseName)\n ) {\n declaredBaseVariable?.dependents.add(identifierName);\n dependencies.add(full);\n\n // We have this object, but not the full member chain.\n const existingTracker = this.dependentsTracker.get(full);\n if (existingTracker) {\n existingTracker.add(identifierName);\n } else {\n this.dependentsTracker.set(full, new Set([ identifierName ]));\n }\n }\n }\n return;\n }\n\n if (parent?.type === 'MetaProperty') {\n return; // Skip stuff like \"new.target\" or \"import.meta\"\n }\n\n if (isInScope(n.name) || jsBuiltIns.has(n.name)) return;\n\n // It's a free variable, so it's a dependency.\n dependencies.add(n.name);\n\n const declaredVariable = this.declaredVariables.get(n.name);\n if (declaredVariable) {\n declaredVariable.dependents.add(identifierName);\n } else {\n // Not declared yet, track for future resolution.\n const existing = this.dependentsTracker.get(n.name);\n if (existing) {\n existing.add(identifierName);\n } else {\n this.dependentsTracker.set(n.name, new Set([ identifierName ]));\n }\n }\n break;\n }\n case 'ForStatement':\n case 'ForInStatement':\n case 'ForOfStatement': {\n scopeStack.push({ names: new Set(), type: 'block' });\n break;\n }\n }\n },\n leave: (n: any) => {\n switch (n.type) {\n case 'FunctionDeclaration':\n case 'FunctionExpression':\n case 'ArrowFunctionExpression':\n case 'BlockStatement':\n case 'CatchClause':\n case 'ForStatement':\n case 'ForInStatement':\n case 'ForOfStatement':\n if (scopeStack.length > 1) scopeStack.pop();\n break;\n }\n }\n });\n\n return dependencies;\n }\n\n /**\n * Returns the current set of matched extractions.\n */\n public getExtractedMatches(): ExtractionMatch[] {\n return this.extractionStates\n .filter((state) => !!state.node);\n }\n\n /**\n * Returns the raw, original source.\n */\n public getSource(): string {\n return this.source;\n }\n}", "import type { ESTree } from 'meriyah';\nimport type { JsAnalyzer, VariableMetadata } from './JsAnalyzer.js';\nimport { createWrapperFunction, extractNodeSource, indent, jsBuiltIns, memberToString } from './helpers.js';\n\nexport type SideEffectMode = 'strict' | 'loose';\n\nexport interface SideEffectPolicyOptions {\n /**\n * Determines how strictly side-effect detection should behave.\n * Use `\"loose\"` to allow benign computed expressions.\n */\n mode?: SideEffectMode;\n}\n\nexport interface EmitterOptions {\n /**\n * The maximum depth to traverse when emitting dependencies.\n * If not specified, there is no limit on the depth.\n */\n maxDepth?: number;\n /**\n * When true or configured, replace unsafe initializers (calls, `new`, etc.)\n * with `undefined` to avoid executing side-effectful code.\n * Use `{ mode: 'loose' }` to allow a broader set of expressions.\n */\n disallowSideEffectInitializers?: boolean | SideEffectPolicyOptions;\n /**\n * When true, emit a single `var` declaration for every variable\n * encountered, even if it originally had an initializer.\n */\n forceVarPredeclaration?: boolean;\n /**\n * When true, also export raw values of matched nodes.\n */\n exportRawValues?: boolean;\n /**\n * Array of names to skip emitting code/deps for, but still export the raw value.\n */\n rawValueOnly?: string[];\n}\n\nexport interface BuildScriptResult {\n /**\n * The generated output script as a string.\n */\n output: string;\n /**\n * An array of exported variable names.\n */\n exported: string[];\n /**\n * An object mapping exported variable names to their raw values, if `exportRawValues` was enabled.\n */\n exportedRawValues?: Record;\n}\n\n/**\n * Class responsible for extracting and emitting JavaScript code snippets\n * based on analysis results from a `JsAnalyzer` instance.\n */\nexport class JsExtractor {\n constructor(private analyzer: JsAnalyzer) { /** no-op */ }\n\n /**\n * Checks if all provided arguments are safe initializers.\n * @param args - The arguments to check.\n * @param mode - The side effect mode to use ('strict' or 'loose').\n */\n private areSafeArgs(\n args?: (ESTree.Expression | ESTree.SpreadElement | null | undefined)[],\n mode: SideEffectMode = 'strict'\n ): boolean {\n return (args ?? []).every((arg) => {\n if (!arg) return false;\n if (arg.type === 'SpreadElement') return false;\n return this.isSafeInitializer(arg, mode);\n });\n }\n\n /**\n * Determines if a given AST node is a safe initializer without side effects.\n * @param node - The AST node to evaluate.\n * @param mode - The side effect mode to use ('strict' or 'loose').\n */\n private isSafeInitializer(\n node?: ESTree.Node | null,\n mode: SideEffectMode = 'strict'\n ): boolean {\n if (!node) return true;\n\n switch (node.type) {\n case 'ClassExpression':\n return true;\n case 'Literal': {\n const literal = node as ESTree.Literal & { regex?: unknown };\n return (\n typeof literal.value === 'string' ||\n typeof literal.value === 'number' ||\n typeof literal.value === 'boolean' ||\n literal.value === null ||\n Boolean(literal.regex)\n );\n }\n case 'TemplateLiteral': {\n return node.expressions.every((expr) => this.isSafeInitializer(expr, mode));\n }\n case 'ArrayExpression': {\n return node.elements.every((elem) => {\n if (!elem) return true;\n if (elem.type === 'SpreadElement') return false;\n return this.isSafeInitializer(elem, mode);\n });\n }\n case 'ObjectExpression': {\n return node.properties.every((prop) => {\n if (prop.type !== 'Property') return false;\n if (prop.computed) return false;\n if (prop.kind !== 'init') return false;\n\n const value = prop.value;\n if (!value) return false;\n\n // e.g., { a: function() {} }, { a: () => {} }, or { a: \"string\" }\n return value.type === 'FunctionExpression' ||\n value.type === 'ArrowFunctionExpression' ||\n value.type === 'Literal';\n\n });\n }\n case 'CallExpression': {\n if (node.callee.type === 'Identifier' && jsBuiltIns.has(node.callee.name)) {\n return this.areSafeArgs(node.arguments, mode);\n } else if (node.callee.type === 'MemberExpression') {\n if (!this.isSafeInitializer(node.callee.object, mode)) return false;\n\n if (mode === 'strict') {\n const propertyName = node.callee.property.type === 'Identifier' ? node.callee.property.name : '';\n if (node.callee.computed || !jsBuiltIns.has(propertyName)) {\n return false;\n }\n }\n\n return this.areSafeArgs(node.arguments, mode);\n }\n return false;\n }\n case 'NewExpression': {\n if (node.callee.type === 'Identifier') {\n if (jsBuiltIns.has(node.callee.name)) {\n return this.areSafeArgs(node.arguments, mode);\n }\n if (mode === 'loose') {\n return this.areSafeArgs(node.arguments, mode);\n }\n }\n return false;\n }\n case 'UnaryExpression': {\n return this.isSafeInitializer(node.argument, mode);\n }\n case 'FunctionExpression':\n case 'ArrowFunctionExpression':\n case 'Identifier': {\n return true;\n }\n case 'MemberExpression': {\n if (mode === 'loose') {\n if (node.computed && !this.isSafeInitializer(node.property, mode)) {\n return false;\n }\n return this.isSafeInitializer(node.object, mode);\n }\n\n // Allow cases such as a.b = c.prototype;\n if (!node.computed && node.property.type === 'Identifier' && node.property.name === 'prototype') {\n return true;\n }\n\n return false;\n }\n case 'LogicalExpression':\n case 'BinaryExpression': {\n return (\n this.isSafeInitializer(node.left, mode) &&\n this.isSafeInitializer(node.right, mode)\n );\n }\n case 'ConditionalExpression': {\n if (mode === 'loose') {\n return (\n this.isSafeInitializer(node.test, mode) &&\n this.isSafeInitializer(node.consequent, mode) &&\n this.isSafeInitializer(node.alternate, mode)\n );\n }\n return false;\n }\n case 'SequenceExpression': {\n if (mode === 'loose') {\n return node.expressions.every((expr) => this.isSafeInitializer(expr, mode));\n }\n return false;\n }\n case 'AssignmentExpression': {\n if (node.left.type === 'MemberExpression' && !node.left.computed) {\n const object = node.left.object;\n if (object.type === 'Identifier' && this.analyzer.declaredVariables.get(object.name)?.node.init !== undefined) {\n return this.isSafeInitializer(node.right, mode);\n }\n } else if (node.left.type === 'Identifier') {\n if (this.analyzer.declaredVariables.has(node.left.name)) {\n return this.isSafeInitializer(node.right, mode);\n }\n }\n return false;\n }\n // @todo: check for more?\n default:\n return false;\n }\n }\n\n /**\n * Provides a fallback initializer string based on the type of the initializer node.\n * @TODO: Check more cases.\n * @param init - The initializer expression to evaluate.\n */\n private getInitializerFallback(init?: ESTree.Expression | null): string {\n switch (init?.type) {\n case 'ObjectExpression':\n case 'NewExpression':\n case 'MemberExpression':\n case 'LogicalExpression':\n return '{}';\n case 'ArrayExpression':\n return '[]';\n default:\n return 'undefined';\n }\n }\n\n /**\n * Renders an AST node to JavaScript source code, with special handling for variable declarators.\n * @param node - The ESTree node to render.\n * @param preDeclared - Whether the variable has been previously declared.\n * @param options - Configuration options for the emitter.\n */\n private renderNode(\n node: ESTree.Node,\n preDeclared: boolean,\n options: EmitterOptions = {}\n ) {\n const source = this.analyzer.getSource();\n const declaredVariables = this.analyzer.declaredVariables;\n\n const sideEffectPolicy = options.disallowSideEffectInitializers;\n const sideEffectMode = typeof sideEffectPolicy === 'object' && sideEffectPolicy !== null ?\n sideEffectPolicy.mode ?? 'strict' : 'strict';\n const canDisallow = Boolean(sideEffectPolicy);\n\n const assignmentTarget =\n node.type === 'AssignmentExpression'\n ? node\n : node.type === 'ExpressionStatement' && node.expression.type === 'AssignmentExpression'\n ? node.expression\n : null;\n\n const init = assignmentTarget && assignmentTarget.operator === '=' ? assignmentTarget.right : node.type === 'VariableDeclarator' ? node.init : null;\n const forceRemove = canDisallow && init && !this.isSafeInitializer(init, sideEffectMode);\n const initializerFallback = this.getInitializerFallback(init);\n\n let initSource = initializerFallback;\n\n if (!forceRemove && init) {\n // e.g. `var someVar = document;`\n if (!preDeclared && init.type === 'Identifier' && !declaredVariables.has(init.name)) {\n initSource = initializerFallback;\n } else {\n const left = assignmentTarget?.left;\n const isPrototypeAlias = init?.type === 'MemberExpression' && !init.computed && init.property.type === 'Identifier' && init.property.name === 'prototype';\n\n // Skip things we don't need.\n if (!isPrototypeAlias && left?.type === 'MemberExpression' && init) {\n if (\n canDisallow &&\n left.object.type === 'Identifier' &&\n init.type !== 'FunctionExpression' &&\n init.type !== 'ArrowFunctionExpression' &&\n init.type !== 'LogicalExpression' &&\n init.type !== 'ClassExpression'\n ) {\n return `${indent}// Skipped ${memberToString(left, source)} assignment.`;\n }\n }\n\n // e.g. `someVar = someOtherVarFuncOrCall`\n initSource = extractNodeSource(init, source)\n ?.trim()\n .replace(/;\\s*$/, '') || 'undefined // [JsExtractor] Failed to extract initializer source.';\n }\n }\n\n // Wrap sequence expressions in parens to avoid syntax issues.\n if (!forceRemove && init && init.type === 'SequenceExpression' && !initSource.startsWith('(')) {\n initSource = `(${initSource})`;\n }\n\n const idName =\n node.type === 'VariableDeclarator' && node.id.type === 'Identifier' ? node.id.name :\n assignmentTarget && assignmentTarget.left.type === 'Identifier' ? assignmentTarget.left.name :\n assignmentTarget?.type === 'AssignmentExpression' ? memberToString(assignmentTarget.left, source)?.trim() : 'unknown';\n\n const assignmentExpression = `${idName} = ${initSource};`;\n\n // If it's not pre-declared and has an initializer, we need to use the `var` keyword (duh).\n if (node.type === 'VariableDeclarator' && node.init && !preDeclared) {\n return `${indent}var ${assignmentExpression}`;\n }\n\n return `${indent}${assignmentExpression}`;\n }\n\n /**\n * Processes extracted matches from the analyzer, handles dependencies, predeclares \n * variables as needed, and generates an IIFE-wrapped output string containing the\n * code snippets and exported variables.\n * @param config - Configuration options for the emitter.\n */\n public buildScript(config: EmitterOptions): BuildScriptResult {\n const { maxDepth = Infinity, forceVarPredeclaration = false, exportRawValues = false, rawValueOnly: skipEmitFor = [] } = config;\n\n const extractions = this.analyzer.getExtractedMatches();\n const seen = new Set(extractions.map((e) => e.metadata?.name || ''));\n\n const snippets: string[] = [];\n const predeclaredVarSet = new Set();\n const exported = new Map();\n const exportedRawValues: Record = {};\n\n function registerPredeclaredVar(name?: string) {\n if (!name || name.includes('.')) return;\n predeclaredVarSet.add(name);\n }\n\n const visit = (metadata?: VariableMetadata, depth: number = 0, whitelistedDep?: string) => {\n if (!metadata || depth > maxDepth) return;\n\n for (const dependency of metadata.dependencies) {\n if (whitelistedDep && whitelistedDep !== dependency) {\n // If we haven't yet encountered the whitelisted dependency, skip this one.\n // And if we have, delete the whitelist var so that all subsequent dependencies are included.\n if (!seen.has(whitelistedDep))\n continue;\n whitelistedDep = undefined;\n }\n\n if (seen.has(dependency))\n continue;\n\n seen.add(dependency);\n\n const dependencyMetadata = this.analyzer.declaredVariables.get(dependency);\n\n if (!dependencyMetadata)\n continue;\n\n const shouldPredeclare = forceVarPredeclaration || dependencyMetadata.predeclared;\n if (shouldPredeclare) {\n registerPredeclaredVar(dependency);\n }\n\n visit(dependencyMetadata, depth + 1, whitelistedDep);\n\n snippets.push(this.renderNode(dependencyMetadata.node, shouldPredeclare, config));\n\n if (dependencyMetadata.prototypeAliases.size > 0) {\n for (const [ , aliasMembers ] of dependencyMetadata.prototypeAliases) {\n for (const member of aliasMembers) {\n // This is deeper than the first visit, so no need to pass the whitelist, we want all deps of the member to be included.\n visit(member, depth);\n snippets.push(this.renderNode(member.node, shouldPredeclare, config));\n }\n }\n }\n }\n };\n\n // Now we can process the main stuff.\n for (const extraction of extractions) {\n const fname = extraction.config.friendlyName;\n const shouldSkip = fname && skipEmitFor.includes(fname);\n\n if (extraction.metadata) {\n if (!shouldSkip)\n snippets.push(`${indent}//#region --- start [${fname || 'Unknown'}] ---`);\n\n const shouldPredeclare = (forceVarPredeclaration || extraction.metadata.predeclared) && !shouldSkip;\n const onlyProcessMatchContext = extraction.config.onlyProcessMatchContext;\n\n if (shouldPredeclare) {\n registerPredeclaredVar(extraction.metadata.name);\n }\n\n if (extraction.config.collectDependencies && !shouldSkip) {\n let whitelistedDep;\n\n const matchContextNode = extraction.matchContext;\n\n if (matchContextNode?.type === 'NewExpression' && onlyProcessMatchContext) {\n if (matchContextNode.callee.type === 'Identifier') {\n whitelistedDep = matchContextNode.callee.name;\n } else if (matchContextNode.callee.type === 'MemberExpression') {\n whitelistedDep = memberToString(matchContextNode.callee, this.analyzer.getSource()) || undefined;\n }\n }\n\n visit(extraction.metadata, undefined, whitelistedDep);\n }\n\n if (extraction.matchContext && fname) {\n exported.set(fname, extraction.matchContext);\n\n if (exportRawValues) {\n const ctx = extraction.matchContext;\n const src = this.analyzer.getSource();\n let rawValue: string | null = null;\n\n if (ctx.type === 'Property') {\n rawValue = extractNodeSource(ctx.value, src);\n } else if (ctx.type === 'Identifier') {\n rawValue = ctx.name;\n } else {\n rawValue = extractNodeSource(ctx, src);\n }\n\n exportedRawValues[fname] = rawValue;\n }\n }\n\n if (!shouldSkip) {\n if (!onlyProcessMatchContext) {\n snippets.push(this.renderNode(extraction.metadata.node, shouldPredeclare, config));\n }\n\n snippets.push(`${indent}//#endregion --- end [${fname || 'Unknown'}] ---\\n`);\n }\n }\n }\n\n const output = [];\n\n output.push('const __jsExtractorGlobal = typeof globalThis !== \\'undefined\\' ? globalThis :');\n output.push(`${indent}typeof self !== 'undefined' ? self :`);\n output.push(`${indent}typeof window !== 'undefined' ? window :`);\n output.push(`${indent}typeof global !== 'undefined' ? global : {};\\n`);\n\n output.push(`const exportedVars = (function(${this.analyzer.iifeParamName}) {`);\n output.push(`${indent}const window = typeof __jsExtractorGlobal.window !== 'undefined' ? __jsExtractorGlobal.window : Object.create(null);`);\n output.push(`${indent}const document = typeof __jsExtractorGlobal.document !== 'undefined' ? __jsExtractorGlobal.document : {};`);\n output.push(`${indent}const self = typeof __jsExtractorGlobal.self !== 'undefined' ? __jsExtractorGlobal.self : window;\\n`);\n\n if (predeclaredVarSet.size > 0) {\n output.push(`${indent}var ${Array.from(predeclaredVarSet).join(', ')};\\n`);\n }\n\n output.push(snippets.join('\\n'));\n\n const exportedVars = [];\n\n // Finally, export the matched stuff.\n for (const [ friendlyName, node ] of exported) {\n let currentFunctionNode: ESTree.Node | null = null;\n\n if (node.type === 'Identifier') {\n const decl = this.analyzer.declaredVariables.get(node.name);\n if (decl?.node?.type === 'VariableDeclarator' && decl.node.init?.type === 'FunctionExpression') {\n currentFunctionNode = decl.node;\n }\n } else if (node.type === 'CallExpression' || node.type === 'NewExpression' || node.type === 'VariableDeclarator') {\n currentFunctionNode = node;\n }\n\n if (currentFunctionNode) {\n const wrapper = createWrapperFunction(this.analyzer, friendlyName, currentFunctionNode);\n if (wrapper) {\n output.push(`${wrapper}\\n`);\n exportedVars.push(friendlyName);\n }\n }\n }\n\n if (exportRawValues) {\n const rawJson = JSON.stringify(exportedRawValues, null, indent.length);\n const rawJsonLines = rawJson.split('\\n');\n\n // Indent all lines except the first one..\n const formattedRawJson =\n `${rawJsonLines[0]}\\n${rawJsonLines.slice(1).map((line) => indent + line).join('\\n')}`;\n\n output.push(`${indent}const rawValues = ${formattedRawJson};\\n`);\n\n exportedVars.push('rawValues');\n }\n\n output.push(`${indent}return { ${exportedVars.join(', ')} };`);\n output.push('})({});\\n');\n\n return {\n output: output.join('\\n'),\n exported: exportedVars,\n exportedRawValues: exportRawValues ? exportedRawValues : undefined\n };\n }\n}", "import { Parser } from '../../index.js';\nimport { YTNode } from '../../helpers.js';\nimport type { RawNode } from '../../index.js';\n\nexport default class OpenPopupAction extends YTNode {\n static type = 'OpenPopupAction';\n\n popup: YTNode;\n popup_type: string;\n\n constructor(data: RawNode) {\n super();\n this.popup = Parser.parseItem(data.popup);\n this.popup_type = data.popupType;\n }\n}", "import Text from './misc/Text.js';\nimport NavigationEndpoint from './NavigationEndpoint.js';\nimport { YTNode } from '../helpers.js';\nimport type { RawNode } from '../index.js';\nimport AccessibilityData, { type AccessibilitySupportedDatas } from './misc/AccessibilityData.js';\n\nexport default class Button extends YTNode {\n static type = 'Button';\n\n public text?: string;\n public label?: string;\n public tooltip?: string;\n public style?: string;\n public size?: string;\n public icon_type?: string;\n public is_disabled?: boolean;\n public target_id?: string;\n public endpoint: NavigationEndpoint;\n public accessibility?: AccessibilitySupportedDatas;\n \n constructor(data: RawNode) {\n super();\n if (Reflect.has(data, 'text'))\n this.text = new Text(data.text).toString();\n\n if (Reflect.has(data, 'accessibility') && Reflect.has(data.accessibility, 'label')) {\n this.label = data.accessibility.label;\n }\n\n if ('accessibilityData' in data\n && 'accessibilityData' in data.accessibilityData) {\n this.accessibility = {\n accessibility_data: new AccessibilityData(data.accessibilityData.accessibilityData)\n };\n }\n\n if (Reflect.has(data, 'tooltip'))\n this.tooltip = data.tooltip;\n\n if (Reflect.has(data, 'style'))\n this.style = data.style;\n\n if (Reflect.has(data, 'size'))\n this.size = data.size;\n\n if (Reflect.has(data, 'icon') && Reflect.has(data.icon, 'iconType'))\n this.icon_type = data.icon.iconType;\n\n if (Reflect.has(data, 'isDisabled'))\n this.is_disabled = data.isDisabled;\n\n if (Reflect.has(data, 'targetId'))\n this.target_id = data.targetId;\n\n this.endpoint = new NavigationEndpoint(data.navigationEndpoint || data.serviceEndpoint || data.command);\n }\n}", "import { YTNode } from '../helpers.js';\nimport type { RawNode } from '../index.js';\nimport Text from './misc/Text.js';\nimport NavigationEndpoint from './NavigationEndpoint.js';\n\nexport default class DropdownItem extends YTNode {\n static type = 'DropdownItem';\n\n label: string;\n selected: boolean;\n value?: number | string;\n icon_type?: string;\n description?: Text;\n endpoint?: NavigationEndpoint;\n\n constructor(data: RawNode) {\n super();\n this.label = new Text(data.label).toString();\n this.selected = !!data.isSelected;\n\n if (Reflect.has(data, 'int32Value')) {\n this.value = data.int32Value;\n } else if (data.stringValue) {\n this.value = data.stringValue;\n }\n\n if (Reflect.has(data, 'onSelectCommand')) {\n this.endpoint = new NavigationEndpoint(data.onSelectCommand);\n }\n\n if (Reflect.has(data, 'icon')) {\n this.icon_type = data.icon?.iconType;\n }\n\n if (Reflect.has(data, 'descriptionText')) {\n this.description = new Text(data.descriptionText);\n }\n }\n}", "import { YTNode, type ObservedArray } from '../helpers.js';\nimport { Parser, type RawNode } from '../index.js';\nimport DropdownItem from './DropdownItem.js';\n\nexport default class Dropdown extends YTNode {\n static type = 'Dropdown';\n\n label: string;\n entries: ObservedArray;\n\n constructor(data: RawNode) {\n super();\n this.label = data.label || '';\n this.entries = Parser.parseArray(data.entries, DropdownItem);\n }\n}", "import { YTNode } from '../helpers.js';\nimport { Parser, type RawNode } from '../index.js';\nimport Button from './Button.js';\nimport Dropdown from './Dropdown.js';\nimport Text from './misc/Text.js';\n\nexport default class CreatePlaylistDialog extends YTNode {\n static type = 'CreatePlaylistDialog';\n\n title: string;\n title_placeholder: string;\n privacy_option: Dropdown | null;\n cancel_button: Button | null;\n create_button: Button | null;\n\n constructor(data: RawNode) {\n super();\n this.title = new Text(data.dialogTitle).toString();\n this.title_placeholder = data.titlePlaceholder || '';\n this.privacy_option = Parser.parseItem(data.privacyOption, Dropdown);\n this.create_button = Parser.parseItem(data.cancelButton, Button);\n this.cancel_button = Parser.parseItem(data.cancelButton, Button);\n }\n}", "import type { ObservedArray } from '../../helpers.js';\nimport { YTNode } from '../../helpers.js';\nimport { Parser, type RawNode } from '../../index.js';\n\nexport default class CommandExecutorCommand extends YTNode {\n static type = 'CommandExecutorCommand';\n\n public commands: ObservedArray;\n\n constructor(data: RawNode) {\n super();\n this.commands = Parser.parseCommands(data.commands);\n }\n}", "import { YTNode } from '../helpers.js';\nimport { Parser, type IEndpoint, type RawNode } from '../index.js';\nimport OpenPopupAction from './actions/OpenPopupAction.js';\nimport CreatePlaylistDialog from './CreatePlaylistDialog.js';\nimport CommandExecutorCommand from './commands/CommandExecutorCommand.js';\n\nimport type Actions from '../../core/Actions.js';\nimport type ModalWithTitleAndButton from './ModalWithTitleAndButton.js';\nimport type { ApiResponse } from '../../core/Actions.js';\nimport type { IParsedResponse } from '../types/index.js';\n\nexport type Metadata = {\n url?: string;\n api_url?: string;\n page_type?: string;\n send_post?: boolean;\n};\n\nexport default class NavigationEndpoint extends YTNode {\n static type = 'NavigationEndpoint';\n\n public name?: string;\n public payload: any;\n public dialog?: CreatePlaylistDialog | YTNode | null;\n public modal?: ModalWithTitleAndButton | YTNode | null;\n public open_popup?: OpenPopupAction | null;\n public next_endpoint?: NavigationEndpoint;\n public metadata: Metadata;\n public command?: YTNode | YTNode & IEndpoint;\n public commands?: NavigationEndpoint[];\n\n constructor(data: RawNode) {\n super();\n if (data) {\n if (data.serialCommand || data.parallelCommand) {\n const raw_command = data.serialCommand || data.parallelCommand;\n this.commands = raw_command.commands.map((command: RawNode) => new NavigationEndpoint(command));\n }\n\n if (data.innertubeCommand || data.command || data.performOnceCommand) {\n data = data.innertubeCommand || data.command || data.performOnceCommand;\n }\n }\n\n this.command = Parser.parseCommand(data);\n\n if (Reflect.has(data || {}, 'openPopupAction'))\n this.open_popup = new OpenPopupAction(data.openPopupAction);\n\n this.name = Object.keys(data || {})\n .find((item) =>\n item.endsWith('Endpoint') ||\n item.endsWith('Command')\n );\n\n this.payload = this.name ? Reflect.get(data, this.name) : {};\n\n if (Reflect.has(this.payload, 'dialog') || Reflect.has(this.payload, 'content')) {\n this.dialog = Parser.parseItem(this.payload.dialog || this.payload.content);\n }\n\n if (Reflect.has(this.payload, 'modal')) {\n this.modal = Parser.parseItem(this.payload.modal);\n }\n\n if (Reflect.has(this.payload, 'nextEndpoint')) {\n this.next_endpoint = new NavigationEndpoint(this.payload.nextEndpoint);\n }\n\n if (data?.serviceEndpoint) {\n data = data.serviceEndpoint;\n }\n\n this.metadata = {};\n\n if (data?.commandMetadata?.webCommandMetadata?.url) {\n this.metadata.url = data.commandMetadata.webCommandMetadata.url;\n }\n\n if (data?.commandMetadata?.webCommandMetadata?.webPageType) {\n this.metadata.page_type = data.commandMetadata.webCommandMetadata.webPageType;\n }\n\n if (data?.commandMetadata?.webCommandMetadata?.apiUrl) {\n this.metadata.api_url = data.commandMetadata.webCommandMetadata.apiUrl.replace('/youtubei/v1/', '');\n } else if (this.name) {\n this.metadata.api_url = this.getPath(this.name);\n }\n\n if (data?.commandMetadata?.webCommandMetadata?.sendPost) {\n this.metadata.send_post = data.commandMetadata.webCommandMetadata.sendPost;\n }\n\n if (data?.createPlaylistEndpoint) {\n if (data?.createPlaylistEndpoint.createPlaylistDialog) {\n this.dialog = Parser.parseItem(data?.createPlaylistEndpoint.createPlaylistDialog, CreatePlaylistDialog);\n }\n }\n }\n\n /**\n * Sometimes InnerTube does not return an API url, in that case the library should set it based on the name of the payload object.\n * @deprecated This should be removed in the future.\n */\n getPath(name: string) {\n switch (name) {\n case 'browseEndpoint':\n return '/browse';\n case 'watchEndpoint':\n case 'reelWatchEndpoint':\n return '/player';\n case 'searchEndpoint':\n return '/search';\n case 'watchPlaylistEndpoint':\n return '/next';\n case 'liveChatItemContextMenuEndpoint':\n return '/live_chat/get_item_context_menu';\n }\n }\n\n call(actions: Actions, args: { [key: string]: any; parse: true }): Promise;\n call(actions: Actions, args?: { [key: string]: any; parse?: false }): Promise;\n call(actions: Actions, args?: { [key: string]: any; parse?: boolean }): Promise {\n if (!actions)\n throw new Error('An API caller must be provided');\n\n if (this.command) {\n let command = this.command as (YTNode & IEndpoint);\n\n if (command.is(CommandExecutorCommand)) {\n command = command.commands.at(-1) as (YTNode & IEndpoint);\n }\n\n return actions.execute(command.getApiPath(), { ...command.buildRequest(), ...args });\n }\n\n if (!this.metadata.api_url)\n throw new Error('Expected an api_url, but none was found.');\n\n return actions.execute(this.metadata.api_url, { ...this.payload, ...args });\n }\n\n toURL(): string | undefined {\n if (!this.metadata.url)\n return undefined;\n if (!this.metadata.page_type)\n return undefined;\n return (\n this.metadata.page_type === 'WEB_PAGE_TYPE_UNKNOWN' ?\n this.metadata.url : `https://www.youtube.com${this.metadata.url}`\n );\n }\n}", "import type { RawNode } from '../../index.js';\n\nexport default class Thumbnail {\n url: string;\n width: number;\n height: number;\n\n constructor(data: RawNode) {\n this.url = data.url;\n this.width = data.width;\n this.height = data.height;\n }\n\n /**\n * Get thumbnails from response object.\n */\n static fromResponse(data: any): Thumbnail[] {\n if (!data) return [];\n\n let thumbnail_data;\n\n if (data.thumbnails) {\n thumbnail_data = data.thumbnails;\n } else if (data.sources) {\n thumbnail_data = data.sources;\n }\n\n if (thumbnail_data) {\n return thumbnail_data.map((x: any) => new Thumbnail(x)).sort((a: Thumbnail, b: Thumbnail) => b.width - a.width);\n }\n\n return [];\n }\n}", "import type { RawNode } from '../../index.js';\nimport { escape, type Run } from './Text.js';\nimport Thumbnail from './Thumbnail.js';\n\nexport interface Emoji {\n emoji_id: string;\n shortcuts: string[];\n search_terms: string[];\n image: Thumbnail[];\n is_custom: boolean;\n}\n\nexport default class EmojiRun implements Run {\n public text: string;\n public emoji: Emoji;\n\n constructor(data: RawNode) {\n this.text =\n data.emoji?.emojiId ||\n data.emoji?.shortcuts?.[0] ||\n data.text ||\n '';\n\n this.emoji = {\n emoji_id: data.emoji.emojiId,\n shortcuts: data.emoji?.shortcuts || [],\n search_terms: data.emoji?.searchTerms || [],\n image: Thumbnail.fromResponse(data.emoji.image),\n is_custom: !!data.emoji?.isCustomEmoji\n };\n }\n\n toString(): string {\n return this.text;\n }\n\n toHTML(): string {\n const escaped_text = escape(this.text);\n return `\"${escaped_text}\"`;\n }\n}", "import NavigationEndpoint from '../NavigationEndpoint.js';\nimport { escape, type Run } from './Text.js';\nimport type { RawNode } from '../../index.js';\n\nexport default class TextRun implements Run {\n public text: string;\n public text_color?: number;\n public endpoint?: NavigationEndpoint;\n public bold: boolean;\n public bracket: boolean;\n public dark_mode_text_color?: number;\n public deemphasize: boolean;\n public italics: boolean;\n public strikethrough: boolean;\n public error_underline: boolean;\n public underline: boolean;\n public font_face?:\n | 'FONT_FACE_UNKNOWN'\n | 'FONT_FACE_YT_SANS_MEDIUM'\n | 'FONT_FACE_ROBOTO_MEDIUM'\n | 'FONT_FACE_YOUTUBE_SANS_LIGHT'\n | 'FONT_FACE_YOUTUBE_SANS_REGULAR'\n | 'FONT_FACE_YOUTUBE_SANS_MEDIUM'\n | 'FONT_FACE_YOUTUBE_SANS_SEMIBOLD'\n | 'FONT_FACE_YOUTUBE_SANS_BOLD'\n | 'FONT_FACE_YOUTUBE_SANS_EXTRABOLD'\n | 'FONT_FACE_YOUTUBE_SANS_BLACK'\n | 'FONT_FACE_YT_SANS_BOLD'\n | 'FONT_FACE_ROBOTO_REGULAR';\n public attachment;\n\n constructor(data: RawNode) {\n this.text = data.text;\n this.bold = Boolean(data.bold);\n this.bracket = Boolean(data.bracket);\n this.italics = Boolean(data.italics);\n this.strikethrough = Boolean(data.strikethrough);\n this.error_underline = Boolean(data.error_underline);\n this.underline = Boolean(data.underline);\n this.deemphasize = Boolean(data.deemphasize);\n\n if ('textColor' in data) {\n this.text_color = data.textColor;\n }\n \n if ('navigationEndpoint' in data) {\n this.endpoint = new NavigationEndpoint(data.navigationEndpoint);\n }\n\n if ('darkModeTextColor' in data) {\n this.dark_mode_text_color = data.darkModeTextColor;\n }\n \n if ('fontFace' in data) {\n this.font_face = data.fontFace;\n }\n\n this.attachment = data.attachment;\n }\n\n toString(): string {\n return this.text;\n }\n\n toHTML(): string {\n const tags: string[] = [];\n\n if (this.bold) tags.push('b');\n if (this.italics) tags.push('i');\n if (this.strikethrough) tags.push('s');\n if (this.deemphasize) tags.push('small');\n if (this.underline) tags.push('u');\n if (this.error_underline) tags.push('u');\n\n if (!this.text?.length)\n return '';\n\n const escaped_text = escape(this.text);\n const styled_text = tags.map((tag) => `<${tag}>`).join('') + escaped_text + tags.map((tag) => ``).join('');\n const wrapped_text = `${styled_text}`;\n\n if (this.attachment) {\n if (this.attachment.element.type.imageType.image.sources.length) {\n if (this.endpoint) {\n const { url } = this.attachment.element.type.imageType.image.sources[0];\n\n let image_el = '';\n\n if (url) {\n image_el = `\"\"`;\n }\n\n const nav_url = this.endpoint.toURL();\n if (nav_url) return `${image_el}${wrapped_text}`;\n }\n }\n }\n\n if (this.endpoint) {\n const url = this.endpoint.toURL();\n if (url) return `${wrapped_text}`;\n }\n\n return wrapped_text;\n }\n}", "import { Log } from '../../../utils/index.js';\nimport type { RawNode } from '../../index.js';\nimport NavigationEndpoint from '../NavigationEndpoint.js';\nimport EmojiRun from './EmojiRun.js';\nimport TextRun from './TextRun.js';\nimport AccessibilityData from './AccessibilityData.js';\n\nexport interface Run {\n text: string;\n\n toString(): string;\n\n toHTML(): string;\n}\n\nexport interface FormattedStringSupportedAccessibilityDatas {\n accessibility_data: AccessibilityData;\n}\n\nexport function escape(text: string) {\n return text\n .replace(/&/g, '&')\n .replace(//g, '>')\n .replace(/\"/g, '"')\n .replace(/'/g, ''');\n}\n\nconst TAG = 'Text';\n\n/**\n * Represents text content that may include formatting, emojis, and navigation endpoints.\n */\nexport default class Text {\n /**\n * The plain text content.\n */\n public text?: string;\n\n /**\n * Individual text segments with their formatting.\n */\n public runs?: (EmojiRun | TextRun)[];\n\n /**\n * Navigation endpoint associated with this text.\n */\n public endpoint?: NavigationEndpoint;\n\n /**\n * Accessibility data associated with this text.\n */\n public accessibility?: FormattedStringSupportedAccessibilityDatas;\n\n /**\n * Indicates if the text is right-to-left.\n */\n public rtl: boolean;\n\n constructor(data: RawNode) {\n if (this.isRunsData(data)) {\n this.runs = data.runs.map((run: RawNode) =>\n run.emoji ? new EmojiRun(run) : new TextRun(run)\n );\n this.text = this.runs.map((run) => run.text).join('');\n } else {\n this.text = data?.simpleText;\n }\n\n if (this.isObject(data) && 'accessibility' in data\n && 'accessibilityData' in data.accessibility) {\n this.accessibility = {\n accessibility_data: new AccessibilityData(data.accessibility.accessibilityData)\n };\n }\n\n this.rtl = !!data?.rtl;\n\n this.parseEndpoint(data);\n }\n\n private isRunsData(data: RawNode): data is { runs: RawNode[] } {\n return this.isObject(data) &&\n Reflect.has(data, 'runs') &&\n Array.isArray(data.runs);\n }\n\n private parseEndpoint(data: RawNode): void {\n if (!this.isObject(data)) return;\n if ('navigationEndpoint' in data) {\n this.endpoint = new NavigationEndpoint(data.navigationEndpoint);\n } else if ('titleNavigationEndpoint' in data) {\n this.endpoint = new NavigationEndpoint(data.titleNavigationEndpoint);\n } else if ((this.runs?.[0] as TextRun)?.endpoint) {\n this.endpoint = (this.runs?.[0] as TextRun).endpoint;\n }\n }\n\n private isObject(data: RawNode): boolean {\n return typeof data === 'object' && data !== null;\n }\n\n static fromAttributed(data: AttributedText) {\n const {\n content,\n commandRuns: command_runs,\n attachmentRuns: attachment_runs\n } = data;\n\n const runs: RawRun[] = [\n {\n text: content,\n startIndex: 0\n }\n ];\n\n // In AttributedText, styleRuns may not always include the `startIndex` or `length` properties\n // - If `startIndex` is missing, we assume the style applies from the beginning of the text\n // - If `length` is missing, we assume the style applies to the entire text\n // The following code ensures default values are provided for these properties\n const style_runs = data.styleRuns?.map((run) => ({\n ...run,\n startIndex: run.startIndex ?? 0,\n length: run.length ?? content.length\n }) as StyleRun & ResponseRun);\n\n if (style_runs?.length)\n this.processStyleRuns(runs, style_runs, data);\n\n if (command_runs?.length)\n this.processCommandRuns(runs, command_runs, data);\n\n if (attachment_runs?.length)\n this.processAttachmentRuns(runs, attachment_runs, data);\n\n return new Text({ runs });\n }\n\n private static processStyleRuns(runs: RawRun[], style_runs: (StyleRun & ResponseRun)[], data: AttributedText) {\n for (const style_run of style_runs) {\n if (\n style_run.italic ||\n style_run.strikethrough === 'LINE_STYLE_SINGLE' ||\n style_run.weightLabel === 'FONT_WEIGHT_MEDIUM' ||\n style_run.weightLabel === 'FONT_WEIGHT_BOLD'\n ) {\n const matching_run = findMatchingRun(runs, style_run);\n\n if (!matching_run) {\n Log.warn(TAG, 'Unable to find matching run for style run. Skipping...', {\n style_run,\n input_data: data,\n // For performance reasons, web browser consoles only expand an object, when the user clicks on it,\n // So if we log the original runs object, it might have changed by the time the user looks at it.\n // Deep clone, so that we log the exact state of the runs at this point.\n parsed_runs: JSON.parse(JSON.stringify(runs))\n });\n\n continue;\n }\n\n // Comments use MEDIUM for bold text and video descriptions use BOLD for bold text\n insertSubRun(runs, matching_run, style_run, {\n bold: style_run.weightLabel === 'FONT_WEIGHT_MEDIUM' || style_run.weightLabel === 'FONT_WEIGHT_BOLD',\n italics: style_run.italic,\n strikethrough: style_run.strikethrough === 'LINE_STYLE_SINGLE'\n });\n } else {\n Log.debug(TAG, 'Skipping style run as it is doesn\\'t have any information that we parse.', {\n style_run,\n input_data: data\n });\n }\n }\n }\n\n private static processCommandRuns(runs: RawRun[], command_runs: CommandRun[], data: AttributedText) {\n for (const command_run of command_runs) {\n if (command_run.onTap) {\n const matching_run = findMatchingRun(runs, command_run);\n\n if (!matching_run) {\n Log.warn(TAG, 'Unable to find matching run for command run. Skipping...', {\n command_run,\n input_data: data,\n // For performance reasons, web browser consoles only expand an object, when the user clicks on it,\n // So if we log the original runs object, it might have changed by the time the user looks at it.\n // Deep clone, so that we log the exact state of the runs at this point.\n parsed_runs: JSON.parse(JSON.stringify(runs))\n });\n\n continue;\n }\n\n insertSubRun(runs, matching_run, command_run, {\n navigationEndpoint: command_run.onTap\n });\n } else {\n Log.debug(TAG, 'Skipping command run as it is missing the \"doTap\" property.', {\n command_run,\n input_data: data\n });\n }\n }\n }\n\n private static processAttachmentRuns(runs: RawRun[], attachment_runs: AttachmentRun[], data: AttributedText) {\n for (const attachment_run of attachment_runs) {\n const matching_run = findMatchingRun(runs, attachment_run);\n\n if (!matching_run) {\n Log.warn(TAG, 'Unable to find matching run for attachment run. Skipping...', {\n attachment_run,\n input_data: data,\n // For performance reasons, web browser consoles only expand an object, when the user clicks on it,\n // So if we log the original runs object, it might have changed by the time the user looks at it.\n // Deep clone, so that we log the exact state of the runs at this point.\n parsed_runs: JSON.parse(JSON.stringify(runs))\n });\n\n continue;\n }\n\n if (attachment_run.length === 0) {\n matching_run.attachment = attachment_run;\n } else {\n const offset_start_index = attachment_run.startIndex - matching_run.startIndex;\n\n const text = matching_run.text.substring(offset_start_index, offset_start_index + attachment_run.length);\n\n const is_custom_emoji = (/^:[^:]+:$/).test(text);\n\n if (attachment_run.element?.type?.imageType?.image && (is_custom_emoji || (/^(?:\\p{Emoji}|\\u200d)+$/u).test(text))) {\n const emoji = {\n image: attachment_run.element.type.imageType.image,\n isCustomEmoji: is_custom_emoji,\n shortcuts: is_custom_emoji ? [ text ] : undefined\n };\n\n insertSubRun(runs, matching_run, attachment_run, { emoji });\n } else {\n insertSubRun(runs, matching_run, attachment_run, {\n attachment: attachment_run\n });\n }\n }\n }\n }\n\n /**\n * Converts the text to HTML.\n * @returns The HTML.\n */\n toHTML(): string | undefined {\n return this.runs ? this.runs.map((run) => run.toHTML()).join('') : this.text;\n }\n\n /**\n * Checks if the text is empty.\n * @returns Whether the text is empty.\n */\n isEmpty(): boolean {\n return this.text === undefined;\n }\n\n /**\n * Converts the text to a string.\n * @returns The text.\n */\n toString(): string {\n return this.text || 'N/A';\n }\n}\n\nfunction findMatchingRun(runs: RawRun[], response_run: ResponseRun) {\n return runs.find((run) => {\n return run.startIndex <= response_run.startIndex &&\n response_run.startIndex + response_run.length <= run.startIndex + run.text.length;\n });\n}\n\nfunction insertSubRun(runs: RawRun[], original_run: RawRun, response_run: ResponseRun, properties_to_add: Omit) {\n const replace_index = runs.indexOf(original_run);\n const replacement_runs = [];\n\n const offset_start_index = response_run.startIndex - original_run.startIndex;\n\n // Stuff before the run\n if (response_run.startIndex > original_run.startIndex) {\n replacement_runs.push({\n ...original_run,\n text: original_run.text.substring(0, offset_start_index)\n });\n }\n\n replacement_runs.push({\n ...original_run,\n text: original_run.text.substring(offset_start_index, offset_start_index + response_run.length),\n startIndex: response_run.startIndex,\n ...properties_to_add\n });\n\n // Stuff after the run\n if (response_run.startIndex + response_run.length < original_run.startIndex + original_run.text.length) {\n replacement_runs.push({\n ...original_run,\n text: original_run.text.substring(offset_start_index + response_run.length),\n startIndex: response_run.startIndex + response_run.length\n });\n }\n\n runs.splice(replace_index, 1, ...replacement_runs);\n}\n\ninterface RawRun {\n text: string,\n bold?: boolean;\n italics?: boolean;\n strikethrough?: boolean;\n navigationEndpoint?: RawNode;\n attachment?: RawNode;\n emoji?: RawNode;\n startIndex: number;\n}\n\nexport interface AttributedText {\n content: string;\n styleRuns?: StyleRun[];\n commandRuns?: CommandRun[];\n attachmentRuns?: AttachmentRun[];\n decorationRuns?: ResponseRun[];\n}\n\ninterface ResponseRun {\n startIndex: number;\n length: number;\n}\n\ninterface StyleRun extends Partial {\n italic?: boolean;\n weightLabel?: string;\n strikethrough?: string;\n fontFamilyName?: string;\n styleRunExtensions?: {\n styleRunColorMapExtension?: {\n colorMap?: {\n key: string,\n value: number\n }[]\n }\n };\n}\n\ninterface CommandRun extends ResponseRun {\n onTap?: RawNode;\n}\n\ninterface AttachmentRun extends ResponseRun {\n alignment?: string;\n element?: {\n type?: {\n imageType?: {\n image: RawNode,\n playbackState?: string;\n }\n };\n properties?: RawNode\n };\n}", "import { YTNode } from '../helpers.js';\nimport type { RawNode } from '../index.js';\nimport Text from './misc/Text.js';\nimport Thumbnail from './misc/Thumbnail.js';\n\nexport default class ChannelExternalLinkView extends YTNode {\n static type = 'ChannelExternalLinkView';\n\n title: Text;\n link: Text;\n favicon: Thumbnail[];\n\n constructor(data: RawNode) {\n super();\n\n this.title = Text.fromAttributed(data.title);\n this.link = Text.fromAttributed(data.link);\n this.favicon = Thumbnail.fromResponse(data.favicon);\n }\n}", "import type { ObservedArray } from '../helpers.js';\nimport { YTNode } from '../helpers.js';\nimport { Parser, type RawNode } from '../index.js';\nimport ChannelExternalLinkView from './ChannelExternalLinkView.js';\nimport NavigationEndpoint from './NavigationEndpoint.js';\nimport Text from './misc/Text.js';\n\nexport default class AboutChannelView extends YTNode {\n static type = 'AboutChannelView';\n\n description?: string;\n description_label?: Text;\n country?: string;\n custom_links_label?: Text;\n subscriber_count?: string;\n view_count?: string;\n joined_date?: Text;\n canonical_channel_url?: string;\n channel_id?: string;\n additional_info_label?: Text;\n custom_url_on_tap?: NavigationEndpoint;\n video_count?: string;\n sign_in_for_business_email?: Text;\n links: ObservedArray;\n\n constructor(data: RawNode) {\n super();\n\n if (Reflect.has(data, 'description')) {\n this.description = data.description;\n }\n\n if (Reflect.has(data, 'descriptionLabel')) {\n this.description_label = Text.fromAttributed(data.descriptionLabel);\n }\n\n if (Reflect.has(data, 'country')) {\n this.country = data.country;\n }\n\n if (Reflect.has(data, 'customLinksLabel')) {\n this.custom_links_label = Text.fromAttributed(data.customLinksLabel);\n }\n\n if (Reflect.has(data, 'subscriberCountText')) {\n this.subscriber_count = data.subscriberCountText;\n }\n\n if (Reflect.has(data, 'viewCountText')) {\n this.view_count = data.viewCountText;\n }\n\n if (Reflect.has(data, 'joinedDateText')) {\n this.joined_date = Text.fromAttributed(data.joinedDateText);\n }\n\n if (Reflect.has(data, 'canonicalChannelUrl')) {\n this.canonical_channel_url = data.canonicalChannelUrl;\n }\n\n if (Reflect.has(data, 'channelId')) {\n this.channel_id = data.channelId;\n }\n\n if (Reflect.has(data, 'additionalInfoLabel')) {\n this.additional_info_label = Text.fromAttributed(data.additionalInfoLabel);\n }\n\n if (Reflect.has(data, 'customUrlOnTap')) {\n this.custom_url_on_tap = new NavigationEndpoint(data.customUrlOnTap);\n }\n\n if (Reflect.has(data, 'videoCountText')) {\n this.video_count = data.videoCountText;\n }\n\n if (Reflect.has(data, 'signInForBusinessEmail')) {\n this.sign_in_for_business_email = Text.fromAttributed(data.signInForBusinessEmail);\n }\n\n if (Reflect.has(data, 'links')) {\n this.links = Parser.parseArray(data.links, ChannelExternalLinkView);\n } else {\n this.links = [] as unknown as ObservedArray;\n }\n }\n}", "import { YTNode } from '../helpers.js';\nimport { Parser, type RawNode } from '../index.js';\nimport AboutChannelView from './AboutChannelView.js';\nimport Button from './Button.js';\n\nexport default class AboutChannel extends YTNode {\n static type = 'AboutChannel';\n\n metadata: AboutChannelView | null;\n share_channel: Button | null;\n\n constructor(data: RawNode) {\n super();\n\n this.metadata = Parser.parseItem(data.metadata, AboutChannelView);\n this.share_channel = Parser.parseItem(data.shareChannel, Button);\n }\n}", "import Text from './misc/Text.js';\nimport NavigationEndpoint from './NavigationEndpoint.js';\nimport { YTNode } from '../helpers.js';\nimport type { RawNode } from '../index.js';\n\nexport default class AccountChannel extends YTNode {\n static type = 'AccountChannel';\n\n title: Text;\n endpoint: NavigationEndpoint;\n\n constructor(data: RawNode) {\n super();\n this.title = new Text(data.title);\n this.endpoint = new NavigationEndpoint(data.navigationEndpoint);\n }\n}", "import { YTNode } from '../helpers.js';\nimport { type RawNode } from '../index.js';\nimport NavigationEndpoint from './NavigationEndpoint.js';\nimport Text from './misc/Text.js';\nimport Thumbnail from './misc/Thumbnail.js';\n\n/**\n * Not a real renderer but we treat it as one to keep things organized.\n */\nexport default class AccountItem extends YTNode {\n static type = 'AccountItem';\n\n account_name: Text;\n account_photo: Thumbnail[];\n is_selected: boolean;\n is_disabled: boolean;\n has_channel: boolean;\n endpoint: NavigationEndpoint;\n account_byline: Text;\n channel_handle: Text;\n\n constructor(data: RawNode) {\n super();\n this.account_name = new Text(data.accountName);\n this.account_photo = Thumbnail.fromResponse(data.accountPhoto);\n this.is_selected = !!data.isSelected;\n this.is_disabled = !!data.isDisabled;\n this.has_channel = !!data.hasChannel;\n this.endpoint = new NavigationEndpoint(data.serviceEndpoint);\n this.account_byline = new Text(data.accountByline);\n this.channel_handle = new Text(data.channelHandle);\n }\n}", "import Text from './misc/Text.js';\nimport { YTNode } from '../helpers.js';\nimport type { RawNode } from '../index.js';\n\nexport default class AccountItemSectionHeader extends YTNode {\n static type = 'AccountItemSectionHeader';\n\n title: Text;\n\n constructor(data: RawNode) {\n super();\n this.title = new Text(data.title);\n }\n}", "import Text from './misc/Text.js';\nimport NavigationEndpoint from './NavigationEndpoint.js';\nimport { YTNode } from '../helpers.js';\nimport type { RawNode } from '../index.js';\n\nexport default class CompactLink extends YTNode {\n static type = 'CompactLink';\n\n public title: string;\n public subtitle?: Text;\n public endpoint: NavigationEndpoint;\n public style: string;\n public icon_type?: string;\n public secondary_icon_type?: string;\n\n constructor(data: RawNode) {\n super();\n this.title = new Text(data.title).toString();\n\n if ('subtitle' in data)\n this.subtitle = new Text(data.subtitle);\n \n if ('icon' in data && 'iconType' in data.icon)\n this.icon_type = data.icon.iconType;\n \n if ('secondaryIcon' in data && 'iconType' in data.secondaryIcon)\n this.secondary_icon_type = data.secondaryIcon.iconType;\n \n this.endpoint = new NavigationEndpoint(data.navigationEndpoint || data.serviceEndpoint);\n this.style = data.style;\n }\n}", "import { Parser } from '../index.js';\nimport AccountItem from './AccountItem.js';\nimport AccountItemSectionHeader from './AccountItemSectionHeader.js';\nimport { YTNode, type ObservedArray } from '../helpers.js';\nimport type { RawNode } from '../index.js';\nimport CompactLink from './CompactLink.js';\n\nexport default class AccountItemSection extends YTNode {\n static type = 'AccountItemSection';\n\n public contents: ObservedArray;\n public header: AccountItemSectionHeader | null;\n\n constructor(data: RawNode) {\n super();\n this.contents = Parser.parseArray(data.contents, [ AccountItem, CompactLink ]);\n this.header = Parser.parseItem(data.header, AccountItemSectionHeader);\n }\n}", "import { Parser } from '../index.js';\nimport AccountChannel from './AccountChannel.js';\nimport AccountItemSection from './AccountItemSection.js';\n\nimport type { RawNode } from '../index.js';\nimport type { ObservedArray } from '../helpers.js';\nimport { YTNode } from '../helpers.js';\n\nexport default class AccountSectionList extends YTNode {\n static type = 'AccountSectionList';\n\n public contents: ObservedArray;\n public footers: ObservedArray;\n\n constructor(data: RawNode) {\n super();\n this.contents = Parser.parseArray(data.contents, AccountItemSection);\n this.footers = Parser.parseArray(data.footers, AccountChannel);\n }\n}", "import { Parser } from '../../index.js';\nimport type { RawNode } from '../../index.js';\nimport type { ObservedArray } from '../../helpers.js';\nimport { YTNode } from '../../helpers.js';\n\nexport default class AppendContinuationItemsAction extends YTNode {\n static type = 'AppendContinuationItemsAction';\n\n contents: ObservedArray;\n target: string;\n\n constructor(data: RawNode) {\n super();\n this.contents = Parser.parseArray(data.continuationItems);\n this.target = data.target;\n }\n}", "import { YTNode } from '../../helpers.js';\nimport type { RawNode } from '../../index.js';\n\nexport default class ChangeEngagementPanelVisibilityAction extends YTNode {\n static type = 'ChangeEngagementPanelVisibilityAction';\n \n public target_id: string;\n public visibility: string;\n\n constructor(data: RawNode) {\n super();\n this.target_id = data.targetId;\n this.visibility = data.visibility;\n }\n}", "import type { ObservedArray } from '../../helpers.js';\nimport { YTNode } from '../../helpers.js';\nimport type { RawNode } from '../../index.js';\nimport { Parser } from '../../index.js';\n\nexport default class MultiPageMenu extends YTNode {\n static type = 'MultiPageMenu';\n\n header: YTNode;\n sections: ObservedArray;\n style: string;\n\n constructor(data: RawNode) {\n super();\n this.header = Parser.parseItem(data.header);\n this.sections = Parser.parseArray(data.sections);\n this.style = data.style;\n }\n}", "import { Parser } from '../../index.js';\nimport { YTNode } from '../../helpers.js';\nimport type { RawNode } from '../../index.js';\nimport MultiPageMenu from '../menus/MultiPageMenu.js';\n\nexport default class GetMultiPageMenuAction extends YTNode {\n static type = 'GetMultiPageMenuAction';\n \n public menu: MultiPageMenu | null;\n \n constructor(data: RawNode) {\n super();\n this.menu = Parser.parseItem(data.menu, MultiPageMenu);\n }\n}", "import { YTNode } from '../../helpers.js';\nimport type { RawNode } from '../../types/index.js';\n\nexport default class SendFeedbackAction extends YTNode {\n static type = 'SendFeedbackAction';\n \n public bucket: string;\n \n constructor(data: RawNode) {\n super();\n this.bucket = data.bucket;\n }\n}", "import { YTNode } from '../../helpers.js';\nimport type { RawNode } from '../../index.js';\n\nexport default class SignalAction extends YTNode {\n static type = 'SignalAction';\n\n public signal: string;\n\n constructor(data: RawNode) {\n super();\n this.signal = data.signal;\n }\n}", "import type { ObservedArray } from '../helpers.js';\nimport { YTNode } from '../helpers.js';\nimport { Parser, type RawNode } from '../index.js';\n\nexport default class ChannelSwitcherPage extends YTNode {\n static type = 'ChannelSwitcherPage';\n\n header: YTNode;\n contents: ObservedArray | null;\n\n constructor(data: RawNode) {\n super();\n this.header = Parser.parseItem(data.header);\n this.contents = Parser.parse(data.contents, true);\n }\n}", "import type { ObservedArray } from '../../helpers.js';\nimport { YTNode } from '../../helpers.js';\nimport { Parser, type RawNode } from '../../index.js';\nimport ChannelSwitcherPage from '../ChannelSwitcherPage.js';\n\nexport default class UpdateChannelSwitcherPageAction extends YTNode {\n static type = 'UpdateChannelSwitcherPageAction';\n\n public header?: YTNode;\n public contents?: ObservedArray | null;\n\n constructor(data: RawNode) {\n super();\n const page = Parser.parseItem(data.page, ChannelSwitcherPage);\n if (page) {\n this.header = page.header;\n this.contents = page.contents;\n }\n }\n}\n", "import { YTNode } from '../helpers.js';\nimport type { RawNode } from '../index.js';\nimport NavigationEndpoint from './NavigationEndpoint.js';\nimport AccessibilityData, { type AccessibilitySupportedDatas } from './misc/AccessibilityData.js';\n\nexport interface SubMenuItem {\n title: string;\n selected: boolean;\n continuation: string;\n endpoint: NavigationEndpoint;\n subtitle: string | null;\n}\n\nexport default class SortFilterSubMenu extends YTNode {\n static type = 'SortFilterSubMenu';\n\n public title?: string;\n public icon_type?: string;\n public tooltip?: string;\n public sub_menu_items?: SubMenuItem[];\n public accessibility?: AccessibilitySupportedDatas;\n\n constructor(data: RawNode) {\n super();\n if ('title' in data) {\n this.title = data.title;\n }\n\n if ('icon' in data) {\n this.icon_type = data.icon.iconType;\n }\n\n if ('tooltip' in data) {\n this.tooltip = data.tooltip;\n }\n\n if ('subMenuItems' in data) {\n this.sub_menu_items = data.subMenuItems.map((item: RawNode) => ({\n title: item.title,\n selected: item.selected,\n continuation: item.continuation?.reloadContinuationData?.continuation,\n endpoint: new NavigationEndpoint(item.serviceEndpoint || item.navigationEndpoint),\n subtitle: item.subtitle || null\n }));\n }\n\n if ('accessibility' in data\n && 'accessibilityData' in data.accessibility) {\n this.accessibility = {\n accessibility_data: new AccessibilityData(data.accessibility.accessibilityData)\n };\n }\n }\n \n get label(): string | undefined {\n return this.accessibility?.accessibility_data?.label;\n }\n}", "import { YTNode } from '../helpers.js';\nimport type { RawNode } from '../index.js';\nimport { Parser } from '../index.js';\nimport SortFilterSubMenu from './SortFilterSubMenu.js';\n\nexport default class TranscriptFooter extends YTNode {\n static type = 'TranscriptFooter';\n\n language_menu: SortFilterSubMenu | null;\n\n constructor(data: RawNode) {\n super();\n this.language_menu = Parser.parseItem(data.languageMenu, SortFilterSubMenu);\n }\n}", "import { YTNode } from '../helpers.js';\nimport type { RawNode } from '../index.js';\nimport { Parser } from '../index.js';\nimport Button from './Button.js';\nimport NavigationEndpoint from './NavigationEndpoint.js';\nimport { Text } from '../misc.js';\n\nexport default class TranscriptSearchBox extends YTNode {\n static type = 'TranscriptSearchBox';\n\n formatted_placeholder: Text;\n clear_button: Button | null;\n endpoint: NavigationEndpoint;\n search_button: Button | null;\n\n constructor(data: RawNode) {\n super();\n this.formatted_placeholder = new Text(data.formattedPlaceholder);\n this.clear_button = Parser.parseItem(data.clearButton, Button);\n this.endpoint = new NavigationEndpoint(data.onTextChangeCommand);\n this.search_button = Parser.parseItem(data.searchButton, Button);\n }\n}", "import { YTNode } from '../helpers.js';\nimport type { RawNode } from '../index.js';\nimport Text from './misc/Text.js';\n\nexport default class TranscriptSectionHeader extends YTNode {\n static type = 'TranscriptSectionHeader';\n\n start_ms: string;\n end_ms: string;\n snippet: Text;\n\n constructor(data: RawNode) {\n super();\n this.start_ms = data.startMs;\n this.end_ms = data.endMs;\n this.snippet = new Text(data.snippet);\n }\n}", "import { YTNode } from '../helpers.js';\nimport type { RawNode } from '../index.js';\nimport { Text } from '../misc.js';\n\nexport default class TranscriptSegment extends YTNode {\n static type = 'TranscriptSegment';\n\n start_ms: string;\n end_ms: string;\n snippet: Text;\n start_time_text: Text;\n target_id: string;\n\n constructor(data: RawNode) {\n super();\n this.start_ms = data.startMs;\n this.end_ms = data.endMs;\n this.snippet = new Text(data.snippet);\n this.start_time_text = new Text(data.startTimeText);\n this.target_id = data.targetId;\n }\n}", "import type { ObservedArray } from '../helpers.js';\nimport { YTNode } from '../helpers.js';\nimport type { RawNode } from '../index.js';\nimport { Parser } from '../index.js';\nimport { Text } from '../misc.js';\nimport TranscriptSectionHeader from './TranscriptSectionHeader.js';\nimport TranscriptSegment from './TranscriptSegment.js';\n\nexport default class TranscriptSegmentList extends YTNode {\n static type = 'TranscriptSegmentList';\n\n initial_segments: ObservedArray;\n no_result_label: Text;\n retry_label: Text;\n touch_captions_enabled: boolean;\n\n constructor(data: RawNode) {\n super();\n this.initial_segments = Parser.parseArray(data.initialSegments, [ TranscriptSegment, TranscriptSectionHeader ]);\n this.no_result_label = new Text(data.noResultLabel);\n this.retry_label = new Text(data.retryLabel);\n this.touch_captions_enabled = data.touchCaptionsEnabled;\n }\n}", "import { YTNode } from '../helpers.js';\nimport type { RawNode } from '../index.js';\nimport { Parser } from '../index.js';\nimport TranscriptFooter from './TranscriptFooter.js';\nimport TranscriptSearchBox from './TranscriptSearchBox.js';\nimport TranscriptSegmentList from './TranscriptSegmentList.js';\n\nexport default class TranscriptSearchPanel extends YTNode {\n static type = 'TranscriptSearchPanel';\n\n header: TranscriptSearchBox | null;\n body: TranscriptSegmentList | null;\n footer: TranscriptFooter | null;\n target_id: string;\n\n constructor(data: RawNode) {\n super();\n this.header = Parser.parseItem(data.header, TranscriptSearchBox);\n this.body = Parser.parseItem(data.body, TranscriptSegmentList);\n this.footer = Parser.parseItem(data.footer, TranscriptFooter);\n this.target_id = data.targetId;\n }\n}", "import { YTNode } from '../helpers.js';\nimport type { RawNode } from '../index.js';\nimport { Parser } from '../index.js';\nimport TranscriptSearchPanel from './TranscriptSearchPanel.js';\n\nexport default class Transcript extends YTNode {\n static type = 'Transcript';\n\n content: TranscriptSearchPanel | null;\n\n constructor(data: RawNode) {\n super();\n this.content = Parser.parseItem(data.content, TranscriptSearchPanel);\n }\n}", "import { YTNode } from '../../helpers.js';\nimport type { RawNode } from '../../index.js';\nimport { Parser } from '../../index.js';\nimport Transcript from '../Transcript.js';\n\nexport default class UpdateEngagementPanelAction extends YTNode {\n static type = 'UpdateEngagementPanelAction';\n\n target_id: string;\n content: Transcript | null;\n\n constructor(data: RawNode) {\n super();\n this.target_id = data.targetId;\n this.content = Parser.parseItem(data.content, Transcript);\n }\n}", "import type { RawNode } from '../../index.js';\nimport { YTNode } from '../../helpers.js';\n\nexport default class UpdateSubscribeButtonAction extends YTNode {\n static type = 'UpdateSubscribeButtonAction';\n\n public channel_id: string;\n public subscribed: boolean;\n\n constructor(data: RawNode) {\n super();\n this.channel_id = data.channelId;\n this.subscribed = data.subscribed;\n }\n}", "import { YTNode } from '../helpers.js';\nimport { type RawNode } from '../index.js';\nimport Text from './misc/Text.js';\nimport Thumbnail from './misc/Thumbnail.js';\nimport NavigationEndpoint from './NavigationEndpoint.js';\n\nexport default class ActiveAccountHeader extends YTNode {\n static type = 'ActiveAccountHeader';\n\n public account_name: Text;\n public account_photo: Thumbnail[];\n public endpoint: NavigationEndpoint;\n public manage_account_title: Text;\n public channel_handle: Text;\n\n constructor(data: RawNode) {\n super();\n this.account_name = new Text(data.accountName);\n this.account_photo = Thumbnail.fromResponse(data.accountPhoto);\n this.endpoint = new NavigationEndpoint(data.serviceEndpoint);\n this.manage_account_title = new Text(data.manageAccountTitle);\n this.channel_handle = new Text(data.channelHandle);\n }\n}", "import { YTNode } from '../helpers.js';\nimport { Text } from '../misc.js';\nimport type { RawNode } from '../index.js';\n\nexport default class MenuTitle extends YTNode {\n static type = 'MenuTitle';\n\n public title: Text;\n\n constructor(data: RawNode) {\n super();\n this.title = new Text(data.title);\n }\n}", "import { YTNode } from '../helpers.js';\nimport { Text } from '../misc.js';\nimport NavigationEndpoint from './NavigationEndpoint.js';\nimport type { RawNode } from '../index.js';\n\nexport type PrivacyIcon = {\n icon_type: string | null;\n};\n\nexport default class PlaylistAddToOption extends YTNode {\n static type = 'PlaylistAddToOption';\n\n public add_to_playlist_service_endpoint: NavigationEndpoint;\n public contains_selected_videos: 'ALL' | 'NONE';\n public playlist_id: string;\n public privacy: string;\n public privacy_icon: PrivacyIcon;\n public remove_from_playlist_service_endpoint: NavigationEndpoint;\n public title: Text;\n\n constructor(data: RawNode) {\n super();\n this.add_to_playlist_service_endpoint = new NavigationEndpoint(data.addToPlaylistServiceEndpoint);\n this.contains_selected_videos = data.containsSelectedVideos;\n this.playlist_id = data.playlistId;\n this.privacy = data.privacy;\n this.privacy_icon = { icon_type: data.privacyIcon?.iconType || null };\n this.remove_from_playlist_service_endpoint = new NavigationEndpoint(data.removeFromPlaylistServiceEndpoint);\n this.title = new Text(data.title);\n }\n}", "import { type ObservedArray, YTNode } from '../helpers.js';\nimport { Parser, type RawNode } from '../index.js';\nimport Button from './Button.js';\nimport MenuTitle from './MenuTitle.js';\nimport PlaylistAddToOption from './PlaylistAddToOption.js';\n\nexport default class AddToPlaylist extends YTNode {\n static type = 'AddToPlaylist';\n\n public actions: ObservedArray;\n public playlists: ObservedArray;\n\n constructor(data: RawNode) {\n super();\n this.actions = Parser.parseArray(data.actions, [ MenuTitle, Button ]);\n this.playlists = Parser.parseArray(data.playlists, PlaylistAddToOption);\n }\n}", "import Text from './misc/Text.js';\nimport { YTNode } from '../helpers.js';\nimport type { RawNode } from '../index.js';\n\nexport type AlertType = 'UNKNOWN' | 'WARNING' | 'ERROR' | 'SUCCESS' | 'INFO';\n\nexport default class Alert extends YTNode {\n static type = 'Alert';\n\n text: Text;\n alert_type: AlertType;\n\n constructor(data: RawNode) {\n super();\n this.text = new Text(data.text);\n this.alert_type = data.type;\n }\n}", "import Button from './Button.js';\nimport Text from './misc/Text.js';\nimport { YTNode } from '../helpers.js';\nimport { Parser, type RawNode } from '../index.js';\n\nexport default class AlertWithButton extends YTNode {\n static type = 'AlertWithButton';\n\n text: Text;\n alert_type: string;\n dismiss_button: Button | null;\n\n constructor(data: RawNode) {\n super();\n this.text = new Text(data.text);\n this.alert_type = data.type;\n this.dismiss_button = Parser.parseItem(data.dismissButton, Button);\n }\n}", "import { YTNode } from '../helpers.js';\nimport type { RawNode } from '../types/index.js';\nimport Thumbnail from './misc/Thumbnail.js';\n\nexport default class AnimatedThumbnailOverlayView extends YTNode {\n static type = 'AnimatedThumbnailOverlayView';\n\n public thumbnail: Thumbnail[];\n\n constructor(data: RawNode) {\n super();\n this.thumbnail = Thumbnail.fromResponse(data.thumbnail);\n }\n}\n", "import { YTNode } from '../helpers.js';\nimport type { RawNode } from '../index.js';\nimport Text from './misc/Text.js';\n\nexport default class AttributionView extends YTNode {\n static type = 'AttributionView';\n\n text: Text;\n suffix: Text;\n\n constructor(data: RawNode) {\n super();\n\n this.text = Text.fromAttributed(data.text);\n this.suffix = Text.fromAttributed(data.suffix);\n }\n}", "import { YTNode } from '../helpers.js';\nimport type { RawNode } from '../index.js';\n\nexport default class AudioOnlyPlayability extends YTNode {\n static type = 'AudioOnlyPlayability';\n\n audio_only_availability: string;\n\n constructor (data: RawNode) {\n super();\n this.audio_only_availability = data.audioOnlyAvailability;\n }\n}", "import { YTNode } from '../helpers.js';\nimport NavigationEndpoint from './NavigationEndpoint.js';\nimport type { RawNode } from '../index.js';\n\nexport default class AutomixPreviewVideo extends YTNode {\n static type = 'AutomixPreviewVideo';\n\n playlist_video?: { endpoint: NavigationEndpoint };\n\n constructor(data: RawNode) {\n super();\n if (data?.content?.automixPlaylistVideoRenderer?.navigationEndpoint) {\n this.playlist_video = {\n endpoint: new NavigationEndpoint(data.content.automixPlaylistVideoRenderer.navigationEndpoint)\n };\n }\n }\n}", "import { YTNode } from '../helpers.js';\nimport { type RawNode } from '../index.js';\nimport { Thumbnail } from '../misc.js';\n\nexport default class AvatarView extends YTNode {\n static type = 'AvatarView';\n\n image: Thumbnail[];\n image_processor: {\n border_image_processor: {\n circular: boolean\n }\n } | undefined;\n avatar_image_size: string;\n\n constructor(data: RawNode) {\n super();\n this.image = Thumbnail.fromResponse(data.image);\n this.avatar_image_size = data.avatarImageSize;\n\n if (data.image.processor) {\n this.image_processor = {\n border_image_processor: {\n circular: data.image.processor.borderImageProcessor.circular\n }\n };\n }\n }\n}", "import type { RawNode } from '../../types/index.js';\nimport NavigationEndpoint from '../NavigationEndpoint.js';\n\nexport default class CommandContext {\n public on_focus?: NavigationEndpoint;\n public on_hidden?: NavigationEndpoint;\n public on_touch_end?: NavigationEndpoint;\n public on_touch_move?: NavigationEndpoint;\n public on_long_press?: NavigationEndpoint;\n public on_tap?: NavigationEndpoint;\n public on_touch_start?: NavigationEndpoint;\n public on_visible?: NavigationEndpoint;\n public on_first_visible?: NavigationEndpoint;\n public on_hover?: NavigationEndpoint;\n \n constructor(data: RawNode) {\n if ('onFocus' in data)\n this.on_focus = new NavigationEndpoint(data.onFocus);\n \n if ('onHidden' in data)\n this.on_hidden = new NavigationEndpoint(data.onHidden);\n \n if ('onTouchEnd' in data)\n this.on_touch_end = new NavigationEndpoint(data.onTouchEnd);\n \n if ('onTouchMove' in data)\n this.on_touch_move = new NavigationEndpoint(data.onTouchMove);\n \n if ('onLongPress' in data)\n this.on_long_press = new NavigationEndpoint(data.onLongPress);\n \n if ('onTap' in data)\n this.on_tap = new NavigationEndpoint(data.onTap);\n \n if ('onTouchStart' in data)\n this.on_touch_start = new NavigationEndpoint(data.onTouchStart);\n \n if ('onVisible' in data)\n this.on_visible = new NavigationEndpoint(data.onVisible);\n \n if ('onFirstVisible' in data)\n this.on_first_visible = new NavigationEndpoint(data.onFirstVisible);\n \n if ('onHover' in data)\n this.on_hover = new NavigationEndpoint(data.onHover);\n }\n}", "import type { RawNode } from '../../types/index.js';\nimport CommandContext from './CommandContext.js';\nimport AccessibilityContext from './AccessibilityContext.js';\n\nexport default class RendererContext {\n public command_context?: CommandContext;\n public accessibility_context?: AccessibilityContext;\n\n constructor(data?: RawNode) {\n if (!data)\n return;\n\n if ('commandContext' in data) {\n this.command_context = new CommandContext(data.commandContext);\n }\n\n if ('accessibilityContext' in data) {\n this.accessibility_context = new AccessibilityContext(data.accessibilityContext);\n }\n }\n}", "import { type ObservedArray, YTNode } from '../helpers.js';\nimport type { RawNode } from '../types/index.js';\nimport { Parser } from '../index.js';\n\nimport Text from './misc/Text.js';\nimport AvatarView from './AvatarView.js';\nimport RendererContext from './misc/RendererContext.js';\n\nexport default class AvatarStackView extends YTNode {\n static type = 'AvatarStackView';\n\n public avatars: ObservedArray;\n public text?: Text;\n public renderer_context: RendererContext;\n\n constructor(data: RawNode) {\n super();\n this.avatars = Parser.parseArray(data.avatars, AvatarView);\n\n if (Reflect.has(data, 'text'))\n this.text = Text.fromAttributed(data.text);\n \n this.renderer_context = new RendererContext(data.rendererContext);\n }\n}", "import { YTNode } from '../helpers.js';\nimport type { RawNode } from '../index.js';\nimport NavigationEndpoint from './NavigationEndpoint.js';\nimport Thumbnail from './misc/Thumbnail.js';\n\nexport default class ButtonView extends YTNode {\n static type = 'ButtonView';\n\n public secondary_icon_image?: Thumbnail[];\n public icon_name?: string;\n public enable_icon_button?: boolean;\n public tooltip?: string;\n public icon_image_flip_for_rtl?: boolean;\n public button_size?: 'BUTTON_VIEW_MODEL_SIZE_UNKNOWN' | 'BUTTON_VIEW_MODEL_SIZE_DEFAULT' | 'BUTTON_VIEW_MODEL_SIZE_COMPACT' | 'BUTTON_VIEW_MODEL_SIZE_XSMALL' | 'BUTTON_VIEW_MODEL_SIZE_LARGE' | 'BUTTON_VIEW_MODEL_SIZE_XLARGE' | 'BUTTON_VIEW_MODEL_SIZE_XXLARGE';\n public icon_position?: 'BUTTON_VIEW_MODEL_ICON_POSITION_UNKNOWN' | 'BUTTON_VIEW_MODEL_ICON_POSITION_TRAILING' | 'BUTTON_VIEW_MODEL_ICON_POSITION_LEADING' | 'BUTTON_VIEW_MODEL_ICON_POSITION_ABOVE' | 'BUTTON_VIEW_MODEL_ICON_POSITION_LEADING_TRAILING';\n public is_full_width?: boolean;\n public state?: 'BUTTON_VIEW_MODEL_STATE_UNKNOWN' | 'BUTTON_VIEW_MODEL_STATE_ACTIVE' | 'BUTTON_VIEW_MODEL_STATE_INACTIVE' | 'BUTTON_VIEW_MODEL_STATE_DISABLED';\n public on_disabled_tap?: NavigationEndpoint;\n public custom_border_color?: number;\n public on_tap?: NavigationEndpoint;\n public style?: 'BUTTON_VIEW_MODEL_STYLE_UNKNOWN' | 'BUTTON_VIEW_MODEL_STYLE_CTA' | 'BUTTON_VIEW_MODEL_STYLE_BRAND' | 'BUTTON_VIEW_MODEL_STYLE_ADS_CTA' | 'BUTTON_VIEW_MODEL_STYLE_OVERLAY' | 'BUTTON_VIEW_MODEL_STYLE_CTA_THEMED' | 'BUTTON_VIEW_MODEL_STYLE_BLACK_CTA' | 'BUTTON_VIEW_MODEL_STYLE_CUSTOM' | 'BUTTON_VIEW_MODEL_STYLE_MONO' | 'BUTTON_VIEW_MODEL_STYLE_OVERLAY_DARK' | 'BUTTON_VIEW_MODEL_STYLE_CTA_OVERLAY' | 'BUTTON_VIEW_MODEL_STYLE_BRAND_AI' | 'BUTTON_VIEW_MODEL_STYLE_YT_GRADIENT' | 'BUTTON_VIEW_MODEL_STYLE_BRAND_GRADIENT';\n public icon_image?: object;\n public custom_dark_theme_border_color?: number;\n public title?: string;\n public target_id?: string;\n public enable_full_width_margins?: boolean;\n public custom_font_color?: number;\n public button_type?: 'BUTTON_VIEW_MODEL_TYPE_UNKNOWN' | 'BUTTON_VIEW_MODEL_TYPE_FILLED' | 'BUTTON_VIEW_MODEL_TYPE_OUTLINE' | 'BUTTON_VIEW_MODEL_TYPE_TEXT' | 'BUTTON_VIEW_MODEL_TYPE_TONAL';\n public enabled?: boolean;\n public accessibility_id?: string;\n public custom_background_color?: number;\n public on_long_press?: NavigationEndpoint;\n public title_formatted?: object;\n public on_visible?: object;\n public icon_trailing?: boolean;\n public accessibility_text?: string;\n\n constructor(data: RawNode) {\n super();\n if ('secondaryIconImage' in data)\n this.secondary_icon_image = Thumbnail.fromResponse(data.secondaryIconImage);\n\n if ('iconName' in data)\n this.icon_name = data.iconName;\n \n if ('enableIconButton' in data)\n this.enable_icon_button = data.enableIconButton;\n \n if ('tooltip' in data)\n this.tooltip = data.tooltip;\n \n if ('iconImageFlipForRtl' in data)\n this.icon_image_flip_for_rtl = data.iconImageFlipForRtl;\n \n if ('buttonSize' in data)\n this.button_size = data.buttonSize;\n \n if ('iconPosition' in data)\n this.icon_position = data.iconPosition;\n \n if ('isFullWidth' in data)\n this.is_full_width = data.isFullWidth;\n \n if ('state' in data)\n this.state = data.state;\n \n if ('onDisabledTap' in data)\n this.on_disabled_tap = new NavigationEndpoint(data.onDisabledTap);\n \n if ('customBorderColor' in data)\n this.custom_border_color = data.customBorderColor;\n \n if ('onTap' in data)\n this.on_tap = new NavigationEndpoint(data.onTap);\n \n if ('style' in data)\n this.style = data.style;\n \n if ('iconImage' in data)\n this.icon_image = data.iconImage;\n \n if ('customDarkThemeBorderColor' in data)\n this.custom_dark_theme_border_color = data.customDarkThemeBorderColor;\n \n if ('title' in data)\n this.title = data.title;\n \n if ('targetId' in data)\n this.target_id = data.targetId;\n \n if ('enableFullWidthMargins' in data)\n this.enable_full_width_margins = data.enableFullWidthMargins;\n \n if ('customFontColor' in data)\n this.custom_font_color = data.customFontColor;\n \n if ('type' in data)\n this.button_type = data.type;\n \n if ('enabled' in data)\n this.enabled = data.enabled;\n \n if ('accessibilityId' in data)\n this.accessibility_id = data.accessibilityId;\n \n if ('customBackgroundColor' in data)\n this.custom_background_color = data.customBackgroundColor;\n \n if ('onLongPress' in data)\n this.on_long_press = new NavigationEndpoint(data.onLongPress);\n \n if ('titleFormatted' in data)\n this.title_formatted = data.titleFormatted;\n \n if ('onVisible' in data)\n this.on_visible = data.onVisible;\n \n if ('iconTrailing' in data)\n this.icon_trailing = data.iconTrailing;\n \n if ('accessibilityText' in data)\n this.accessibility_text = data.accessibilityText;\n }\n}", "import { YTNode } from '../helpers.js';\nimport { Parser, type RawNode } from '../index.js';\nimport Text from './misc/Text.js';\nimport Button from './Button.js';\nimport ButtonView from './ButtonView.js';\n\nexport default class BackgroundPromo extends YTNode {\n static type = 'BackgroundPromo';\n\n public body_text?: Text;\n public cta_button?: Button | ButtonView | null;\n public icon_type?: string;\n public title?: Text;\n \n constructor(data: RawNode) {\n super();\n this.body_text = new Text(data.bodyText);\n this.cta_button = Parser.parseItem(data.ctaButton, [ Button, ButtonView ]);\n \n if (Reflect.has(data, 'icon'))\n this.icon_type = data.icon.iconType;\n \n this.title = new Text(data.title);\n }\n}", "import Thumbnail from './misc/Thumbnail.js';\nimport NavigationEndpoint from './NavigationEndpoint.js';\nimport { YTNode } from '../helpers.js';\nimport type { RawNode } from '../index.js';\n\nexport default class BackstageImage extends YTNode {\n static type = 'BackstageImage';\n\n image: Thumbnail[];\n endpoint: NavigationEndpoint;\n\n constructor(data: RawNode) {\n super();\n this.image = Thumbnail.fromResponse(data.image);\n this.endpoint = new NavigationEndpoint(data.command);\n }\n}", "import Text from './misc/Text.js';\nimport NavigationEndpoint from './NavigationEndpoint.js';\nimport { YTNode } from '../helpers.js';\nimport type { RawNode } from '../index.js';\n\nexport default class ToggleButton extends YTNode {\n static type = 'ToggleButton';\n\n text: Text;\n toggled_text: Text;\n tooltip: string;\n toggled_tooltip: string;\n is_toggled: boolean;\n is_disabled: boolean;\n icon_type: string;\n like_count?: number;\n short_like_count?: string;\n endpoint: NavigationEndpoint;\n toggled_endpoint: NavigationEndpoint;\n button_id?: string;\n target_id?: string;\n\n constructor(data: RawNode) {\n super();\n this.text = new Text(data.defaultText);\n this.toggled_text = new Text(data.toggledText);\n this.tooltip = data.defaultTooltip;\n this.toggled_tooltip = data.toggledTooltip;\n this.is_toggled = data.isToggled;\n this.is_disabled = data.isDisabled;\n this.icon_type = data.defaultIcon?.iconType;\n\n const acc_label =\n data?.defaultText?.accessibility?.accessibilityData?.label ||\n data?.accessibilityData?.accessibilityData?.label ||\n data?.accessibility?.label;\n\n if (this.icon_type == 'LIKE') {\n this.like_count = parseInt(acc_label.replace(/\\D/g, ''));\n this.short_like_count = new Text(data.defaultText).toString();\n }\n\n this.endpoint =\n data.defaultServiceEndpoint?.commandExecutorCommand?.commands ?\n new NavigationEndpoint(data.defaultServiceEndpoint.commandExecutorCommand.commands.pop()) :\n new NavigationEndpoint(data.defaultServiceEndpoint);\n\n this.toggled_endpoint = new NavigationEndpoint(data.toggledServiceEndpoint);\n\n if (Reflect.has(data, 'toggleButtonSupportedData') && Reflect.has(data.toggleButtonSupportedData, 'toggleButtonIdData')) {\n this.button_id = data.toggleButtonSupportedData.toggleButtonIdData.id;\n }\n\n if (Reflect.has(data, 'targetId')) {\n this.target_id = data.targetId;\n }\n }\n}", "import { YTNode } from '../../helpers.js';\nimport type { RawNode } from '../../index.js';\nimport Thumbnail from '../misc/Thumbnail.js';\n\nexport default class CreatorHeart extends YTNode {\n static type = 'CreatorHeart';\n\n creator_thumbnail: Thumbnail[];\n heart_icon_type?: string;\n heart_color: {\n basic_color_palette_data: {\n foreground_title_color: string;\n }\n };\n hearted_tooltip: string;\n is_hearted: boolean;\n is_enabled: boolean;\n kennedy_heart_color_string: string;\n\n constructor(data: RawNode) {\n super();\n this.creator_thumbnail = Thumbnail.fromResponse(data.creatorThumbnail);\n\n if (Reflect.has(data, 'heartIcon') && Reflect.has(data.heartIcon, 'iconType')) {\n this.heart_icon_type = data.heartIcon.iconType;\n }\n\n this.heart_color = {\n basic_color_palette_data: {\n foreground_title_color: data.heartColor?.basicColorPaletteData?.foregroundTitleColor\n }\n };\n\n this.hearted_tooltip = data.heartedTooltip;\n this.is_hearted = data.isHearted;\n this.is_enabled = data.isEnabled;\n this.kennedy_heart_color_string = data.kennedyHeartColorString;\n }\n}", "import { Parser } from '../../index.js';\nimport Button from '../Button.js';\nimport ToggleButton from '../ToggleButton.js';\nimport CreatorHeart from './CreatorHeart.js';\n\nimport { YTNode } from '../../helpers.js';\nimport type { RawNode } from '../../index.js';\n\nexport default class CommentActionButtons extends YTNode {\n static type = 'CommentActionButtons';\n\n like_button: ToggleButton | null;\n dislike_button: ToggleButton | null;\n reply_button: Button | null;\n creator_heart: CreatorHeart | null;\n\n constructor(data: RawNode) {\n super();\n this.like_button = Parser.parseItem(data.likeButton, ToggleButton);\n this.dislike_button = Parser.parseItem(data.dislikeButton, ToggleButton);\n this.reply_button = Parser.parseItem(data.replyButton, Button);\n this.creator_heart = Parser.parseItem(data.creatorHeart, CreatorHeart);\n }\n}", "import { YTNode } from '../helpers.js';\nimport { Parser, type RawNode } from '../index.js';\nimport ButtonView from './ButtonView.js';\n\nexport default class ToggleButtonView extends YTNode {\n static type = 'ToggleButtonView';\n\n default_button: ButtonView | null;\n toggled_button: ButtonView | null;\n is_toggling_disabled: boolean;\n identifier?: string;\n is_toggled?: boolean;\n\n constructor(data: RawNode) {\n super();\n this.default_button = Parser.parseItem(data.defaultButtonViewModel, ButtonView);\n this.toggled_button = Parser.parseItem(data.toggledButtonViewModel, ButtonView);\n this.is_toggling_disabled = data.isTogglingDisabled;\n this.identifier = data.identifier;\n \n if (Reflect.has(data, 'isToggled')) {\n this.is_toggled = data.isToggled;\n }\n }\n}", "import { YTNode } from '../helpers.js';\nimport { Parser, type RawNode } from '../index.js';\nimport ToggleButtonView from './ToggleButtonView.js';\n\nexport default class LikeButtonView extends YTNode {\n static type = 'LikeButtonView';\n\n toggle_button: ToggleButtonView | null;\n like_status_entity_key: string;\n like_status_entity: {\n key: string,\n like_status: string\n };\n\n constructor(data: RawNode) {\n super();\n this.toggle_button = Parser.parseItem(data.toggleButtonViewModel, ToggleButtonView);\n this.like_status_entity_key = data.likeStatusEntityKey;\n this.like_status_entity = {\n key: data.likeStatusEntity.key,\n like_status: data.likeStatusEntity.likeStatus\n };\n }\n}", "import { YTNode } from '../helpers.js';\nimport { Parser, type RawNode } from '../index.js';\nimport ToggleButtonView from './ToggleButtonView.js';\n\nexport default class DislikeButtonView extends YTNode {\n static type = 'DislikeButtonView';\n\n toggle_button: ToggleButtonView | null;\n dislike_entity_key: string;\n\n constructor(data: RawNode) {\n super();\n this.toggle_button = Parser.parseItem(data.toggleButtonViewModel, ToggleButtonView);\n this.dislike_entity_key = data.dislikeEntityKey;\n }\n}", "import { YTNode } from '../helpers.js';\nimport { Parser, type RawNode } from '../index.js';\nimport LikeButtonView from './LikeButtonView.js';\nimport DislikeButtonView from './DislikeButtonView.js';\n\nexport default class SegmentedLikeDislikeButtonView extends YTNode {\n static type = 'SegmentedLikeDislikeButtonView';\n\n like_button: LikeButtonView | null;\n dislike_button: DislikeButtonView | null;\n icon_type: string;\n like_count_entity: {\n key: string\n };\n dynamic_like_count_update_data: {\n update_status_key: string,\n placeholder_like_count_values_key: string,\n update_delay_loop_id: string,\n update_delay_sec: number\n };\n\n like_count?: number;\n short_like_count?: string;\n\n constructor(data: RawNode) {\n super();\n this.like_button = Parser.parseItem(data.likeButtonViewModel, LikeButtonView);\n this.dislike_button = Parser.parseItem(data.dislikeButtonViewModel, DislikeButtonView);\n this.icon_type = data.iconType;\n\n if (this.like_button && this.like_button.toggle_button) {\n const toggle_button = this.like_button.toggle_button;\n\n if (toggle_button.default_button) {\n this.short_like_count = toggle_button.default_button.title;\n\n if (toggle_button.default_button.accessibility_text)\n this.like_count = parseInt(toggle_button.default_button.accessibility_text.replace(/\\D/g, ''));\n } else if (toggle_button.toggled_button) {\n this.short_like_count = toggle_button.toggled_button.title;\n if (toggle_button.toggled_button.accessibility_text)\n this.like_count = parseInt(toggle_button.toggled_button.accessibility_text.replace(/\\D/g, ''));\n }\n }\n\n this.like_count_entity = {\n key: data.likeCountEntity.key\n };\n\n this.dynamic_like_count_update_data = {\n update_status_key: data.dynamicLikeCountUpdateData.updateStatusKey,\n placeholder_like_count_values_key: data.dynamicLikeCountUpdateData.placeholderLikeCountValuesKey,\n update_delay_loop_id: data.dynamicLikeCountUpdateData.updateDelayLoopId,\n update_delay_sec: data.dynamicLikeCountUpdateData.updateDelaySec\n };\n }\n}", "import Button from '../Button.js';\nimport type { RawNode } from '../../index.js';\n\nexport default class MenuServiceItem extends Button {\n static type = 'MenuServiceItem';\n\n constructor(data: RawNode) {\n super(data);\n }\n}", "import NavigationEndpoint from './NavigationEndpoint.js';\nimport { YTNode } from '../helpers.js';\nimport type { RawNode } from '../index.js';\n\nexport default class DownloadButton extends YTNode {\n static type = 'DownloadButton';\n\n style: string;\n size: string; // TODO: check this\n endpoint: NavigationEndpoint;\n target_id: string;\n\n constructor(data: RawNode) {\n super();\n this.style = data.style;\n this.size = data.size;\n this.endpoint = new NavigationEndpoint(data.command);\n this.target_id = data.targetId;\n }\n}", "import { YTNode } from '../../helpers.js';\nimport type { RawNode } from '../../index.js';\nimport NavigationEndpoint from '../NavigationEndpoint.js';\n\nexport default class MenuServiceItemDownload extends YTNode {\n static type = 'MenuServiceItemDownload';\n\n has_separator: boolean;\n endpoint: NavigationEndpoint;\n\n constructor(data: RawNode) {\n super();\n this.has_separator = !!data.hasSeparator;\n this.endpoint = new NavigationEndpoint(data.navigationEndpoint || data.serviceEndpoint);\n }\n}", "import type { RawNode } from '../types/RawResponse.js';\nimport { YTNode } from '../helpers.js';\nimport NavigationEndpoint from './NavigationEndpoint.js';\n\ninterface ButtonContent {\n button_text: string;\n accessibility_text: string;\n image_name: string;\n subscribe_state_subscribed: boolean;\n endpoint: NavigationEndpoint;\n}\n\ninterface BellAccessibilityData {\n off_label?: string;\n all_label?: string;\n occasional_label?: string;\n disabled_label?: string;\n}\n\ninterface ButtonStyle {\n unsubscribed_state_style?: string;\n subscribed_state_style?: string;\n}\n\nexport default class SubscribeButtonView extends YTNode {\n static type = 'SubscribeButtonView';\n\n public subscribe_button_content: ButtonContent;\n public unsubscribe_button_content: ButtonContent;\n public disable_notification_bell: boolean;\n public button_style?: ButtonStyle;\n public is_signed_out: boolean;\n public background_style: string;\n public disable_subscribe_button: boolean;\n public on_show_subscription_options?: NavigationEndpoint;\n public channel_id: string;\n public enable_subscribe_button_post_click_animation: boolean;\n public bell_accessibility_data?: BellAccessibilityData;\n\n constructor(data: RawNode) {\n super();\n this.subscribe_button_content = this.#parseButtonContent(data.subscribeButtonContent);\n this.unsubscribe_button_content = this.#parseButtonContent(data.unsubscribeButtonContent);\n this.disable_notification_bell = data.disableNotificationBell;\n\n if ('buttonStyle' in data) {\n this.button_style = {\n unsubscribed_state_style: data.buttonStyle?.unsubscribedStateStyle,\n subscribed_state_style: data.buttonStyle?.subscribedStateStyle\n };\n }\n\n this.is_signed_out = data.isSignedOut;\n this.background_style = data.backgroundStyle;\n this.disable_subscribe_button = data.disableSubscribeButton;\n\n if ('onShowSubscriptionOptions' in data) {\n this.on_show_subscription_options = new NavigationEndpoint(data.onShowSubscriptionOptions);\n }\n\n this.channel_id = data.channelId;\n this.enable_subscribe_button_post_click_animation = data.enableSubscribeButtonPostClickAnimation;\n\n if ('bellAccessibilityData' in data) {\n this.bell_accessibility_data = {\n off_label: data.bellAccessibilityData?.offLabel,\n all_label: data.bellAccessibilityData?.allLabel,\n occasional_label: data.bellAccessibilityData?.occasionalLabel,\n disabled_label: data.bellAccessibilityData?.disabledLabel\n };\n }\n }\n\n #parseButtonContent(data: RawNode): ButtonContent {\n return {\n button_text: data.buttonText,\n accessibility_text: data.accessibilityText,\n image_name: data.imageName,\n subscribe_state_subscribed: data.subscribeState.subscribed,\n endpoint: new NavigationEndpoint(data.onTapCommand)\n };\n }\n}", "import type { ObservedArray } from '../helpers.js';\nimport type { RawNode } from '../types/RawResponse.js';\nimport { YTNode } from '../helpers.js';\nimport { Parser } from '../index.js';\n\nimport AvatarView from './AvatarView.js';\nimport RendererContext from './misc/RendererContext.js';\nimport SubscribeButtonView from './SubscribeButtonView.js';\nimport Text from './misc/Text.js';\n\nexport default class ListItemView extends YTNode {\n static type = 'ListItemView';\n\n public title?: Text;\n public subtitle?: Text;\n public leading_accessory: AvatarView | null;\n public renderer_context?: RendererContext;\n public trailing_buttons: ObservedArray;\n\n constructor(data: RawNode) {\n super();\n if ('title' in data) {\n this.title = Text.fromAttributed(data.title);\n }\n\n if ('subtitle' in data) {\n this.subtitle = Text.fromAttributed(data.subtitle);\n }\n\n this.leading_accessory = Parser.parseItem(data.leadingAccessory, AvatarView);\n\n if ('rendererContext' in data) {\n this.renderer_context = new RendererContext(data.rendererContext);\n }\n\n this.trailing_buttons = Parser.parseArray(data.trailingButtons?.buttons, SubscribeButtonView);\n }\n}", "import { Parser } from '../../index.js';\nimport { YTNode } from '../../helpers.js';\nimport type { RawNode } from '../../index.js';\n\nimport Button from '../Button.js';\nimport ButtonView from '../ButtonView.js';\nimport MenuServiceItem from './MenuServiceItem.js';\nimport DownloadButton from '../DownloadButton.js';\nimport MenuServiceItemDownload from './MenuServiceItemDownload.js';\nimport ListItemView from '../ListItemView.js';\n\nexport default class MenuFlexibleItem extends YTNode {\n static type = 'MenuFlexibleItem';\n\n public menu_item: ListItemView | MenuServiceItem | MenuServiceItemDownload | null;\n public top_level_button: DownloadButton | ButtonView | Button | null;\n\n constructor(data: RawNode) {\n super();\n this.menu_item = Parser.parseItem(data.menuItem, [ ListItemView, MenuServiceItem, MenuServiceItemDownload ]);\n this.top_level_button = Parser.parseItem(data.topLevelButton, [ DownloadButton, ButtonView, Button ]);\n }\n}", "import { YTNode } from '../helpers.js';\nimport type { RawNode } from '../index.js';\nimport NavigationEndpoint from './NavigationEndpoint.js';\n\nexport default class LikeButton extends YTNode {\n static type = 'LikeButton';\n\n target: {\n video_id: string;\n };\n\n like_status: string;\n likes_allowed: string;\n endpoints?: NavigationEndpoint[];\n\n constructor(data: RawNode) {\n super();\n\n this.target = {\n video_id: data.target.videoId\n };\n\n this.like_status = data.likeStatus;\n this.likes_allowed = data.likesAllowed;\n\n if (Reflect.has(data, 'serviceEndpoints')) {\n this.endpoints = data.serviceEndpoints.map((endpoint: RawNode) => new NavigationEndpoint(endpoint));\n }\n }\n}", "import { type ObservedArray, YTNode } from '../helpers.js';\nimport { Parser, type RawNode } from '../index.js';\nimport ButtonView from './ButtonView.js';\nimport ToggleButtonView from './ToggleButtonView.js';\nimport SubscribeButtonView from './SubscribeButtonView.js';\n\nexport type ActionRow = {\n actions: ObservedArray;\n};\n\nexport default class FlexibleActionsView extends YTNode {\n static type = 'FlexibleActionsView';\n\n actions_rows: ActionRow[];\n style: string;\n\n constructor(data: RawNode) {\n super();\n this.actions_rows = data.actionsRows.map((row: RawNode) => ({\n actions: Parser.parseArray(row.actions, [ ButtonView, ToggleButtonView, SubscribeButtonView ])\n }));\n this.style = data.style;\n }\n}\n", "import { Parser } from '../../index.js';\nimport type { ObservedArray } from '../../helpers.js';\nimport { YTNode } from '../../helpers.js';\nimport type { RawNode } from '../../index.js';\nimport Button from '../Button.js';\nimport ButtonView from '../ButtonView.js';\nimport SegmentedLikeDislikeButtonView from '../SegmentedLikeDislikeButtonView.js';\nimport MenuFlexibleItem from './MenuFlexibleItem.js';\nimport LikeButton from '../LikeButton.js';\nimport ToggleButton from '../ToggleButton.js';\nimport FlexibleActionsView from '../FlexibleActionsView.js';\nimport AccessibilityData, { type AccessibilitySupportedDatas } from '../misc/AccessibilityData.js';\n\nexport default class Menu extends YTNode {\n static type = 'Menu';\n\n public items: ObservedArray;\n public flexible_items: ObservedArray;\n public top_level_buttons: ObservedArray;\n public accessibility?: AccessibilitySupportedDatas;\n\n constructor(data: RawNode) {\n super();\n this.items = Parser.parseArray(data.items);\n this.flexible_items = Parser.parseArray(data.flexibleItems, MenuFlexibleItem);\n this.top_level_buttons = Parser.parseArray(data.topLevelButtons, [ ToggleButton, LikeButton, Button, ButtonView, SegmentedLikeDislikeButtonView, FlexibleActionsView ]);\n\n if ('accessibility' in data\n && 'accessibilityData' in data.accessibility) {\n this.accessibility = {\n accessibility_data: new AccessibilityData(data.accessibility.accessibilityData)\n };\n }\n }\n \n get label(): string | undefined {\n return this.accessibility?.accessibility_data?.label;\n }\n\n // XXX: alias for consistency\n get contents() {\n return this.items;\n }\n}", "import { YTNode } from '../helpers.js';\nimport { Parser, type RawNode } from '../index.js';\nimport Button from './Button.js';\nimport NavigationEndpoint from './NavigationEndpoint.js';\nimport CommentActionButtons from './comments/CommentActionButtons.js';\nimport Menu from './menus/Menu.js';\nimport Author from './misc/Author.js';\nimport Text from './misc/Text.js';\n\nexport default class BackstagePost extends YTNode {\n static type = 'BackstagePost';\n\n id: string;\n author: Author;\n content: Text;\n published: Text;\n poll_status?: string;\n vote_status?: string;\n vote_count?: Text;\n menu?: Menu | null;\n action_buttons?: CommentActionButtons | null;\n vote_button?: Button | null;\n surface: string;\n endpoint?: NavigationEndpoint;\n attachment;\n\n constructor(data: RawNode) {\n super();\n this.id = data.postId;\n\n this.author = new Author({\n ...data.authorText,\n navigationEndpoint: data.authorEndpoint\n }, null, data.authorThumbnail);\n\n this.content = new Text(data.contentText);\n this.published = new Text(data.publishedTimeText);\n\n if (Reflect.has(data, 'pollStatus')) {\n this.poll_status = data.pollStatus;\n }\n\n if (Reflect.has(data, 'voteStatus')) {\n this.vote_status = data.voteStatus;\n }\n\n if (Reflect.has(data, 'voteCount')) {\n this.vote_count = new Text(data.voteCount);\n }\n\n if (Reflect.has(data, 'actionMenu')) {\n this.menu = Parser.parseItem(data.actionMenu, Menu);\n }\n\n if (Reflect.has(data, 'actionButtons')) {\n this.action_buttons = Parser.parseItem(data.actionButtons, CommentActionButtons);\n }\n\n if (Reflect.has(data, 'voteButton')) {\n this.vote_button = Parser.parseItem(data.voteButton, Button);\n }\n\n if (Reflect.has(data, 'navigationEndpoint')) {\n this.endpoint = new NavigationEndpoint(data.navigationEndpoint);\n }\n\n if (Reflect.has(data, 'backstageAttachment')) {\n this.attachment = Parser.parseItem(data.backstageAttachment);\n }\n\n this.surface = data.surface;\n }\n}", "import { Parser, type RawNode } from '../index.js';\nimport { YTNode } from '../helpers.js';\n\nexport default class BackstagePostThread extends YTNode {\n static type = 'BackstagePostThread';\n\n post: YTNode;\n\n constructor(data: RawNode) {\n super();\n this.post = Parser.parseItem(data.post);\n }\n}", "import { YTNode } from '../helpers.js';\nimport type { RawNode } from '../types/index.js';\n\nexport default class BadgeView extends YTNode {\n text: string;\n style: string;\n accessibility_label: string;\n\n constructor(data: RawNode) {\n super();\n\n this.text = data.badgeText;\n this.style = data.badgeStyle;\n this.accessibility_label = data.accessibilityLabel;\n }\n}", "import { YTNode } from '../helpers.js';\nimport type { RawNode } from '../index.js';\nimport NavigationEndpoint from './NavigationEndpoint.js';\nimport Text from './misc/Text.js';\n\nexport default class SubFeedOption extends YTNode {\n static type = 'SubFeedOption';\n\n name: Text;\n is_selected: boolean;\n endpoint: NavigationEndpoint;\n\n constructor(data: RawNode) {\n super();\n this.name = new Text(data.name);\n this.is_selected = data.isSelected;\n this.endpoint = new NavigationEndpoint(data.navigationEndpoint);\n }\n}", "import { Parser, type RawNode } from '../index.js';\nimport Text from './misc/Text.js';\nimport { type ObservedArray, YTNode } from '../helpers.js';\nimport SubFeedOption from './SubFeedOption.js';\n\nexport default class SubFeedSelector extends YTNode {\n static type = 'SubFeedSelector';\n\n title: Text;\n options: ObservedArray;\n\n constructor(data: RawNode) {\n super();\n this.title = new Text(data.title);\n this.options = Parser.parseArray(data.options, SubFeedOption);\n }\n}", "import Text from './misc/Text.js';\nimport { YTNode } from '../helpers.js';\nimport { type RawNode } from '../index.js';\n\nexport default class EomSettingsDisclaimer extends YTNode {\n static type = 'EomSettingsDisclaimer';\n\n disclaimer: Text;\n info_icon: {\n icon_type: string\n };\n usage_scenario: string;\n\n constructor(data: RawNode) {\n super();\n this.disclaimer = new Text(data.disclaimer);\n this.info_icon = {\n icon_type: data.infoIcon.iconType\n };\n this.usage_scenario = data.usageScenario;\n }\n}\n", "import { YTNode } from '../helpers.js';\nimport { Parser, type RawNode } from '../index.js';\nimport Button from './Button.js';\nimport NavigationEndpoint from './NavigationEndpoint.js';\nimport Text from './misc/Text.js';\n\nexport default class SearchBox extends YTNode {\n static type = 'SearchBox';\n\n endpoint: NavigationEndpoint;\n search_button: Button | null;\n clear_button: Button | null;\n placeholder_text: Text;\n\n constructor(data: RawNode) {\n super();\n this.endpoint = new NavigationEndpoint(data.endpoint);\n this.search_button = Parser.parseItem(data.searchButton, Button);\n this.clear_button = Parser.parseItem(data.clearButton, Button);\n this.placeholder_text = new Text(data.placeholderText);\n }\n}", "import { Parser, type RawNode } from '../index.js';\nimport { type ObservedArray, YTNode } from '../helpers.js';\nimport SubFeedSelector from './SubFeedSelector.js';\nimport EomSettingsDisclaimer from './EomSettingsDisclaimer.js';\nimport ToggleButton from './ToggleButton.js';\nimport CompactLink from './CompactLink.js';\nimport SearchBox from './SearchBox.js';\nimport Button from './Button.js';\n\nexport default class BrowseFeedActions extends YTNode {\n static type = 'BrowseFeedActions';\n\n public contents: ObservedArray;\n\n constructor(data: RawNode) {\n super();\n this.contents = Parser.parseArray(data.contents, [ SubFeedSelector, EomSettingsDisclaimer, ToggleButton, CompactLink, SearchBox, Button ]);\n }\n}", "import Text from './misc/Text.js';\nimport Thumbnail from './misc/Thumbnail.js';\nimport { YTNode } from '../helpers.js';\nimport type { RawNode } from '../index.js';\n\nexport default class BrowserMediaSession extends YTNode {\n static type = 'BrowserMediaSession';\n\n album: Text;\n thumbnails: Thumbnail[];\n\n constructor (data: RawNode) {\n super();\n this.album = new Text(data.album);\n this.thumbnails = Thumbnail.fromResponse(data.thumbnailDetails);\n }\n}", "import { YTNode } from '../helpers.js';\nimport type { RawNode } from '../index.js';\nimport RendererContext from './misc/RendererContext.js';\n\nexport default class ButtonCardView extends YTNode {\n static type = 'ButtonCardView';\n\n public title: string;\n public icon_name: string;\n public renderer_context: RendererContext;\n\n constructor(data: RawNode) {\n super();\n this.title = data.title;\n this.icon_name = data.image.sources[0].clientResource.imageName;\n this.renderer_context = new RendererContext(data.rendererContext);\n }\n}\n", "import { YTNode, observe, type ObservedArray } from '../helpers.js';\nimport type { RawNode } from '../index.js';\nimport NavigationEndpoint from './NavigationEndpoint.js';\nimport Text from './misc/Text.js';\nimport Thumbnail from './misc/Thumbnail.js';\n\n// XXX (LuanRT): This is not a real YTNode, but we treat it as one to keep things clean.\nexport class HeaderLink extends YTNode {\n static type = 'HeaderLink';\n\n endpoint: NavigationEndpoint;\n icon: Thumbnail[];\n title: Text;\n\n constructor(data: RawNode) {\n super();\n this.endpoint = new NavigationEndpoint(data.navigationEndpoint);\n this.icon = Thumbnail.fromResponse(data.icon);\n this.title = new Text(data.title);\n }\n}\n\nexport default class ChannelHeaderLinks extends YTNode {\n static type = 'ChannelHeaderLinks';\n\n primary: ObservedArray;\n secondary: ObservedArray;\n\n constructor(data: RawNode) {\n super();\n this.primary = observe(data.primaryLinks?.map((link: RawNode) => new HeaderLink(link)) || []);\n this.secondary = observe(data.secondaryLinks?.map((link: RawNode) => new HeaderLink(link)) || []);\n }\n}", "import { YTNode } from '../helpers.js';\nimport type { RawNode } from '../index.js';\nimport Text from './misc/Text.js';\n\nexport default class ChannelHeaderLinksView extends YTNode {\n static type = 'ChannelHeaderLinksView';\n\n first_link?: Text;\n more?: Text;\n\n constructor(data: RawNode) {\n super();\n\n if (Reflect.has(data, 'firstLink')) {\n this.first_link = Text.fromAttributed(data.firstLink);\n }\n\n if (Reflect.has(data, 'more')) {\n this.more = Text.fromAttributed(data.more);\n }\n }\n}", "import { YTNode } from '../helpers.js';\nimport Text from './misc/Text.js';\n\nimport type { RawNode } from '../types/index.js';\n\nexport default class ClipCreationTextInput extends YTNode {\n static type = 'ClipCreationTextInput';\n\n placeholder_text: Text;\n max_character_limit: number;\n\n constructor(data: RawNode) {\n super();\n this.placeholder_text = new Text(data.placeholderText);\n this.max_character_limit = data.maxCharacterLimit;\n }\n}", "import { YTNode } from '../helpers.js';\n\nimport type { RawNode } from '../types/index.js';\n\nexport default class ClipCreationScrubber extends YTNode {\n static type = 'ClipCreationScrubber';\n\n length_template: string;\n max_length_ms: number;\n min_length_ms: number;\n default_length_ms: number;\n window_size_ms: number;\n start_label?: string;\n end_label?: string;\n duration_label?: string;\n\n constructor(data: RawNode) {\n super();\n this.length_template = data.lengthTemplate;\n this.max_length_ms = data.maxLengthMs;\n this.min_length_ms = data.minLengthMs;\n this.default_length_ms = data.defaultLengthMs;\n this.window_size_ms = data.windowSizeMs;\n this.start_label = data.startAccessibility?.accessibilityData?.label;\n this.end_label = data.endAccessibility?.accessibilityData?.label;\n this.duration_label = data.durationAccessibility?.accessibilityData?.label;\n }\n}", "import { YTNode } from '../helpers.js';\nimport Text from './misc/Text.js';\n\nimport type { RawNode } from '../types/index.js';\n\nexport default class ClipAdState extends YTNode {\n static type = 'ClipAdState';\n\n title: Text;\n body: Text;\n\n constructor(data: RawNode) {\n super();\n this.title = new Text(data.title);\n this.body = new Text(data.body);\n }\n}", "import { YTNode } from '../helpers.js';\nimport Thumbnail from './misc/Thumbnail.js';\nimport Button from './Button.js';\nimport ClipCreationTextInput from './ClipCreationTextInput.js';\nimport ClipCreationScrubber from './ClipCreationScrubber.js';\nimport ClipAdState from './ClipAdState.js';\nimport Text from './misc/Text.js';\n\nimport { Parser } from '../index.js';\n\nimport type { RawNode } from '../types/index.js';\n\nexport default class ClipCreation extends YTNode {\n static type = 'ClipCreation';\n\n user_avatar: Thumbnail[];\n title_input: ClipCreationTextInput | null;\n scrubber: ClipCreationScrubber | null;\n save_button: Button | null;\n display_name: Text;\n publicity_label: string;\n cancel_button: Button | null;\n ad_state_overlay: ClipAdState | null;\n external_video_id: string;\n publicity_label_icon: string;\n\n constructor(data: RawNode) {\n super();\n this.user_avatar = Thumbnail.fromResponse(data.userAvatar);\n this.title_input = Parser.parseItem(data.titleInput, [ ClipCreationTextInput ]);\n this.scrubber = Parser.parseItem(data.scrubber, [ ClipCreationScrubber ]);\n this.save_button = Parser.parseItem(data.saveButton, [ Button ]);\n this.display_name = new Text(data.displayName);\n this.publicity_label = data.publicityLabel;\n this.cancel_button = Parser.parseItem(data.cancelButton, [ Button ]);\n this.ad_state_overlay = Parser.parseItem(data.adStateOverlay, [ ClipAdState ]);\n this.external_video_id = data.externalVideoId;\n this.publicity_label_icon = data.publicityLabelIcon;\n }\n}", "import type { ObservedArray } from '../helpers.js';\nimport { YTNode } from '../helpers.js';\n\nimport ClipCreation from './ClipCreation.js';\n\nimport { Parser } from '../index.js';\n\nimport type { RawNode } from '../types/index.js';\n\nexport default class ClipSection extends YTNode {\n static type = 'ClipSection';\n\n contents: ObservedArray | null;\n\n constructor(data: RawNode) {\n super();\n this.contents = Parser.parse(data.contents, true, [ ClipCreation ]);\n }\n}\n", "import { YTNode } from '../helpers.js';\nimport { Parser, type RawNode } from '../index.js';\nimport Button from './Button.js';\nimport NavigationEndpoint from './NavigationEndpoint.js';\n\nexport default class ContinuationItem extends YTNode {\n static type = 'ContinuationItem';\n\n trigger: string;\n button?: Button | null;\n endpoint: NavigationEndpoint;\n\n constructor(data: RawNode) {\n super();\n this.trigger = data.trigger;\n\n if (Reflect.has(data, 'button')) {\n this.button = Parser.parseItem(data.button, Button);\n }\n\n this.endpoint = new NavigationEndpoint(data.continuationEndpoint);\n }\n}", "import { YTNode } from '../helpers.js';\nimport { Parser, type RawNode } from '../index.js';\nimport Text from './misc/Text.js';\nimport Button from './Button.js';\n\nexport default class EngagementPanelTitleHeader extends YTNode {\n static type = 'EngagementPanelTitleHeader';\n\n public title: Text;\n public visibility_button: Button | null;\n public contextual_info?: Text;\n public menu: YTNode | null;\n\n constructor(data: RawNode) {\n super();\n this.title = new Text(data.title);\n this.contextual_info = data.contextualInfo ? new Text(data.contextualInfo) : undefined;\n this.visibility_button = Parser.parseItem(data.visibilityButton, Button);\n this.menu = Parser.parseItem(data.menu);\n }\n}", "import { YTNode } from '../helpers.js';\nimport { Parser, type RawNode } from '../index.js';\nimport Menu from './menus/Menu.js';\nimport Text from './misc/Text.js';\n\nexport default class MacroMarkersInfoItem extends YTNode {\n static type = 'MacroMarkersInfoItem';\n\n info_text: Text;\n menu: Menu | null;\n\n constructor(data: RawNode) {\n super();\n this.info_text = new Text(data.infoText);\n this.menu = Parser.parseItem(data.menu, Menu);\n }\n}", "import Text from './misc/Text.js';\nimport Thumbnail from './misc/Thumbnail.js';\nimport NavigationEndpoint from './NavigationEndpoint.js';\n\nimport { YTNode } from '../helpers.js';\nimport type { RawNode } from '../index.js';\n\nexport default class MacroMarkersListItem extends YTNode {\n static type = 'MacroMarkersListItem';\n\n title: Text;\n time_description: Text;\n thumbnail: Thumbnail[];\n on_tap_endpoint: NavigationEndpoint;\n layout: string;\n is_highlighted: boolean;\n\n constructor(data: RawNode) {\n super();\n this.title = new Text(data.title);\n this.time_description = new Text(data.timeDescription);\n this.thumbnail = Thumbnail.fromResponse(data.thumbnail);\n this.on_tap_endpoint = new NavigationEndpoint(data.onTap);\n this.layout = data.layout;\n this.is_highlighted = !!data.isHighlighted;\n }\n}", "import { YTNode, type ObservedArray } from '../helpers.js';\nimport { Parser, type RawNode } from '../index.js';\nimport { Text } from '../misc.js';\nimport MacroMarkersInfoItem from './MacroMarkersInfoItem.js';\nimport MacroMarkersListItem from './MacroMarkersListItem.js';\n\nexport default class MacroMarkersList extends YTNode {\n static type = 'MacroMarkersList';\n\n contents: ObservedArray;\n sync_button_label: Text;\n\n constructor(data: RawNode) {\n super();\n this.contents = Parser.parseArray(data.contents, [ MacroMarkersInfoItem, MacroMarkersListItem ]);\n this.sync_button_label = new Text(data.syncButtonLabel);\n }\n}", "import type { ObservedArray } from '../helpers.js';\nimport { YTNode } from '../helpers.js';\nimport type { RawNode } from '../index.js';\nimport { Parser } from '../index.js';\n\nexport default class ProductList extends YTNode {\n static type = 'ProductList';\n\n contents: ObservedArray;\n\n constructor(data: RawNode) {\n super();\n this.contents = Parser.parseArray(data.contents);\n }\n}", "import { type ObservedArray, YTNode } from '../helpers.js';\nimport { Parser, type RawNode } from '../index.js';\n\nexport default class SectionList extends YTNode {\n static type = 'SectionList';\n\n contents: ObservedArray;\n target_id?: string;\n continuation?: string;\n header?: YTNode;\n sub_menu?: YTNode;\n\n constructor(data: RawNode) {\n super();\n this.contents = Parser.parseArray(data.contents);\n\n if (Reflect.has(data, 'targetId')) {\n this.target_id = data.targetId;\n }\n\n if (Reflect.has(data, 'continuations')) {\n if (Reflect.has(data.continuations[0], 'nextContinuationData')) {\n this.continuation = data.continuations[0].nextContinuationData.continuation;\n } else if (Reflect.has(data.continuations[0], 'reloadContinuationData')) {\n this.continuation = data.continuations[0].reloadContinuationData.continuation;\n }\n }\n\n if (Reflect.has(data, 'header')) {\n this.header = Parser.parseItem(data.header);\n }\n\n if (Reflect.has(data, 'subMenu')) {\n this.sub_menu = Parser.parseItem(data.subMenu);\n }\n }\n}", "import { YTNode } from '../helpers.js';\nimport { Text } from '../misc.js';\n\nimport type { RawNode } from '../index.js';\n\nexport default class ExpandableVideoDescriptionBody extends YTNode {\n static type = 'ExpandableVideoDescriptionBody';\n\n show_more_text: Text;\n show_less_text: Text;\n attributed_description_body_text?: Text;\n\n constructor(data: RawNode) {\n super();\n this.show_more_text = new Text(data.showMoreText);\n this.show_less_text = new Text(data.showLessText);\n if (Reflect.has(data, 'attributedDescriptionBodyText')) {\n this.attributed_description_body_text = Text.fromAttributed(data.attributedDescriptionBodyText);\n }\n }\n}\n", "import NavigationEndpoint from './NavigationEndpoint.js';\nimport Thumbnail from './misc/Thumbnail.js';\nimport Text from './misc/Text.js';\nimport { YTNode } from '../helpers.js';\nimport type { RawNode } from '../index.js';\n\nexport default class SearchRefinementCard extends YTNode {\n static type = 'SearchRefinementCard';\n\n thumbnails: Thumbnail[];\n endpoint: NavigationEndpoint;\n query: string;\n\n constructor(data: RawNode) {\n super();\n this.thumbnails = Thumbnail.fromResponse(data.thumbnail);\n this.endpoint = new NavigationEndpoint(data.searchEndpoint);\n this.query = new Text(data.query).toString();\n }\n}", "import { YTNode } from '../helpers.js';\nimport { Parser, type RawNode } from '../index.js';\n\nexport default class GameCard extends YTNode {\n static type = 'GameCard';\n\n game: YTNode;\n\n constructor(data: RawNode) {\n super();\n this.game = Parser.parseItem(data.game);\n }\n}", "import { Parser, type RawNode } from '../index.js';\nimport { type ObservedArray, YTNode } from '../helpers.js';\n\nexport default class HorizontalList extends YTNode {\n static type = 'HorizontalList';\n\n visible_item_count: string;\n items: ObservedArray;\n\n constructor(data: RawNode) {\n super();\n this.visible_item_count = data.visibleItemCount;\n this.items = Parser.parseArray(data.items);\n }\n\n // XXX: Alias for consistency.\n get contents() {\n return this.items;\n }\n}", "import { YTNode } from '../helpers.js';\nimport { type RawNode } from '../index.js';\nimport { Text } from '../misc.js';\n\nexport default class VideoSummaryParagraphView extends YTNode {\n static type = 'VideoSummaryParagraphView';\n\n public text: Text;\n\n constructor(data: RawNode) {\n super();\n this.text = Text.fromAttributed(data.text);\n }\n}", "import type { ObservedArray } from '../helpers.js';\nimport { YTNode } from '../helpers.js';\nimport { Parser, type RawNode } from '../index.js';\nimport DislikeButtonView from './DislikeButtonView.js';\nimport LikeButtonView from './LikeButtonView.js';\nimport VideoSummaryParagraphView from './VideoSummaryParagraphView.js';\n\nexport default class VideoSummaryContentView extends YTNode {\n static type = 'VideoSummaryContentView';\n\n public dislike_button_view?: DislikeButtonView | null;\n public like_button_view?: LikeButtonView | null;\n public paragraphs: ObservedArray;\n\n constructor(data: RawNode) {\n super();\n\n if ('dislikeButtonViewModel' in data) {\n this.dislike_button_view = Parser.parseItem(data.dislikeButtonViewModel, DislikeButtonView);\n }\n\n if ('likeButtonViewModel' in data) {\n this.like_button_view = Parser.parseItem(data.likeButtonViewModel, LikeButtonView);\n }\n\n this.paragraphs = Parser.parseArray(data.paragraphs, VideoSummaryParagraphView);\n }\n}", "import { YTNode } from '../helpers.js';\nimport { Parser, type RawNode } from '../index.js';\nimport Button from './Button.js';\nimport HorizontalCardList from './HorizontalCardList.js';\nimport HorizontalList from './HorizontalList.js';\nimport Text from './misc/Text.js';\nimport Thumbnail from './misc/Thumbnail.js';\nimport VideoSummaryContentView from './VideoSummaryContentView.js';\n\nexport default class ExpandableMetadata extends YTNode {\n static type = 'ExpandableMetadata';\n\n header?: {\n collapsed_title: Text;\n collapsed_thumbnail: Thumbnail[];\n collapsed_label: Text;\n expanded_title: Text;\n };\n\n expanded_content: VideoSummaryContentView | HorizontalCardList | HorizontalList | null;\n expand_button: Button | null;\n collapse_button: Button | null;\n\n constructor(data: RawNode) {\n super();\n\n if (Reflect.has(data, 'header')) {\n this.header = {\n collapsed_title: new Text(data.header.collapsedTitle),\n collapsed_thumbnail: Thumbnail.fromResponse(data.header.collapsedThumbnail),\n collapsed_label: new Text(data.header.collapsedLabel),\n expanded_title: new Text(data.header.expandedTitle)\n };\n }\n\n this.expanded_content = Parser.parseItem(data.expandedContent, [ VideoSummaryContentView, HorizontalCardList, HorizontalList ]);\n this.expand_button = Parser.parseItem(data.expandButton, Button);\n this.collapse_button = Parser.parseItem(data.collapseButton, Button);\n }\n}", "import { YTNode } from '../helpers.js';\nimport type { RawNode } from '../index.js';\n\nexport default class MetadataBadge extends YTNode {\n static type = 'MetadataBadge';\n\n icon_type?: string;\n style?: string;\n label?: string;\n tooltip?: string;\n\n constructor(data: RawNode) {\n super();\n if (Reflect.has(data, 'icon')) {\n this.icon_type = data.icon.iconType;\n }\n\n if (Reflect.has(data, 'style')) {\n this.style = data.style;\n }\n\n if (Reflect.has(data, 'label')) {\n this.label = data.label;\n }\n\n if (Reflect.has(data, 'tooltip') || Reflect.has(data, 'iconTooltip')) {\n this.tooltip = data.tooltip || data.iconTooltip;\n }\n }\n}", "import Text from './misc/Text.js';\nimport { YTNode } from '../helpers.js';\nimport type { RawNode } from '../index.js';\n\nexport default class ThumbnailOverlayTimeStatus extends YTNode {\n static type = 'ThumbnailOverlayTimeStatus';\n\n text: string;\n style: string;\n\n constructor(data: RawNode) {\n super();\n this.text = new Text(data.text).toString();\n this.style = data.style;\n }\n}", "import { timeToSeconds } from '../../utils/Utils.js';\nimport { type ObservedArray, YTNode } from '../helpers.js';\nimport { Parser, type RawNode } from '../index.js';\nimport ExpandableMetadata from './ExpandableMetadata.js';\nimport MetadataBadge from './MetadataBadge.js';\nimport NavigationEndpoint from './NavigationEndpoint.js';\nimport ThumbnailOverlayTimeStatus from './ThumbnailOverlayTimeStatus.js';\nimport Menu from './menus/Menu.js';\nimport Author from './misc/Author.js';\nimport Text from './misc/Text.js';\nimport Thumbnail from './misc/Thumbnail.js';\n\nexport default class Video extends YTNode {\n static type = 'Video';\n\n public video_id: string;\n public title: Text;\n public untranslated_title?: Text;\n public description_snippet?: Text;\n public snippets?: { text: Text; hover_text: Text; }[];\n public expandable_metadata: ExpandableMetadata | null;\n public additional_metadatas?: Text[];\n public thumbnails: Thumbnail[];\n public thumbnail_overlays: ObservedArray;\n public rich_thumbnail?: YTNode;\n public author: Author;\n public badges: ObservedArray;\n public endpoint?: NavigationEndpoint;\n public published?: Text;\n public view_count?: Text;\n public short_view_count?: Text;\n public upcoming?: Date;\n public length_text?: Text;\n public show_action_menu: boolean;\n public is_watched: boolean;\n public menu: Menu | null;\n public byline_text?: Text;\n public search_video_result_entity_key?: string;\n public service_endpoints?: NavigationEndpoint[];\n public service_endpoint?: NavigationEndpoint;\n public style?: 'VIDEO_STYLE_TYPE_UNKNOWN' | 'VIDEO_STYLE_TYPE_NORMAL' | 'VIDEO_STYLE_TYPE_POST' | 'VIDEO_STYLE_TYPE_SUB' | 'VIDEO_STYLE_TYPE_LIVE_POST' | 'VIDEO_STYLE_TYPE_FULL_BLEED_ISOLATED' | 'VIDEO_STYLE_TYPE_WITH_EXPANDED_METADATA';\n\n constructor(data: RawNode) {\n super();\n this.title = new Text(data.title);\n this.video_id = data.videoId;\n this.expandable_metadata = Parser.parseItem(data.expandableMetadata, ExpandableMetadata);\n\n if ('untranslatedTitle' in data)\n this.untranslated_title = new Text(data.untranslatedTitle);\n\n if ('descriptionSnippet' in data)\n this.description_snippet = new Text(data.descriptionSnippet);\n\n if ('detailedMetadataSnippets' in data) {\n this.snippets = data.detailedMetadataSnippets.map((snippet: RawNode) => ({\n text: new Text(snippet.snippetText),\n hover_text: new Text(snippet.snippetHoverText)\n }));\n }\n\n if ('additionalMetadatas' in data)\n this.additional_metadatas = data.additionalMetadatas.map((meta: RawNode) => new Text(meta));\n\n this.thumbnails = Thumbnail.fromResponse(data.thumbnail);\n this.thumbnail_overlays = Parser.parseArray(data.thumbnailOverlays);\n\n if ('richThumbnail' in data)\n this.rich_thumbnail = Parser.parseItem(data.richThumbnail);\n\n this.author = new Author(data.ownerText, data.ownerBadges, data.channelThumbnailSupportedRenderers?.channelThumbnailWithLinkRenderer?.thumbnail);\n this.badges = Parser.parseArray(data.badges, MetadataBadge);\n\n if ('navigationEndpoint' in data)\n this.endpoint = new NavigationEndpoint(data.navigationEndpoint);\n\n if ('publishedTimeText' in data)\n this.published = new Text(data.publishedTimeText);\n\n if ('viewCountText' in data)\n this.view_count = new Text(data.viewCountText);\n\n if ('shortViewCountText' in data)\n this.short_view_count = new Text(data.shortViewCountText);\n\n if ('upcomingEventData' in data)\n this.upcoming = new Date(Number(`${data.upcomingEventData.startTime}000`));\n\n this.show_action_menu = !!data.showActionMenu;\n this.is_watched = !!data.isWatched;\n this.menu = Parser.parseItem(data.menu, Menu);\n\n if ('searchVideoResultEntityKey' in data)\n this.search_video_result_entity_key = data.searchVideoResultEntityKey;\n\n if ('bylineText' in data)\n this.byline_text = new Text(data.bylineText);\n\n if ('lengthText' in data)\n this.length_text = new Text(data.lengthText);\n\n if ('serviceEndpoints' in data)\n this.service_endpoints = data.serviceEndpoints.map((endpoint: RawNode) => new NavigationEndpoint(endpoint));\n\n if ('serviceEndpoint' in data)\n this.service_endpoint = new NavigationEndpoint(data.serviceEndpoint);\n \n if ('style' in data)\n this.style = data.style;\n }\n\n /**\n * @deprecated Use {@linkcode video_id} instead.\n */\n get id(): string {\n return this.video_id;\n }\n\n get description(): string {\n if (this.snippets)\n return this.snippets.map((snip) => snip.text.toString()).join('');\n return this.description_snippet?.toString() || '';\n }\n\n get is_live(): boolean {\n return this.badges.some((badge) => {\n if (badge.style === 'BADGE_STYLE_TYPE_LIVE_NOW' || badge.label === 'LIVE')\n return true;\n }) || this.thumbnail_overlays.firstOfType(ThumbnailOverlayTimeStatus)?.style === 'LIVE';\n }\n\n get is_upcoming(): boolean | undefined {\n return this.upcoming && this.upcoming > new Date();\n }\n\n get is_premiere(): boolean {\n return this.badges.some((badge) => badge.label === 'PREMIERE');\n }\n\n get is_4k(): boolean {\n return this.badges.some((badge) => badge.label === '4K');\n }\n\n get has_captions(): boolean {\n return this.badges.some((badge) => badge.label === 'CC');\n }\n\n get best_thumbnail(): Thumbnail | undefined {\n return this.thumbnails[0];\n }\n\n get duration() {\n const overlay_time_status = this.thumbnail_overlays.firstOfType(ThumbnailOverlayTimeStatus);\n const length_text = this.length_text?.toString() || overlay_time_status?.text.toString();\n return {\n text: length_text,\n seconds: length_text ? timeToSeconds(length_text) : 0\n };\n }\n}\n", "import type { RawNode } from '../index.js';\nimport Author from './misc/Author.js';\nimport Text from './misc/Text.js';\nimport Video from './Video.js';\n\nexport default class VideoCard extends Video {\n static type = 'VideoCard';\n \n public metadata_text?: Text;\n\n constructor(data: RawNode) {\n super(data);\n if (Reflect.has(data, 'metadataText')) {\n this.metadata_text = new Text(data.metadataText);\n if (this.metadata_text.text) {\n this.short_view_count = new Text({ simpleText: this.metadata_text.text.split('\u00B7')[0]?.trim() } as RawNode);\n this.published = new Text({ simpleText: this.metadata_text.text.split('\u00B7')[1]?.trim() } as RawNode);\n }\n }\n \n if (Reflect.has(data, 'bylineText')) {\n this.author = new Author(data.bylineText, data.ownerBadges, data.channelThumbnailSupportedRenderers?.channelThumbnailWithLinkRenderer?.thumbnail);\n }\n }\n}", "import { YTNode } from '../helpers.js';\nimport type { RawNode } from '../index.js';\nimport Thumbnail from './misc/Thumbnail.js';\n\nexport default class ContentPreviewImageView extends YTNode {\n static type = 'ContentPreviewImageView';\n\n image: Thumbnail[];\n style: string;\n\n constructor(data: RawNode) {\n super();\n this.image = Thumbnail.fromResponse(data.image);\n this.style = data.style;\n }\n}", "import { YTNode } from '../helpers.js';\nimport NavigationEndpoint from './NavigationEndpoint.js';\n\nimport ContentPreviewImageView from './ContentPreviewImageView.js';\nimport { Parser } from '../index.js';\n\nimport type { RawNode } from '../types/index.js';\nimport Thumbnail from './misc/Thumbnail.js';\n\nexport default class VideoAttributeView extends YTNode {\n static type = 'VideoAttributeView';\n\n image: ContentPreviewImageView | Thumbnail[] | null;\n image_style: string;\n title: string;\n subtitle: string;\n secondary_subtitle?: {\n content: string\n };\n orientation: string;\n sizing_rule: string;\n overflow_menu_on_tap: NavigationEndpoint;\n overflow_menu_a11y_label: string;\n\n constructor(data: RawNode) {\n super();\n\n if (data.image?.sources) {\n this.image = Thumbnail.fromResponse(data.image);\n } else {\n this.image = Parser.parseItem(data.image, ContentPreviewImageView);\n }\n\n this.image_style = data.imageStyle;\n this.title = data.title;\n this.subtitle = data.subtitle;\n\n if (Reflect.has(data, 'secondarySubtitle')) {\n this.secondary_subtitle = {\n content: data.secondarySubtitle.content\n };\n }\n\n this.orientation = data.orientation;\n this.sizing_rule = data.sizingRule;\n this.overflow_menu_on_tap = new NavigationEndpoint(data.overflowMenuOnTap);\n this.overflow_menu_a11y_label = data.overflowMenuA11yLabel;\n }\n}", "import { Parser, type RawNode } from '../index.js';\nimport { type ObservedArray, YTNode } from '../helpers.js';\nimport SearchRefinementCard from './SearchRefinementCard.js';\nimport Button from './Button.js';\nimport MacroMarkersListItem from './MacroMarkersListItem.js';\nimport GameCard from './GameCard.js';\nimport VideoCard from './VideoCard.js';\nimport VideoAttributeView from './VideoAttributeView.js';\n\nexport default class HorizontalCardList extends YTNode {\n static type = 'HorizontalCardList';\n\n cards: ObservedArray;\n header: YTNode;\n previous_button: Button | null;\n next_button: Button | null;\n\n constructor(data: RawNode) {\n super();\n this.cards = Parser.parseArray(data.cards, [ VideoAttributeView, SearchRefinementCard, MacroMarkersListItem, GameCard, VideoCard ]);\n this.header = Parser.parseItem(data.header);\n this.previous_button = Parser.parseItem(data.previousButton, Button);\n this.next_button = Parser.parseItem(data.nextButton, Button);\n }\n}", "import { YTNode } from '../helpers.js';\nimport { type RawNode } from '../index.js';\nimport { Text } from '../misc.js';\n\nexport default class Factoid extends YTNode {\n static type = 'Factoid';\n\n label: Text;\n value: Text;\n accessibility_text: string;\n\n constructor(data: RawNode) {\n super();\n this.label = new Text(data.label);\n this.value = new Text(data.value);\n this.accessibility_text = data.accessibilityText;\n }\n}\n", "import { YTNode } from '../helpers.js';\nimport type { RawNode } from '../index.js';\nimport { Parser } from '../index.js';\nimport Factoid from './Factoid.js';\n\nexport default class UploadTimeFactoid extends YTNode {\n static type = 'UploadTimeFactoid';\n\n factoid: Factoid | null;\n\n constructor(data: RawNode) {\n super();\n this.factoid = Parser.parseItem(data.factoid, Factoid);\n }\n}", "import { YTNode } from '../helpers.js';\nimport type { RawNode } from '../index.js';\nimport { Parser } from '../index.js';\nimport Factoid from './Factoid.js';\n\nexport default class ViewCountFactoid extends YTNode {\n static type = 'ViewCountFactoid';\n\n view_count_entity_key: string;\n factoid: Factoid | null;\n view_count_type: string;\n\n constructor(data: RawNode) {\n super();\n this.view_count_entity_key = data.viewCountEntityKey;\n this.factoid = Parser.parseItem(data.factoid, [ Factoid ]);\n this.view_count_type = data.viewCountType;\n }\n}\n", "import { Parser, type RawNode } from '../index.js';\nimport { YTNode } from '../helpers.js';\nimport Factoid from './Factoid.js';\n\nexport default class HypePointsFactoid extends YTNode {\n static type = 'HypePointsFactoid';\n\n public factoid: Factoid | null;\n\n constructor(data: RawNode) {\n super();\n this.factoid = Parser.parseItem(data.factoid, Factoid);\n }\n}", "import { YTNode, type ObservedArray } from '../helpers.js';\nimport { Parser, type RawNode } from '../index.js';\nimport { Text, Thumbnail } from '../misc.js';\nimport Factoid from './Factoid.js';\nimport NavigationEndpoint from './NavigationEndpoint.js';\nimport UploadTimeFactoid from './UploadTimeFactoid.js';\nimport ViewCountFactoid from './ViewCountFactoid.js';\nimport HypePointsFactoid from './HypePointsFactoid.js';\n\nexport default class VideoDescriptionHeader extends YTNode {\n static type = 'VideoDescriptionHeader';\n\n channel: Text;\n channel_navigation_endpoint?: NavigationEndpoint;\n channel_thumbnail: Thumbnail[];\n factoids: ObservedArray;\n publish_date: Text;\n title: Text;\n views: Text;\n\n constructor(data: RawNode) {\n super();\n this.title = new Text(data.title);\n this.channel = new Text(data.channel);\n this.channel_navigation_endpoint = new NavigationEndpoint(data.channelNavigationEndpoint);\n this.channel_thumbnail = Thumbnail.fromResponse(data.channelThumbnail);\n this.publish_date = new Text(data.publishDate);\n this.views = new Text(data.views);\n this.factoids = Parser.parseArray(data.factoid, [ Factoid, HypePointsFactoid, ViewCountFactoid, UploadTimeFactoid ]);\n }\n}\n", "import { Parser, type RawNode } from '../index.js';\n\nimport { YTNode } from '../helpers.js';\nimport Text from './misc/Text.js';\nimport Thumbnail from './misc/Thumbnail.js';\nimport Button from './Button.js';\nimport NavigationEndpoint from './NavigationEndpoint.js';\n\nexport default class VideoDescriptionInfocardsSection extends YTNode {\n static type = 'VideoDescriptionInfocardsSection';\n\n section_title: Text;\n creator_videos_button: Button | null;\n creator_about_button: Button | null;\n section_subtitle: Text;\n channel_avatar: Thumbnail[];\n channel_endpoint: NavigationEndpoint;\n\n constructor(data: RawNode) {\n super();\n this.section_title = new Text(data.sectionTitle);\n this.creator_videos_button = Parser.parseItem(data.creatorVideosButton, Button);\n this.creator_about_button = Parser.parseItem(data.creatorAboutButton, Button);\n this.section_subtitle = new Text(data.sectionSubtitle);\n this.channel_avatar = Thumbnail.fromResponse(data.channelAvatar);\n this.channel_endpoint = new NavigationEndpoint(data.channelEndpoint);\n }\n}", "import { YTNode } from '../helpers.js';\nimport { Text } from '../misc.js';\nimport type { RawNode } from '../index.js';\n\nexport default class InfoRow extends YTNode {\n static type = 'InfoRow';\n\n title: Text;\n default_metadata?: Text;\n expanded_metadata?: Text;\n info_row_expand_status_key?: string;\n\n constructor(data: RawNode) {\n super();\n this.title = new Text(data.title);\n\n if (Reflect.has(data, 'defaultMetadata')) {\n this.default_metadata = new Text(data.defaultMetadata);\n }\n\n if (Reflect.has(data, 'expandedMetadata')) {\n this.expanded_metadata = new Text(data.expandedMetadata);\n }\n\n if (Reflect.has(data, 'infoRowExpandStatusKey')) {\n this.info_row_expand_status_key = data.infoRowExpandStatusKey;\n }\n }\n}", "import { timeToSeconds } from '../../utils/Utils.js';\nimport { type ObservedArray, YTNode } from '../helpers.js';\nimport { Parser, type RawNode } from '../index.js';\nimport Menu from './menus/Menu.js';\nimport MetadataBadge from './MetadataBadge.js';\nimport Author from './misc/Author.js';\nimport Text from './misc/Text.js';\nimport Thumbnail from './misc/Thumbnail.js';\nimport NavigationEndpoint from './NavigationEndpoint.js';\nimport ThumbnailOverlayTimeStatus from './ThumbnailOverlayTimeStatus.js';\n\nexport default class CompactVideo extends YTNode {\n static type = 'CompactVideo';\n\n public video_id: string;\n public thumbnails: Thumbnail[];\n public rich_thumbnail?: YTNode;\n public title: Text;\n public author: Author;\n public view_count?: Text;\n public short_view_count?: Text;\n public short_byline_text?: Text;\n public long_byline_text?: Text;\n public published?: Text;\n public badges: ObservedArray;\n public thumbnail_overlays: ObservedArray;\n public endpoint?: NavigationEndpoint;\n public menu: Menu | null;\n public length_text?: Text;\n public is_watched: boolean;\n public service_endpoints?: NavigationEndpoint[];\n public service_endpoint?: NavigationEndpoint;\n public style?: 'COMPACT_VIDEO_STYLE_TYPE_UNKNOWN' | 'COMPACT_VIDEO_STYLE_TYPE_NORMAL' | 'COMPACT_VIDEO_STYLE_TYPE_PROMINENT_THUMBNAIL' | 'COMPACT_VIDEO_STYLE_TYPE_HERO';\n\n constructor(data: RawNode) {\n super();\n this.video_id = data.videoId;\n this.thumbnails = Thumbnail.fromResponse(data.thumbnail);\n this.title = new Text(data.title);\n this.author = new Author(data.longBylineText, data.ownerBadges, data.channelThumbnail);\n this.is_watched = !!data.isWatched;\n this.thumbnail_overlays = Parser.parseArray(data.thumbnailOverlays);\n this.menu = Parser.parseItem(data.menu, Menu);\n this.badges = Parser.parseArray(data.badges, MetadataBadge);\n\n if ('publishedTimeText' in data)\n this.published = new Text(data.publishedTimeText);\n \n if ('shortBylineText' in data)\n this.view_count = new Text(data.viewCountText);\n\n if ('shortViewCountText' in data)\n this.short_view_count = new Text(data.shortViewCountText);\n\n if ('richThumbnail' in data)\n this.rich_thumbnail = Parser.parseItem(data.richThumbnail);\n\n if ('shortBylineText' in data)\n this.short_byline_text = new Text(data.shortBylineText);\n\n if ('longBylineText' in data)\n this.long_byline_text = new Text(data.longBylineText);\n\n if ('lengthText' in data)\n this.length_text = new Text(data.lengthText);\n\n if ('serviceEndpoints' in data)\n this.service_endpoints = data.serviceEndpoints.map((endpoint: RawNode) => new NavigationEndpoint(endpoint));\n\n if ('serviceEndpoint' in data)\n this.service_endpoint = new NavigationEndpoint(data.serviceEndpoint);\n\n if ('navigationEndpoint' in data)\n this.endpoint = new NavigationEndpoint(data.navigationEndpoint);\n\n if ('style' in data)\n this.style = data.style;\n }\n\n /**\n * @deprecated Use {@linkcode video_id} instead.\n */\n get id(): string {\n return this.video_id;\n }\n\n get duration() {\n const overlay_time_status = this.thumbnail_overlays.firstOfType(ThumbnailOverlayTimeStatus);\n const length_text = this.length_text?.toString() || overlay_time_status?.text.toString();\n return {\n text: length_text,\n seconds: length_text ? timeToSeconds(length_text) : 0\n };\n }\n\n get best_thumbnail() {\n return this.thumbnails[0];\n }\n\n get is_fundraiser(): boolean {\n return this.badges.some((badge) => badge.label === 'Fundraiser');\n }\n\n get is_live(): boolean {\n return this.badges.some((badge) => {\n if (badge.style === 'BADGE_STYLE_TYPE_LIVE_NOW' || badge.label === 'LIVE')\n return true;\n });\n }\n\n get is_new(): boolean {\n return this.badges.some((badge) => badge.label === 'New');\n }\n\n get is_premiere(): boolean {\n return this.badges.some((badge) => badge.style === 'PREMIERE');\n }\n}", "import { type ObservedArray, YTNode } from '../helpers.js';\nimport InfoRow from './InfoRow.js';\nimport { Parser, type RawNode } from '../index.js';\nimport CompactVideo from './CompactVideo.js';\n\nexport default class CarouselLockup extends YTNode {\n static type = 'CarouselLockup';\n\n info_rows: ObservedArray;\n video_lockup?: CompactVideo | null;\n\n constructor(data: RawNode) {\n super();\n this.info_rows = Parser.parseArray(data.infoRows, InfoRow);\n this.video_lockup = Parser.parseItem(data.videoLockup, CompactVideo);\n }\n}\n", "import { YTNode, type ObservedArray } from '../helpers.js';\nimport { Parser, type RawNode } from '../index.js';\nimport { Text } from '../misc.js';\nimport CarouselLockup from './CarouselLockup.js';\n\nexport default class VideoDescriptionMusicSection extends YTNode {\n static type = 'VideoDescriptionMusicSection';\n\n carousel_lockups: ObservedArray;\n section_title: Text;\n\n constructor(data: RawNode) {\n super();\n this.carousel_lockups = Parser.parseArray(data.carouselLockups, CarouselLockup);\n this.section_title = new Text(data.sectionTitle);\n }\n}\n", "import { YTNode } from '../helpers.js';\nimport type { RawNode } from '../index.js';\nimport { Parser } from '../index.js';\nimport { Text } from '../misc.js';\nimport Button from './Button.js';\n\nexport default class VideoDescriptionTranscriptSection extends YTNode {\n static type = 'VideoDescriptionTranscriptSection';\n\n section_title: Text;\n sub_header_text: Text;\n primary_button: Button | null;\n\n constructor(data: RawNode) {\n super();\n this.section_title = new Text(data.sectionTitle);\n this.sub_header_text = new Text(data.subHeaderText);\n this.primary_button = Parser.parseItem(data.primaryButton, Button);\n }\n}", "import { YTNode } from '../helpers.js';\nimport type { RawNode } from '../index.js';\nimport NavigationEndpoint from './NavigationEndpoint.js';\nimport Text from './misc/Text.js';\nimport Thumbnail from './misc/Thumbnail.js';\n\nexport default class StructuredDescriptionPlaylistLockup extends YTNode {\n static type = 'StructuredDescriptionPlaylistLockup';\n\n thumbnail: Thumbnail[];\n title: Text;\n short_byline_text: Text;\n video_count_short_text: Text;\n endpoint: NavigationEndpoint;\n thumbnail_width: number;\n aspect_ratio: number;\n max_lines_title: number;\n max_lines_short_byline_text: number;\n overlay_position: string;\n\n constructor(data: RawNode) {\n super();\n this.thumbnail = Thumbnail.fromResponse(data.thumbnail);\n this.title = new Text(data.title);\n this.short_byline_text = new Text(data.shortBylineText);\n this.video_count_short_text = new Text(data.videoCountShortText);\n this.endpoint = new NavigationEndpoint(data.navigationEndpoint);\n this.thumbnail_width = data.thumbnailWidth;\n this.aspect_ratio = data.aspectRatio;\n this.max_lines_title = data.maxLinesTitle;\n this.max_lines_short_byline_text = data.maxLinesShortBylineText;\n this.overlay_position = data.overlayPosition;\n }\n}\n", "import type { ObservedArray } from '../helpers.js';\nimport { YTNode } from '../helpers.js';\nimport type { RawNode } from '../index.js';\nimport { Parser } from '../index.js';\nimport StructuredDescriptionPlaylistLockup from './StructuredDescriptionPlaylistLockup.js';\nimport Text from './misc/Text.js';\n\nexport default class VideoDescriptionCourseSection extends YTNode {\n static type = 'VideoDescriptionCourseSection';\n\n section_title: Text;\n media_lockups: ObservedArray;\n\n constructor(data: RawNode) {\n super();\n this.section_title = new Text(data.sectionTitle);\n this.media_lockups = Parser.parseArray(data.mediaLockups, [ StructuredDescriptionPlaylistLockup ]);\n }\n}", "import { Parser, type RawNode } from '../index.js';\nimport { YTNode, type ObservedArray } from '../helpers.js';\n\nimport ButtonView from './ButtonView.js';\nimport VideoAttributeView from './VideoAttributeView.js';\n\nexport default class VideoAttributesSectionView extends YTNode {\n static type = 'VideoAttributesSectionView';\n\n header_title: string;\n header_subtitle: string;\n video_attributes: ObservedArray;\n previous_button: ButtonView | null;\n next_button: ButtonView | null;\n\n constructor(data: RawNode) {\n super();\n this.header_title = data.headerTitle;\n this.header_subtitle = data.headerSubtitle;\n this.video_attributes = Parser.parseArray(data.videoAttributeViewModels, VideoAttributeView);\n this.previous_button = Parser.parseItem(data.previousButton, ButtonView);\n this.next_button = Parser.parseItem(data.nextButton, ButtonView);\n }\n}\n", "import { type RawNode } from '../index.js';\nimport { YTNode } from '../helpers.js';\nimport Text from './misc/Text.js';\n\nexport default class HowThisWasMadeSectionView extends YTNode {\n static type = 'HowThisWasMadeSectionView';\n\n public section_title?: Text;\n public body_text?: Text;\n public body_header?: Text;\n\n constructor(data: RawNode) {\n super();\n if (Reflect.has(data, 'sectionText'))\n this.section_title = Text.fromAttributed(data.sectionText);\n if (Reflect.has(data, 'bodyText'))\n this.body_text = Text.fromAttributed(data.bodyText);\n if (Reflect.has(data, 'bodyHeader'))\n this.body_header = Text.fromAttributed(data.bodyHeader);\n }\n}", "import { YTNode, type ObservedArray } from '../helpers.js';\nimport { Parser, type RawNode } from '../index.js';\nimport NavigationEndpoint from './NavigationEndpoint.js';\nimport Text from './misc/Text.js';\n\nexport default class ReelShelf extends YTNode {\n static type = 'ReelShelf';\n\n title: Text;\n items: ObservedArray;\n endpoint?: NavigationEndpoint;\n\n constructor(data: RawNode) {\n super();\n this.title = new Text(data.title);\n this.items = Parser.parseArray(data.items);\n\n if (Reflect.has(data, 'endpoint')) {\n this.endpoint = new NavigationEndpoint(data.endpoint);\n }\n }\n\n // XXX: Alias for consistency.\n get contents() {\n return this.items;\n }\n}", "import { YTNode, type ObservedArray } from '../helpers.js';\nimport { Parser, type RawNode } from '../index.js';\n\nexport default class MerchandiseShelf extends YTNode {\n static type = 'MerchandiseShelf';\n\n title: string;\n menu: YTNode;\n items: ObservedArray;\n\n constructor(data: RawNode) {\n super();\n this.title = data.title;\n this.menu = Parser.parseItem(data.actionButton);\n this.items = Parser.parseArray(data.items);\n }\n\n // XXX: Alias for consistency.\n get contents() {\n return this.items;\n }\n}", "import { type ObservedArray, YTNode } from '../helpers.js';\nimport { Parser, type RawNode } from '../index.js';\nimport ExpandableVideoDescriptionBody from './ExpandableVideoDescriptionBody.js';\nimport HorizontalCardList from './HorizontalCardList.js';\nimport VideoDescriptionHeader from './VideoDescriptionHeader.js';\nimport VideoDescriptionInfocardsSection from './VideoDescriptionInfocardsSection.js';\nimport VideoDescriptionMusicSection from './VideoDescriptionMusicSection.js';\nimport VideoDescriptionTranscriptSection from './VideoDescriptionTranscriptSection.js';\nimport VideoDescriptionCourseSection from './VideoDescriptionCourseSection.js';\nimport VideoAttributesSectionView from './VideoAttributesSectionView.js';\nimport HowThisWasMadeSectionView from './HowThisWasMadeSectionView.js';\nimport ReelShelf from './ReelShelf.js';\nimport ExpandableMetadata from './ExpandableMetadata.js';\nimport MerchandiseShelf from './MerchandiseShelf.js';\n\nexport default class StructuredDescriptionContent extends YTNode {\n static type = 'StructuredDescriptionContent';\n\n public items: ObservedArray<\n VideoDescriptionHeader | ExpandableVideoDescriptionBody | VideoDescriptionMusicSection |\n VideoDescriptionInfocardsSection | VideoDescriptionTranscriptSection |\n VideoDescriptionCourseSection | HorizontalCardList | ReelShelf | VideoAttributesSectionView |\n HowThisWasMadeSectionView | ExpandableMetadata | MerchandiseShelf\n >;\n\n constructor(data: RawNode) {\n super();\n this.items = Parser.parseArray(data.items, [\n VideoDescriptionHeader, ExpandableVideoDescriptionBody, VideoDescriptionMusicSection,\n VideoDescriptionInfocardsSection, VideoDescriptionCourseSection, VideoDescriptionTranscriptSection,\n VideoDescriptionTranscriptSection, HorizontalCardList, ReelShelf, VideoAttributesSectionView,\n HowThisWasMadeSectionView, ExpandableMetadata, MerchandiseShelf \n ]);\n }\n}", "import { YTNode } from '../helpers.js';\nimport { Parser, type RawNode } from '../index.js';\nimport ClipSection from './ClipSection.js';\nimport ContinuationItem from './ContinuationItem.js';\nimport EngagementPanelTitleHeader from './EngagementPanelTitleHeader.js';\nimport MacroMarkersList from './MacroMarkersList.js';\nimport ProductList from './ProductList.js';\nimport SectionList from './SectionList.js';\nimport StructuredDescriptionContent from './StructuredDescriptionContent.js';\nimport VideoAttributeView from './VideoAttributeView.js';\n\nexport default class EngagementPanelSectionList extends YTNode {\n static type = 'EngagementPanelSectionList';\n\n header: EngagementPanelTitleHeader | null;\n content: VideoAttributeView | SectionList | ContinuationItem | ClipSection | StructuredDescriptionContent | MacroMarkersList | ProductList | null;\n target_id?: string;\n panel_identifier?: string;\n identifier?: {\n surface: string,\n tag: string\n };\n visibility?: string;\n\n constructor(data: RawNode) {\n super();\n this.header = Parser.parseItem(data.header, EngagementPanelTitleHeader);\n this.content = Parser.parseItem(data.content, [ VideoAttributeView, SectionList, ContinuationItem, ClipSection, StructuredDescriptionContent, MacroMarkersList, ProductList ]);\n this.panel_identifier = data.panelIdentifier;\n this.identifier = data.identifier ? {\n surface: data.identifier.surface,\n tag: data.identifier.tag\n } : undefined;\n this.target_id = data.targetId;\n this.visibility = data.visibility;\n }\n}", "import { YTNode } from '../helpers.js';\nimport { Parser, type RawNode } from '../index.js';\nimport NavigationEndpoint from './NavigationEndpoint.js';\nimport EngagementPanelSectionList from './EngagementPanelSectionList.js';\n\nexport default class ChannelTagline extends YTNode {\n static type = 'ChannelTagline';\n\n content: string;\n max_lines: number;\n more_endpoint: {\n show_engagement_panel_endpoint: {\n engagement_panel: EngagementPanelSectionList | null,\n engagement_panel_popup_type: string;\n identifier: {\n surface: string,\n tag: string\n }\n }\n } | NavigationEndpoint;\n more_icon_type: string;\n more_label: string;\n target_id: string;\n\n constructor(data: RawNode) {\n super();\n\n this.content = data.content;\n this.max_lines = data.maxLines;\n this.more_endpoint = data.moreEndpoint.showEngagementPanelEndpoint ? {\n show_engagement_panel_endpoint: {\n engagement_panel: Parser.parseItem(data.moreEndpoint.showEngagementPanelEndpoint.engagementPanel, EngagementPanelSectionList),\n engagement_panel_popup_type: data.moreEndpoint.showEngagementPanelEndpoint.engagementPanelPresentationConfigs.engagementPanelPopupPresentationConfig.popupType,\n identifier: {\n surface: data.moreEndpoint.showEngagementPanelEndpoint.identifier.surface,\n tag: data.moreEndpoint.showEngagementPanelEndpoint.identifier.tag\n }\n }\n } : new NavigationEndpoint(data.moreEndpoint);\n this.more_icon_type = data.moreIcon.iconType;\n this.more_label = data.moreLabel;\n this.target_id = data.targetId;\n }\n}", "import { Parser, type RawNode } from '../index.js';\nimport { type SuperParsedResult, YTNode } from '../helpers.js';\n\nexport default class SubscriptionNotificationToggleButton extends YTNode {\n static type = 'SubscriptionNotificationToggleButton';\n\n states: {\n id: string;\n next_id: string;\n state: SuperParsedResult;\n };\n\n current_state_id: string;\n target_id: string;\n\n constructor(data: any) {\n super();\n this.states = data.states.map((data: RawNode) => ({\n id: data.stateId,\n next_id: data.nextStateId,\n state: Parser.parse(data.state)\n }));\n\n this.current_state_id = data.currentStateId;\n this.target_id = data.targetId;\n }\n}", "import { YTNode } from '../helpers.js';\nimport { Parser, type RawNode } from '../index.js';\nimport NavigationEndpoint from './NavigationEndpoint.js';\nimport SubscriptionNotificationToggleButton from './SubscriptionNotificationToggleButton.js';\nimport Text from './misc/Text.js';\n\nexport default class SubscribeButton extends YTNode {\n static type = 'SubscribeButton';\n\n public button_text: Text;\n public subscribed: boolean;\n public enabled: boolean;\n public item_type: string;\n public channel_id: string;\n public show_preferences: boolean;\n public subscribed_text?: Text;\n public unsubscribed_text?: Text;\n public unsubscribe_text?: Text;\n public notification_preference_button: SubscriptionNotificationToggleButton | null;\n public service_endpoints?: NavigationEndpoint[];\n public on_subscribe_endpoints?: NavigationEndpoint[];\n public on_unsubscribe_endpoints?: NavigationEndpoint[];\n public subscribed_entity_key?: string;\n public target_id?: string;\n public subscribe_accessibility_label?: string;\n public unsubscribe_accessibility_label?: string;\n\n constructor(data: RawNode) {\n super();\n this.button_text = new Text(data.buttonText);\n this.subscribed = data.subscribed;\n this.enabled = data.enabled;\n this.item_type = data.type;\n this.channel_id = data.channelId;\n this.show_preferences = data.showPreferences;\n\n if (Reflect.has(data, 'subscribedButtonText'))\n this.subscribed_text = new Text(data.subscribedButtonText);\n\n if (Reflect.has(data, 'unsubscribedButtonText'))\n this.unsubscribed_text = new Text(data.unsubscribedButtonText);\n\n if (Reflect.has(data, 'unsubscribeButtonText'))\n this.unsubscribe_text = new Text(data.unsubscribeButtonText);\n\n this.notification_preference_button = Parser.parseItem(data.notificationPreferenceButton, SubscriptionNotificationToggleButton);\n\n if (Reflect.has(data, 'serviceEndpoints'))\n this.service_endpoints = data.serviceEndpoints.map((endpoint: RawNode) => new NavigationEndpoint(endpoint));\n\n if (Reflect.has(data, 'onSubscribeEndpoints'))\n this.on_subscribe_endpoints = data.onSubscribeEndpoints.map((endpoint: RawNode) => new NavigationEndpoint(endpoint));\n\n if (Reflect.has(data, 'onUnsubscribeEndpoints'))\n this.on_unsubscribe_endpoints = data.onUnsubscribeEndpoints.map((endpoint: RawNode) => new NavigationEndpoint(endpoint));\n\n if (Reflect.has(data, 'subscribedEntityKey'))\n this.subscribed_entity_key = data.subscribedEntityKey;\n\n if (Reflect.has(data, 'targetId'))\n this.target_id = data.targetId;\n\n if (Reflect.has(data, 'subscribeAccessibility'))\n this.subscribe_accessibility_label = data.subscribeAccessibility.accessibilityData?.label;\n\n if (Reflect.has(data, 'unsubscribeAccessibility'))\n this.unsubscribe_accessibility_label = data.unsubscribeAccessibility.accessibilityData?.label;\n }\n}", "import { YTNode } from '../helpers.js';\nimport { Parser, type RawNode } from '../index.js';\nimport Button from './Button.js';\nimport ChannelHeaderLinks from './ChannelHeaderLinks.js';\nimport ChannelHeaderLinksView from './ChannelHeaderLinksView.js';\nimport ChannelTagline from './ChannelTagline.js';\nimport SubscribeButton from './SubscribeButton.js';\nimport Author from './misc/Author.js';\nimport Text from './misc/Text.js';\nimport Thumbnail from './misc/Thumbnail.js';\n\nexport default class C4TabbedHeader extends YTNode {\n static type = 'C4TabbedHeader';\n\n author: Author;\n banner?: Thumbnail[];\n tv_banner?: Thumbnail[];\n mobile_banner?: Thumbnail[];\n subscribers?: Text;\n videos_count?: Text;\n sponsor_button?: Button | null;\n subscribe_button?: SubscribeButton | Button | null;\n header_links?: ChannelHeaderLinks | ChannelHeaderLinksView | null;\n channel_handle?: Text;\n channel_id?: string;\n tagline?: ChannelTagline | null;\n\n constructor(data: RawNode) {\n super();\n this.author = new Author({\n simpleText: data.title,\n navigationEndpoint: data.navigationEndpoint\n }, data.badges, data.avatar);\n\n if (Reflect.has(data, 'banner')) {\n this.banner = Thumbnail.fromResponse(data.banner);\n }\n\n if (Reflect.has(data, 'tv_banner')) {\n this.tv_banner = Thumbnail.fromResponse(data.tvBanner);\n }\n\n if (Reflect.has(data, 'mobile_banner')) {\n this.mobile_banner = Thumbnail.fromResponse(data.mobileBanner);\n }\n\n if (Reflect.has(data, 'subscriberCountText')) {\n this.subscribers = new Text(data.subscriberCountText);\n }\n\n if (Reflect.has(data, 'videosCountText')) {\n this.videos_count = new Text(data.videosCountText);\n }\n\n if (Reflect.has(data, 'sponsorButton')) {\n this.sponsor_button = Parser.parseItem(data.sponsorButton, Button);\n }\n\n if (Reflect.has(data, 'subscribeButton')) {\n this.subscribe_button = Parser.parseItem(data.subscribeButton, [ SubscribeButton, Button ]);\n }\n\n if (Reflect.has(data, 'headerLinks')) {\n this.header_links = Parser.parseItem(data.headerLinks, [ ChannelHeaderLinks, ChannelHeaderLinksView ]);\n }\n\n if (Reflect.has(data, 'channelHandleText')) {\n this.channel_handle = new Text(data.channelHandleText);\n }\n\n if (Reflect.has(data, 'channelId')) {\n this.channel_id = data.channelId;\n }\n\n if (Reflect.has(data, 'tagline')) {\n this.tagline = Parser.parseItem(data.tagline, ChannelTagline);\n }\n }\n}", "import Text from './misc/Text.js';\nimport { YTNode } from '../helpers.js';\nimport type { RawNode } from '../index.js';\n\nexport default class CallToActionButton extends YTNode {\n static type = 'CallToActionButton';\n\n label: Text;\n icon_type: string;\n style: string;\n\n constructor(data: RawNode) {\n super();\n this.label = new Text(data.label);\n this.icon_type = data.icon.iconType;\n this.style = data.style;\n }\n}", "import { Parser, type RawNode } from '../index.js';\nimport { YTNode } from '../helpers.js';\n\nexport default class Card extends YTNode {\n static type = 'Card';\n\n teaser: YTNode;\n content: YTNode;\n card_id?: string;\n feature?: string;\n\n cue_ranges: {\n start_card_active_ms: string;\n end_card_active_ms: string;\n teaser_duration_ms: string;\n icon_after_teaser_ms: string;\n }[];\n\n constructor(data: RawNode) {\n super();\n this.teaser = Parser.parseItem(data.teaser);\n this.content = Parser.parseItem(data.content);\n\n if (Reflect.has(data, 'cardId')) {\n this.card_id = data.cardId;\n }\n\n if (Reflect.has(data, 'feature')) {\n this.feature = data.feature;\n }\n\n this.cue_ranges = data.cueRanges.map((cr: any) => ({\n start_card_active_ms: cr.startCardActiveMs,\n end_card_active_ms: cr.endCardActiveMs,\n teaser_duration_ms: cr.teaserDurationMs,\n icon_after_teaser_ms: cr.iconAfterTeaserMs\n }));\n }\n}", "import { YTNode, type ObservedArray } from '../helpers.js';\nimport { Parser, type RawNode } from '../index.js';\nimport Text from './misc/Text.js';\n\nexport default class CardCollection extends YTNode {\n static type = 'CardCollection';\n\n cards: ObservedArray;\n header: Text;\n allow_teaser_dismiss: boolean;\n\n constructor(data: RawNode) {\n super();\n this.cards = Parser.parseArray(data.cards);\n this.header = new Text(data.headerText);\n this.allow_teaser_dismiss = data.allowTeaserDismiss;\n }\n}", "import { Parser, type RawNode } from '../index.js';\nimport { type ObservedArray, YTNode } from '../helpers.js';\n\nexport default class CarouselHeader extends YTNode {\n static type = 'CarouselHeader';\n\n contents: ObservedArray;\n\n constructor(data: RawNode) {\n super();\n this.contents = Parser.parseArray(data.contents);\n }\n}", "import { Parser, type RawNode } from '../index.js';\nimport { type ObservedArray, YTNode } from '../helpers.js';\nimport Thumbnail from './misc/Thumbnail.js';\n\nexport default class CarouselItem extends YTNode {\n static type = 'CarouselItem';\n\n items: ObservedArray;\n background_color: string;\n layout_style: string;\n pagination_thumbnails: Thumbnail[];\n paginator_alignment: string;\n\n constructor (data: RawNode) {\n super();\n this.items = Parser.parseArray(data.carouselItems);\n this.background_color = data.backgroundColor;\n this.layout_style = data.layoutStyle;\n this.pagination_thumbnails = Thumbnail.fromResponse(data.paginationThumbnails);\n this.paginator_alignment = data.paginatorAlignment;\n }\n\n // XXX: For consistency.\n get contents() {\n return this.items;\n }\n}", "import { YTNode } from '../helpers.js';\nimport { Parser, type RawNode } from '../index.js';\nimport { Text } from '../misc.js';\nimport ButtonView from './ButtonView.js';\nimport NavigationEndpoint from './NavigationEndpoint.js';\n\nexport default class TextCarouselItemView extends YTNode {\n static type = 'TextCarouselItemView';\n\n icon_name: string;\n text: Text;\n on_tap_endpoint: NavigationEndpoint;\n button: ButtonView | null;\n\n constructor(data: RawNode) {\n super();\n this.icon_name = data.iconName;\n this.text = Text.fromAttributed(data.text);\n this.on_tap_endpoint = new NavigationEndpoint(data.onTap);\n this.button = Parser.parseItem(data.button, ButtonView);\n }\n}", "import { YTNode } from '../helpers.js';\nimport { Parser, type RawNode } from '../index.js';\nimport TextCarouselItemView from './TextCarouselItemView.js';\n\nexport default class CarouselItemView extends YTNode {\n static type = 'CarouselItemView';\n\n item_type: string;\n carousel_item: TextCarouselItemView | null;\n\n constructor(data: RawNode) {\n super();\n this.item_type = data.itemType;\n this.carousel_item = Parser.parseItem(data.carouselItem, TextCarouselItemView);\n }\n}", "import { YTNode } from '../helpers.js';\nimport { Parser, type RawNode } from '../index.js';\nimport ButtonView from './ButtonView.js';\n\nexport default class CarouselTitleView extends YTNode {\n static type = 'CarouselTitleView';\n\n title: string;\n previous_button: ButtonView | null;\n next_button: ButtonView | null;\n\n constructor(data: RawNode) {\n super();\n this.title = data.title;\n this.previous_button = Parser.parseItem(data.previousButton, ButtonView);\n this.next_button = Parser.parseItem(data.nextButton, ButtonView);\n }\n}", "import { YTNode } from '../helpers.js';\nimport { Parser, type RawNode } from '../index.js';\nimport Button from './Button.js';\nimport NavigationEndpoint from './NavigationEndpoint.js';\nimport SubscribeButton from './SubscribeButton.js';\nimport Author from './misc/Author.js';\nimport Text from './misc/Text.js';\n\nexport default class Channel extends YTNode {\n static type = 'Channel';\n\n id: string;\n author: Author;\n subscriber_count: Text;\n video_count: Text;\n long_byline: Text;\n short_byline: Text;\n endpoint: NavigationEndpoint;\n subscribe_button: SubscribeButton | Button | null;\n description_snippet: Text;\n\n constructor(data: RawNode) {\n super();\n this.id = data.channelId;\n\n this.author = new Author({\n ...data.title,\n navigationEndpoint: data.navigationEndpoint\n }, data.ownerBadges, data.thumbnail);\n\n // XXX: `subscriberCountText` is now the channel's handle and `videoCountText` is the subscriber count.\n this.subscriber_count = new Text(data.subscriberCountText);\n this.video_count = new Text(data.videoCountText);\n this.long_byline = new Text(data.longBylineText);\n this.short_byline = new Text(data.shortBylineText);\n this.endpoint = new NavigationEndpoint(data.navigationEndpoint);\n this.subscribe_button = Parser.parseItem(data.subscribeButton, [ SubscribeButton, Button ]);\n this.description_snippet = new Text(data.descriptionSnippet);\n }\n}", "import { YTNode, type ObservedArray } from '../helpers.js';\nimport { Parser, type RawNode } from '../index.js';\nimport Button from './Button.js';\nimport NavigationEndpoint from './NavigationEndpoint.js';\nimport Text from './misc/Text.js';\nimport Thumbnail from './misc/Thumbnail.js';\n\nexport default class ChannelAboutFullMetadata extends YTNode {\n static type = 'ChannelAboutFullMetadata';\n\n id: string;\n name: Text;\n avatar: Thumbnail[];\n canonical_channel_url: string;\n\n primary_links: {\n endpoint: NavigationEndpoint;\n icon: Thumbnail[];\n title: Text;\n }[];\n\n view_count: Text;\n joined_date: Text;\n description: Text;\n email_reveal: NavigationEndpoint;\n can_reveal_email: boolean;\n country: Text;\n buttons: ObservedArray diff --git a/public/sw.js b/public/sw.js index 2608007..b2d68e8 100644 --- a/public/sw.js +++ b/public/sw.js @@ -1,4 +1,4 @@ -const CACHE_NAME = 'camila-ai-v8'; +const CACHE_NAME = 'camila-ai-v10'; const urlsToCache = [ '/', '/index.html', diff --git a/server.js b/server.js index d75bb9e..25e9e5d 100644 --- a/server.js +++ b/server.js @@ -749,7 +749,7 @@ function getYouTubeId(url) { } app.post('/api/videomind/analyze', requireAuth, async (req, res) => { - const { url, lines } = req.body; + const { url, lines, pastedTranscript } = req.body; if (!url) { return res.status(400).json({ error: 'A URL do vídeo é obrigatória.' }); @@ -785,20 +785,26 @@ app.post('/api/videomind/analyze', requireAuth, async (req, res) => { let isFallbackMode = false; let systemNotice = ''; - try { - // Tenta obter legenda - const transcriptObj = await YoutubeTranscript.fetchTranscript(videoId); - transcriptText = transcriptObj.map(t => t.text).join(' '); - } catch (transcErr) { - console.warn(`[VideoMind] Erro ao obter legenda para o vídeo ${videoId}:`, transcErr.message); - isFallbackMode = true; - - if (transcErr.message && transcErr.message.toLowerCase().includes('disabled')) { - transcriptText = `[Aviso: O autor deste vídeo desativou as legendas ou elas ainda não foram geradas pelo YouTube. Por favor, analise e descreva os objetivos pedagógicos com base estritamente no título do vídeo, canal do autor e no seu vasto conhecimento pedagógico sobre o tema indicado no título]`; - systemNotice = `> ⚠️ **Nota do Sistema**: Este vídeo não possui legendas disponíveis (foram desativadas pelo autor ou ainda não geradas pelo YouTube). A análise e o resumo abaixo foram elaborados a partir do título do vídeo, nome do canal e fundamentação pedagógica correspondente.\n\n`; - } else { - transcriptText = `[Aviso: Devido a restrições de conexão do YouTube, a legenda de áudio não pôde ser lida diretamente. Por favor, analise e descreva os objetivos pedagógicos com base estritamente no título do vídeo, canal do autor e no seu vasto conhecimento pedagógico sobre o tema indicado no título]`; - systemNotice = `> ⚠️ **Nota do Sistema**: Devido a restrições de conexão do YouTube ou indisponibilidade temporária, a transcrição não pôde ser lida. A análise e o resumo abaixo foram elaborados a partir do título do vídeo, canal do autor e fundamentação psicopedagógica correspondente.\n\n`; + if (pastedTranscript && pastedTranscript.trim().length > 10) { + // Se o usuário colou a transcrição, ignorar a extração automática + transcriptText = pastedTranscript.trim(); + systemNotice = `> 📝 **Nota do Sistema**: A análise abaixo foi elaborada com base na transcrição manual que você forneceu.\n\n`; + } else { + try { + // Tenta obter legenda + const transcriptObj = await YoutubeTranscript.fetchTranscript(videoId); + transcriptText = transcriptObj.map(t => t.text).join(' '); + } catch (transcErr) { + console.warn(`[VideoMind] Erro ao obter legenda para o vídeo ${videoId}:`, transcErr.message); + isFallbackMode = true; + + if (transcErr.message && transcErr.message.toLowerCase().includes('disabled')) { + transcriptText = `[Aviso: O autor deste vídeo desativou as legendas ou elas ainda não foram geradas pelo YouTube. Por favor, analise e descreva os objetivos pedagógicos com base estritamente no título do vídeo, canal do autor e no seu vasto conhecimento pedagógico sobre o tema indicado no título]`; + systemNotice = `> ⚠️ **Nota do Sistema**: Este vídeo não possui legendas disponíveis (foram desativadas pelo autor ou ainda não geradas pelo YouTube). A análise e o resumo abaixo foram elaborados a partir do título do vídeo, nome do canal e fundamentação pedagógica correspondente.\n\n`; + } else { + transcriptText = `[Aviso: Devido a restrições de conexão do YouTube, a legenda de áudio não pôde ser lida diretamente. Por favor, analise e descreva os objetivos pedagógicos com base estritamente no título do vídeo, canal do autor e no seu vasto conhecimento pedagógico sobre o tema indicado no título]`; + systemNotice = `> ⚠️ **Nota do Sistema**: Devido a restrições de conexão do YouTube ou indisponibilidade temporária, a transcrição não pôde ser lida. A análise e o resumo abaixo foram elaborados a partir do título do vídeo, canal do autor e fundamentação psicopedagógica correspondente.\n\n`; + } } } diff --git a/test_gemini.js b/test_gemini.js new file mode 100644 index 0000000..d463342 --- /dev/null +++ b/test_gemini.js @@ -0,0 +1,9 @@ +require('dotenv').config(); +const apiKey = process.env.GOOGLE_AI_API_KEY; +fetch(`https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent?key=${apiKey}`, { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ + contents: [{ parts: [{ text: "Por favor, resuma o que é falado neste vídeo: https://www.youtube.com/watch?v=0g7qSGQIoxw" }] }] + }) +}).then(r => r.json()).then(j => console.dir(j, {depth: null})).catch(console.error); diff --git a/test_proxy.js b/test_proxy.js new file mode 100644 index 0000000..fe1911a --- /dev/null +++ b/test_proxy.js @@ -0,0 +1,17 @@ +const axios = require('axios'); +async function test() { + try { + const res = await axios.get('https://api.allorigins.win/raw?url=' + encodeURIComponent('https://www.youtube.com/watch?v=0g7qSGQIoxw')); + const html = res.data; + const match = html.match(/"captionTracks":(\[.*?\])/); + if (match) { + console.log("ACHOU CAPTIONS!"); + console.log(match[1].substring(0, 500)); + } else { + console.log("NÃO ACHOU CAPTIONS NO HTML PROXY"); + } + } catch (err) { + console.error("Erro no proxy:", err.message); + } +} +test(); diff --git a/test_py.py b/test_py.py new file mode 100644 index 0000000..1690576 --- /dev/null +++ b/test_py.py @@ -0,0 +1,6 @@ +from youtube_transcript_api import YouTubeTranscriptApi +try: + tx = YouTubeTranscriptApi.get_transcript('0g7qSGQIoxw', languages=['pt', 'en']) + print(tx) +except Exception as e: + print("Error:", e) diff --git a/test_youtubei.js b/test_youtubei.js new file mode 100644 index 0000000..caf95cf --- /dev/null +++ b/test_youtubei.js @@ -0,0 +1,13 @@ +const { Innertube } = require('youtubei.js'); + +async function test() { + try { + const yt = await Innertube.create(); + const info = await yt.getInfo('0g7qSGQIoxw'); + const transcriptData = await info.getTranscript(); + console.log(transcriptData.transcript.content.body.initial_segments.map(s => s.snippet.text).join(' ').substring(0, 500)); + } catch (err) { + console.error(err); + } +} +test(); diff --git a/test_youtubei2.js b/test_youtubei2.js new file mode 100644 index 0000000..e0bf06f --- /dev/null +++ b/test_youtubei2.js @@ -0,0 +1,12 @@ +const { Innertube } = require('youtubei.js'); +async function test() { + try { + const yt = await Innertube.create(); + const info = await yt.getInfo('dQw4w9WgXcQ'); + const transcriptData = await info.getTranscript(); + console.log(transcriptData.transcript.content.body.initial_segments.map(s => s.snippet.text).join(' ').substring(0, 500)); + } catch (err) { + console.error(err); + } +} +test();